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 |
|---|---|---|---|---|---|---|---|---|---|---|
cdk/cdk | base/data/src/main/java/org/openscience/cdk/AtomContainerSet.java | AtomContainerSet.addAtomContainer | @Override
public void addAtomContainer(IAtomContainer atomContainer, double multiplier) {
"""
Adds an atomContainer to this container with the given
multiplier.
@param atomContainer The atomContainer to be added to this container
@param multiplier The multiplier of this atomContainer
"""
... | java | @Override
public void addAtomContainer(IAtomContainer atomContainer, double multiplier) {
if (atomContainerCount + 1 >= atomContainers.length) {
growAtomContainerArray();
}
atomContainer.addListener(this);
atomContainers[atomContainerCount] = atomContainer;
multip... | [
"@",
"Override",
"public",
"void",
"addAtomContainer",
"(",
"IAtomContainer",
"atomContainer",
",",
"double",
"multiplier",
")",
"{",
"if",
"(",
"atomContainerCount",
"+",
"1",
">=",
"atomContainers",
".",
"length",
")",
"{",
"growAtomContainerArray",
"(",
")",
... | Adds an atomContainer to this container with the given
multiplier.
@param atomContainer The atomContainer to be added to this container
@param multiplier The multiplier of this atomContainer | [
"Adds",
"an",
"atomContainer",
"to",
"this",
"container",
"with",
"the",
"given",
"multiplier",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/data/src/main/java/org/openscience/cdk/AtomContainerSet.java#L226-L236 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseLambdaExpression | private Expr parseLambdaExpression(EnclosingScope scope, boolean terminated) {
"""
Parse a lambda or address expression, which have the form:
<pre>
TermExpr::= ...
| '&' [ '[' [ Lifetime (',' Lifetime )* ] ']' ]
[ '<' [ Identifier (',' Identifier)* ] '>' ]
'(' [Type Identifier (',' Type Identifier)*] '->... | java | private Expr parseLambdaExpression(EnclosingScope scope, boolean terminated) {
int start = index;
match(Ampersand);
if (tryAndMatch(terminated, LeftBrace, LeftSquare, LeftAngle) != null) {
index = start; // backtrack
return parseLambdaInitialiser(scope, terminated);
} else {
index = start; // backtrack... | [
"private",
"Expr",
"parseLambdaExpression",
"(",
"EnclosingScope",
"scope",
",",
"boolean",
"terminated",
")",
"{",
"int",
"start",
"=",
"index",
";",
"match",
"(",
"Ampersand",
")",
";",
"if",
"(",
"tryAndMatch",
"(",
"terminated",
",",
"LeftBrace",
",",
"L... | Parse a lambda or address expression, which have the form:
<pre>
TermExpr::= ...
| '&' [ '[' [ Lifetime (',' Lifetime )* ] ']' ]
[ '<' [ Identifier (',' Identifier)* ] '>' ]
'(' [Type Identifier (',' Type Identifier)*] '->' Expr ')'
| '&' Identifier [ '(' Type (',' Type)* ')']
</pre>
Disambiguating these two forms... | [
"Parse",
"a",
"lambda",
"or",
"address",
"expression",
"which",
"have",
"the",
"form",
":"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L3131-L3141 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/scene_objects/GVRCubeSceneObject.java | GVRCubeSceneObject.createSimpleCubeSixMeshes | private void createSimpleCubeSixMeshes(GVRContext gvrContext,
boolean facingOut, String vertexDesc, ArrayList<GVRTexture> textureList) {
"""
Creates a cube with each face as a separate mesh using a different texture.
The meshes will share a common vertex array but will have separate index buffers.
@p... | java | private void createSimpleCubeSixMeshes(GVRContext gvrContext,
boolean facingOut, String vertexDesc, ArrayList<GVRTexture> textureList)
{
GVRSceneObject[] children = new GVRSceneObject[6];
GVRMesh[] meshes = new GVRMesh[6];
GVRVertexBuffer vbuf = new GVRVertexBuffer(gvrContext, ve... | [
"private",
"void",
"createSimpleCubeSixMeshes",
"(",
"GVRContext",
"gvrContext",
",",
"boolean",
"facingOut",
",",
"String",
"vertexDesc",
",",
"ArrayList",
"<",
"GVRTexture",
">",
"textureList",
")",
"{",
"GVRSceneObject",
"[",
"]",
"children",
"=",
"new",
"GVRSc... | Creates a cube with each face as a separate mesh using a different texture.
The meshes will share a common vertex array but will have separate index buffers.
@param gvrContext context to use for creating cube
@param facingOut true for outward normals, false for inward normals
@param vertexDesc string describi... | [
"Creates",
"a",
"cube",
"with",
"each",
"face",
"as",
"a",
"separate",
"mesh",
"using",
"a",
"different",
"texture",
".",
"The",
"meshes",
"will",
"share",
"a",
"common",
"vertex",
"array",
"but",
"will",
"have",
"separate",
"index",
"buffers",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/scene_objects/GVRCubeSceneObject.java#L553-L594 |
spring-projects/spring-hateoas | src/main/java/org/springframework/hateoas/client/JsonPathLinkDiscoverer.java | JsonPathLinkDiscoverer.createLinksFrom | private Links createLinksFrom(Object parseResult, LinkRelation rel) {
"""
Creates {@link Link} instances from the given parse result.
@param parseResult the result originating from parsing the source content using the JSON path expression.
@param rel the relation type that was parsed for.
@return
"""
i... | java | private Links createLinksFrom(Object parseResult, LinkRelation rel) {
if (JSONArray.class.isInstance(parseResult)) {
JSONArray jsonArray = (JSONArray) parseResult;
return jsonArray.stream() //
.flatMap(it -> JSONArray.class.isInstance(it) ? ((JSONArray) it).stream() : Stream.of(it)) //
.map(it -> e... | [
"private",
"Links",
"createLinksFrom",
"(",
"Object",
"parseResult",
",",
"LinkRelation",
"rel",
")",
"{",
"if",
"(",
"JSONArray",
".",
"class",
".",
"isInstance",
"(",
"parseResult",
")",
")",
"{",
"JSONArray",
"jsonArray",
"=",
"(",
"JSONArray",
")",
"pars... | Creates {@link Link} instances from the given parse result.
@param parseResult the result originating from parsing the source content using the JSON path expression.
@param rel the relation type that was parsed for.
@return | [
"Creates",
"{",
"@link",
"Link",
"}",
"instances",
"from",
"the",
"given",
"parse",
"result",
"."
] | train | https://github.com/spring-projects/spring-hateoas/blob/70ebff9309f086cd8d6a97daf67e0dc215c87d9c/src/main/java/org/springframework/hateoas/client/JsonPathLinkDiscoverer.java#L163-L178 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/BatchUpdateDaemon.java | BatchUpdateDaemon.invalidateByTemplate | public void invalidateByTemplate(String template, boolean waitOnInvalidation, DCache cache) {
"""
This invalidates all cache entries in all caches whose template
is specified.
@param template The Template that is used to to invalidate fragments.
@param waitOnInvalidation True indicates that this method should... | java | public void invalidateByTemplate(String template, boolean waitOnInvalidation, DCache cache) {
synchronized (this) {
BatchUpdateList bul = getUpdateList(cache);
bul.invalidateByTemplateEvents.put(template, new InvalidateByTemplateEvent(template, CachePerf.LOCAL));
}
if (wa... | [
"public",
"void",
"invalidateByTemplate",
"(",
"String",
"template",
",",
"boolean",
"waitOnInvalidation",
",",
"DCache",
"cache",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"BatchUpdateList",
"bul",
"=",
"getUpdateList",
"(",
"cache",
")",
";",
"bul",
"... | This invalidates all cache entries in all caches whose template
is specified.
@param template The Template that is used to to invalidate fragments.
@param waitOnInvalidation True indicates that this method should
not return until all invalidations have taken effect.
False indicates that the invalidations will take eff... | [
"This",
"invalidates",
"all",
"cache",
"entries",
"in",
"all",
"caches",
"whose",
"template",
"is",
"specified",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/BatchUpdateDaemon.java#L95-L103 |
dbracewell/mango | src/main/java/com/davidbracewell/conversion/Val.java | Val.asOrElse | public <T> T asOrElse(Class<T> clazz, @NonNull Supplier<T> supplier) {
"""
Converts the underlying object to the given class type.
@param <T> the type parameter
@param clazz The class to convert to
@param supplier The supplier to use to generate a default value
@return This object as the given type o... | java | public <T> T asOrElse(Class<T> clazz, @NonNull Supplier<T> supplier) {
if (isNull()) {
return supplier.get();
}
T value = as(clazz);
if (value == null) {
return supplier.get();
}
return value;
} | [
"public",
"<",
"T",
">",
"T",
"asOrElse",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"@",
"NonNull",
"Supplier",
"<",
"T",
">",
"supplier",
")",
"{",
"if",
"(",
"isNull",
"(",
")",
")",
"{",
"return",
"supplier",
".",
"get",
"(",
")",
";",
"}",... | Converts the underlying object to the given class type.
@param <T> the type parameter
@param clazz The class to convert to
@param supplier The supplier to use to generate a default value
@return This object as the given type or null if the wrapped object is null | [
"Converts",
"the",
"underlying",
"object",
"to",
"the",
"given",
"class",
"type",
"."
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/conversion/Val.java#L242-L251 |
DDTH/ddth-kafka | src/main/java/com/github/ddth/kafka/KafkaClient.java | KafkaClient.sendMessageRaw | public Future<RecordMetadata> sendMessageRaw(KafkaMessage message, Callback callback) {
"""
Sends a message asynchronously, with default {@link ProducerType}.
<p>
This methods returns the underlying Kafka producer's output directly to
caller, not converting {@link RecordMetadata} to {@link KafkaMessage}.
</p... | java | public Future<RecordMetadata> sendMessageRaw(KafkaMessage message, Callback callback) {
return sendMessageRaw(DEFAULT_PRODUCER_TYPE, message, callback);
} | [
"public",
"Future",
"<",
"RecordMetadata",
">",
"sendMessageRaw",
"(",
"KafkaMessage",
"message",
",",
"Callback",
"callback",
")",
"{",
"return",
"sendMessageRaw",
"(",
"DEFAULT_PRODUCER_TYPE",
",",
"message",
",",
"callback",
")",
";",
"}"
] | Sends a message asynchronously, with default {@link ProducerType}.
<p>
This methods returns the underlying Kafka producer's output directly to
caller, not converting {@link RecordMetadata} to {@link KafkaMessage}.
</p>
@param message
@param callback
@return
@since 1.3.1 | [
"Sends",
"a",
"message",
"asynchronously",
"with",
"default",
"{",
"@link",
"ProducerType",
"}",
"."
] | train | https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/KafkaClient.java#L779-L781 |
belaban/JGroups | src/org/jgroups/util/SubmitToThreadPool.java | SubmitToThreadPool.removeAndDispatchNonBundledMessages | protected void removeAndDispatchNonBundledMessages(MessageBatch oob_batch) {
"""
Removes messages with flags DONT_BUNDLE and OOB set and executes them in the oob or internal thread pool. JGRP-1737
"""
if(oob_batch == null)
return;
AsciiString tmp=oob_batch.clusterName();
byt... | java | protected void removeAndDispatchNonBundledMessages(MessageBatch oob_batch) {
if(oob_batch == null)
return;
AsciiString tmp=oob_batch.clusterName();
byte[] cname=tmp != null? tmp.chars() : null;
for(Iterator<Message> it=oob_batch.iterator(); it.hasNext();) {
Messag... | [
"protected",
"void",
"removeAndDispatchNonBundledMessages",
"(",
"MessageBatch",
"oob_batch",
")",
"{",
"if",
"(",
"oob_batch",
"==",
"null",
")",
"return",
";",
"AsciiString",
"tmp",
"=",
"oob_batch",
".",
"clusterName",
"(",
")",
";",
"byte",
"[",
"]",
"cnam... | Removes messages with flags DONT_BUNDLE and OOB set and executes them in the oob or internal thread pool. JGRP-1737 | [
"Removes",
"messages",
"with",
"flags",
"DONT_BUNDLE",
"and",
"OOB",
"set",
"and",
"executes",
"them",
"in",
"the",
"oob",
"or",
"internal",
"thread",
"pool",
".",
"JGRP",
"-",
"1737"
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/util/SubmitToThreadPool.java#L47-L62 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Completable.java | Completable.ambArray | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public static Completable ambArray(final CompletableSource... sources) {
"""
Returns a Completable which terminates as soon as one of the source Completables
terminates (normally or with an error) and disposes all other Completables.
<p>
<img wi... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public static Completable ambArray(final CompletableSource... sources) {
ObjectHelper.requireNonNull(sources, "sources is null");
if (sources.length == 0) {
return complete();
}
if (sources.length == 1) {
... | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"static",
"Completable",
"ambArray",
"(",
"final",
"CompletableSource",
"...",
"sources",
")",
"{",
"ObjectHelper",
".",
"requireNonNull",
"(",
"sources",
",",
"... | Returns a Completable which terminates as soon as one of the source Completables
terminates (normally or with an error) and disposes all other Completables.
<p>
<img width="640" height="518" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.ambArray.png" alt="">
<dl>
<dt><b>Scheduler:</b... | [
"Returns",
"a",
"Completable",
"which",
"terminates",
"as",
"soon",
"as",
"one",
"of",
"the",
"source",
"Completables",
"terminates",
"(",
"normally",
"or",
"with",
"an",
"error",
")",
"and",
"disposes",
"all",
"other",
"Completables",
".",
"<p",
">",
"<img"... | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Completable.java#L120-L132 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/ling/CategoryWordTagFactory.java | CategoryWordTagFactory.newLabel | public Label newLabel(String word, String tag, String category) {
"""
Create a new CategoryWordTag label, where the label is formed from
the various <code>String</code> objects passed in.
@param word The word part of the label
@param tag The tag part of the label
@param category The category part of... | java | public Label newLabel(String word, String tag, String category) {
// System.out.println("Making new CWT label: " + category + " | " +
// word + " | " + tag);
return new CategoryWordTag(category, word, tag);
} | [
"public",
"Label",
"newLabel",
"(",
"String",
"word",
",",
"String",
"tag",
",",
"String",
"category",
")",
"{",
"// System.out.println(\"Making new CWT label: \" + category + \" | \" +\r",
"//\t\t word + \" | \" + tag);\r",
"return",
"new",
"CategoryWordTag",
"(",
"categor... | Create a new CategoryWordTag label, where the label is formed from
the various <code>String</code> objects passed in.
@param word The word part of the label
@param tag The tag part of the label
@param category The category part of the label
@return The newly created Label | [
"Create",
"a",
"new",
"CategoryWordTag",
"label",
"where",
"the",
"label",
"is",
"formed",
"from",
"the",
"various",
"<code",
">",
"String<",
"/",
"code",
">",
"objects",
"passed",
"in",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ling/CategoryWordTagFactory.java#L55-L59 |
teatrove/teatrove | tea/src/main/java/org/teatrove/tea/parsetree/Expression.java | Expression.setType | public void setType(Type type) {
"""
Sets the type of this expression, clearing the conversion chain.
"""
Type actual = Type.preserveType(this.getType(), type);
mConversions.clear();
mExceptionPossible = false;
if (actual != null) {
// Prefer cast for initial type f... | java | public void setType(Type type) {
Type actual = Type.preserveType(this.getType(), type);
mConversions.clear();
mExceptionPossible = false;
if (actual != null) {
// Prefer cast for initial type for correct operation of
// setInitialType if a conversion needs to be ... | [
"public",
"void",
"setType",
"(",
"Type",
"type",
")",
"{",
"Type",
"actual",
"=",
"Type",
".",
"preserveType",
"(",
"this",
".",
"getType",
"(",
")",
",",
"type",
")",
";",
"mConversions",
".",
"clear",
"(",
")",
";",
"mExceptionPossible",
"=",
"false... | Sets the type of this expression, clearing the conversion chain. | [
"Sets",
"the",
"type",
"of",
"this",
"expression",
"clearing",
"the",
"conversion",
"chain",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/tea/src/main/java/org/teatrove/tea/parsetree/Expression.java#L314-L325 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/EnvelopesApi.java | EnvelopesApi.getDocumentPageImage | public byte[] getDocumentPageImage(String accountId, String envelopeId, String documentId, String pageNumber) throws ApiException {
"""
Gets a page image from an envelope for display.
Retrieves a page image for display from the specified envelope.
@param accountId The external account number (int) or account ID ... | java | public byte[] getDocumentPageImage(String accountId, String envelopeId, String documentId, String pageNumber) throws ApiException {
return getDocumentPageImage(accountId, envelopeId, documentId, pageNumber, null);
} | [
"public",
"byte",
"[",
"]",
"getDocumentPageImage",
"(",
"String",
"accountId",
",",
"String",
"envelopeId",
",",
"String",
"documentId",
",",
"String",
"pageNumber",
")",
"throws",
"ApiException",
"{",
"return",
"getDocumentPageImage",
"(",
"accountId",
",",
"env... | Gets a page image from an envelope for display.
Retrieves a page image for display from the specified envelope.
@param accountId The external account number (int) or account ID Guid. (required)
@param envelopeId The envelopeId Guid of the envelope being accessed. (required)
@param documentId The ID of the document bein... | [
"Gets",
"a",
"page",
"image",
"from",
"an",
"envelope",
"for",
"display",
".",
"Retrieves",
"a",
"page",
"image",
"for",
"display",
"from",
"the",
"specified",
"envelope",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/EnvelopesApi.java#L2346-L2348 |
strator-dev/greenpepper | greenpepper-open/greenpepper-maven-runner/src/main/java/com/greenpepper/maven/runner/util/ReflectionUtils.java | ReflectionUtils.invokeMain | public static void invokeMain(Class<?> mainClass, List<String> args)
throws Exception {
"""
<p>invokeMain.</p>
@param mainClass a {@link java.lang.Class} object.
@param args a {@link java.util.List} object.
@throws java.lang.Exception if any.
"""
Method mainMethod = mainClass.getMethod("main", Class.... | java | public static void invokeMain(Class<?> mainClass, List<String> args)
throws Exception
{
Method mainMethod = mainClass.getMethod("main", Class.forName("[Ljava.lang.String;"));
mainMethod.invoke(null, convertToArray(args));
} | [
"public",
"static",
"void",
"invokeMain",
"(",
"Class",
"<",
"?",
">",
"mainClass",
",",
"List",
"<",
"String",
">",
"args",
")",
"throws",
"Exception",
"{",
"Method",
"mainMethod",
"=",
"mainClass",
".",
"getMethod",
"(",
"\"main\"",
",",
"Class",
".",
... | <p>invokeMain.</p>
@param mainClass a {@link java.lang.Class} object.
@param args a {@link java.util.List} object.
@throws java.lang.Exception if any. | [
"<p",
">",
"invokeMain",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/greenpepper-maven-runner/src/main/java/com/greenpepper/maven/runner/util/ReflectionUtils.java#L58-L64 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java | FilesImpl.deleteFromComputeNodeAsync | public Observable<Void> deleteFromComputeNodeAsync(String poolId, String nodeId, String filePath) {
"""
Deletes the specified file from the compute node.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node from which you want to delete the file.
@param fil... | java | public Observable<Void> deleteFromComputeNodeAsync(String poolId, String nodeId, String filePath) {
return deleteFromComputeNodeWithServiceResponseAsync(poolId, nodeId, filePath).map(new Func1<ServiceResponseWithHeaders<Void, FileDeleteFromComputeNodeHeaders>, Void>() {
@Override
public ... | [
"public",
"Observable",
"<",
"Void",
">",
"deleteFromComputeNodeAsync",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"String",
"filePath",
")",
"{",
"return",
"deleteFromComputeNodeWithServiceResponseAsync",
"(",
"poolId",
",",
"nodeId",
",",
"filePath",
"... | Deletes the specified file from the compute node.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node from which you want to delete the file.
@param filePath The path to the file or directory that you want to delete.
@throws IllegalArgumentException thrown if param... | [
"Deletes",
"the",
"specified",
"file",
"from",
"the",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java#L902-L909 |
apache/incubator-gobblin | gobblin-audit/src/main/java/org/apache/gobblin/audit/values/sink/FsAuditSink.java | FsAuditSink.getAuditFilePath | public Path getAuditFilePath() {
"""
Returns the complete path of the audit file. Generate the audit file path with format
<pre>
|-- <Database>
|-- <Table>
|-- P=<PHASE>.C=<CLUSTER>.E=<EXTRACT_ID>.S=<SNAPSHOT_ID>.D=<DELTA_ID>
|-- *.avro
</pre>
"""
StringBui... | java | public Path getAuditFilePath() {
StringBuilder auditFileNameBuilder = new StringBuilder();
auditFileNameBuilder.append("P=").append(auditMetadata.getPhase()).append(FILE_NAME_DELIMITTER).append("C=")
.append(auditMetadata.getCluster()).append(FILE_NAME_DELIMITTER).append("E=")
.append(auditMetad... | [
"public",
"Path",
"getAuditFilePath",
"(",
")",
"{",
"StringBuilder",
"auditFileNameBuilder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"auditFileNameBuilder",
".",
"append",
"(",
"\"P=\"",
")",
".",
"append",
"(",
"auditMetadata",
".",
"getPhase",
"(",
")",
... | Returns the complete path of the audit file. Generate the audit file path with format
<pre>
|-- <Database>
|-- <Table>
|-- P=<PHASE>.C=<CLUSTER>.E=<EXTRACT_ID>.S=<SNAPSHOT_ID>.D=<DELTA_ID>
|-- *.avro
</pre> | [
"Returns",
"the",
"complete",
"path",
"of",
"the",
"audit",
"file",
".",
"Generate",
"the",
"audit",
"file",
"path",
"with",
"format"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-audit/src/main/java/org/apache/gobblin/audit/values/sink/FsAuditSink.java#L97-L107 |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/TriggersInner.java | TriggersInner.getAsync | public Observable<TriggerInner> getAsync(String deviceName, String name, String resourceGroupName) {
"""
Get a specific trigger by name.
@param deviceName The device name.
@param name The trigger name.
@param resourceGroupName The resource group name.
@throws IllegalArgumentException thrown if parameters fai... | java | public Observable<TriggerInner> getAsync(String deviceName, String name, String resourceGroupName) {
return getWithServiceResponseAsync(deviceName, name, resourceGroupName).map(new Func1<ServiceResponse<TriggerInner>, TriggerInner>() {
@Override
public TriggerInner call(ServiceResponse<T... | [
"public",
"Observable",
"<",
"TriggerInner",
">",
"getAsync",
"(",
"String",
"deviceName",
",",
"String",
"name",
",",
"String",
"resourceGroupName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"deviceName",
",",
"name",
",",
"resourceGroupName",
")",
... | Get a specific trigger by name.
@param deviceName The device name.
@param name The trigger name.
@param resourceGroupName The resource group name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the TriggerInner object | [
"Get",
"a",
"specific",
"trigger",
"by",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/TriggersInner.java#L377-L384 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ClassUtils.java | ClassUtils.resolveMethod | public static Method resolveMethod(Class<?> type, String methodName, Class<?>[] parameterTypes, Object[] arguments,
Class<?> returnType) {
"""
Attempts to resolve the method with the specified name and signature on the given class type. The named method's
resolution is first attempted by using the specifie... | java | public static Method resolveMethod(Class<?> type, String methodName, Class<?>[] parameterTypes, Object[] arguments,
Class<?> returnType) {
try {
return getMethod(type, methodName, parameterTypes);
}
catch (MethodNotFoundException cause) {
Method method = findMethod(type, methodName, argu... | [
"public",
"static",
"Method",
"resolveMethod",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
",",
"Object",
"[",
"]",
"arguments",
",",
"Class",
"<",
"?",
">",
"returnType",
"... | Attempts to resolve the method with the specified name and signature on the given class type. The named method's
resolution is first attempted by using the specified method's name along with the array of parameter types.
If unsuccessful, the method proceeds to lookup the named method by searching all "declared" method... | [
"Attempts",
"to",
"resolve",
"the",
"method",
"with",
"the",
"specified",
"name",
"and",
"signature",
"on",
"the",
"given",
"class",
"type",
".",
"The",
"named",
"method",
"s",
"resolution",
"is",
"first",
"attempted",
"by",
"using",
"the",
"specified",
"met... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ClassUtils.java#L411-L427 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/NeedlessCustomSerialization.java | NeedlessCustomSerialization.visitCode | @Override
public void visitCode(Code obj) {
"""
overrides the method to check for either readObject or writeObject methods and if so, reset the stack
"""
String nameAndSignature = getMethod().getName() + getMethod().getSignature();
if (SignatureBuilder.SIG_READ_OBJECT.equals(nameAndSignatur... | java | @Override
public void visitCode(Code obj) {
String nameAndSignature = getMethod().getName() + getMethod().getSignature();
if (SignatureBuilder.SIG_READ_OBJECT.equals(nameAndSignature)) {
inReadObject = true;
inWriteObject = false;
} else if (SIG_WRITE_OBJECT.equals(na... | [
"@",
"Override",
"public",
"void",
"visitCode",
"(",
"Code",
"obj",
")",
"{",
"String",
"nameAndSignature",
"=",
"getMethod",
"(",
")",
".",
"getName",
"(",
")",
"+",
"getMethod",
"(",
")",
".",
"getSignature",
"(",
")",
";",
"if",
"(",
"SignatureBuilder... | overrides the method to check for either readObject or writeObject methods and if so, reset the stack | [
"overrides",
"the",
"method",
"to",
"check",
"for",
"either",
"readObject",
"or",
"writeObject",
"methods",
"and",
"if",
"so",
"reset",
"the",
"stack"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/NeedlessCustomSerialization.java#L87-L106 |
knowitall/openregex | src/main/java/edu/washington/cs/knowitall/logic/LogicExpression.java | LogicExpression.getArgs | private void getArgs(Apply<?> apply, List<String> args) {
"""
*
Private helper method to recursively find arguments.
@param apply the expression tree to search.
@param args the resulting list of arguments.
"""
if (apply instanceof Op.Bin<?>) {
Op.Bin<?> bin = (Op.Bin<?>) apply;
... | java | private void getArgs(Apply<?> apply, List<String> args) {
if (apply instanceof Op.Bin<?>) {
Op.Bin<?> bin = (Op.Bin<?>) apply;
getArgs(bin.left, args);
getArgs(bin.right, args);
}
else if (apply instanceof Arg.Pred<?>) {
args.add(((Arg.Pred<?>)app... | [
"private",
"void",
"getArgs",
"(",
"Apply",
"<",
"?",
">",
"apply",
",",
"List",
"<",
"String",
">",
"args",
")",
"{",
"if",
"(",
"apply",
"instanceof",
"Op",
".",
"Bin",
"<",
"?",
">",
")",
"{",
"Op",
".",
"Bin",
"<",
"?",
">",
"bin",
"=",
"... | *
Private helper method to recursively find arguments.
@param apply the expression tree to search.
@param args the resulting list of arguments. | [
"*",
"Private",
"helper",
"method",
"to",
"recursively",
"find",
"arguments",
"."
] | train | https://github.com/knowitall/openregex/blob/6dffbcac884b5bd17f9feb7a3107052163f0497d/src/main/java/edu/washington/cs/knowitall/logic/LogicExpression.java#L180-L190 |
jboss/jboss-jstl-api_spec | src/main/java/org/apache/taglibs/standard/util/ExpressionUtil.java | ExpressionUtil.createValueExpression | public static ValueExpression createValueExpression(PageContext pageContext, String expression, Class<?> expectedType) {
"""
Create a value expression.
@param pageContext the context in which the expression will be parsed
@param expression the expression
@param expectedType the expected type of result
@re... | java | public static ValueExpression createValueExpression(PageContext pageContext, String expression, Class<?> expectedType) {
ExpressionFactory factory = getExpressionFactory(pageContext);
return factory.createValueExpression(pageContext.getELContext(), expression, expectedType);
} | [
"public",
"static",
"ValueExpression",
"createValueExpression",
"(",
"PageContext",
"pageContext",
",",
"String",
"expression",
",",
"Class",
"<",
"?",
">",
"expectedType",
")",
"{",
"ExpressionFactory",
"factory",
"=",
"getExpressionFactory",
"(",
"pageContext",
")",... | Create a value expression.
@param pageContext the context in which the expression will be parsed
@param expression the expression
@param expectedType the expected type of result
@return a parsed expression | [
"Create",
"a",
"value",
"expression",
"."
] | train | https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/org/apache/taglibs/standard/util/ExpressionUtil.java#L38-L41 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/masterslave/MasterSlaveUtils.java | MasterSlaveUtils.essentiallyEqualsTo | static boolean essentiallyEqualsTo(RedisNodeDescription o1, RedisNodeDescription o2) {
"""
Check for {@code MASTER} or {@code SLAVE} roles and the URI.
@param o1 the first object to be compared.
@param o2 the second object to be compared.
@return {@literal true} if {@code MASTER} or {@code SLAVE} flags change... | java | static boolean essentiallyEqualsTo(RedisNodeDescription o1, RedisNodeDescription o2) {
if (o2 == null) {
return false;
}
if (o1.getRole() != o2.getRole()) {
return false;
}
if (!o1.getUri().equals(o2.getUri())) {
return false;
}
... | [
"static",
"boolean",
"essentiallyEqualsTo",
"(",
"RedisNodeDescription",
"o1",
",",
"RedisNodeDescription",
"o2",
")",
"{",
"if",
"(",
"o2",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"o1",
".",
"getRole",
"(",
")",
"!=",
"o2",
".",
... | Check for {@code MASTER} or {@code SLAVE} roles and the URI.
@param o1 the first object to be compared.
@param o2 the second object to be compared.
@return {@literal true} if {@code MASTER} or {@code SLAVE} flags changed or the URI changed. | [
"Check",
"for",
"{",
"@code",
"MASTER",
"}",
"or",
"{",
"@code",
"SLAVE",
"}",
"roles",
"and",
"the",
"URI",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/masterslave/MasterSlaveUtils.java#L89-L104 |
apache/spark | sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/MetadataOperation.java | MetadataOperation.convertPattern | private String convertPattern(final String pattern, boolean datanucleusFormat) {
"""
Convert a pattern containing JDBC catalog search wildcards into
Java regex patterns.
@param pattern input which may contain '%' or '_' wildcard characters, or
these characters escaped using {@link #getSearchStringEscape()}.
... | java | private String convertPattern(final String pattern, boolean datanucleusFormat) {
String wStr;
if (datanucleusFormat) {
wStr = "*";
} else {
wStr = ".*";
}
return pattern
.replaceAll("([^\\\\])%", "$1" + wStr).replaceAll("\\\\%", "%").replaceAll("^%", wStr)
.replaceAll("([... | [
"private",
"String",
"convertPattern",
"(",
"final",
"String",
"pattern",
",",
"boolean",
"datanucleusFormat",
")",
"{",
"String",
"wStr",
";",
"if",
"(",
"datanucleusFormat",
")",
"{",
"wStr",
"=",
"\"*\"",
";",
"}",
"else",
"{",
"wStr",
"=",
"\".*\"",
";... | Convert a pattern containing JDBC catalog search wildcards into
Java regex patterns.
@param pattern input which may contain '%' or '_' wildcard characters, or
these characters escaped using {@link #getSearchStringEscape()}.
@return replace %/_ with regex search characters, also handle escaped
characters.
The datanucl... | [
"Convert",
"a",
"pattern",
"containing",
"JDBC",
"catalog",
"search",
"wildcards",
"into",
"Java",
"regex",
"patterns",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/MetadataOperation.java#L97-L107 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.queryPredictions | public PredictionQueryResult queryPredictions(UUID projectId, PredictionQueryToken query) {
"""
Get images that were sent to your prediction endpoint.
@param projectId The project id
@param query Parameters used to query the predictions. Limited to combining 2 tags
@throws IllegalArgumentException thrown if p... | java | public PredictionQueryResult queryPredictions(UUID projectId, PredictionQueryToken query) {
return queryPredictionsWithServiceResponseAsync(projectId, query).toBlocking().single().body();
} | [
"public",
"PredictionQueryResult",
"queryPredictions",
"(",
"UUID",
"projectId",
",",
"PredictionQueryToken",
"query",
")",
"{",
"return",
"queryPredictionsWithServiceResponseAsync",
"(",
"projectId",
",",
"query",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",... | Get images that were sent to your prediction endpoint.
@param projectId The project id
@param query Parameters used to query the predictions. Limited to combining 2 tags
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws ... | [
"Get",
"images",
"that",
"were",
"sent",
"to",
"your",
"prediction",
"endpoint",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L3003-L3005 |
dropwizard/dropwizard | dropwizard-core/src/main/java/io/dropwizard/cli/Command.java | Command.onError | public void onError(Cli cli, Namespace namespace, Throwable e) {
"""
Method is called if there is an issue parsing configuration, setting up the
environment, or running the command itself. The default is printing the stacktrace
to facilitate debugging, but can be customized per command.
@param cli contains th... | java | public void onError(Cli cli, Namespace namespace, Throwable e) {
e.printStackTrace(cli.getStdErr());
} | [
"public",
"void",
"onError",
"(",
"Cli",
"cli",
",",
"Namespace",
"namespace",
",",
"Throwable",
"e",
")",
"{",
"e",
".",
"printStackTrace",
"(",
"cli",
".",
"getStdErr",
"(",
")",
")",
";",
"}"
] | Method is called if there is an issue parsing configuration, setting up the
environment, or running the command itself. The default is printing the stacktrace
to facilitate debugging, but can be customized per command.
@param cli contains the streams for stdout and stderr
@param namespace the parsed arguments from the... | [
"Method",
"is",
"called",
"if",
"there",
"is",
"an",
"issue",
"parsing",
"configuration",
"setting",
"up",
"the",
"environment",
"or",
"running",
"the",
"command",
"itself",
".",
"The",
"default",
"is",
"printing",
"the",
"stacktrace",
"to",
"facilitate",
"deb... | train | https://github.com/dropwizard/dropwizard/blob/7ee09a410476b9681e8072ab684788bb440877bd/dropwizard-core/src/main/java/io/dropwizard/cli/Command.java#L68-L70 |
ironjacamar/ironjacamar | deployers/src/main/java/org/ironjacamar/deployers/common/AbstractResourceAdapterDeployer.java | AbstractResourceAdapterDeployer.createInboundMapping | private Map<String, ActivationSpecImpl> createInboundMapping(InboundResourceAdapter ira, ClassLoader cl)
throws Exception {
"""
Create an inbound mapping
@param ira The inbound resource adapter definition
@param cl The class loader
@return The mapping
@exception Exception Thrown in case of an error
"... | java | private Map<String, ActivationSpecImpl> createInboundMapping(InboundResourceAdapter ira, ClassLoader cl)
throws Exception
{
if (ira != null)
{
Map<String, ActivationSpecImpl> result = new HashMap<>();
for (org.ironjacamar.common.api.metadata.spec.MessageListener ml :
... | [
"private",
"Map",
"<",
"String",
",",
"ActivationSpecImpl",
">",
"createInboundMapping",
"(",
"InboundResourceAdapter",
"ira",
",",
"ClassLoader",
"cl",
")",
"throws",
"Exception",
"{",
"if",
"(",
"ira",
"!=",
"null",
")",
"{",
"Map",
"<",
"String",
",",
"Ac... | Create an inbound mapping
@param ira The inbound resource adapter definition
@param cl The class loader
@return The mapping
@exception Exception Thrown in case of an error | [
"Create",
"an",
"inbound",
"mapping"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/deployers/src/main/java/org/ironjacamar/deployers/common/AbstractResourceAdapterDeployer.java#L1198-L1234 |
VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java | ComponentExposedTypeGenerator.addFieldsForComputedMethod | private void addFieldsForComputedMethod(TypeElement component, Set<String> alreadyDone) {
"""
Add fields for computed methods so they are visible in the template
@param component Component we are currently processing
@param alreadyDone Already processed computed properties (in case there is a getter and a
... | java | private void addFieldsForComputedMethod(TypeElement component, Set<String> alreadyDone) {
getMethodsWithAnnotation(component, Computed.class).forEach(method -> {
String propertyName = computedPropertyNameToFieldName(getComputedPropertyName(method));
if (alreadyDone.contains(propertyName)) {
ret... | [
"private",
"void",
"addFieldsForComputedMethod",
"(",
"TypeElement",
"component",
",",
"Set",
"<",
"String",
">",
"alreadyDone",
")",
"{",
"getMethodsWithAnnotation",
"(",
"component",
",",
"Computed",
".",
"class",
")",
".",
"forEach",
"(",
"method",
"->",
"{",... | Add fields for computed methods so they are visible in the template
@param component Component we are currently processing
@param alreadyDone Already processed computed properties (in case there is a getter and a | [
"Add",
"fields",
"for",
"computed",
"methods",
"so",
"they",
"are",
"visible",
"in",
"the",
"template"
] | train | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentExposedTypeGenerator.java#L415-L436 |
MenoData/Time4J | base/src/main/java/net/time4j/history/EraPreference.java | EraPreference.abUrbeConditaBetween | public static EraPreference abUrbeConditaBetween(
PlainDate start,
PlainDate end
) {
"""
/*[deutsch]
<p>Legt fest, daß die Ära Ab Urbe Condita innerhalb der angegebenen Datumsspanne bevorzugt wird. </p>
@param start first date when the era A.U.C. shall be used (inclusive)... | java | public static EraPreference abUrbeConditaBetween(
PlainDate start,
PlainDate end
) {
return new EraPreference(HistoricEra.AB_URBE_CONDITA, start, end);
} | [
"public",
"static",
"EraPreference",
"abUrbeConditaBetween",
"(",
"PlainDate",
"start",
",",
"PlainDate",
"end",
")",
"{",
"return",
"new",
"EraPreference",
"(",
"HistoricEra",
".",
"AB_URBE_CONDITA",
",",
"start",
",",
"end",
")",
";",
"}"
] | /*[deutsch]
<p>Legt fest, daß die Ära Ab Urbe Condita innerhalb der angegebenen Datumsspanne bevorzugt wird. </p>
@param start first date when the era A.U.C. shall be used (inclusive)
@param end last date when the era A.U.C. shall be used (inclusive)
@return EraPreference
@see Histori... | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Legt",
"fest",
"daß",
";",
"die",
"Ä",
";",
"ra",
"Ab",
"Urbe",
"Condita",
"innerhalb",
"der",
"angegebenen",
"Datumsspanne",
"bevorzugt",
"wird",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/history/EraPreference.java#L255-L262 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/annotation/AnnotationUtil.java | AnnotationUtil.calculateHashCode | @SuppressWarnings("MagicNumber")
public static int calculateHashCode(Map<? extends CharSequence, Object> values) {
"""
Calculates the hash code of annotation values.
@param values The map to calculate values' hash code
@return The hash code
"""
int hashCode = 0;
for (Map.Entry<? extend... | java | @SuppressWarnings("MagicNumber")
public static int calculateHashCode(Map<? extends CharSequence, Object> values) {
int hashCode = 0;
for (Map.Entry<? extends CharSequence, Object> member : values.entrySet()) {
Object value = member.getValue();
int nameHashCode = member.getK... | [
"@",
"SuppressWarnings",
"(",
"\"MagicNumber\"",
")",
"public",
"static",
"int",
"calculateHashCode",
"(",
"Map",
"<",
"?",
"extends",
"CharSequence",
",",
"Object",
">",
"values",
")",
"{",
"int",
"hashCode",
"=",
"0",
";",
"for",
"(",
"Map",
".",
"Entry"... | Calculates the hash code of annotation values.
@param values The map to calculate values' hash code
@return The hash code | [
"Calculates",
"the",
"hash",
"code",
"of",
"annotation",
"values",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/annotation/AnnotationUtil.java#L149-L177 |
stagemonitor/stagemonitor | stagemonitor-core/src/main/java/org/stagemonitor/core/instrument/StagemonitorByteBuddyTransformer.java | StagemonitorByteBuddyTransformer.beforeTransformation | public void beforeTransformation(TypeDescription typeDescription, ClassLoader classLoader) {
"""
This method is called before the transformation.
You can stop the transformation from happening by returning false from this method.
@param typeDescription The type that is being transformed.
@param classLoader ... | java | public void beforeTransformation(TypeDescription typeDescription, ClassLoader classLoader) {
if (isPreventDuplicateTransformation()) {
Dispatcher.put(getClassAlreadyTransformedKey(typeDescription, classLoader), Boolean.TRUE);
}
if (DEBUG_INSTRUMENTATION && logger.isDebugEnabled()) {
logger.debug("TRANSFORM... | [
"public",
"void",
"beforeTransformation",
"(",
"TypeDescription",
"typeDescription",
",",
"ClassLoader",
"classLoader",
")",
"{",
"if",
"(",
"isPreventDuplicateTransformation",
"(",
")",
")",
"{",
"Dispatcher",
".",
"put",
"(",
"getClassAlreadyTransformedKey",
"(",
"t... | This method is called before the transformation.
You can stop the transformation from happening by returning false from this method.
@param typeDescription The type that is being transformed.
@param classLoader The class loader which is loading this type. | [
"This",
"method",
"is",
"called",
"before",
"the",
"transformation",
".",
"You",
"can",
"stop",
"the",
"transformation",
"from",
"happening",
"by",
"returning",
"false",
"from",
"this",
"method",
"."
] | train | https://github.com/stagemonitor/stagemonitor/blob/7a1bf6848906f816aa465983f602ea1f1e8f2b7b/stagemonitor-core/src/main/java/org/stagemonitor/core/instrument/StagemonitorByteBuddyTransformer.java#L226-L234 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.toMultiPolygon | public MultiPolygon toMultiPolygon(
List<com.google.android.gms.maps.model.Polygon> polygonList) {
"""
Convert a list of {@link com.google.android.gms.maps.model.Polygon} to a
{@link MultiPolygon}
@param polygonList polygon list
@return multi polygon
"""
return toMultiPolygon(polygonLi... | java | public MultiPolygon toMultiPolygon(
List<com.google.android.gms.maps.model.Polygon> polygonList) {
return toMultiPolygon(polygonList, false, false);
} | [
"public",
"MultiPolygon",
"toMultiPolygon",
"(",
"List",
"<",
"com",
".",
"google",
".",
"android",
".",
"gms",
".",
"maps",
".",
"model",
".",
"Polygon",
">",
"polygonList",
")",
"{",
"return",
"toMultiPolygon",
"(",
"polygonList",
",",
"false",
",",
"fal... | Convert a list of {@link com.google.android.gms.maps.model.Polygon} to a
{@link MultiPolygon}
@param polygonList polygon list
@return multi polygon | [
"Convert",
"a",
"list",
"of",
"{",
"@link",
"com",
".",
"google",
".",
"android",
".",
"gms",
".",
"maps",
".",
"model",
".",
"Polygon",
"}",
"to",
"a",
"{",
"@link",
"MultiPolygon",
"}"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L1009-L1012 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/FragmentJoiner.java | FragmentJoiner.reduceFragments | public static boolean reduceFragments(List<FragmentPair> fragments, FragmentPair f, Matrix rmsmat) {
"""
In helices often many similar fragments can be found. To reduce these to a few
representative ones this check can be used. It does a distance check between
all known Fragments and a new one. If this one is on... | java | public static boolean reduceFragments(List<FragmentPair> fragments, FragmentPair f, Matrix rmsmat){
boolean doNotAdd =false;
int i = f.getPos1();
int j = f.getPos2();
for ( int p =0; p < fragments.size(); p++){
FragmentPair tmp = fragments.get(p);
int di1 = Math.abs(f.getPos1() - tmp.getPos1());
int ... | [
"public",
"static",
"boolean",
"reduceFragments",
"(",
"List",
"<",
"FragmentPair",
">",
"fragments",
",",
"FragmentPair",
"f",
",",
"Matrix",
"rmsmat",
")",
"{",
"boolean",
"doNotAdd",
"=",
"false",
";",
"int",
"i",
"=",
"f",
".",
"getPos1",
"(",
")",
"... | In helices often many similar fragments can be found. To reduce these to a few
representative ones this check can be used. It does a distance check between
all known Fragments and a new one. If this one is on a similar diagonal and it
has a lower rms, this one is a better representation. Note: shifts of one are
not all... | [
"In",
"helices",
"often",
"many",
"similar",
"fragments",
"can",
"be",
"found",
".",
"To",
"reduce",
"these",
"to",
"a",
"few",
"representative",
"ones",
"this",
"check",
"can",
"be",
"used",
".",
"It",
"does",
"a",
"distance",
"check",
"between",
"all",
... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/FragmentJoiner.java#L91-L114 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/DCacheBase.java | DCacheBase.increaseCacheSizeInBytes | public void increaseCacheSizeInBytes(long size, String msg) {
"""
Increase cache size in bytes to the total count
@param size
The size to be increased
"""
if (this.memoryCacheSizeInMBEnabled) {
this.currentMemoryCacheSizeInBytes += size;
if (tc.isDebugEnabled()) {
... | java | public void increaseCacheSizeInBytes(long size, String msg) {
if (this.memoryCacheSizeInMBEnabled) {
this.currentMemoryCacheSizeInBytes += size;
if (tc.isDebugEnabled()) {
Tr.debug(tc, "increaseCacheSizeInBytes() cacheName=" + cacheName + " " + msg + " size=" + size + " c... | [
"public",
"void",
"increaseCacheSizeInBytes",
"(",
"long",
"size",
",",
"String",
"msg",
")",
"{",
"if",
"(",
"this",
".",
"memoryCacheSizeInMBEnabled",
")",
"{",
"this",
".",
"currentMemoryCacheSizeInBytes",
"+=",
"size",
";",
"if",
"(",
"tc",
".",
"isDebugEn... | Increase cache size in bytes to the total count
@param size
The size to be increased | [
"Increase",
"cache",
"size",
"in",
"bytes",
"to",
"the",
"total",
"count"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/DCacheBase.java#L288-L296 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/DeployKeysApi.java | DeployKeysApi.deleteDeployKey | public void deleteDeployKey(Object projectIdOrPath, Integer keyId) throws GitLabApiException {
"""
Removes a deploy key from the project. If the deploy key is used only for this project,it will be deleted from the system.
<pre><code>GitLab Endpoint: DELETE /projects/:id/deploy_keys/:key_id</code></pre>
@para... | java | public void deleteDeployKey(Object projectIdOrPath, Integer keyId) throws GitLabApiException {
if (keyId == null) {
throw new RuntimeException("keyId cannot be null");
}
delete(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPath), "deploy_keys", keyId);
} | [
"public",
"void",
"deleteDeployKey",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"keyId",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"keyId",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"keyId cannot be null\"",
")",
";",
"... | Removes a deploy key from the project. If the deploy key is used only for this project,it will be deleted from the system.
<pre><code>GitLab Endpoint: DELETE /projects/:id/deploy_keys/:key_id</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param keyId ... | [
"Removes",
"a",
"deploy",
"key",
"from",
"the",
"project",
".",
"If",
"the",
"deploy",
"key",
"is",
"used",
"only",
"for",
"this",
"project",
"it",
"will",
"be",
"deleted",
"from",
"the",
"system",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/DeployKeysApi.java#L204-L211 |
lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toQuery | public static Query toQuery(Object o, boolean duplicate, Query defaultValue) {
"""
cast a Object to a Query Object
@param o Object to cast
@param duplicate duplicate the object or not
@param defaultValue
@return casted Query Object
"""
try {
return toQuery(o, duplicate);
}
catch (PageException e)... | java | public static Query toQuery(Object o, boolean duplicate, Query defaultValue) {
try {
return toQuery(o, duplicate);
}
catch (PageException e) {
return defaultValue;
}
} | [
"public",
"static",
"Query",
"toQuery",
"(",
"Object",
"o",
",",
"boolean",
"duplicate",
",",
"Query",
"defaultValue",
")",
"{",
"try",
"{",
"return",
"toQuery",
"(",
"o",
",",
"duplicate",
")",
";",
"}",
"catch",
"(",
"PageException",
"e",
")",
"{",
"... | cast a Object to a Query Object
@param o Object to cast
@param duplicate duplicate the object or not
@param defaultValue
@return casted Query Object | [
"cast",
"a",
"Object",
"to",
"a",
"Query",
"Object"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L3037-L3044 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/HOSECodeGenerator.java | HOSECodeGenerator.getHOSECode | public String getHOSECode(IAtomContainer ac, IAtom root, int noOfSpheres, boolean ringsize) throws CDKException {
"""
Produces a HOSE code for Atom <code>root</code> in the {@link IAtomContainer} <code>ac</code>. The HOSE
code is produced for the number of spheres given by <code>noOfSpheres</code>.
IMPORTANT: if... | java | public String getHOSECode(IAtomContainer ac, IAtom root, int noOfSpheres, boolean ringsize) throws CDKException {
ensureIsotopeFactory();
CanonicalLabeler canLabler = new CanonicalLabeler();
canLabler.canonLabel(ac);
centerCode = "";
this.atomContainer = ac;
maxSphere = n... | [
"public",
"String",
"getHOSECode",
"(",
"IAtomContainer",
"ac",
",",
"IAtom",
"root",
",",
"int",
"noOfSpheres",
",",
"boolean",
"ringsize",
")",
"throws",
"CDKException",
"{",
"ensureIsotopeFactory",
"(",
")",
";",
"CanonicalLabeler",
"canLabler",
"=",
"new",
"... | Produces a HOSE code for Atom <code>root</code> in the {@link IAtomContainer} <code>ac</code>. The HOSE
code is produced for the number of spheres given by <code>noOfSpheres</code>.
IMPORTANT: if you want aromaticity to be included in the code, you need
to run the IAtomContainer <code>ac</code> to the {@link org.opensc... | [
"Produces",
"a",
"HOSE",
"code",
"for",
"Atom",
"<code",
">",
"root<",
"/",
"code",
">",
"in",
"the",
"{",
"@link",
"IAtomContainer",
"}",
"<code",
">",
"ac<",
"/",
"code",
">",
".",
"The",
"HOSE",
"code",
"is",
"produced",
"for",
"the",
"number",
"o... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/HOSECodeGenerator.java#L239-L265 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsInner.java | ExpressRoutePortsInner.getByResourceGroup | public ExpressRoutePortInner getByResourceGroup(String resourceGroupName, String expressRoutePortName) {
"""
Retrieves the requested ExpressRoutePort resource.
@param resourceGroupName The name of the resource group.
@param expressRoutePortName The name of ExpressRoutePort.
@throws IllegalArgumentException th... | java | public ExpressRoutePortInner getByResourceGroup(String resourceGroupName, String expressRoutePortName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, expressRoutePortName).toBlocking().single().body();
} | [
"public",
"ExpressRoutePortInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"expressRoutePortName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"expressRoutePortName",
")",
".",
"toBlocking",
... | Retrieves the requested ExpressRoutePort resource.
@param resourceGroupName The name of the resource group.
@param expressRoutePortName The name of ExpressRoutePort.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws Runt... | [
"Retrieves",
"the",
"requested",
"ExpressRoutePort",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsInner.java#L277-L279 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java | SerializedFormBuilder.buildSerializableMethods | public void buildSerializableMethods(XMLNode node, Content classContentTree) {
"""
Build the summaries for the methods that belong to the given
class.
@param node the XML element that specifies which components to document
@param classContentTree content tree to which the documentation will be added
"""
... | java | public void buildSerializableMethods(XMLNode node, Content classContentTree) {
Content serializableMethodTree = methodWriter.getSerializableMethodsHeader();
MemberDoc[] members = currentClass.serializationMethods();
int membersLength = members.length;
if (membersLength > 0) {
... | [
"public",
"void",
"buildSerializableMethods",
"(",
"XMLNode",
"node",
",",
"Content",
"classContentTree",
")",
"{",
"Content",
"serializableMethodTree",
"=",
"methodWriter",
".",
"getSerializableMethodsHeader",
"(",
")",
";",
"MemberDoc",
"[",
"]",
"members",
"=",
"... | Build the summaries for the methods that belong to the given
class.
@param node the XML element that specifies which components to document
@param classContentTree content tree to which the documentation will be added | [
"Build",
"the",
"summaries",
"for",
"the",
"methods",
"that",
"belong",
"to",
"the",
"given",
"class",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java#L272-L300 |
BoltsFramework/Bolts-Android | bolts-applinks/src/main/java/bolts/AppLinkNavigation.java | AppLinkNavigation.navigateInBackground | public static Task<NavigationResult> navigateInBackground(final Context context,
Uri destination,
AppLinkResolver resolver) {
"""
Navigates to an {@link AppLink} for the given destination using t... | java | public static Task<NavigationResult> navigateInBackground(final Context context,
Uri destination,
AppLinkResolver resolver) {
return resolver.getAppLinkFromUrlInBackground(destination)
... | [
"public",
"static",
"Task",
"<",
"NavigationResult",
">",
"navigateInBackground",
"(",
"final",
"Context",
"context",
",",
"Uri",
"destination",
",",
"AppLinkResolver",
"resolver",
")",
"{",
"return",
"resolver",
".",
"getAppLinkFromUrlInBackground",
"(",
"destination... | Navigates to an {@link AppLink} for the given destination using the App Link resolution
strategy specified.
@param context the Context from which the navigation should be performed.
@param destination the destination URL for the App Link.
@param resolver the resolver to use for fetching App Link metadata.
@retu... | [
"Navigates",
"to",
"an",
"{",
"@link",
"AppLink",
"}",
"for",
"the",
"given",
"destination",
"using",
"the",
"App",
"Link",
"resolution",
"strategy",
"specified",
"."
] | train | https://github.com/BoltsFramework/Bolts-Android/blob/54e9cb8bdd4950aa4d418dcbc0ea65414762aef5/bolts-applinks/src/main/java/bolts/AppLinkNavigation.java#L386-L396 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java | AbstractDoclet.generateOtherFiles | protected void generateOtherFiles(RootDoc root, ClassTree classtree) throws Exception {
"""
Generate additional documentation that is added to the API documentation.
@param root the RootDoc of source to document.
@param classtree the data structure representing the class tree.
"""
BuilderFacto... | java | protected void generateOtherFiles(RootDoc root, ClassTree classtree) throws Exception {
BuilderFactory builderFactory = configuration.getBuilderFactory();
AbstractBuilder constantsSummaryBuilder = builderFactory.getConstantsSummaryBuider();
constantsSummaryBuilder.build();
AbstractBuilde... | [
"protected",
"void",
"generateOtherFiles",
"(",
"RootDoc",
"root",
",",
"ClassTree",
"classtree",
")",
"throws",
"Exception",
"{",
"BuilderFactory",
"builderFactory",
"=",
"configuration",
".",
"getBuilderFactory",
"(",
")",
";",
"AbstractBuilder",
"constantsSummaryBuil... | Generate additional documentation that is added to the API documentation.
@param root the RootDoc of source to document.
@param classtree the data structure representing the class tree. | [
"Generate",
"additional",
"documentation",
"that",
"is",
"added",
"to",
"the",
"API",
"documentation",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java#L162-L168 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java | CmsDomUtil.getElementsByClass | public static List<Element> getElementsByClass(String className, Element rootElement) {
"""
Returns all elements with the given CSS class including the root element.<p>
@param className the class name to look for
@param rootElement the root element of the search
@return the matching elements
"""
... | java | public static List<Element> getElementsByClass(String className, Element rootElement) {
return getElementsByClass(className, Tag.ALL, rootElement);
} | [
"public",
"static",
"List",
"<",
"Element",
">",
"getElementsByClass",
"(",
"String",
"className",
",",
"Element",
"rootElement",
")",
"{",
"return",
"getElementsByClass",
"(",
"className",
",",
"Tag",
".",
"ALL",
",",
"rootElement",
")",
";",
"}"
] | Returns all elements with the given CSS class including the root element.<p>
@param className the class name to look for
@param rootElement the root element of the search
@return the matching elements | [
"Returns",
"all",
"elements",
"with",
"the",
"given",
"CSS",
"class",
"including",
"the",
"root",
"element",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java#L1344-L1348 |
jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/FastMathCalc.java | FastMathCalc.slowCos | static double slowCos(final double x, final double result[]) {
"""
For x between 0 and pi/4 compute cosine using Talor series
cos(x) = 1 - x^2/2! + x^4/4! ...
@param x number from which cosine is requested
@param result placeholder where to put the result in extended precision
(may be null)
@return cos(x)
... | java | static double slowCos(final double x, final double result[]) {
final double xs[] = new double[2];
final double ys[] = new double[2];
final double facts[] = new double[2];
final double as[] = new double[2];
split(x, xs);
ys[0] = ys[1] = 0.0;
for (int i = FACT.len... | [
"static",
"double",
"slowCos",
"(",
"final",
"double",
"x",
",",
"final",
"double",
"result",
"[",
"]",
")",
"{",
"final",
"double",
"xs",
"[",
"]",
"=",
"new",
"double",
"[",
"2",
"]",
";",
"final",
"double",
"ys",
"[",
"]",
"=",
"new",
"double",
... | For x between 0 and pi/4 compute cosine using Talor series
cos(x) = 1 - x^2/2! + x^4/4! ...
@param x number from which cosine is requested
@param result placeholder where to put the result in extended precision
(may be null)
@return cos(x) | [
"For",
"x",
"between",
"0",
"and",
"pi",
"/",
"4",
"compute",
"cosine",
"using",
"Talor",
"series",
"cos",
"(",
"x",
")",
"=",
"1",
"-",
"x^2",
"/",
"2!",
"+",
"x^4",
"/",
"4!",
"..."
] | train | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/FastMathCalc.java#L204-L239 |
ops4j/org.ops4j.pax.wicket | service/src/main/java/org/ops4j/pax/wicket/internal/PaxWicketAppFactoryTracker.java | PaxWicketAppFactoryTracker.addingService | public void addingService(ServiceReference<WebApplicationFactory<?>> reference, WebApplicationFactory<?> service) {
"""
<p>addingService.</p>
@param reference a {@link org.osgi.framework.ServiceReference} object.
@param service a {@link org.ops4j.pax.wicket.api.WebApplicationFactory} object.
"""
Pa... | java | public void addingService(ServiceReference<WebApplicationFactory<?>> reference, WebApplicationFactory<?> service) {
PaxWicketApplicationFactory internalFactory =
PaxWicketApplicationFactory.createPaxWicketApplicationFactory(context, service, reference);
addApplication(reference, internalFact... | [
"public",
"void",
"addingService",
"(",
"ServiceReference",
"<",
"WebApplicationFactory",
"<",
"?",
">",
">",
"reference",
",",
"WebApplicationFactory",
"<",
"?",
">",
"service",
")",
"{",
"PaxWicketApplicationFactory",
"internalFactory",
"=",
"PaxWicketApplicationFacto... | <p>addingService.</p>
@param reference a {@link org.osgi.framework.ServiceReference} object.
@param service a {@link org.ops4j.pax.wicket.api.WebApplicationFactory} object. | [
"<p",
">",
"addingService",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ops4j/org.ops4j.pax.wicket/blob/ef7cb4bdf918e9e61ec69789b9c690567616faa9/service/src/main/java/org/ops4j/pax/wicket/internal/PaxWicketAppFactoryTracker.java#L64-L68 |
moleculer-java/moleculer-java | src/main/java/services/moleculer/eventbus/EventEmitter.java | EventEmitter.broadcastLocal | public void broadcastLocal(String name, Tree payload) {
"""
Emits a <b>LOCAL</b> event to <b>ALL</b> listeners from ALL event groups,
who are listening this event. Sample code:<br>
<br>
Tree params = new Tree();<br>
params.put("a", true);<br>
params.putList("b").add(1).add(2).add(3);<br>
ctx.broadcastLocal("... | java | public void broadcastLocal(String name, Tree payload) {
eventbus.broadcast(name, payload, null, true);
} | [
"public",
"void",
"broadcastLocal",
"(",
"String",
"name",
",",
"Tree",
"payload",
")",
"{",
"eventbus",
".",
"broadcast",
"(",
"name",
",",
"payload",
",",
"null",
",",
"true",
")",
";",
"}"
] | Emits a <b>LOCAL</b> event to <b>ALL</b> listeners from ALL event groups,
who are listening this event. Sample code:<br>
<br>
Tree params = new Tree();<br>
params.put("a", true);<br>
params.putList("b").add(1).add(2).add(3);<br>
ctx.broadcastLocal("user.modified", params);
@param name
name of event (eg. "user.created"... | [
"Emits",
"a",
"<b",
">",
"LOCAL<",
"/",
"b",
">",
"event",
"to",
"<b",
">",
"ALL<",
"/",
"b",
">",
"listeners",
"from",
"ALL",
"event",
"groups",
"who",
"are",
"listening",
"this",
"event",
".",
"Sample",
"code",
":",
"<br",
">",
"<br",
">",
"Tree"... | train | https://github.com/moleculer-java/moleculer-java/blob/27575c44b9ecacc17c4456ceacf5d1851abf1cc4/src/main/java/services/moleculer/eventbus/EventEmitter.java#L239-L241 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java | CommonOps_DDRM.minRows | public static DMatrixRMaj minRows(DMatrixRMaj input , DMatrixRMaj output ) {
"""
<p>
Finds the element with the minimum value along each row in the input matrix and returns the results in a vector:<br>
<br>
b<sub>j</sub> = min(i=1:n ; a<sub>ji</sub>)
</p>
@param input Input matrix
@param output Optional st... | java | public static DMatrixRMaj minRows(DMatrixRMaj input , DMatrixRMaj output ) {
if( output == null ) {
output = new DMatrixRMaj(input.numRows,1);
} else {
output.reshape(input.numRows,1);
}
for( int row = 0; row < input.numRows; row++ ) {
double min = Do... | [
"public",
"static",
"DMatrixRMaj",
"minRows",
"(",
"DMatrixRMaj",
"input",
",",
"DMatrixRMaj",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"{",
"output",
"=",
"new",
"DMatrixRMaj",
"(",
"input",
".",
"numRows",
",",
"1",
")",
";",
"}",
... | <p>
Finds the element with the minimum value along each row in the input matrix and returns the results in a vector:<br>
<br>
b<sub>j</sub> = min(i=1:n ; a<sub>ji</sub>)
</p>
@param input Input matrix
@param output Optional storage for output. Reshaped into a column. Modified.
@return Vector containing the sum of eac... | [
"<p",
">",
"Finds",
"the",
"element",
"with",
"the",
"minimum",
"value",
"along",
"each",
"row",
"in",
"the",
"input",
"matrix",
"and",
"returns",
"the",
"results",
"in",
"a",
"vector",
":",
"<br",
">",
"<br",
">",
"b<sub",
">",
"j<",
"/",
"sub",
">"... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L1893-L1913 |
lucee/Lucee | core/src/main/java/lucee/runtime/schedule/StorageUtil.java | StorageUtil.toDateTime | public DateTime toDateTime(Config config, Element el, String attributeName) {
"""
reads a XML Element Attribute ans cast it to a DateTime Object
@param config
@param el XML Element to read Attribute from it
@param attributeName Name of the Attribute to read
@return Attribute Value
"""
String str = el.ge... | java | public DateTime toDateTime(Config config, Element el, String attributeName) {
String str = el.getAttribute(attributeName);
if (str == null) return null;
return DateCaster.toDateAdvanced(str, ThreadLocalPageContext.getTimeZone(config), null);
} | [
"public",
"DateTime",
"toDateTime",
"(",
"Config",
"config",
",",
"Element",
"el",
",",
"String",
"attributeName",
")",
"{",
"String",
"str",
"=",
"el",
".",
"getAttribute",
"(",
"attributeName",
")",
";",
"if",
"(",
"str",
"==",
"null",
")",
"return",
"... | reads a XML Element Attribute ans cast it to a DateTime Object
@param config
@param el XML Element to read Attribute from it
@param attributeName Name of the Attribute to read
@return Attribute Value | [
"reads",
"a",
"XML",
"Element",
"Attribute",
"ans",
"cast",
"it",
"to",
"a",
"DateTime",
"Object"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/schedule/StorageUtil.java#L243-L247 |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/ProxyUtil.java | ProxyUtil.createCompositeServiceProxy | public static Object createCompositeServiceProxy(ClassLoader classLoader, Object[] services, boolean allowMultipleInheritance) {
"""
Creates a composite service using all of the given
services.
@param classLoader the {@link ClassLoader}
@param services the service objects
@param ... | java | public static Object createCompositeServiceProxy(ClassLoader classLoader, Object[] services, boolean allowMultipleInheritance) {
return createCompositeServiceProxy(classLoader, services, null, allowMultipleInheritance);
} | [
"public",
"static",
"Object",
"createCompositeServiceProxy",
"(",
"ClassLoader",
"classLoader",
",",
"Object",
"[",
"]",
"services",
",",
"boolean",
"allowMultipleInheritance",
")",
"{",
"return",
"createCompositeServiceProxy",
"(",
"classLoader",
",",
"services",
",",
... | Creates a composite service using all of the given
services.
@param classLoader the {@link ClassLoader}
@param services the service objects
@param allowMultipleInheritance whether or not to allow multiple inheritance
@return the object | [
"Creates",
"a",
"composite",
"service",
"using",
"all",
"of",
"the",
"given",
"services",
"."
] | train | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/ProxyUtil.java#L37-L39 |
gotev/android-upload-service | uploadservice/src/main/java/net/gotev/uploadservice/HttpUploadRequest.java | HttpUploadRequest.addParameter | public B addParameter(final String paramName, final String paramValue) {
"""
Adds a parameter to this upload request.
@param paramName parameter name
@param paramValue parameter value
@return self instance
"""
httpParams.addParameter(paramName, paramValue);
return self();
} | java | public B addParameter(final String paramName, final String paramValue) {
httpParams.addParameter(paramName, paramValue);
return self();
} | [
"public",
"B",
"addParameter",
"(",
"final",
"String",
"paramName",
",",
"final",
"String",
"paramValue",
")",
"{",
"httpParams",
".",
"addParameter",
"(",
"paramName",
",",
"paramValue",
")",
";",
"return",
"self",
"(",
")",
";",
"}"
] | Adds a parameter to this upload request.
@param paramName parameter name
@param paramValue parameter value
@return self instance | [
"Adds",
"a",
"parameter",
"to",
"this",
"upload",
"request",
"."
] | train | https://github.com/gotev/android-upload-service/blob/0952fcbe4b32c100150ffd0a237de3be4942e0a8/uploadservice/src/main/java/net/gotev/uploadservice/HttpUploadRequest.java#L85-L88 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/clustering/seeding/GeneralizedOrssSeed.java | GeneralizedOrssSeed.chooseSeeds | public DoubleVector[] chooseSeeds(int k, Matrix dataPoints) {
"""
Selects {@code k} rows of {@code dataPoints} to be seeds of a
<i>k</i>-means instance. If more seeds are requested than are available,
all possible rows are returned.
@param dataPoints a matrix whose rows are to be evaluated and from which
{@... | java | public DoubleVector[] chooseSeeds(int k, Matrix dataPoints) {
// If no weights were selected, then just use a uniform weighting of 1.
int[] weights = new int[dataPoints.rows()];
Arrays.fill(weights, 1);
return chooseSeeds(dataPoints, k, weights);
} | [
"public",
"DoubleVector",
"[",
"]",
"chooseSeeds",
"(",
"int",
"k",
",",
"Matrix",
"dataPoints",
")",
"{",
"// If no weights were selected, then just use a uniform weighting of 1.",
"int",
"[",
"]",
"weights",
"=",
"new",
"int",
"[",
"dataPoints",
".",
"rows",
"(",
... | Selects {@code k} rows of {@code dataPoints} to be seeds of a
<i>k</i>-means instance. If more seeds are requested than are available,
all possible rows are returned.
@param dataPoints a matrix whose rows are to be evaluated and from which
{@code k} data points will be selected
@param k the number of data points (row... | [
"Selects",
"{",
"@code",
"k",
"}",
"rows",
"of",
"{",
"@code",
"dataPoints",
"}",
"to",
"be",
"seeds",
"of",
"a",
"<i",
">",
"k<",
"/",
"i",
">",
"-",
"means",
"instance",
".",
"If",
"more",
"seeds",
"are",
"requested",
"than",
"are",
"available",
... | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/clustering/seeding/GeneralizedOrssSeed.java#L101-L106 |
hypercube1024/firefly | firefly-db/src/main/java/com/firefly/db/jdbc/helper/DefaultBeanProcessor.java | DefaultBeanProcessor.populateBean | @Override
public <T> T populateBean(ResultSet rs, T bean) throws SQLException {
"""
Initializes the fields of the provided bean from the ResultSet.
@param <T> The type of bean
@param rs The result set.
@param bean The bean to be populated.
@return An initialized object.
@throws SQLException if a data... | java | @Override
public <T> T populateBean(ResultSet rs, T bean) throws SQLException {
Class<?> type = bean.getClass();
PropertyDescriptor[] props = this.propertyDescriptors(type);
int[] columnToProperty = this.mapColumnsToProperties(rs.getMetaData(), props, type);
return populateBean(rs, b... | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"populateBean",
"(",
"ResultSet",
"rs",
",",
"T",
"bean",
")",
"throws",
"SQLException",
"{",
"Class",
"<",
"?",
">",
"type",
"=",
"bean",
".",
"getClass",
"(",
")",
";",
"PropertyDescriptor",
"[",
"]",
... | Initializes the fields of the provided bean from the ResultSet.
@param <T> The type of bean
@param rs The result set.
@param bean The bean to be populated.
@return An initialized object.
@throws SQLException if a database error occurs. | [
"Initializes",
"the",
"fields",
"of",
"the",
"provided",
"bean",
"from",
"the",
"ResultSet",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-db/src/main/java/com/firefly/db/jdbc/helper/DefaultBeanProcessor.java#L110-L116 |
liferay/com-liferay-commerce | commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/persistence/impl/CommerceWishListPersistenceImpl.java | CommerceWishListPersistenceImpl.findAll | @Override
public List<CommerceWishList> findAll() {
"""
Returns all the commerce wish lists.
@return the commerce wish lists
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceWishList> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceWishList",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce wish lists.
@return the commerce wish lists | [
"Returns",
"all",
"the",
"commerce",
"wish",
"lists",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-wish-list-service/src/main/java/com/liferay/commerce/wish/list/service/persistence/impl/CommerceWishListPersistenceImpl.java#L4914-L4917 |
apereo/cas | support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/web/OAuth20HandlerInterceptorAdapter.java | OAuth20HandlerInterceptorAdapter.requestRequiresAuthentication | protected boolean requestRequiresAuthentication(final HttpServletRequest request, final HttpServletResponse response) {
"""
Request requires authentication.
@param request the request
@param response the response
@return true/false
"""
val accessTokenRequest = isAccessTokenRequest(request, respon... | java | protected boolean requestRequiresAuthentication(final HttpServletRequest request, final HttpServletResponse response) {
val accessTokenRequest = isAccessTokenRequest(request, response);
if (!accessTokenRequest) {
val extractor = extractAccessTokenGrantRequest(request);
if (extrac... | [
"protected",
"boolean",
"requestRequiresAuthentication",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"HttpServletResponse",
"response",
")",
"{",
"val",
"accessTokenRequest",
"=",
"isAccessTokenRequest",
"(",
"request",
",",
"response",
")",
";",
"if",
... | Request requires authentication.
@param request the request
@param response the response
@return true/false | [
"Request",
"requires",
"authentication",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/web/OAuth20HandlerInterceptorAdapter.java#L88-L104 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bos/BosClient.java | BosClient.completeMultipartUpload | public CompleteMultipartUploadResponse completeMultipartUpload(CompleteMultipartUploadRequest request) {
"""
Completes a multipart upload by assembling previously uploaded parts.
@param request The CompleteMultipartUploadRequest object that specifies all the parameters of this operation.
@return A CompleteMult... | java | public CompleteMultipartUploadResponse completeMultipartUpload(CompleteMultipartUploadRequest request) {
checkNotNull(request, "request should not be null.");
InternalRequest internalRequest = this.createRequest(request, HttpMethodName.POST);
internalRequest.addParameter("uploadId", request.get... | [
"public",
"CompleteMultipartUploadResponse",
"completeMultipartUpload",
"(",
"CompleteMultipartUploadRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"InternalRequest",
"internalRequest",
"=",
"this",
".",
"creat... | Completes a multipart upload by assembling previously uploaded parts.
@param request The CompleteMultipartUploadRequest object that specifies all the parameters of this operation.
@return A CompleteMultipartUploadResponse from Bos containing the ETag for
the new object composed of the individual parts. | [
"Completes",
"a",
"multipart",
"upload",
"by",
"assembling",
"previously",
"uploaded",
"parts",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bos/BosClient.java#L1253-L1297 |
mygreen/excel-cellformatter | src/main/java/com/github/mygreen/cellformatter/JXLCellFormatter.java | JXLCellFormatter.format | public CellFormatResult format(final Cell cell, final boolean isStartDate1904) {
"""
セルの値をフォーマットする。
@since 0.3
@param cell フォーマット対象のセル
@param isStartDate1904 ファイルの設定が1904年始まりかどうか。
{@link JXLUtils#isDateStart1904(jxl.Sheet)}で値を調べます。
@return フォーマットしたセルの値。
@throws IllegalArgumentException cell is null.
""" ... | java | public CellFormatResult format(final Cell cell, final boolean isStartDate1904) {
ArgUtils.notNull(cell, "cell");
return format(cell, Locale.getDefault(), isStartDate1904);
} | [
"public",
"CellFormatResult",
"format",
"(",
"final",
"Cell",
"cell",
",",
"final",
"boolean",
"isStartDate1904",
")",
"{",
"ArgUtils",
".",
"notNull",
"(",
"cell",
",",
"\"cell\"",
")",
";",
"return",
"format",
"(",
"cell",
",",
"Locale",
".",
"getDefault",... | セルの値をフォーマットする。
@since 0.3
@param cell フォーマット対象のセル
@param isStartDate1904 ファイルの設定が1904年始まりかどうか。
{@link JXLUtils#isDateStart1904(jxl.Sheet)}で値を調べます。
@return フォーマットしたセルの値。
@throws IllegalArgumentException cell is null. | [
"セルの値をフォーマットする。"
] | train | https://github.com/mygreen/excel-cellformatter/blob/e802af273d49889500591e03799c9262cbf29185/src/main/java/com/github/mygreen/cellformatter/JXLCellFormatter.java#L124-L127 |
jhy/jsoup | src/main/java/org/jsoup/nodes/Node.java | Node.setBaseUri | public void setBaseUri(final String baseUri) {
"""
Update the base URI of this node and all of its descendants.
@param baseUri base URI to set
"""
Validate.notNull(baseUri);
traverse(new NodeVisitor() {
public void head(Node node, int depth) {
node.doSetBaseUri(bas... | java | public void setBaseUri(final String baseUri) {
Validate.notNull(baseUri);
traverse(new NodeVisitor() {
public void head(Node node, int depth) {
node.doSetBaseUri(baseUri);
}
public void tail(Node node, int depth) {
}
});
} | [
"public",
"void",
"setBaseUri",
"(",
"final",
"String",
"baseUri",
")",
"{",
"Validate",
".",
"notNull",
"(",
"baseUri",
")",
";",
"traverse",
"(",
"new",
"NodeVisitor",
"(",
")",
"{",
"public",
"void",
"head",
"(",
"Node",
"node",
",",
"int",
"depth",
... | Update the base URI of this node and all of its descendants.
@param baseUri base URI to set | [
"Update",
"the",
"base",
"URI",
"of",
"this",
"node",
"and",
"all",
"of",
"its",
"descendants",
"."
] | train | https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/nodes/Node.java#L146-L157 |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/login/TypicalLoginAssist.java | TypicalLoginAssist.handleRememberMeCookie | protected Boolean handleRememberMeCookie(String[] valueAry, RememberMeLoginSpecifiedOption option) {
"""
Handle remember-me cookie (and do remember-me). <br>
You can change access token's structure by override. #change_access_token
@param valueAry The array of cookie values. (NotNull)
@param option The option o... | java | protected Boolean handleRememberMeCookie(String[] valueAry, RememberMeLoginSpecifiedOption option) {
if (valueAry.length != 2) { // invalid cookie
return null;
}
final String userKey = valueAry[0]; // resolved by identity login
final String expireDate = valueAry[1]; // Access... | [
"protected",
"Boolean",
"handleRememberMeCookie",
"(",
"String",
"[",
"]",
"valueAry",
",",
"RememberMeLoginSpecifiedOption",
"option",
")",
"{",
"if",
"(",
"valueAry",
".",
"length",
"!=",
"2",
")",
"{",
"// invalid cookie",
"return",
"null",
";",
"}",
"final",... | Handle remember-me cookie (and do remember-me). <br>
You can change access token's structure by override. #change_access_token
@param valueAry The array of cookie values. (NotNull)
@param option The option of remember-me login specified by caller. (NotNull)
@return The determination of remember-me, true or false or nul... | [
"Handle",
"remember",
"-",
"me",
"cookie",
"(",
"and",
"do",
"remember",
"-",
"me",
")",
".",
"<br",
">",
"You",
"can",
"change",
"access",
"token",
"s",
"structure",
"by",
"override",
".",
"#change_access_token"
] | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/login/TypicalLoginAssist.java#L574-L585 |
io7m/jcanephora | com.io7m.jcanephora.core/src/main/java/com/io7m/jcanephora/core/JCGLBufferUpdates.java | JCGLBufferUpdates.newUpdateReplacingAll | public static <T extends JCGLBufferWritableType> JCGLBufferUpdateType<T>
newUpdateReplacingAll(final T buffer) {
"""
Construct an update that will replace all of the data in {@code buffer}.
@param buffer The buffer
@param <T> The precise type of buffer
@return An update
"""
NullCheck.notNull(bu... | java | public static <T extends JCGLBufferWritableType> JCGLBufferUpdateType<T>
newUpdateReplacingAll(final T buffer)
{
NullCheck.notNull(buffer, "Buffer");
return newUpdateReplacingRange(buffer, buffer.byteRange());
} | [
"public",
"static",
"<",
"T",
"extends",
"JCGLBufferWritableType",
">",
"JCGLBufferUpdateType",
"<",
"T",
">",
"newUpdateReplacingAll",
"(",
"final",
"T",
"buffer",
")",
"{",
"NullCheck",
".",
"notNull",
"(",
"buffer",
",",
"\"Buffer\"",
")",
";",
"return",
"n... | Construct an update that will replace all of the data in {@code buffer}.
@param buffer The buffer
@param <T> The precise type of buffer
@return An update | [
"Construct",
"an",
"update",
"that",
"will",
"replace",
"all",
"of",
"the",
"data",
"in",
"{",
"@code",
"buffer",
"}",
"."
] | train | https://github.com/io7m/jcanephora/blob/0004c1744b7f0969841d04cd4fa693f402b10980/com.io7m.jcanephora.core/src/main/java/com/io7m/jcanephora/core/JCGLBufferUpdates.java#L48-L53 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/io/IOUtils.java | IOUtils.slurpFile | public static String slurpFile(String filename, String encoding)
throws IOException {
"""
Returns all the text in the given file with the given encoding.
"""
Reader r = new InputStreamReader(new FileInputStream(filename), encoding);
return IOUtils.slurpReader(r);
} | java | public static String slurpFile(String filename, String encoding)
throws IOException {
Reader r = new InputStreamReader(new FileInputStream(filename), encoding);
return IOUtils.slurpReader(r);
} | [
"public",
"static",
"String",
"slurpFile",
"(",
"String",
"filename",
",",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"Reader",
"r",
"=",
"new",
"InputStreamReader",
"(",
"new",
"FileInputStream",
"(",
"filename",
")",
",",
"encoding",
")",
";",
... | Returns all the text in the given file with the given encoding. | [
"Returns",
"all",
"the",
"text",
"in",
"the",
"given",
"file",
"with",
"the",
"given",
"encoding",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/io/IOUtils.java#L726-L730 |
groupon/odo | client/src/main/java/com/groupon/odo/client/Client.java | Client.setCustomRequestForDefaultProfile | public static boolean setCustomRequestForDefaultProfile(String pathName, String customData) {
"""
set custom request for the default profile's default client
@param pathName friendly name of path
@param customData custom response/request data
@return true if success, false otherwise
"""
try {
... | java | public static boolean setCustomRequestForDefaultProfile(String pathName, String customData) {
try {
return setCustomForDefaultProfile(pathName, false, customData);
} catch (Exception e) {
e.printStackTrace();
}
return false;
} | [
"public",
"static",
"boolean",
"setCustomRequestForDefaultProfile",
"(",
"String",
"pathName",
",",
"String",
"customData",
")",
"{",
"try",
"{",
"return",
"setCustomForDefaultProfile",
"(",
"pathName",
",",
"false",
",",
"customData",
")",
";",
"}",
"catch",
"(",... | set custom request for the default profile's default client
@param pathName friendly name of path
@param customData custom response/request data
@return true if success, false otherwise | [
"set",
"custom",
"request",
"for",
"the",
"default",
"profile",
"s",
"default",
"client"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L871-L878 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4Connection.java | JDBC4Connection.setTypeMap | @Override
public void setTypeMap(Map<String,Class<?>> map) throws SQLException {
"""
Installs the given TypeMap object as the type map for this Connection object.
"""
checkClosed();
throw SQLError.noSupport();
} | java | @Override
public void setTypeMap(Map<String,Class<?>> map) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | [
"@",
"Override",
"public",
"void",
"setTypeMap",
"(",
"Map",
"<",
"String",
",",
"Class",
"<",
"?",
">",
">",
"map",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"throw",
"SQLError",
".",
"noSupport",
"(",
")",
";",
"}"
] | Installs the given TypeMap object as the type map for this Connection object. | [
"Installs",
"the",
"given",
"TypeMap",
"object",
"as",
"the",
"type",
"map",
"for",
"this",
"Connection",
"object",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4Connection.java#L520-L525 |
graphhopper/graphhopper | api/src/main/java/com/graphhopper/util/DistanceCalcEarth.java | DistanceCalcEarth.calcNormalizedEdgeDistanceNew | public double calcNormalizedEdgeDistanceNew(double r_lat_deg, double r_lon_deg,
double a_lat_deg, double a_lon_deg,
double b_lat_deg, double b_lon_deg, boolean reduceToSegment) {
"""
New edge distance calculation where ... | java | public double calcNormalizedEdgeDistanceNew(double r_lat_deg, double r_lon_deg,
double a_lat_deg, double a_lon_deg,
double b_lat_deg, double b_lon_deg, boolean reduceToSegment) {
double shrinkFactor = calcShrinkFacto... | [
"public",
"double",
"calcNormalizedEdgeDistanceNew",
"(",
"double",
"r_lat_deg",
",",
"double",
"r_lon_deg",
",",
"double",
"a_lat_deg",
",",
"double",
"a_lon_deg",
",",
"double",
"b_lat_deg",
",",
"double",
"b_lon_deg",
",",
"boolean",
"reduceToSegment",
")",
"{",
... | New edge distance calculation where no validEdgeDistance check would be necessary
<p>
@return the normalized distance of the query point "r" to the project point "c" onto the line
segment a-b | [
"New",
"edge",
"distance",
"calculation",
"where",
"no",
"validEdgeDistance",
"check",
"would",
"be",
"necessary",
"<p",
">"
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/api/src/main/java/com/graphhopper/util/DistanceCalcEarth.java#L117-L156 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java | GrailsDomainBinder.bindClass | protected void bindClass(PersistentEntity domainClass, PersistentClass persistentClass, InFlightMetadataCollector mappings) {
"""
Binds the specified persistant class to the runtime model based on the
properties defined in the domain class
@param domainClass The Grails domain class
@param persistentClass ... | java | protected void bindClass(PersistentEntity domainClass, PersistentClass persistentClass, InFlightMetadataCollector mappings) {
// set lazy loading for now
persistentClass.setLazy(true);
final String entityName = domainClass.getName();
persistentClass.setEntityName(entityName);
pe... | [
"protected",
"void",
"bindClass",
"(",
"PersistentEntity",
"domainClass",
",",
"PersistentClass",
"persistentClass",
",",
"InFlightMetadataCollector",
"mappings",
")",
"{",
"// set lazy loading for now",
"persistentClass",
".",
"setLazy",
"(",
"true",
")",
";",
"final",
... | Binds the specified persistant class to the runtime model based on the
properties defined in the domain class
@param domainClass The Grails domain class
@param persistentClass The persistant class
@param mappings Existing mappings | [
"Binds",
"the",
"specified",
"persistant",
"class",
"to",
"the",
"runtime",
"model",
"based",
"on",
"the",
"properties",
"defined",
"in",
"the",
"domain",
"class"
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java#L1341-L1364 |
apache/reef | lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/impl/MultiObserverImpl.java | MultiObserverImpl.unimplemented | private <TEvent> void unimplemented(final long identifier, final TEvent event) {
"""
Called when an event is received that does not have an onNext method definition
in TSubCls. Override in TSubClas to handle the error.
@param event A reference to an object which is an event not handled by TSubCls.
@param <TEven... | java | private <TEvent> void unimplemented(final long identifier, final TEvent event) {
LOG.log(Level.SEVERE, "Unimplemented event: [{0}]: {1}", new Object[] {identifier, event});
throw new RuntimeException("Event not supported: " + event);
} | [
"private",
"<",
"TEvent",
">",
"void",
"unimplemented",
"(",
"final",
"long",
"identifier",
",",
"final",
"TEvent",
"event",
")",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"SEVERE",
",",
"\"Unimplemented event: [{0}]: {1}\"",
",",
"new",
"Object",
"[",
"]",... | Called when an event is received that does not have an onNext method definition
in TSubCls. Override in TSubClas to handle the error.
@param event A reference to an object which is an event not handled by TSubCls.
@param <TEvent> The type of the event being processed. | [
"Called",
"when",
"an",
"event",
"is",
"received",
"that",
"does",
"not",
"have",
"an",
"onNext",
"method",
"definition",
"in",
"TSubCls",
".",
"Override",
"in",
"TSubClas",
"to",
"handle",
"the",
"error",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/impl/MultiObserverImpl.java#L65-L68 |
atomix/atomix | core/src/main/java/io/atomix/core/multimap/impl/AbstractAtomicMultimapService.java | AbstractAtomicMultimapService.onChange | private void onChange(String key, byte[] oldValue, byte[] newValue) {
"""
Sends a change event to listeners.
@param key the changed key
@param oldValue the old value
@param newValue the new value
"""
listeners.forEach(id -> getSession(id).accept(client -> client.onChange(key, oldValue, newValue))... | java | private void onChange(String key, byte[] oldValue, byte[] newValue) {
listeners.forEach(id -> getSession(id).accept(client -> client.onChange(key, oldValue, newValue)));
} | [
"private",
"void",
"onChange",
"(",
"String",
"key",
",",
"byte",
"[",
"]",
"oldValue",
",",
"byte",
"[",
"]",
"newValue",
")",
"{",
"listeners",
".",
"forEach",
"(",
"id",
"->",
"getSession",
"(",
"id",
")",
".",
"accept",
"(",
"client",
"->",
"clie... | Sends a change event to listeners.
@param key the changed key
@param oldValue the old value
@param newValue the new value | [
"Sends",
"a",
"change",
"event",
"to",
"listeners",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/core/src/main/java/io/atomix/core/multimap/impl/AbstractAtomicMultimapService.java#L495-L497 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java | SearchIndex.createExecutableQuery | public ExecutableQuery createExecutableQuery(SessionImpl session, SessionDataManager itemMgr, String statement,
String language) throws InvalidQueryException {
"""
Creates a new query by specifying the query statement itself and the
language in which the query is stated. If the query statement is
syntactic... | java | public ExecutableQuery createExecutableQuery(SessionImpl session, SessionDataManager itemMgr, String statement,
String language) throws InvalidQueryException
{
QueryImpl query =
new QueryImpl(session, itemMgr, this, getContext().getPropertyTypeRegistry(), statement, language,
getQuer... | [
"public",
"ExecutableQuery",
"createExecutableQuery",
"(",
"SessionImpl",
"session",
",",
"SessionDataManager",
"itemMgr",
",",
"String",
"statement",
",",
"String",
"language",
")",
"throws",
"InvalidQueryException",
"{",
"QueryImpl",
"query",
"=",
"new",
"QueryImpl",
... | Creates a new query by specifying the query statement itself and the
language in which the query is stated. If the query statement is
syntactically invalid, given the language specified, an
InvalidQueryException is thrown. <code>language</code> must specify a
query language string from among those returned by
QueryMana... | [
"Creates",
"a",
"new",
"query",
"by",
"specifying",
"the",
"query",
"statement",
"itself",
"and",
"the",
"language",
"in",
"which",
"the",
"query",
"is",
"stated",
".",
"If",
"the",
"query",
"statement",
"is",
"syntactically",
"invalid",
"given",
"the",
"lan... | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java#L1424-L1432 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/SRTServletRequestUtils.java | SRTServletRequestUtils.getHeader | @Sensitive
public static String getHeader(HttpServletRequest req, String key) {
"""
Obtain the value of the specified header.
@param req
@param key
@return The value of the header
@see HttpServletRequest#getHeader(String)
"""
HttpServletRequest sr = getWrappedServletRequestObject(req);
... | java | @Sensitive
public static String getHeader(HttpServletRequest req, String key) {
HttpServletRequest sr = getWrappedServletRequestObject(req);
return sr.getHeader(key);
} | [
"@",
"Sensitive",
"public",
"static",
"String",
"getHeader",
"(",
"HttpServletRequest",
"req",
",",
"String",
"key",
")",
"{",
"HttpServletRequest",
"sr",
"=",
"getWrappedServletRequestObject",
"(",
"req",
")",
";",
"return",
"sr",
".",
"getHeader",
"(",
"key",
... | Obtain the value of the specified header.
@param req
@param key
@return The value of the header
@see HttpServletRequest#getHeader(String) | [
"Obtain",
"the",
"value",
"of",
"the",
"specified",
"header",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/SRTServletRequestUtils.java#L95-L99 |
osglworks/java-tool | src/main/java/org/osgl/Lang.java | F1.compose | public <X1, X2, X3, X4, X5> F5<X1, X2, X3, X4, X5, R>
compose(final Func5<? super X1, ? super X2, ? super X3, ? super X4, ? super X5, ? extends P1> before) {
"""
Returns an {@code F3<X1, X2, X3, X4, X5, R>>} function by composing the specified
{@code Func3<X1, X2, X3, X4, X5, P1>} function with... | java | public <X1, X2, X3, X4, X5> F5<X1, X2, X3, X4, X5, R>
compose(final Func5<? super X1, ? super X2, ? super X3, ? super X4, ? super X5, ? extends P1> before) {
final F1<P1, R> me = this;
return new F5<X1, X2, X3, X4, X5, R>() {
@Override
public R apply(X1 x1... | [
"public",
"<",
"X1",
",",
"X2",
",",
"X3",
",",
"X4",
",",
"X5",
">",
"F5",
"<",
"X1",
",",
"X2",
",",
"X3",
",",
"X4",
",",
"X5",
",",
"R",
">",
"compose",
"(",
"final",
"Func5",
"<",
"?",
"super",
"X1",
",",
"?",
"super",
"X2",
",",
"?"... | Returns an {@code F3<X1, X2, X3, X4, X5, R>>} function by composing the specified
{@code Func3<X1, X2, X3, X4, X5, P1>} function with this function applied last
@param <X1>
the type of first param the new function applied to
@param <X2>
the type of second param the new function applied to
@param <X3>
the ty... | [
"Returns",
"an",
"{",
"@code",
"F3<",
";",
"X1",
"X2",
"X3",
"X4",
"X5",
"R>",
";",
">",
"}",
"function",
"by",
"composing",
"the",
"specified",
"{",
"@code",
"Func3<X1",
"X2",
"X3",
"X4",
"X5",
"P1>",
";",
"}",
"function",
"with",
"this",
"f... | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/Lang.java#L757-L766 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/json/JsonObject.java | JsonObject.getDouble | public double getDouble(String name, double defaultValue) {
"""
Returns the <code>double</code> value of the member with the specified name in this object. If
this object does not contain a member with this name, the given default value is returned. If
this object contains multiple members with the given name, t... | java | public double getDouble(String name, double defaultValue) {
JsonValue value = get(name);
return value != null ? value.asDouble() : defaultValue;
} | [
"public",
"double",
"getDouble",
"(",
"String",
"name",
",",
"double",
"defaultValue",
")",
"{",
"JsonValue",
"value",
"=",
"get",
"(",
"name",
")",
";",
"return",
"value",
"!=",
"null",
"?",
"value",
".",
"asDouble",
"(",
")",
":",
"defaultValue",
";",
... | Returns the <code>double</code> value of the member with the specified name in this object. If
this object does not contain a member with this name, the given default value is returned. If
this object contains multiple members with the given name, the last one will be picked. If this
member's value does not represent a... | [
"Returns",
"the",
"<code",
">",
"double<",
"/",
"code",
">",
"value",
"of",
"the",
"member",
"with",
"the",
"specified",
"name",
"in",
"this",
"object",
".",
"If",
"this",
"object",
"does",
"not",
"contain",
"a",
"member",
"with",
"this",
"name",
"the",
... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/json/JsonObject.java#L638-L641 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistriesInner.java | RegistriesInner.beginQueueBuildAsync | public Observable<BuildInner> beginQueueBuildAsync(String resourceGroupName, String registryName, QueueBuildRequest buildRequest) {
"""
Creates a new build based on the request parameters and add it to the build queue.
@param resourceGroupName The name of the resource group to which the container registry belon... | java | public Observable<BuildInner> beginQueueBuildAsync(String resourceGroupName, String registryName, QueueBuildRequest buildRequest) {
return beginQueueBuildWithServiceResponseAsync(resourceGroupName, registryName, buildRequest).map(new Func1<ServiceResponse<BuildInner>, BuildInner>() {
@Override
... | [
"public",
"Observable",
"<",
"BuildInner",
">",
"beginQueueBuildAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"QueueBuildRequest",
"buildRequest",
")",
"{",
"return",
"beginQueueBuildWithServiceResponseAsync",
"(",
"resourceGroupName",
",",... | Creates a new build based on the request parameters and add it to the build queue.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param buildRequest The parameters of a build that needs to queued.
@throws Illegal... | [
"Creates",
"a",
"new",
"build",
"based",
"on",
"the",
"request",
"parameters",
"and",
"add",
"it",
"to",
"the",
"build",
"queue",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistriesInner.java#L1829-L1836 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/SerializationUtils.java | SerializationUtils.toByteArray | public static byte[] toByteArray(Object obj, ClassLoader classLoader) {
"""
Serialize an object to byte array, with a custom class loader.
<p>
If the target object implements {@link ISerializationSupport}, this
method calls its {@link ISerializationSupport#toBytes()} method;
otherwise FST library is used to ... | java | public static byte[] toByteArray(Object obj, ClassLoader classLoader) {
if (obj instanceof ISerializationSupport) {
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
if (classLoader != null) {
Thread.currentThread().setContextClassLoader(classLo... | [
"public",
"static",
"byte",
"[",
"]",
"toByteArray",
"(",
"Object",
"obj",
",",
"ClassLoader",
"classLoader",
")",
"{",
"if",
"(",
"obj",
"instanceof",
"ISerializationSupport",
")",
"{",
"ClassLoader",
"oldClassLoader",
"=",
"Thread",
".",
"currentThread",
"(",
... | Serialize an object to byte array, with a custom class loader.
<p>
If the target object implements {@link ISerializationSupport}, this
method calls its {@link ISerializationSupport#toBytes()} method;
otherwise FST library is used to serialize the object.
</p>
@param obj
@param classLoader
@return
@deprecated since 0.... | [
"Serialize",
"an",
"object",
"to",
"byte",
"array",
"with",
"a",
"custom",
"class",
"loader",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/SerializationUtils.java#L80-L94 |
kiegroup/jbpm | jbpm-human-task/jbpm-human-task-jpa/src/main/java/org/jbpm/services/task/impl/model/TaskDataImpl.java | TaskDataImpl.setFault | public void setFault(long faultContentId, FaultData faultData) {
"""
Sets the fault data for this task data. It will set the <field>faultContentId</field> from the specified
faultContentId, <field>faultAccessType</field>, <field>faultType</field>, <field>faultName</field> from the
specified faultData.
@param fa... | java | public void setFault(long faultContentId, FaultData faultData) {
setFaultContentId(faultContentId);
setFaultAccessType(faultData.getAccessType());
setFaultType(faultData.getType());
setFaultName(faultData.getFaultName());
} | [
"public",
"void",
"setFault",
"(",
"long",
"faultContentId",
",",
"FaultData",
"faultData",
")",
"{",
"setFaultContentId",
"(",
"faultContentId",
")",
";",
"setFaultAccessType",
"(",
"faultData",
".",
"getAccessType",
"(",
")",
")",
";",
"setFaultType",
"(",
"fa... | Sets the fault data for this task data. It will set the <field>faultContentId</field> from the specified
faultContentId, <field>faultAccessType</field>, <field>faultType</field>, <field>faultName</field> from the
specified faultData.
@param faultContentId id of fault content
@param faultData FaultData | [
"Sets",
"the",
"fault",
"data",
"for",
"this",
"task",
"data",
".",
"It",
"will",
"set",
"the",
"<field",
">",
"faultContentId<",
"/",
"field",
">",
"from",
"the",
"specified",
"faultContentId",
"<field",
">",
"faultAccessType<",
"/",
"field",
">",
"<field",... | train | https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-human-task/jbpm-human-task-jpa/src/main/java/org/jbpm/services/task/impl/model/TaskDataImpl.java#L605-L610 |
pebble/pebble-android-sdk | PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/PebbleKit.java | PebbleKit.getWatchFWVersion | public static FirmwareVersionInfo getWatchFWVersion(final Context context) {
"""
Get the version information of the firmware running on a connected watch.
@param context
The Android context used to perform the query.
<em>Protip:</em> You probably want to use your ApplicationContext here.
@return null if ... | java | public static FirmwareVersionInfo getWatchFWVersion(final Context context) {
Cursor c = null;
try {
c = queryProvider(context);
if (c == null || !c.moveToNext()) {
return null;
}
int majorVersion = c.getInt(KIT_STATE_COLUMN_VERSION_MAJOR);
int minorVersion = c.getInt(KIT_STATE_... | [
"public",
"static",
"FirmwareVersionInfo",
"getWatchFWVersion",
"(",
"final",
"Context",
"context",
")",
"{",
"Cursor",
"c",
"=",
"null",
";",
"try",
"{",
"c",
"=",
"queryProvider",
"(",
"context",
")",
";",
"if",
"(",
"c",
"==",
"null",
"||",
"!",
"c",
... | Get the version information of the firmware running on a connected watch.
@param context
The Android context used to perform the query.
<em>Protip:</em> You probably want to use your ApplicationContext here.
@return null if the watch is disconnected or we can't get the version. Otherwise,
a FirmwareVersionObject con... | [
"Get",
"the",
"version",
"information",
"of",
"the",
"firmware",
"running",
"on",
"a",
"connected",
"watch",
"."
] | train | https://github.com/pebble/pebble-android-sdk/blob/ddfc53ecf3950deebb62a1f205aa21fbe9bce45d/PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/PebbleKit.java#L151-L170 |
elki-project/elki | elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/strings/LevenshteinDistanceFunction.java | LevenshteinDistanceFunction.levenshteinDistance | public static int levenshteinDistance(String o1, String o2) {
"""
Levenshtein distance for two strings.
@param o1 First string
@param o2 Second string
@return Levenshtein distance
"""
// Let o1 be the shorter one:
if(o1.length() > o2.length()) {
return levenshteinDistance(o2, o1);
}
... | java | public static int levenshteinDistance(String o1, String o2) {
// Let o1 be the shorter one:
if(o1.length() > o2.length()) {
return levenshteinDistance(o2, o1);
}
final int l1 = o1.length(), l2 = o2.length();
// Exploit that Java caches the hash code of strings:
if(l1 == l2 && o1.hashCode()... | [
"public",
"static",
"int",
"levenshteinDistance",
"(",
"String",
"o1",
",",
"String",
"o2",
")",
"{",
"// Let o1 be the shorter one:",
"if",
"(",
"o1",
".",
"length",
"(",
")",
">",
"o2",
".",
"length",
"(",
")",
")",
"{",
"return",
"levenshteinDistance",
... | Levenshtein distance for two strings.
@param o1 First string
@param o2 Second string
@return Levenshtein distance | [
"Levenshtein",
"distance",
"for",
"two",
"strings",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/strings/LevenshteinDistanceFunction.java#L84-L106 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java | FilesImpl.deleteFromComputeNode | public void deleteFromComputeNode(String poolId, String nodeId, String filePath, Boolean recursive, FileDeleteFromComputeNodeOptions fileDeleteFromComputeNodeOptions) {
"""
Deletes the specified file from the compute node.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of... | java | public void deleteFromComputeNode(String poolId, String nodeId, String filePath, Boolean recursive, FileDeleteFromComputeNodeOptions fileDeleteFromComputeNodeOptions) {
deleteFromComputeNodeWithServiceResponseAsync(poolId, nodeId, filePath, recursive, fileDeleteFromComputeNodeOptions).toBlocking().single().body... | [
"public",
"void",
"deleteFromComputeNode",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"String",
"filePath",
",",
"Boolean",
"recursive",
",",
"FileDeleteFromComputeNodeOptions",
"fileDeleteFromComputeNodeOptions",
")",
"{",
"deleteFromComputeNodeWithServiceRespons... | Deletes the specified file from the compute node.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node from which you want to delete the file.
@param filePath The path to the file or directory that you want to delete.
@param recursive Whether to delete children of a... | [
"Deletes",
"the",
"specified",
"file",
"from",
"the",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java#L973-L975 |
msgpack/msgpack-java | msgpack-core/src/main/java/org/msgpack/core/buffer/MessageBuffer.java | MessageBuffer.copyTo | public void copyTo(int index, MessageBuffer dst, int offset, int length) {
"""
Copy this buffer contents to another MessageBuffer
@param index
@param dst
@param offset
@param length
"""
unsafe.copyMemory(base, address + index, dst.base, dst.address + offset, length);
} | java | public void copyTo(int index, MessageBuffer dst, int offset, int length)
{
unsafe.copyMemory(base, address + index, dst.base, dst.address + offset, length);
} | [
"public",
"void",
"copyTo",
"(",
"int",
"index",
",",
"MessageBuffer",
"dst",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"unsafe",
".",
"copyMemory",
"(",
"base",
",",
"address",
"+",
"index",
",",
"dst",
".",
"base",
",",
"dst",
".",
"add... | Copy this buffer contents to another MessageBuffer
@param index
@param dst
@param offset
@param length | [
"Copy",
"this",
"buffer",
"contents",
"to",
"another",
"MessageBuffer"
] | train | https://github.com/msgpack/msgpack-java/blob/16e370e348215a72a14c210b42d448d513aee015/msgpack-core/src/main/java/org/msgpack/core/buffer/MessageBuffer.java#L626-L629 |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/BandwidthSchedulesInner.java | BandwidthSchedulesInner.beginCreateOrUpdate | public BandwidthScheduleInner beginCreateOrUpdate(String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) {
"""
Creates or updates a bandwidth schedule.
@param deviceName The device name.
@param name The bandwidth schedule name which needs to be added/updated.
@param resou... | java | public BandwidthScheduleInner beginCreateOrUpdate(String deviceName, String name, String resourceGroupName, BandwidthScheduleInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, parameters).toBlocking().single().body();
} | [
"public",
"BandwidthScheduleInner",
"beginCreateOrUpdate",
"(",
"String",
"deviceName",
",",
"String",
"name",
",",
"String",
"resourceGroupName",
",",
"BandwidthScheduleInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"deviceName"... | Creates or updates a bandwidth schedule.
@param deviceName The device name.
@param name The bandwidth schedule name which needs to be added/updated.
@param resourceGroupName The resource group name.
@param parameters The bandwidth schedule to be added or updated.
@throws IllegalArgumentException thrown if parameters f... | [
"Creates",
"or",
"updates",
"a",
"bandwidth",
"schedule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/BandwidthSchedulesInner.java#L406-L408 |
javagl/ND | nd-distance/src/main/java/de/javagl/nd/distance/tuples/j/LongTupleDistanceFunctions.java | LongTupleDistanceFunctions.byDistanceComparator | public static Comparator<LongTuple> byDistanceComparator(
LongTuple reference,
final ToDoubleBiFunction<? super LongTuple, ? super LongTuple>
distanceFunction) {
"""
Returns a new comparator that compares {@link LongTuple} instances
by their distance to the given reference, accordi... | java | public static Comparator<LongTuple> byDistanceComparator(
LongTuple reference,
final ToDoubleBiFunction<? super LongTuple, ? super LongTuple>
distanceFunction)
{
final LongTuple fReference = LongTuples.copy(reference);
return new Comparator<LongTuple>()
{
... | [
"public",
"static",
"Comparator",
"<",
"LongTuple",
">",
"byDistanceComparator",
"(",
"LongTuple",
"reference",
",",
"final",
"ToDoubleBiFunction",
"<",
"?",
"super",
"LongTuple",
",",
"?",
"super",
"LongTuple",
">",
"distanceFunction",
")",
"{",
"final",
"LongTup... | Returns a new comparator that compares {@link LongTuple} instances
by their distance to the given reference, according to the given
distance function.
A copy of the given reference point will be stored, so that changes
in the given point will not affect the returned comparator.
@param reference The reference point
@pa... | [
"Returns",
"a",
"new",
"comparator",
"that",
"compares",
"{",
"@link",
"LongTuple",
"}",
"instances",
"by",
"their",
"distance",
"to",
"the",
"given",
"reference",
"according",
"to",
"the",
"given",
"distance",
"function",
".",
"A",
"copy",
"of",
"the",
"giv... | train | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-distance/src/main/java/de/javagl/nd/distance/tuples/j/LongTupleDistanceFunctions.java#L54-L70 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java | HttpChannelConfig.parseDoNotAllowDuplicateSetCookies | private void parseDoNotAllowDuplicateSetCookies(Map<?, ?> props) {
"""
Check the configuration map for the property to tell us if we should prevent multiple set-cookies with the same name
@ param props
"""
//PI31734 - prevent multiple Set-Cookies with the same name
String value = (String) pr... | java | private void parseDoNotAllowDuplicateSetCookies(Map<?, ?> props) {
//PI31734 - prevent multiple Set-Cookies with the same name
String value = (String) props.get(HttpConfigConstants.PROPNAME_DO_NOT_ALLOW_DUPLICATE_SET_COOKIES);
if (null != value) {
this.doNotAllowDuplicateSetCookies =... | [
"private",
"void",
"parseDoNotAllowDuplicateSetCookies",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"props",
")",
"{",
"//PI31734 - prevent multiple Set-Cookies with the same name",
"String",
"value",
"=",
"(",
"String",
")",
"props",
".",
"get",
"(",
"HttpConfigConstants",... | Check the configuration map for the property to tell us if we should prevent multiple set-cookies with the same name
@ param props | [
"Check",
"the",
"configuration",
"map",
"for",
"the",
"property",
"to",
"tell",
"us",
"if",
"we",
"should",
"prevent",
"multiple",
"set",
"-",
"cookies",
"with",
"the",
"same",
"name"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L1245-L1254 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java | BeanUtil.setProperty | public static void setProperty(Object bean, String expression, Object value) {
"""
解析Bean中的属性值
@param bean Bean对象,支持Map、List、Collection、Array
@param expression 表达式,例如:person.friend[5].name
@see BeanPath#get(Object)
@since 4.0.6
"""
BeanPath.create(expression).set(bean, value);
} | java | public static void setProperty(Object bean, String expression, Object value) {
BeanPath.create(expression).set(bean, value);
} | [
"public",
"static",
"void",
"setProperty",
"(",
"Object",
"bean",
",",
"String",
"expression",
",",
"Object",
"value",
")",
"{",
"BeanPath",
".",
"create",
"(",
"expression",
")",
".",
"set",
"(",
"bean",
",",
"value",
")",
";",
"}"
] | 解析Bean中的属性值
@param bean Bean对象,支持Map、List、Collection、Array
@param expression 表达式,例如:person.friend[5].name
@see BeanPath#get(Object)
@since 4.0.6 | [
"解析Bean中的属性值"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/BeanUtil.java#L313-L315 |
google/auto | value/src/main/java/com/google/auto/value/processor/TypeVariables.java | TypeVariables.canAssignStaticMethodResult | static boolean canAssignStaticMethodResult(
ExecutableElement method,
TypeMirror actualParameterType,
TypeMirror targetType,
Types typeUtils) {
"""
Tests whether a given parameter can be given to a static method like
{@code ImmutableMap.copyOf} to produce a value that can be assigned to th... | java | static boolean canAssignStaticMethodResult(
ExecutableElement method,
TypeMirror actualParameterType,
TypeMirror targetType,
Types typeUtils) {
if (!targetType.getKind().equals(TypeKind.DECLARED)
|| !method.getModifiers().contains(Modifier.STATIC)
|| method.getParameters().si... | [
"static",
"boolean",
"canAssignStaticMethodResult",
"(",
"ExecutableElement",
"method",
",",
"TypeMirror",
"actualParameterType",
",",
"TypeMirror",
"targetType",
",",
"Types",
"typeUtils",
")",
"{",
"if",
"(",
"!",
"targetType",
".",
"getKind",
"(",
")",
".",
"eq... | Tests whether a given parameter can be given to a static method like
{@code ImmutableMap.copyOf} to produce a value that can be assigned to the given target type.
<p>For example, suppose we have this method in {@code ImmutableMap}:<br>
{@code static <K, V> ImmutableMap<K, V> copyOf(Map<? extends K, ? extends V>)}<br>
... | [
"Tests",
"whether",
"a",
"given",
"parameter",
"can",
"be",
"given",
"to",
"a",
"static",
"method",
"like",
"{",
"@code",
"ImmutableMap",
".",
"copyOf",
"}",
"to",
"produce",
"a",
"value",
"that",
"can",
"be",
"assigned",
"to",
"the",
"given",
"target",
... | train | https://github.com/google/auto/blob/4158a5fa71f1ef763e683b627f4d29bc04cfde9d/value/src/main/java/com/google/auto/value/processor/TypeVariables.java#L134-L168 |
klinker24/Android-3DTouch-PeekView | library/src/main/java/com/klinker/android/peekview/builder/Peek.java | Peek.applyTo | public void applyTo(final PeekViewActivity activity, final View base) {
"""
Finish the builder by selecting the base view that you want to show the PeekView from.
@param activity the PeekViewActivity that you are on.
@param base the view that you want to touch to apply the peek to.
"""
final Gestur... | java | public void applyTo(final PeekViewActivity activity, final View base) {
final GestureDetectorCompat detector =
new GestureDetectorCompat(activity, new GestureListener(activity, base, this));
base.setOnTouchListener(new View.OnTouchListener() {
@Override
public bo... | [
"public",
"void",
"applyTo",
"(",
"final",
"PeekViewActivity",
"activity",
",",
"final",
"View",
"base",
")",
"{",
"final",
"GestureDetectorCompat",
"detector",
"=",
"new",
"GestureDetectorCompat",
"(",
"activity",
",",
"new",
"GestureListener",
"(",
"activity",
"... | Finish the builder by selecting the base view that you want to show the PeekView from.
@param activity the PeekViewActivity that you are on.
@param base the view that you want to touch to apply the peek to. | [
"Finish",
"the",
"builder",
"by",
"selecting",
"the",
"base",
"view",
"that",
"you",
"want",
"to",
"show",
"the",
"PeekView",
"from",
"."
] | train | https://github.com/klinker24/Android-3DTouch-PeekView/blob/8329c44f31c3752da43bab5f261a28ca02254613/library/src/main/java/com/klinker/android/peekview/builder/Peek.java#L91-L108 |
opengeospatial/teamengine | teamengine-core/src/main/java/com/occamlab/te/util/DocumentationHelper.java | DocumentationHelper.prettyPrintsReport | public void prettyPrintsReport(File sessionDir, File prettyPrintReportFile)
throws Exception {
"""
Create the pretty print HTML document of log report. Verify the content
of log root directory and create the report.html file if it not exists.
@param sessionDir
existing logs directory
"""
... | java | public void prettyPrintsReport(File sessionDir, File prettyPrintReportFile)
throws Exception {
if ((!sessionDir.exists()) || (!sessionDir.isDirectory())) {
throw new Exception("Error: LOGDIR " + sessionDir.getAbsolutePath()
+ " seems not a valid directory. ");
... | [
"public",
"void",
"prettyPrintsReport",
"(",
"File",
"sessionDir",
",",
"File",
"prettyPrintReportFile",
")",
"throws",
"Exception",
"{",
"if",
"(",
"(",
"!",
"sessionDir",
".",
"exists",
"(",
")",
")",
"||",
"(",
"!",
"sessionDir",
".",
"isDirectory",
"(",
... | Create the pretty print HTML document of log report. Verify the content
of log root directory and create the report.html file if it not exists.
@param sessionDir
existing logs directory | [
"Create",
"the",
"pretty",
"print",
"HTML",
"document",
"of",
"log",
"report",
".",
"Verify",
"the",
"content",
"of",
"log",
"root",
"directory",
"and",
"create",
"the",
"report",
".",
"html",
"file",
"if",
"it",
"not",
"exists",
"."
] | train | https://github.com/opengeospatial/teamengine/blob/b6b890214b6784bbe19460bf753bdf28a9514bee/teamengine-core/src/main/java/com/occamlab/te/util/DocumentationHelper.java#L153-L183 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/DashboardDto.java | DashboardDto.transformToDto | public static DashboardDto transformToDto(Dashboard dashboard) {
"""
Converts dashboard entity to dashboardDto.
@param dashboard The dashboard object. Cannot be null.
@return DashboardDto object.
@throws WebApplicationException If an error occurs.
"""
if (dashboard == null) {
... | java | public static DashboardDto transformToDto(Dashboard dashboard) {
if (dashboard == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
DashboardDto result = createDtoObject(DashboardDto.class, dashboard);... | [
"public",
"static",
"DashboardDto",
"transformToDto",
"(",
"Dashboard",
"dashboard",
")",
"{",
"if",
"(",
"dashboard",
"==",
"null",
")",
"{",
"throw",
"new",
"WebApplicationException",
"(",
"\"Null entity object cannot be converted to Dto object.\"",
",",
"Status",
"."... | Converts dashboard entity to dashboardDto.
@param dashboard The dashboard object. Cannot be null.
@return DashboardDto object.
@throws WebApplicationException If an error occurs. | [
"Converts",
"dashboard",
"entity",
"to",
"dashboardDto",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/DashboardDto.java#L77-L86 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/wi/wisite_translationinternalip_binding.java | wisite_translationinternalip_binding.count_filtered | public static long count_filtered(nitro_service service, String sitepath, String filter) throws Exception {
"""
Use this API to count the filtered set of wisite_translationinternalip_binding resources.
filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
"""
wisite_translationinternalip_bi... | java | public static long count_filtered(nitro_service service, String sitepath, String filter) throws Exception{
wisite_translationinternalip_binding obj = new wisite_translationinternalip_binding();
obj.set_sitepath(sitepath);
options option = new options();
option.set_count(true);
option.set_filter(filter);
wis... | [
"public",
"static",
"long",
"count_filtered",
"(",
"nitro_service",
"service",
",",
"String",
"sitepath",
",",
"String",
"filter",
")",
"throws",
"Exception",
"{",
"wisite_translationinternalip_binding",
"obj",
"=",
"new",
"wisite_translationinternalip_binding",
"(",
")... | Use this API to count the filtered set of wisite_translationinternalip_binding resources.
filter string should be in JSON format.eg: "port:80,servicetype:HTTP". | [
"Use",
"this",
"API",
"to",
"count",
"the",
"filtered",
"set",
"of",
"wisite_translationinternalip_binding",
"resources",
".",
"filter",
"string",
"should",
"be",
"in",
"JSON",
"format",
".",
"eg",
":",
"port",
":",
"80",
"servicetype",
":",
"HTTP",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/wi/wisite_translationinternalip_binding.java#L322-L333 |
Drivemode/TypefaceHelper | TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceHelper.java | TypefaceHelper.setTypeface | public void setTypeface(Activity activity, @StringRes int strResId, int style) {
"""
Set the typeface to the all text views belong to the activity.
Note that we use decor view of the activity so that the typeface will also be applied to action bar.
@param activity the activity.
@param strResId string resource c... | java | public void setTypeface(Activity activity, @StringRes int strResId, int style) {
setTypeface(activity, mApplication.getString(strResId), style);
} | [
"public",
"void",
"setTypeface",
"(",
"Activity",
"activity",
",",
"@",
"StringRes",
"int",
"strResId",
",",
"int",
"style",
")",
"{",
"setTypeface",
"(",
"activity",
",",
"mApplication",
".",
"getString",
"(",
"strResId",
")",
",",
"style",
")",
";",
"}"
... | Set the typeface to the all text views belong to the activity.
Note that we use decor view of the activity so that the typeface will also be applied to action bar.
@param activity the activity.
@param strResId string resource containing typeface name.
@param style the typeface style. | [
"Set",
"the",
"typeface",
"to",
"the",
"all",
"text",
"views",
"belong",
"to",
"the",
"activity",
".",
"Note",
"that",
"we",
"use",
"decor",
"view",
"of",
"the",
"activity",
"so",
"that",
"the",
"typeface",
"will",
"also",
"be",
"applied",
"to",
"action"... | train | https://github.com/Drivemode/TypefaceHelper/blob/86bef9ce16b9626b7076559e846db1b9f043c008/TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceHelper.java#L347-L349 |
tvesalainen/util | util/src/main/java/org/vesalainen/nio/channels/ChannelHelper.java | ChannelHelper.alignedPosition | public static final long alignedPosition(SeekableByteChannel ch, long align) throws IOException {
"""
Returns Incremented position so that position mod align == 0, but doesn't
change channels position.
@param ch
@param align
@return
@throws IOException
"""
long position = ch.position();
... | java | public static final long alignedPosition(SeekableByteChannel ch, long align) throws IOException
{
long position = ch.position();
long mod = position % align;
if (mod > 0)
{
return position + align - mod;
}
else
{
return positi... | [
"public",
"static",
"final",
"long",
"alignedPosition",
"(",
"SeekableByteChannel",
"ch",
",",
"long",
"align",
")",
"throws",
"IOException",
"{",
"long",
"position",
"=",
"ch",
".",
"position",
"(",
")",
";",
"long",
"mod",
"=",
"position",
"%",
"align",
... | Returns Incremented position so that position mod align == 0, but doesn't
change channels position.
@param ch
@param align
@return
@throws IOException | [
"Returns",
"Incremented",
"position",
"so",
"that",
"position",
"mod",
"align",
"==",
"0",
"but",
"doesn",
"t",
"change",
"channels",
"position",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/channels/ChannelHelper.java#L154-L166 |
JavaMoney/jsr354-api | src/main/java/javax/money/Monetary.java | Monetary.getRounding | public static MonetaryRounding getRounding(CurrencyUnit currencyUnit, String... providers) {
"""
Creates an {@link MonetaryOperator} for rounding {@link MonetaryAmount}
instances given a currency.
@param currencyUnit The currency, which determines the required scale. As
{@link java.math.RoundingMode}, by defa... | java | public static MonetaryRounding getRounding(CurrencyUnit currencyUnit, String... providers) {
return Optional.ofNullable(monetaryRoundingsSingletonSpi()).orElseThrow(
() -> new MonetaryException("No MonetaryRoundingsSpi loaded, query functionality is not available."))
.getRounding... | [
"public",
"static",
"MonetaryRounding",
"getRounding",
"(",
"CurrencyUnit",
"currencyUnit",
",",
"String",
"...",
"providers",
")",
"{",
"return",
"Optional",
".",
"ofNullable",
"(",
"monetaryRoundingsSingletonSpi",
"(",
")",
")",
".",
"orElseThrow",
"(",
"(",
")"... | Creates an {@link MonetaryOperator} for rounding {@link MonetaryAmount}
instances given a currency.
@param currencyUnit The currency, which determines the required scale. As
{@link java.math.RoundingMode}, by default, {@link java.math.RoundingMode#HALF_UP}
is used.
@param providers the providers and ordering to be ... | [
"Creates",
"an",
"{",
"@link",
"MonetaryOperator",
"}",
"for",
"rounding",
"{",
"@link",
"MonetaryAmount",
"}",
"instances",
"given",
"a",
"currency",
"."
] | train | https://github.com/JavaMoney/jsr354-api/blob/49a7ae436eaf45cac1040879185531ef22de5525/src/main/java/javax/money/Monetary.java#L153-L157 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/OdsElements.java | OdsElements.flushRows | public void flushRows(final XMLUtil util, final ZipUTF8Writer writer) throws IOException {
"""
Flush the rows
@param util the util
@param writer the stream to write
@throws IOException when write fails
"""
this.contentElement.flushRows(util, writer, this.settingsElement);
} | java | public void flushRows(final XMLUtil util, final ZipUTF8Writer writer) throws IOException {
this.contentElement.flushRows(util, writer, this.settingsElement);
} | [
"public",
"void",
"flushRows",
"(",
"final",
"XMLUtil",
"util",
",",
"final",
"ZipUTF8Writer",
"writer",
")",
"throws",
"IOException",
"{",
"this",
".",
"contentElement",
".",
"flushRows",
"(",
"util",
",",
"writer",
",",
"this",
".",
"settingsElement",
")",
... | Flush the rows
@param util the util
@param writer the stream to write
@throws IOException when write fails | [
"Flush",
"the",
"rows"
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/OdsElements.java#L269-L271 |
mapsforge/mapsforge | mapsforge-poi/src/main/java/org/mapsforge/poi/storage/DoubleLinkedPoiCategory.java | DoubleLinkedPoiCategory.calculateCategoryIDs | public static int calculateCategoryIDs(DoubleLinkedPoiCategory rootNode, int maxValue) {
"""
This method calculates a unique ID for all nodes in the tree. For each node's 'n' ID named
'ID_'n at depth 'd' the following invariants must be true:
<ul>
<li>ID > max(ID of all child nodes)</li>
<li>All nodes' IDs lef... | java | public static int calculateCategoryIDs(DoubleLinkedPoiCategory rootNode, int maxValue) {
int newMax = maxValue;
for (PoiCategory c : rootNode.childCategories) {
newMax = calculateCategoryIDs((DoubleLinkedPoiCategory) c, newMax);
}
rootNode.id = newMax;
return newMax... | [
"public",
"static",
"int",
"calculateCategoryIDs",
"(",
"DoubleLinkedPoiCategory",
"rootNode",
",",
"int",
"maxValue",
")",
"{",
"int",
"newMax",
"=",
"maxValue",
";",
"for",
"(",
"PoiCategory",
"c",
":",
"rootNode",
".",
"childCategories",
")",
"{",
"newMax",
... | This method calculates a unique ID for all nodes in the tree. For each node's 'n' ID named
'ID_'n at depth 'd' the following invariants must be true:
<ul>
<li>ID > max(ID of all child nodes)</li>
<li>All nodes' IDs left of n must be < ID_n.</li>
<li>All nodes' IDs right of n must be > ID_n.</li>
</ul>
@param rootNode ... | [
"This",
"method",
"calculates",
"a",
"unique",
"ID",
"for",
"all",
"nodes",
"in",
"the",
"tree",
".",
"For",
"each",
"node",
"s",
"n",
"ID",
"named",
"ID_",
"n",
"at",
"depth",
"d",
"the",
"following",
"invariants",
"must",
"be",
"true",
":",
"<ul",
... | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-poi/src/main/java/org/mapsforge/poi/storage/DoubleLinkedPoiCategory.java#L91-L100 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBase.java | DTMDefaultBase.findInSortedSuballocatedIntVector | protected int findInSortedSuballocatedIntVector(SuballocatedIntVector vector, int lookfor) {
"""
Subroutine: Locate the specified node within
m_namespaceDeclSetElements, or the last element which
preceeds it in document order
%REVIEW% Inlne this into findNamespaceContext? Create SortedSuballocatedIntVector ty... | java | protected int findInSortedSuballocatedIntVector(SuballocatedIntVector vector, int lookfor)
{
// Binary search
int i = 0;
if(vector != null) {
int first = 0;
int last = vector.size() - 1;
while (first <= last) {
i = (first + last) / 2;
int test = lookfor-vector.elementAt... | [
"protected",
"int",
"findInSortedSuballocatedIntVector",
"(",
"SuballocatedIntVector",
"vector",
",",
"int",
"lookfor",
")",
"{",
"// Binary search",
"int",
"i",
"=",
"0",
";",
"if",
"(",
"vector",
"!=",
"null",
")",
"{",
"int",
"first",
"=",
"0",
";",
"int"... | Subroutine: Locate the specified node within
m_namespaceDeclSetElements, or the last element which
preceeds it in document order
%REVIEW% Inlne this into findNamespaceContext? Create SortedSuballocatedIntVector type?
@return If positive or zero, the index of the found item.
If negative, index of the point at which it... | [
"Subroutine",
":",
"Locate",
"the",
"specified",
"node",
"within",
"m_namespaceDeclSetElements",
"or",
"the",
"last",
"element",
"which",
"preceeds",
"it",
"in",
"document",
"order"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBase.java#L1415-L1443 |
grpc/grpc-java | stub/src/main/java/io/grpc/stub/MetadataUtils.java | MetadataUtils.newCaptureMetadataInterceptor | public static ClientInterceptor newCaptureMetadataInterceptor(
AtomicReference<Metadata> headersCapture, AtomicReference<Metadata> trailersCapture) {
"""
Captures the last received metadata on a channel. Useful for testing.
@param headersCapture to record the last received headers
@param trailersCapture ... | java | public static ClientInterceptor newCaptureMetadataInterceptor(
AtomicReference<Metadata> headersCapture, AtomicReference<Metadata> trailersCapture) {
return new MetadataCapturingClientInterceptor(headersCapture, trailersCapture);
} | [
"public",
"static",
"ClientInterceptor",
"newCaptureMetadataInterceptor",
"(",
"AtomicReference",
"<",
"Metadata",
">",
"headersCapture",
",",
"AtomicReference",
"<",
"Metadata",
">",
"trailersCapture",
")",
"{",
"return",
"new",
"MetadataCapturingClientInterceptor",
"(",
... | Captures the last received metadata on a channel. Useful for testing.
@param headersCapture to record the last received headers
@param trailersCapture to record the last received trailers
@return an implementation of the channel with captures installed. | [
"Captures",
"the",
"last",
"received",
"metadata",
"on",
"a",
"channel",
".",
"Useful",
"for",
"testing",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/stub/src/main/java/io/grpc/stub/MetadataUtils.java#L118-L121 |
liferay/com-liferay-commerce | commerce-tax-api/src/main/java/com/liferay/commerce/tax/model/CommerceTaxMethodWrapper.java | CommerceTaxMethodWrapper.getDescription | @Override
public String getDescription(String languageId, boolean useDefault) {
"""
Returns the localized description of this commerce tax method in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefa... | java | @Override
public String getDescription(String languageId, boolean useDefault) {
return _commerceTaxMethod.getDescription(languageId, useDefault);
} | [
"@",
"Override",
"public",
"String",
"getDescription",
"(",
"String",
"languageId",
",",
"boolean",
"useDefault",
")",
"{",
"return",
"_commerceTaxMethod",
".",
"getDescription",
"(",
"languageId",
",",
"useDefault",
")",
";",
"}"
] | Returns the localized description of this commerce tax method 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 language
... | [
"Returns",
"the",
"localized",
"description",
"of",
"this",
"commerce",
"tax",
"method",
"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-tax-api/src/main/java/com/liferay/commerce/tax/model/CommerceTaxMethodWrapper.java#L263-L266 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java | GeometryUtil.translate2DCenterTo | public static void translate2DCenterTo(IAtomContainer container, Point2d p) {
"""
Translates the geometric 2DCenter of the given AtomContainer container to the specified
Point2d p.
@param container AtomContainer which should be translated.
@param p New Location of the geometric 2D Center.
@see #get2D... | java | public static void translate2DCenterTo(IAtomContainer container, Point2d p) {
Point2d com = get2DCenter(container);
Vector2d translation = new Vector2d(p.x - com.x, p.y - com.y);
for (IAtom atom : container.atoms()) {
if (atom.getPoint2d() != null) {
atom.getPoint2d()... | [
"public",
"static",
"void",
"translate2DCenterTo",
"(",
"IAtomContainer",
"container",
",",
"Point2d",
"p",
")",
"{",
"Point2d",
"com",
"=",
"get2DCenter",
"(",
"container",
")",
";",
"Vector2d",
"translation",
"=",
"new",
"Vector2d",
"(",
"p",
".",
"x",
"-"... | Translates the geometric 2DCenter of the given AtomContainer container to the specified
Point2d p.
@param container AtomContainer which should be translated.
@param p New Location of the geometric 2D Center.
@see #get2DCenter
@see #translate2DCentreOfMassTo | [
"Translates",
"the",
"geometric",
"2DCenter",
"of",
"the",
"given",
"AtomContainer",
"container",
"to",
"the",
"specified",
"Point2d",
"p",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java#L521-L529 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_voicemail_serviceName_settings_PUT | public void billingAccount_voicemail_serviceName_settings_PUT(String billingAccount, String serviceName, OvhVoicemailProperties body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/{billingAccount}/voicemail/{serviceName}/settings
@param body [required] New object properties
@param... | java | public void billingAccount_voicemail_serviceName_settings_PUT(String billingAccount, String serviceName, OvhVoicemailProperties body) throws IOException {
String qPath = "/telephony/{billingAccount}/voicemail/{serviceName}/settings";
StringBuilder sb = path(qPath, billingAccount, serviceName);
exec(qPath, "PUT", ... | [
"public",
"void",
"billingAccount_voicemail_serviceName_settings_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhVoicemailProperties",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/voicemail/{serv... | Alter this object properties
REST: PUT /telephony/{billingAccount}/voicemail/{serviceName}/settings
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L8017-L8021 |
JodaOrg/joda-time | src/main/java/org/joda/time/Period.java | Period.withMonths | public Period withMonths(int months) {
"""
Returns a new period with the specified number of months.
<p>
This period instance is immutable and unaffected by this method call.
@param months the amount of months to add, may be negative
@return the new period with the increased months
@throws UnsupportedOpera... | java | public Period withMonths(int months) {
int[] values = getValues(); // cloned
getPeriodType().setIndexedField(this, PeriodType.MONTH_INDEX, values, months);
return new Period(values, getPeriodType());
} | [
"public",
"Period",
"withMonths",
"(",
"int",
"months",
")",
"{",
"int",
"[",
"]",
"values",
"=",
"getValues",
"(",
")",
";",
"// cloned",
"getPeriodType",
"(",
")",
".",
"setIndexedField",
"(",
"this",
",",
"PeriodType",
".",
"MONTH_INDEX",
",",
"values",... | Returns a new period with the specified number of months.
<p>
This period instance is immutable and unaffected by this method call.
@param months the amount of months to add, may be negative
@return the new period with the increased months
@throws UnsupportedOperationException if the field is not supported | [
"Returns",
"a",
"new",
"period",
"with",
"the",
"specified",
"number",
"of",
"months",
".",
"<p",
">",
"This",
"period",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Period.java#L929-L933 |
dmurph/jgoogleanalyticstracker | src/main/java/com/dmurph/tracking/JGoogleAnalyticsTracker.java | JGoogleAnalyticsTracker.trackPageView | public void trackPageView(String argPageURL, String argPageTitle, String argHostName) {
"""
Tracks a page view.
@param argPageURL
required, Google won't track without it. Ex:
<code>"org/me/javaclass.java"</code>, or anything you want as
the page url.
@param argPageTitle
content title
@param argHostName
t... | java | public void trackPageView(String argPageURL, String argPageTitle, String argHostName) {
trackPageViewFromReferrer(argPageURL, argPageTitle, argHostName, "http://www.dmurph.com", "/");
} | [
"public",
"void",
"trackPageView",
"(",
"String",
"argPageURL",
",",
"String",
"argPageTitle",
",",
"String",
"argHostName",
")",
"{",
"trackPageViewFromReferrer",
"(",
"argPageURL",
",",
"argPageTitle",
",",
"argHostName",
",",
"\"http://www.dmurph.com\"",
",",
"\"/\... | Tracks a page view.
@param argPageURL
required, Google won't track without it. Ex:
<code>"org/me/javaclass.java"</code>, or anything you want as
the page url.
@param argPageTitle
content title
@param argHostName
the host name for the url | [
"Tracks",
"a",
"page",
"view",
"."
] | train | https://github.com/dmurph/jgoogleanalyticstracker/blob/69f68caf8e09a53e6f6076477bf05b84bc80e386/src/main/java/com/dmurph/tracking/JGoogleAnalyticsTracker.java#L296-L298 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/RecurrenceUtility.java | RecurrenceUtility.getDurationValue | public static Integer getDurationValue(ProjectProperties properties, Duration duration) {
"""
Convert an MPXJ Duration instance into an integer duration in minutes
ready to be written to an MPX file.
@param properties project properties, used for duration units conversion
@param duration Duration instance
@r... | java | public static Integer getDurationValue(ProjectProperties properties, Duration duration)
{
Integer result;
if (duration == null)
{
result = null;
}
else
{
if (duration.getUnits() != TimeUnit.MINUTES)
{
duration = duration.convertUnits(TimeUnit... | [
"public",
"static",
"Integer",
"getDurationValue",
"(",
"ProjectProperties",
"properties",
",",
"Duration",
"duration",
")",
"{",
"Integer",
"result",
";",
"if",
"(",
"duration",
"==",
"null",
")",
"{",
"result",
"=",
"null",
";",
"}",
"else",
"{",
"if",
"... | Convert an MPXJ Duration instance into an integer duration in minutes
ready to be written to an MPX file.
@param properties project properties, used for duration units conversion
@param duration Duration instance
@return integer duration in minutes | [
"Convert",
"an",
"MPXJ",
"Duration",
"instance",
"into",
"an",
"integer",
"duration",
"in",
"minutes",
"ready",
"to",
"be",
"written",
"to",
"an",
"MPX",
"file",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/RecurrenceUtility.java#L90-L106 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/Configurer.java | Configurer.getBooleanDefault | public final boolean getBooleanDefault(boolean defaultValue, String attribute, String... path) {
"""
Get a boolean in the xml tree.
@param defaultValue Value used if node does not exist.
@param attribute The attribute to get as boolean.
@param path The node path (child list)
@return The boolean value.
@thro... | java | public final boolean getBooleanDefault(boolean defaultValue, String attribute, String... path)
{
return Boolean.parseBoolean(getNodeStringDefault(String.valueOf(defaultValue), attribute, path));
} | [
"public",
"final",
"boolean",
"getBooleanDefault",
"(",
"boolean",
"defaultValue",
",",
"String",
"attribute",
",",
"String",
"...",
"path",
")",
"{",
"return",
"Boolean",
".",
"parseBoolean",
"(",
"getNodeStringDefault",
"(",
"String",
".",
"valueOf",
"(",
"def... | Get a boolean in the xml tree.
@param defaultValue Value used if node does not exist.
@param attribute The attribute to get as boolean.
@param path The node path (child list)
@return The boolean value.
@throws LionEngineException If unable to read node. | [
"Get",
"a",
"boolean",
"in",
"the",
"xml",
"tree",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/Configurer.java#L199-L202 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionsImpl.java | PredictionsImpl.predictImage | public ImagePrediction predictImage(UUID projectId, byte[] imageData, PredictImageOptionalParameter predictImageOptionalParameter) {
"""
Predict an image and saves the result.
@param projectId The project id
@param imageData the InputStream value
@param predictImageOptionalParameter the object representing th... | java | public ImagePrediction predictImage(UUID projectId, byte[] imageData, PredictImageOptionalParameter predictImageOptionalParameter) {
return predictImageWithServiceResponseAsync(projectId, imageData, predictImageOptionalParameter).toBlocking().single().body();
} | [
"public",
"ImagePrediction",
"predictImage",
"(",
"UUID",
"projectId",
",",
"byte",
"[",
"]",
"imageData",
",",
"PredictImageOptionalParameter",
"predictImageOptionalParameter",
")",
"{",
"return",
"predictImageWithServiceResponseAsync",
"(",
"projectId",
",",
"imageData",
... | Predict an image and saves the result.
@param projectId The project id
@param imageData the InputStream value
@param predictImageOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudExc... | [
"Predict",
"an",
"image",
"and",
"saves",
"the",
"result",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/prediction/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/prediction/implementation/PredictionsImpl.java#L447-L449 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/chrono/InternationalFixedDate.java | InternationalFixedDate.resolvePreviousValid | private static InternationalFixedDate resolvePreviousValid(int prolepticYear, int month, int day) {
"""
Consistency check for dates manipulations after calls to
{@link #plus(long, TemporalUnit)},
{@link #minus(long, TemporalUnit)},
{@link #until(AbstractDate, TemporalUnit)} or
{@link #with(TemporalField, long)... | java | private static InternationalFixedDate resolvePreviousValid(int prolepticYear, int month, int day) {
int monthR = Math.min(month, MONTHS_IN_YEAR);
int dayR = Math.min(day,
(monthR == 13 || (monthR == 6 && INSTANCE.isLeapYear(prolepticYear)) ? DAYS_IN_LONG_MONTH : DAYS_IN_MONTH));
ret... | [
"private",
"static",
"InternationalFixedDate",
"resolvePreviousValid",
"(",
"int",
"prolepticYear",
",",
"int",
"month",
",",
"int",
"day",
")",
"{",
"int",
"monthR",
"=",
"Math",
".",
"min",
"(",
"month",
",",
"MONTHS_IN_YEAR",
")",
";",
"int",
"dayR",
"=",... | Consistency check for dates manipulations after calls to
{@link #plus(long, TemporalUnit)},
{@link #minus(long, TemporalUnit)},
{@link #until(AbstractDate, TemporalUnit)} or
{@link #with(TemporalField, long)}.
@param prolepticYear the International fixed proleptic-year
@param month the International fixed month, fro... | [
"Consistency",
"check",
"for",
"dates",
"manipulations",
"after",
"calls",
"to",
"{",
"@link",
"#plus",
"(",
"long",
"TemporalUnit",
")",
"}",
"{",
"@link",
"#minus",
"(",
"long",
"TemporalUnit",
")",
"}",
"{",
"@link",
"#until",
"(",
"AbstractDate",
"Tempor... | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/chrono/InternationalFixedDate.java#L317-L323 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/util/ImageCache.java | ImageCache.getImage | public Image getImage(GraphicsConfiguration config, int w, int h, Object... args) {
"""
Get the cached image for given keys
@param config The graphics configuration, needed if cached image is a
Volatile Image. Used as part of cache key
@param w The image width, used as part of cache key
@param h ... | java | public Image getImage(GraphicsConfiguration config, int w, int h, Object... args) {
lock.readLock().lock();
try {
PixelCountSoftReference ref = map.get(hash(config, w, h, args));
// check reference has not been lost and the key truly matches, in
// case of false pos... | [
"public",
"Image",
"getImage",
"(",
"GraphicsConfiguration",
"config",
",",
"int",
"w",
",",
"int",
"h",
",",
"Object",
"...",
"args",
")",
"{",
"lock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"PixelCountSoftReference",
"ref",
... | Get the cached image for given keys
@param config The graphics configuration, needed if cached image is a
Volatile Image. Used as part of cache key
@param w The image width, used as part of cache key
@param h The image height, used as part of cache key
@param args Other arguments to use as part of the ... | [
"Get",
"the",
"cached",
"image",
"for",
"given",
"keys"
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/util/ImageCache.java#L133-L149 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.