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 |
|---|---|---|---|---|---|---|---|---|---|---|
jcuda/jcusparse | JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java | JCusparse.cusparseSgthrz | public static int cusparseSgthrz(
cusparseHandle handle,
int nnz,
Pointer y,
Pointer xVal,
Pointer xInd,
int idxBase) {
"""
Description: Gather of non-zero elements from desne vector y into
sparse vector x (also replacing these elements in y by zeros).
... | java | public static int cusparseSgthrz(
cusparseHandle handle,
int nnz,
Pointer y,
Pointer xVal,
Pointer xInd,
int idxBase)
{
return checkResult(cusparseSgthrzNative(handle, nnz, y, xVal, xInd, idxBase));
} | [
"public",
"static",
"int",
"cusparseSgthrz",
"(",
"cusparseHandle",
"handle",
",",
"int",
"nnz",
",",
"Pointer",
"y",
",",
"Pointer",
"xVal",
",",
"Pointer",
"xInd",
",",
"int",
"idxBase",
")",
"{",
"return",
"checkResult",
"(",
"cusparseSgthrzNative",
"(",
... | Description: Gather of non-zero elements from desne vector y into
sparse vector x (also replacing these elements in y by zeros). | [
"Description",
":",
"Gather",
"of",
"non",
"-",
"zero",
"elements",
"from",
"desne",
"vector",
"y",
"into",
"sparse",
"vector",
"x",
"(",
"also",
"replacing",
"these",
"elements",
"in",
"y",
"by",
"zeros",
")",
"."
] | train | https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L934-L943 |
strator-dev/greenpepper | greenpepper/core/src/main/java/com/greenpepper/interpreter/flow/dowith/EndRow.java | EndRow.interpret | @Override
public void interpret(Specification table) {
"""
{@inheritDoc}
Cases of failures :
<ul>
<li>this row is not the last row of the Specification table</li>
<li>there is more than one cell in this row</li>
</ul>
"""
Example row = table.nextExample();
Statistics statistics = new... | java | @Override
public void interpret(Specification table)
{
Example row = table.nextExample();
Statistics statistics = new Statistics(0, 0, 0, 0);
if (table.hasMoreExamples()) {
SyntaxException e = new SyntaxException("end", "This keyword should end the table");
statis... | [
"@",
"Override",
"public",
"void",
"interpret",
"(",
"Specification",
"table",
")",
"{",
"Example",
"row",
"=",
"table",
".",
"nextExample",
"(",
")",
";",
"Statistics",
"statistics",
"=",
"new",
"Statistics",
"(",
"0",
",",
"0",
",",
"0",
",",
"0",
")... | {@inheritDoc}
Cases of failures :
<ul>
<li>this row is not the last row of the Specification table</li>
<li>there is more than one cell in this row</li>
</ul> | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/core/src/main/java/com/greenpepper/interpreter/flow/dowith/EndRow.java#L41-L57 |
m-m-m/util | reflect/src/main/java/net/sf/mmm/util/reflect/api/ClassName.java | ClassName.appendEnclosing | private void appendEnclosing(StringBuilder buffer, char enclosingSeparator, ClassName enclosing) {
"""
{@link StringBuilder#append(String) Appends} the {@link #getEnclosingClass() enclosing class} in proper order
(reverse hierarchy).
@param buffer the {@link StringBuilder} to {@link StringBuilder#append(String... | java | private void appendEnclosing(StringBuilder buffer, char enclosingSeparator, ClassName enclosing) {
if (enclosing.enclosingClass != null) {
appendEnclosing(buffer, enclosingSeparator, enclosing.enclosingClass);
}
buffer.append(enclosing.simpleName);
buffer.append(enclosingSeparator);
} | [
"private",
"void",
"appendEnclosing",
"(",
"StringBuilder",
"buffer",
",",
"char",
"enclosingSeparator",
",",
"ClassName",
"enclosing",
")",
"{",
"if",
"(",
"enclosing",
".",
"enclosingClass",
"!=",
"null",
")",
"{",
"appendEnclosing",
"(",
"buffer",
",",
"enclo... | {@link StringBuilder#append(String) Appends} the {@link #getEnclosingClass() enclosing class} in proper order
(reverse hierarchy).
@param buffer the {@link StringBuilder} to {@link StringBuilder#append(String) append} to.
@param enclosingSeparator the separator for enclosing types ('.' or '$').
@param enclosing the {@... | [
"{",
"@link",
"StringBuilder#append",
"(",
"String",
")",
"Appends",
"}",
"the",
"{",
"@link",
"#getEnclosingClass",
"()",
"enclosing",
"class",
"}",
"in",
"proper",
"order",
"(",
"reverse",
"hierarchy",
")",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/reflect/src/main/java/net/sf/mmm/util/reflect/api/ClassName.java#L135-L142 |
perwendel/spark | src/main/java/spark/route/Routes.java | Routes.findMultiple | public List<RouteMatch> findMultiple(HttpMethod httpMethod, String path, String acceptType) {
"""
Finds multiple targets for a requested route.
@param httpMethod the http method
@param path the route path
@param acceptType the accept type
@return the targets
"""
List<RouteMatch> matchSet = ... | java | public List<RouteMatch> findMultiple(HttpMethod httpMethod, String path, String acceptType) {
List<RouteMatch> matchSet = new ArrayList<>();
List<RouteEntry> routeEntries = findTargetsForRequestedRoute(httpMethod, path);
for (RouteEntry routeEntry : routeEntries) {
if (acceptType !=... | [
"public",
"List",
"<",
"RouteMatch",
">",
"findMultiple",
"(",
"HttpMethod",
"httpMethod",
",",
"String",
"path",
",",
"String",
"acceptType",
")",
"{",
"List",
"<",
"RouteMatch",
">",
"matchSet",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"List",
"<",
... | Finds multiple targets for a requested route.
@param httpMethod the http method
@param path the route path
@param acceptType the accept type
@return the targets | [
"Finds",
"multiple",
"targets",
"for",
"a",
"requested",
"route",
"."
] | train | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/route/Routes.java#L97-L114 |
alkacon/opencms-core | src/org/opencms/i18n/CmsListResourceBundle.java | CmsListResourceBundle.addMessage | public void addMessage(String key, String value) {
"""
Adds a message to this list bundle.<p>
Please note:
All additions after the initial call to {@link #getContents()} are ignored.<p>
@param key the message key
@param value the message itself
"""
if (m_bundleMap != null) {
m_bund... | java | public void addMessage(String key, String value) {
if (m_bundleMap != null) {
m_bundleMap.put(key, value);
}
} | [
"public",
"void",
"addMessage",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"m_bundleMap",
"!=",
"null",
")",
"{",
"m_bundleMap",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}",
"}"
] | Adds a message to this list bundle.<p>
Please note:
All additions after the initial call to {@link #getContents()} are ignored.<p>
@param key the message key
@param value the message itself | [
"Adds",
"a",
"message",
"to",
"this",
"list",
"bundle",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/i18n/CmsListResourceBundle.java#L57-L62 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/ZonedDateTime.java | ZonedDateTime.withEarlierOffsetAtOverlap | @Override
public ZonedDateTime withEarlierOffsetAtOverlap() {
"""
Returns a copy of this date-time changing the zone offset to the
earlier of the two valid offsets at a local time-line overlap.
<p>
This method only has any effect when the local time-line overlaps, such as
at an autumn daylight savings cuto... | java | @Override
public ZonedDateTime withEarlierOffsetAtOverlap() {
ZoneOffsetTransition trans = getZone().getRules().getTransition(dateTime);
if (trans != null && trans.isOverlap()) {
ZoneOffset earlierOffset = trans.getOffsetBefore();
if (earlierOffset.equals(offset) == false) {
... | [
"@",
"Override",
"public",
"ZonedDateTime",
"withEarlierOffsetAtOverlap",
"(",
")",
"{",
"ZoneOffsetTransition",
"trans",
"=",
"getZone",
"(",
")",
".",
"getRules",
"(",
")",
".",
"getTransition",
"(",
"dateTime",
")",
";",
"if",
"(",
"trans",
"!=",
"null",
... | Returns a copy of this date-time changing the zone offset to the
earlier of the two valid offsets at a local time-line overlap.
<p>
This method only has any effect when the local time-line overlaps, such as
at an autumn daylight savings cutover. In this scenario, there are two
valid offsets for the local date-time. Cal... | [
"Returns",
"a",
"copy",
"of",
"this",
"date",
"-",
"time",
"changing",
"the",
"zone",
"offset",
"to",
"the",
"earlier",
"of",
"the",
"two",
"valid",
"offsets",
"at",
"a",
"local",
"time",
"-",
"line",
"overlap",
".",
"<p",
">",
"This",
"method",
"only"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/ZonedDateTime.java#L883-L893 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/compiler/TypeConvertingCompiler.java | TypeConvertingCompiler.isToBeCastedAnyType | private boolean isToBeCastedAnyType(LightweightTypeReference actualType, XExpression obj, ITreeAppendable appendable) {
"""
On Java-level the any-type is represented as java.lang.Object as there is no subtype of everything (i.e. type for null).
So, when the values are used we need to manually cast them to whateve... | java | private boolean isToBeCastedAnyType(LightweightTypeReference actualType, XExpression obj, ITreeAppendable appendable) {
if (actualType instanceof AnyTypeReference) {
if (getReferenceName(obj, appendable) != null)
return true;
else if (obj instanceof XBlockExpression) {
XBlockExpression blockExpression =... | [
"private",
"boolean",
"isToBeCastedAnyType",
"(",
"LightweightTypeReference",
"actualType",
",",
"XExpression",
"obj",
",",
"ITreeAppendable",
"appendable",
")",
"{",
"if",
"(",
"actualType",
"instanceof",
"AnyTypeReference",
")",
"{",
"if",
"(",
"getReferenceName",
"... | On Java-level the any-type is represented as java.lang.Object as there is no subtype of everything (i.e. type for null).
So, when the values are used we need to manually cast them to whatever is expected.
This method tells us whether such a cast is needed. | [
"On",
"Java",
"-",
"level",
"the",
"any",
"-",
"type",
"is",
"represented",
"as",
"java",
".",
"lang",
".",
"Object",
"as",
"there",
"is",
"no",
"subtype",
"of",
"everything",
"(",
"i",
".",
"e",
".",
"type",
"for",
"null",
")",
".",
"So",
"when",
... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/compiler/TypeConvertingCompiler.java#L115-L131 |
voldemort/voldemort | src/java/voldemort/utils/ByteUtils.java | ByteUtils.writeUnsignedShort | public static void writeUnsignedShort(byte[] bytes, int value, int offset) {
"""
Write an unsigned short to the byte array starting at the given offset
@param bytes The byte array
@param value The short to write
@param offset The offset to begin writing at
"""
bytes[offset] = (byte) (0xFF & (value... | java | public static void writeUnsignedShort(byte[] bytes, int value, int offset) {
bytes[offset] = (byte) (0xFF & (value >> 8));
bytes[offset + 1] = (byte) (0xFF & value);
} | [
"public",
"static",
"void",
"writeUnsignedShort",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"value",
",",
"int",
"offset",
")",
"{",
"bytes",
"[",
"offset",
"]",
"=",
"(",
"byte",
")",
"(",
"0xFF",
"&",
"(",
"value",
">>",
"8",
")",
")",
";",
"... | Write an unsigned short to the byte array starting at the given offset
@param bytes The byte array
@param value The short to write
@param offset The offset to begin writing at | [
"Write",
"an",
"unsigned",
"short",
"to",
"the",
"byte",
"array",
"starting",
"at",
"the",
"given",
"offset"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/ByteUtils.java#L250-L253 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/domain/builders/GroupBuilder.java | GroupBuilder.addVariable | public GroupBuilder addVariable(String name, String property, String className, DJCalculation operation) {
"""
Registers a variable for later reference inside custom expressions.
The new variable will perform the calculation using the field information passed in the ColumnProperty
parameter. Such ColumnProperty ... | java | public GroupBuilder addVariable(String name, String property, String className, DJCalculation operation) {
group.getVariables().add(new DJGroupVariableDef(name, new ColumnProperty(property,className), operation));
return this;
} | [
"public",
"GroupBuilder",
"addVariable",
"(",
"String",
"name",
",",
"String",
"property",
",",
"String",
"className",
",",
"DJCalculation",
"operation",
")",
"{",
"group",
".",
"getVariables",
"(",
")",
".",
"add",
"(",
"new",
"DJGroupVariableDef",
"(",
"name... | Registers a variable for later reference inside custom expressions.
The new variable will perform the calculation using the field information passed in the ColumnProperty
parameter. Such ColumnProperty will be properly registered in the report design as a field ($F{...})
@param name
@param property
@param className
@... | [
"Registers",
"a",
"variable",
"for",
"later",
"reference",
"inside",
"custom",
"expressions",
".",
"The",
"new",
"variable",
"will",
"perform",
"the",
"calculation",
"using",
"the",
"field",
"information",
"passed",
"in",
"the",
"ColumnProperty",
"parameter",
".",... | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/domain/builders/GroupBuilder.java#L177-L180 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.topp | public static <T> List<T> topp(final T[] a, final int n, final Comparator<? super T> cmp) {
"""
The present order is kept in the result list.
@param a
@param n
@param cmp
@return
"""
return topp(a, 0, len(a), n, cmp);
} | java | public static <T> List<T> topp(final T[] a, final int n, final Comparator<? super T> cmp) {
return topp(a, 0, len(a), n, cmp);
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"topp",
"(",
"final",
"T",
"[",
"]",
"a",
",",
"final",
"int",
"n",
",",
"final",
"Comparator",
"<",
"?",
"super",
"T",
">",
"cmp",
")",
"{",
"return",
"topp",
"(",
"a",
",",
"0",
",",... | The present order is kept in the result list.
@param a
@param n
@param cmp
@return | [
"The",
"present",
"order",
"is",
"kept",
"in",
"the",
"result",
"list",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L17478-L17480 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/json/ObjectToJsonConverter.java | ObjectToJsonConverter.extractObject | public Object extractObject(Object pValue, Stack<String> pPathParts, boolean pJsonify)
throws AttributeNotFoundException {
"""
Related to {@link #extractObjectWithContext} except that
it does not setup a context. This method is called back from the
various extractors to recursively continue the extra... | java | public Object extractObject(Object pValue, Stack<String> pPathParts, boolean pJsonify)
throws AttributeNotFoundException {
ObjectSerializationContext stackContext = stackContextLocal.get();
String limitReached = checkForLimits(pValue, stackContext);
Stack<String> pathStack = pPathPar... | [
"public",
"Object",
"extractObject",
"(",
"Object",
"pValue",
",",
"Stack",
"<",
"String",
">",
"pPathParts",
",",
"boolean",
"pJsonify",
")",
"throws",
"AttributeNotFoundException",
"{",
"ObjectSerializationContext",
"stackContext",
"=",
"stackContextLocal",
".",
"ge... | Related to {@link #extractObjectWithContext} except that
it does not setup a context. This method is called back from the
various extractors to recursively continue the extraction, hence it is public.
This method must not be used as entry point for serialization.
Use {@link #convertToJson(Object, List, JsonConvertOpti... | [
"Related",
"to",
"{",
"@link",
"#extractObjectWithContext",
"}",
"except",
"that",
"it",
"does",
"not",
"setup",
"a",
"context",
".",
"This",
"method",
"is",
"called",
"back",
"from",
"the",
"various",
"extractors",
"to",
"recursively",
"continue",
"the",
"ext... | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/ObjectToJsonConverter.java#L159-L185 |
apache/spark | common/network-common/src/main/java/org/apache/spark/network/util/CryptoUtils.java | CryptoUtils.toCryptoConf | public static Properties toCryptoConf(String prefix, Iterable<Map.Entry<String, String>> conf) {
"""
Extract the commons-crypto configuration embedded in a list of config values.
@param prefix Prefix in the given configuration that identifies the commons-crypto configs.
@param conf List of configuration values... | java | public static Properties toCryptoConf(String prefix, Iterable<Map.Entry<String, String>> conf) {
Properties props = new Properties();
for (Map.Entry<String, String> e : conf) {
String key = e.getKey();
if (key.startsWith(prefix)) {
props.setProperty(COMMONS_CRYPTO_CONFIG_PREFIX + key.substri... | [
"public",
"static",
"Properties",
"toCryptoConf",
"(",
"String",
"prefix",
",",
"Iterable",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
">",
"conf",
")",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"for",
"(",
... | Extract the commons-crypto configuration embedded in a list of config values.
@param prefix Prefix in the given configuration that identifies the commons-crypto configs.
@param conf List of configuration values. | [
"Extract",
"the",
"commons",
"-",
"crypto",
"configuration",
"embedded",
"in",
"a",
"list",
"of",
"config",
"values",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/util/CryptoUtils.java#L37-L47 |
camunda/camunda-xml-model | src/main/java/org/camunda/bpm/model/xml/impl/type/reference/ReferenceImpl.java | ReferenceImpl.referencedElementUpdated | public void referencedElementUpdated(ModelElementInstance referenceTargetElement, String oldIdentifier, String newIdentifier) {
"""
Update the reference identifier
@param referenceTargetElement the reference target model element instance
@param oldIdentifier the old reference identifier
@param newIdentifier t... | java | public void referencedElementUpdated(ModelElementInstance referenceTargetElement, String oldIdentifier, String newIdentifier) {
for (ModelElementInstance referenceSourceElement : findReferenceSourceElements(referenceTargetElement)) {
updateReference(referenceSourceElement, oldIdentifier, newIdentifier);
}... | [
"public",
"void",
"referencedElementUpdated",
"(",
"ModelElementInstance",
"referenceTargetElement",
",",
"String",
"oldIdentifier",
",",
"String",
"newIdentifier",
")",
"{",
"for",
"(",
"ModelElementInstance",
"referenceSourceElement",
":",
"findReferenceSourceElements",
"("... | Update the reference identifier
@param referenceTargetElement the reference target model element instance
@param oldIdentifier the old reference identifier
@param newIdentifier the new reference identifier | [
"Update",
"the",
"reference",
"identifier"
] | train | https://github.com/camunda/camunda-xml-model/blob/85b3f879e26d063f71c94cfd21ac17d9ff6baf4d/src/main/java/org/camunda/bpm/model/xml/impl/type/reference/ReferenceImpl.java#L148-L152 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java | TheMovieDbApi.addToWatchList | public StatusCode addToWatchList(String sessionId, int accountId, MediaType mediaType, Integer mediaId) throws MovieDbException {
"""
Add a movie to an accounts watch list.
@param sessionId sessionId
@param accountId accountId
@param mediaId mediaId
@param mediaType mediaType
@return StatusCode
@throws Mov... | java | public StatusCode addToWatchList(String sessionId, int accountId, MediaType mediaType, Integer mediaId) throws MovieDbException {
return tmdbAccount.modifyWatchList(sessionId, accountId, mediaType, mediaId, true);
} | [
"public",
"StatusCode",
"addToWatchList",
"(",
"String",
"sessionId",
",",
"int",
"accountId",
",",
"MediaType",
"mediaType",
",",
"Integer",
"mediaId",
")",
"throws",
"MovieDbException",
"{",
"return",
"tmdbAccount",
".",
"modifyWatchList",
"(",
"sessionId",
",",
... | Add a movie to an accounts watch list.
@param sessionId sessionId
@param accountId accountId
@param mediaId mediaId
@param mediaType mediaType
@return StatusCode
@throws MovieDbException exception | [
"Add",
"a",
"movie",
"to",
"an",
"accounts",
"watch",
"list",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java#L308-L310 |
pedrovgs/Renderers | renderers/src/main/java/com/pedrogomez/renderers/Renderer.java | Renderer.onCreate | public void onCreate(T content, LayoutInflater layoutInflater, ViewGroup parent) {
"""
Method called when the renderer is going to be created. This method has the responsibility of
inflate the xml layout using the layoutInflater and the parent ViewGroup, set itself to the
tag and call setUpView and hookListeners... | java | public void onCreate(T content, LayoutInflater layoutInflater, ViewGroup parent) {
this.content = content;
this.rootView = inflate(layoutInflater, parent);
if (rootView == null) {
throw new NotInflateViewException(
"Renderer instances have to return a not null view in inflateView method");
... | [
"public",
"void",
"onCreate",
"(",
"T",
"content",
",",
"LayoutInflater",
"layoutInflater",
",",
"ViewGroup",
"parent",
")",
"{",
"this",
".",
"content",
"=",
"content",
";",
"this",
".",
"rootView",
"=",
"inflate",
"(",
"layoutInflater",
",",
"parent",
")",... | Method called when the renderer is going to be created. This method has the responsibility of
inflate the xml layout using the layoutInflater and the parent ViewGroup, set itself to the
tag and call setUpView and hookListeners methods.
@param content to render. If you are using Renderers with RecyclerView widget the c... | [
"Method",
"called",
"when",
"the",
"renderer",
"is",
"going",
"to",
"be",
"created",
".",
"This",
"method",
"has",
"the",
"responsibility",
"of",
"inflate",
"the",
"xml",
"layout",
"using",
"the",
"layoutInflater",
"and",
"the",
"parent",
"ViewGroup",
"set",
... | train | https://github.com/pedrovgs/Renderers/blob/7477fb6e3984468b32b59c8520b66afb765081ea/renderers/src/main/java/com/pedrogomez/renderers/Renderer.java#L54-L64 |
OpenBEL/openbel-framework | org.openbel.framework.tools/src/main/java/org/openbel/framework/tools/PhaseOneApplication.java | PhaseOneApplication.stage7 | private boolean stage7(final ProtoNetwork pn, final Document doc) {
"""
Stage seven saving of proto-network.
@param pn Proto-network
@param doc {@link Document}, the document
@return boolean true if success, false otherwise
"""
beginStage(PHASE1_STAGE7_HDR, "7", NUM_PHASES);
final StringBu... | java | private boolean stage7(final ProtoNetwork pn, final Document doc) {
beginStage(PHASE1_STAGE7_HDR, "7", NUM_PHASES);
final StringBuilder bldr = new StringBuilder();
bldr.append("Saving proto-network for ");
bldr.append(doc.getName());
stageOutput(bldr.toString());
long t... | [
"private",
"boolean",
"stage7",
"(",
"final",
"ProtoNetwork",
"pn",
",",
"final",
"Document",
"doc",
")",
"{",
"beginStage",
"(",
"PHASE1_STAGE7_HDR",
",",
"\"7\"",
",",
"NUM_PHASES",
")",
";",
"final",
"StringBuilder",
"bldr",
"=",
"new",
"StringBuilder",
"("... | Stage seven saving of proto-network.
@param pn Proto-network
@param doc {@link Document}, the document
@return boolean true if success, false otherwise | [
"Stage",
"seven",
"saving",
"of",
"proto",
"-",
"network",
"."
] | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.tools/src/main/java/org/openbel/framework/tools/PhaseOneApplication.java#L600-L636 |
YahooArchive/samoa | samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/ensemble/BoostingPredictionCombinerProcessor.java | BoostingPredictionCombinerProcessor.process | @Override
public boolean process(ContentEvent event) {
"""
On event.
@param event the event
@return true, if successful
"""
ResultContentEvent inEvent = (ResultContentEvent) event;
double[] prediction = inEvent.getClassVotes();
int instanceIndex = (int) inEvent.getInstanceIndex... | java | @Override
public boolean process(ContentEvent event) {
ResultContentEvent inEvent = (ResultContentEvent) event;
double[] prediction = inEvent.getClassVotes();
int instanceIndex = (int) inEvent.getInstanceIndex();
addStatisticsForInstanceReceived(instanceIndex, inEvent.getCl... | [
"@",
"Override",
"public",
"boolean",
"process",
"(",
"ContentEvent",
"event",
")",
"{",
"ResultContentEvent",
"inEvent",
"=",
"(",
"ResultContentEvent",
")",
"event",
";",
"double",
"[",
"]",
"prediction",
"=",
"inEvent",
".",
"getClassVotes",
"(",
")",
";",
... | On event.
@param event the event
@return true, if successful | [
"On",
"event",
"."
] | train | https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/ensemble/BoostingPredictionCombinerProcessor.java#L57-L85 |
ixa-ehu/kaflib | src/main/java/ixa/kaflib/KAFDocument.java | KAFDocument.newProperty | public Feature newProperty(String lemma, List<Span<Term>> references) {
"""
Creates a new property. It assigns an appropriate ID to it. The property is added to the document.
@param lemma the lemma of the property.
@param references different mentions (list of targets) to the same property.
@return a new corefe... | java | public Feature newProperty(String lemma, List<Span<Term>> references) {
String newId = idManager.getNextId(AnnotationType.PROPERTY);
Feature newProperty = new Feature(newId, lemma, references);
annotationContainer.add(newProperty, Layer.PROPERTIES, AnnotationType.PROPERTY);
return newProperty;
} | [
"public",
"Feature",
"newProperty",
"(",
"String",
"lemma",
",",
"List",
"<",
"Span",
"<",
"Term",
">",
">",
"references",
")",
"{",
"String",
"newId",
"=",
"idManager",
".",
"getNextId",
"(",
"AnnotationType",
".",
"PROPERTY",
")",
";",
"Feature",
"newPro... | Creates a new property. It assigns an appropriate ID to it. The property is added to the document.
@param lemma the lemma of the property.
@param references different mentions (list of targets) to the same property.
@return a new coreference. | [
"Creates",
"a",
"new",
"property",
".",
"It",
"assigns",
"an",
"appropriate",
"ID",
"to",
"it",
".",
"The",
"property",
"is",
"added",
"to",
"the",
"document",
"."
] | train | https://github.com/ixa-ehu/kaflib/blob/3921f55d9ae4621736a329418f6334fb721834b8/src/main/java/ixa/kaflib/KAFDocument.java#L914-L919 |
google/error-prone-javac | src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java | JShellTool.hardmsg | @Override
public void hardmsg(String key, Object... args) {
"""
Print using resource bundle look-up, MessageFormat, and add prefix and
postfix
@param key the resource key
@param args
"""
hard(messageFormat(key, args));
} | java | @Override
public void hardmsg(String key, Object... args) {
hard(messageFormat(key, args));
} | [
"@",
"Override",
"public",
"void",
"hardmsg",
"(",
"String",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"hard",
"(",
"messageFormat",
"(",
"key",
",",
"args",
")",
")",
";",
"}"
] | Print using resource bundle look-up, MessageFormat, and add prefix and
postfix
@param key the resource key
@param args | [
"Print",
"using",
"resource",
"bundle",
"look",
"-",
"up",
"MessageFormat",
"and",
"add",
"prefix",
"and",
"postfix"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java#L799-L802 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java | SimpleDocTreeVisitor.visitOther | @Override
public R visitOther(DocTree node, P p) {
"""
{@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction}
"""
return defaultAction(node, p);
} | java | @Override
public R visitOther(DocTree node, P p) {
return defaultAction(node, p);
} | [
"@",
"Override",
"public",
"R",
"visitOther",
"(",
"DocTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"defaultAction",
"(",
"node",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction} | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"calls",
"{",
"@code",
"defaultAction",
"}",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java#L489-L492 |
VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/VForDefinition.java | VForDefinition.initIndexVariable | private void initIndexVariable(String name, TemplateParserContext context) {
"""
Init the index variable and add it to the parser context
@param name Name of the variable
@param context Context of the template parser
"""
this.indexVariableInfo = context.addLocalVariable("int", name.trim());
} | java | private void initIndexVariable(String name, TemplateParserContext context) {
this.indexVariableInfo = context.addLocalVariable("int", name.trim());
} | [
"private",
"void",
"initIndexVariable",
"(",
"String",
"name",
",",
"TemplateParserContext",
"context",
")",
"{",
"this",
".",
"indexVariableInfo",
"=",
"context",
".",
"addLocalVariable",
"(",
"\"int\"",
",",
"name",
".",
"trim",
"(",
")",
")",
";",
"}"
] | Init the index variable and add it to the parser context
@param name Name of the variable
@param context Context of the template parser | [
"Init",
"the",
"index",
"variable",
"and",
"add",
"it",
"to",
"the",
"parser",
"context"
] | train | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/template/parser/VForDefinition.java#L169-L171 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsClient.java | MetricsClient.updateLogMetric | public final LogMetric updateLogMetric(MetricName metricName, LogMetric metric) {
"""
Creates or updates a logs-based metric.
<p>Sample code:
<pre><code>
try (MetricsClient metricsClient = MetricsClient.create()) {
MetricName metricName = ProjectMetricName.of("[PROJECT]", "[METRIC]");
LogMetric metric = L... | java | public final LogMetric updateLogMetric(MetricName metricName, LogMetric metric) {
UpdateLogMetricRequest request =
UpdateLogMetricRequest.newBuilder()
.setMetricName(metricName == null ? null : metricName.toString())
.setMetric(metric)
.build();
return updateLogMetri... | [
"public",
"final",
"LogMetric",
"updateLogMetric",
"(",
"MetricName",
"metricName",
",",
"LogMetric",
"metric",
")",
"{",
"UpdateLogMetricRequest",
"request",
"=",
"UpdateLogMetricRequest",
".",
"newBuilder",
"(",
")",
".",
"setMetricName",
"(",
"metricName",
"==",
... | Creates or updates a logs-based metric.
<p>Sample code:
<pre><code>
try (MetricsClient metricsClient = MetricsClient.create()) {
MetricName metricName = ProjectMetricName.of("[PROJECT]", "[METRIC]");
LogMetric metric = LogMetric.newBuilder().build();
LogMetric response = metricsClient.updateLogMetric(metricName, metr... | [
"Creates",
"or",
"updates",
"a",
"logs",
"-",
"based",
"metric",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsClient.java#L520-L528 |
lucee/Lucee | core/src/main/java/lucee/runtime/reflection/Reflector.java | Reflector.callSetterEL | public static void callSetterEL(Object obj, String prop, Object value) throws PageException {
"""
do nothing when not exist
@param obj
@param prop
@param value
@throws PageException
"""
try {
MethodInstance setter = getSetter(obj, prop, value, null);
if (setter != null) setter.invoke(obj);
}
... | java | public static void callSetterEL(Object obj, String prop, Object value) throws PageException {
try {
MethodInstance setter = getSetter(obj, prop, value, null);
if (setter != null) setter.invoke(obj);
}
catch (InvocationTargetException e) {
Throwable target = e.getTargetException();
if (target inst... | [
"public",
"static",
"void",
"callSetterEL",
"(",
"Object",
"obj",
",",
"String",
"prop",
",",
"Object",
"value",
")",
"throws",
"PageException",
"{",
"try",
"{",
"MethodInstance",
"setter",
"=",
"getSetter",
"(",
"obj",
",",
"prop",
",",
"value",
",",
"nul... | do nothing when not exist
@param obj
@param prop
@param value
@throws PageException | [
"do",
"nothing",
"when",
"not",
"exist"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/reflection/Reflector.java#L1096-L1109 |
jnidzwetzki/bitfinex-v2-wss-api-java | src/main/java/com/github/jnidzwetzki/bitfinex/v2/symbol/BitfinexSymbols.java | BitfinexSymbols.candlesticks | public static BitfinexCandlestickSymbol candlesticks(final BitfinexCurrencyPair currencyPair,
final BitfinexCandleTimeFrame timeframe) {
"""
Returns symbol for candlestick channel
@param currencyPair of candles
@param timeframe configuration of candles
@return symbol
"""
return new... | java | public static BitfinexCandlestickSymbol candlesticks(final BitfinexCurrencyPair currencyPair,
final BitfinexCandleTimeFrame timeframe) {
return new BitfinexCandlestickSymbol(currencyPair, Objects.requireNonNull(timeframe));
} | [
"public",
"static",
"BitfinexCandlestickSymbol",
"candlesticks",
"(",
"final",
"BitfinexCurrencyPair",
"currencyPair",
",",
"final",
"BitfinexCandleTimeFrame",
"timeframe",
")",
"{",
"return",
"new",
"BitfinexCandlestickSymbol",
"(",
"currencyPair",
",",
"Objects",
".",
"... | Returns symbol for candlestick channel
@param currencyPair of candles
@param timeframe configuration of candles
@return symbol | [
"Returns",
"symbol",
"for",
"candlestick",
"channel"
] | train | https://github.com/jnidzwetzki/bitfinex-v2-wss-api-java/blob/2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee/src/main/java/com/github/jnidzwetzki/bitfinex/v2/symbol/BitfinexSymbols.java#L52-L56 |
Metatavu/edelphi | rest/src/main/java/fi/metatavu/edelphi/comments/QueryQuestionCommentController.java | QueryQuestionCommentController.updateQueryQuestionComment | public QueryQuestionComment updateQueryQuestionComment(QueryQuestionComment queryQuestionComment, String comment, Boolean hidden, User modifier, Date modified) {
"""
Updates query question comment
@param queryQuestionComment comment to be updated
@param comment comment contents
@param hidden whether comment s... | java | public QueryQuestionComment updateQueryQuestionComment(QueryQuestionComment queryQuestionComment, String comment, Boolean hidden, User modifier, Date modified) {
queryQuestionCommentDAO.updateHidden(queryQuestionComment, hidden, modifier);
return queryQuestionCommentDAO.updateComment(queryQuestionComment, comme... | [
"public",
"QueryQuestionComment",
"updateQueryQuestionComment",
"(",
"QueryQuestionComment",
"queryQuestionComment",
",",
"String",
"comment",
",",
"Boolean",
"hidden",
",",
"User",
"modifier",
",",
"Date",
"modified",
")",
"{",
"queryQuestionCommentDAO",
".",
"updateHidd... | Updates query question comment
@param queryQuestionComment comment to be updated
@param comment comment contents
@param hidden whether comment should be hidden
@param modifier modifier
@param modified modification time
@return | [
"Updates",
"query",
"question",
"comment"
] | train | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/comments/QueryQuestionCommentController.java#L93-L96 |
chhh/MSFTBX | MSFileToolbox/src/main/java/umich/ms/util/jaxb/JaxbUtils.java | JaxbUtils.unmarshal | public static <T> T unmarshal(Class<T> cl, InputStream s) throws JAXBException {
"""
Convert the contents of an InputStream to an object of a given class.
@param cl Type of object
@param s InputStream to be read
@return Object of the given type
"""
return unmarshal(cl, new StreamSource(s));
} | java | public static <T> T unmarshal(Class<T> cl, InputStream s) throws JAXBException {
return unmarshal(cl, new StreamSource(s));
} | [
"public",
"static",
"<",
"T",
">",
"T",
"unmarshal",
"(",
"Class",
"<",
"T",
">",
"cl",
",",
"InputStream",
"s",
")",
"throws",
"JAXBException",
"{",
"return",
"unmarshal",
"(",
"cl",
",",
"new",
"StreamSource",
"(",
"s",
")",
")",
";",
"}"
] | Convert the contents of an InputStream to an object of a given class.
@param cl Type of object
@param s InputStream to be read
@return Object of the given type | [
"Convert",
"the",
"contents",
"of",
"an",
"InputStream",
"to",
"an",
"object",
"of",
"a",
"given",
"class",
"."
] | train | https://github.com/chhh/MSFTBX/blob/e53ae6be982e2de3123292be7d5297715bec70bb/MSFileToolbox/src/main/java/umich/ms/util/jaxb/JaxbUtils.java#L275-L277 |
apache/incubator-atlas | addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java | HiveMetaStoreBridge.getTableQualifiedName | public static String getTableQualifiedName(String clusterName, Table table) {
"""
Construct the qualified name used to uniquely identify a Table instance in Atlas.
@param clusterName Name of the cluster to which the Hive component belongs
@param table hive table for which the qualified name is needed
@return Un... | java | public static String getTableQualifiedName(String clusterName, Table table) {
return getTableQualifiedName(clusterName, table.getDbName(), table.getTableName(), table.isTemporary());
} | [
"public",
"static",
"String",
"getTableQualifiedName",
"(",
"String",
"clusterName",
",",
"Table",
"table",
")",
"{",
"return",
"getTableQualifiedName",
"(",
"clusterName",
",",
"table",
".",
"getDbName",
"(",
")",
",",
"table",
".",
"getTableName",
"(",
")",
... | Construct the qualified name used to uniquely identify a Table instance in Atlas.
@param clusterName Name of the cluster to which the Hive component belongs
@param table hive table for which the qualified name is needed
@return Unique qualified name to identify the Table instance in Atlas. | [
"Construct",
"the",
"qualified",
"name",
"used",
"to",
"uniquely",
"identify",
"a",
"Table",
"instance",
"in",
"Atlas",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java#L394-L396 |
kiegroup/drools | drools-model/drools-model-compiler/src/main/java/org/drools/modelcompiler/builder/generator/DrlxParseUtil.java | DrlxParseUtil.forceCastForName | public static void forceCastForName(String nameRef, Type type, Expression expression) {
"""
Mutates expression
such that, if it contains a <pre>nameRef</pre>, it is replaced and forcibly casted with <pre>(type) nameRef</pre>.
@param expression a mutated expression
"""
List<NameExpr> allNameExprForN... | java | public static void forceCastForName(String nameRef, Type type, Expression expression) {
List<NameExpr> allNameExprForName = expression.findAll(NameExpr.class, n -> n.getNameAsString().equals(nameRef));
for (NameExpr n : allNameExprForName) {
n.getParentNode().get().replace(n, new EnclosedExp... | [
"public",
"static",
"void",
"forceCastForName",
"(",
"String",
"nameRef",
",",
"Type",
"type",
",",
"Expression",
"expression",
")",
"{",
"List",
"<",
"NameExpr",
">",
"allNameExprForName",
"=",
"expression",
".",
"findAll",
"(",
"NameExpr",
".",
"class",
",",... | Mutates expression
such that, if it contains a <pre>nameRef</pre>, it is replaced and forcibly casted with <pre>(type) nameRef</pre>.
@param expression a mutated expression | [
"Mutates",
"expression",
"such",
"that",
"if",
"it",
"contains",
"a",
"<pre",
">",
"nameRef<",
"/",
"pre",
">",
"it",
"is",
"replaced",
"and",
"forcibly",
"casted",
"with",
"<pre",
">",
"(",
"type",
")",
"nameRef<",
"/",
"pre",
">",
"."
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-model/drools-model-compiler/src/main/java/org/drools/modelcompiler/builder/generator/DrlxParseUtil.java#L640-L645 |
SimonVT/android-menudrawer | menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java | MenuDrawer.setContentView | public void setContentView(View view, LayoutParams params) {
"""
Set the content to an explicit view.
@param view The desired content to display.
@param params Layout parameters for the view.
"""
switch (mDragMode) {
case MenuDrawer.MENU_DRAG_CONTENT:
mContentContainer... | java | public void setContentView(View view, LayoutParams params) {
switch (mDragMode) {
case MenuDrawer.MENU_DRAG_CONTENT:
mContentContainer.removeAllViews();
mContentContainer.addView(view, params);
break;
case MenuDrawer.MENU_DRAG_WINDOW:
... | [
"public",
"void",
"setContentView",
"(",
"View",
"view",
",",
"LayoutParams",
"params",
")",
"{",
"switch",
"(",
"mDragMode",
")",
"{",
"case",
"MenuDrawer",
".",
"MENU_DRAG_CONTENT",
":",
"mContentContainer",
".",
"removeAllViews",
"(",
")",
";",
"mContentConta... | Set the content to an explicit view.
@param view The desired content to display.
@param params Layout parameters for the view. | [
"Set",
"the",
"content",
"to",
"an",
"explicit",
"view",
"."
] | train | https://github.com/SimonVT/android-menudrawer/blob/59e8d18e109c77d911b8b63232d66d5f0551cf6a/menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java#L1479-L1490 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/icon/provider/ConnectedIconsProvider.java | ConnectedIconsProvider.getIcon | @Override
public Icon getIcon(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing facing) {
"""
Gets the corresponding {@link Icon} based on the connections available.
@param world the world
@param pos the pos
@param state the state
@param facing the facing
@return the icon
"""
if (!initi... | java | @Override
public Icon getIcon(IBlockAccess world, BlockPos pos, IBlockState state, EnumFacing facing)
{
if (!initialized)
initializeIcons();
int connections = getConnections(world, pos, facing);
return icons[connections];
} | [
"@",
"Override",
"public",
"Icon",
"getIcon",
"(",
"IBlockAccess",
"world",
",",
"BlockPos",
"pos",
",",
"IBlockState",
"state",
",",
"EnumFacing",
"facing",
")",
"{",
"if",
"(",
"!",
"initialized",
")",
"initializeIcons",
"(",
")",
";",
"int",
"connections"... | Gets the corresponding {@link Icon} based on the connections available.
@param world the world
@param pos the pos
@param state the state
@param facing the facing
@return the icon | [
"Gets",
"the",
"corresponding",
"{",
"@link",
"Icon",
"}",
"based",
"on",
"the",
"connections",
"available",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/icon/provider/ConnectedIconsProvider.java#L145-L152 |
hal/core | gui/src/main/java/org/useware/kernel/model/mapping/Node.java | Node.insertChildAt | public void insertChildAt(int index, Node<T> child) throws IndexOutOfBoundsException {
"""
Inserts a Node<T> at the specified position in the child list. Will * throw an ArrayIndexOutOfBoundsException if the index does not exist.
@param index the position to insert at.
@param child the Node<T> object to inse... | java | public void insertChildAt(int index, Node<T> child) throws IndexOutOfBoundsException {
if (index == getNumberOfChildren()) {
// this is really an append
addChild(child);
return;
} else {
children.get(index); //just to throw the exception, and stop here
... | [
"public",
"void",
"insertChildAt",
"(",
"int",
"index",
",",
"Node",
"<",
"T",
">",
"child",
")",
"throws",
"IndexOutOfBoundsException",
"{",
"if",
"(",
"index",
"==",
"getNumberOfChildren",
"(",
")",
")",
"{",
"// this is really an append",
"addChild",
"(",
"... | Inserts a Node<T> at the specified position in the child list. Will * throw an ArrayIndexOutOfBoundsException if the index does not exist.
@param index the position to insert at.
@param child the Node<T> object to insert.
@throws IndexOutOfBoundsException if thrown. | [
"Inserts",
"a",
"Node<T",
">",
"at",
"the",
"specified",
"position",
"in",
"the",
"child",
"list",
".",
"Will",
"*",
"throw",
"an",
"ArrayIndexOutOfBoundsException",
"if",
"the",
"index",
"does",
"not",
"exist",
"."
] | train | https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/useware/kernel/model/mapping/Node.java#L118-L127 |
classgraph/classgraph | src/main/java/io/github/classgraph/ScanResultObject.java | ScanResultObject.loadClass | <T> Class<T> loadClass(final Class<T> superclassOrInterfaceType) {
"""
Load the class named returned by {@link #getClassInfo()}, or if that returns null, the class named by
{@link #getClassName()}. Returns a {@code Class<?>} reference for the class, cast to the requested superclass
or interface type.
@param <... | java | <T> Class<T> loadClass(final Class<T> superclassOrInterfaceType) {
return loadClass(superclassOrInterfaceType, /* ignoreExceptions = */ false);
} | [
"<",
"T",
">",
"Class",
"<",
"T",
">",
"loadClass",
"(",
"final",
"Class",
"<",
"T",
">",
"superclassOrInterfaceType",
")",
"{",
"return",
"loadClass",
"(",
"superclassOrInterfaceType",
",",
"/* ignoreExceptions = */",
"false",
")",
";",
"}"
] | Load the class named returned by {@link #getClassInfo()}, or if that returns null, the class named by
{@link #getClassName()}. Returns a {@code Class<?>} reference for the class, cast to the requested superclass
or interface type.
@param <T>
the superclass or interface type
@param superclassOrInterfaceType
The type to... | [
"Load",
"the",
"class",
"named",
"returned",
"by",
"{",
"@link",
"#getClassInfo",
"()",
"}",
"or",
"if",
"that",
"returns",
"null",
"the",
"class",
"named",
"by",
"{",
"@link",
"#getClassName",
"()",
"}",
".",
"Returns",
"a",
"{",
"@code",
"Class<?",
">"... | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResultObject.java#L171-L173 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/CommentsApi.java | CommentsApi.getCommentsTranscript | public byte[] getCommentsTranscript(String accountId, String envelopeId) throws ApiException {
"""
Gets comment transcript for envelope and user
@param accountId The external account number (int) or account ID Guid. (required)
@param envelopeId The envelopeId Guid of the envelope being accessed. (required)
@r... | java | public byte[] getCommentsTranscript(String accountId, String envelopeId) throws ApiException {
return getCommentsTranscript(accountId, envelopeId, null);
} | [
"public",
"byte",
"[",
"]",
"getCommentsTranscript",
"(",
"String",
"accountId",
",",
"String",
"envelopeId",
")",
"throws",
"ApiException",
"{",
"return",
"getCommentsTranscript",
"(",
"accountId",
",",
"envelopeId",
",",
"null",
")",
";",
"}"
] | Gets comment transcript for envelope and user
@param accountId The external account number (int) or account ID Guid. (required)
@param envelopeId The envelopeId Guid of the envelope being accessed. (required)
@return byte[] | [
"Gets",
"comment",
"transcript",
"for",
"envelope",
"and",
"user"
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/CommentsApi.java#L59-L61 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/AbstractAddStepHandler.java | AbstractAddStepHandler.populateModel | protected void populateModel(final OperationContext context, final ModelNode operation, final Resource resource) throws OperationFailedException {
"""
Populate the given resource in the persistent configuration model based on the values in the given operation.
This method isinvoked during {@link org.jboss.as.con... | java | protected void populateModel(final OperationContext context, final ModelNode operation, final Resource resource) throws OperationFailedException {
populateModel(operation, resource);
} | [
"protected",
"void",
"populateModel",
"(",
"final",
"OperationContext",
"context",
",",
"final",
"ModelNode",
"operation",
",",
"final",
"Resource",
"resource",
")",
"throws",
"OperationFailedException",
"{",
"populateModel",
"(",
"operation",
",",
"resource",
")",
... | Populate the given resource in the persistent configuration model based on the values in the given operation.
This method isinvoked during {@link org.jboss.as.controller.OperationContext.Stage#MODEL}.
<p>
This default implementation simply calls {@link #populateModel(ModelNode, org.jboss.as.controller.registry.Resource... | [
"Populate",
"the",
"given",
"resource",
"in",
"the",
"persistent",
"configuration",
"model",
"based",
"on",
"the",
"values",
"in",
"the",
"given",
"operation",
".",
"This",
"method",
"isinvoked",
"during",
"{",
"@link",
"org",
".",
"jboss",
".",
"as",
".",
... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AbstractAddStepHandler.java#L221-L223 |
netty/netty-tcnative | openssl-dynamic/src/main/java/io/netty/internal/tcnative/SSLContext.java | SSLContext.setSessionTicketKeys | public static void setSessionTicketKeys(long ctx, SessionTicketKey[] keys) {
"""
Set TLS session ticket keys.
<p> The first key in the list is the primary key. Tickets dervied from the other keys
in the list will be accepted but updated to a new ticket using the primary key. This
is useful for implementing ti... | java | public static void setSessionTicketKeys(long ctx, SessionTicketKey[] keys) {
if (keys == null || keys.length == 0) {
throw new IllegalArgumentException("Length of the keys should be longer than 0.");
}
byte[] binaryKeys = new byte[keys.length * SessionTicketKey.TICKET_KEY_SIZE];
... | [
"public",
"static",
"void",
"setSessionTicketKeys",
"(",
"long",
"ctx",
",",
"SessionTicketKey",
"[",
"]",
"keys",
")",
"{",
"if",
"(",
"keys",
"==",
"null",
"||",
"keys",
".",
"length",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",... | Set TLS session ticket keys.
<p> The first key in the list is the primary key. Tickets dervied from the other keys
in the list will be accepted but updated to a new ticket using the primary key. This
is useful for implementing ticket key rotation.
See <a href="https://tools.ietf.org/html/rfc5077">RFC 5077</a>
@param ... | [
"Set",
"TLS",
"session",
"ticket",
"keys",
"."
] | train | https://github.com/netty/netty-tcnative/blob/4a5d7330c6c36cff2bebbb465571cab1cf7a4063/openssl-dynamic/src/main/java/io/netty/internal/tcnative/SSLContext.java#L423-L438 |
jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mod/mixer/BasicModMixer.java | BasicModMixer.mixChannelIntoBuffers | private void mixChannelIntoBuffers(final int[] leftBuffer, final int[] rightBuffer, final int startIndex, final int endIndex, final ChannelMemory actMemo) {
"""
Fill the buffers with channel data
@since 18.06.2006
@param leftBuffer
@param rightBuffer
@param startIndex
@param amount
@param actMemo
"""
f... | java | private void mixChannelIntoBuffers(final int[] leftBuffer, final int[] rightBuffer, final int startIndex, final int endIndex, final ChannelMemory actMemo)
{
for (int i=startIndex; i<endIndex; i++)
{
// Retrieve the Sampledata for this point (interpolated, if necessary)
long sample = actMemo.currentSample.get... | [
"private",
"void",
"mixChannelIntoBuffers",
"(",
"final",
"int",
"[",
"]",
"leftBuffer",
",",
"final",
"int",
"[",
"]",
"rightBuffer",
",",
"final",
"int",
"startIndex",
",",
"final",
"int",
"endIndex",
",",
"final",
"ChannelMemory",
"actMemo",
")",
"{",
"fo... | Fill the buffers with channel data
@since 18.06.2006
@param leftBuffer
@param rightBuffer
@param startIndex
@param amount
@param actMemo | [
"Fill",
"the",
"buffers",
"with",
"channel",
"data"
] | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mod/mixer/BasicModMixer.java#L1240-L1283 |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/BboxService.java | BboxService.contains | public static boolean contains(Bbox bbox, Coordinate coordinate) {
"""
Is the given coordinate contained within the bounding box or not? If the coordinate is on the bounding box
border, it is considered outside.
@param bbox
The bounding box.
@param coordinate
The coordinate to check.
@return True if the co... | java | public static boolean contains(Bbox bbox, Coordinate coordinate) {
if (bbox.getX() >= coordinate.getX()) {
return false;
}
if (bbox.getY() >= coordinate.getY()) {
return false;
}
if (bbox.getMaxX() <= coordinate.getX()) {
return false;
}
if (bbox.getMaxY() <= coordinate.getY()) {
return false;... | [
"public",
"static",
"boolean",
"contains",
"(",
"Bbox",
"bbox",
",",
"Coordinate",
"coordinate",
")",
"{",
"if",
"(",
"bbox",
".",
"getX",
"(",
")",
">=",
"coordinate",
".",
"getX",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"bbox",
... | Is the given coordinate contained within the bounding box or not? If the coordinate is on the bounding box
border, it is considered outside.
@param bbox
The bounding box.
@param coordinate
The coordinate to check.
@return True if the coordinate is within the bounding box, false otherwise.
@since 1.1.0 | [
"Is",
"the",
"given",
"coordinate",
"contained",
"within",
"the",
"bounding",
"box",
"or",
"not?",
"If",
"the",
"coordinate",
"is",
"on",
"the",
"bounding",
"box",
"border",
"it",
"is",
"considered",
"outside",
"."
] | train | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/BboxService.java#L133-L147 |
podio/podio-java | src/main/java/com/podio/org/OrgAPI.java | OrgAPI.getMember | public OrganizationMember getMember(int orgId, int userId) {
"""
Returns the member data for the given user in the given organization.
@param orgId
The id of the organization
@param userId
The id of the user
@return The details of the users membership of the organization
"""
return getResourceFactory... | java | public OrganizationMember getMember(int orgId, int userId) {
return getResourceFactory().getApiResource(
"/org/" + orgId + "/member/" + userId).get(
OrganizationMember.class);
} | [
"public",
"OrganizationMember",
"getMember",
"(",
"int",
"orgId",
",",
"int",
"userId",
")",
"{",
"return",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/org/\"",
"+",
"orgId",
"+",
"\"/member/\"",
"+",
"userId",
")",
".",
"get",
"(",
"Orga... | Returns the member data for the given user in the given organization.
@param orgId
The id of the organization
@param userId
The id of the user
@return The details of the users membership of the organization | [
"Returns",
"the",
"member",
"data",
"for",
"the",
"given",
"user",
"in",
"the",
"given",
"organization",
"."
] | train | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/org/OrgAPI.java#L194-L198 |
blackducksoftware/hub-common-rest | src/main/java/com/synopsys/integration/blackduck/rest/CredentialsRestConnection.java | CredentialsRestConnection.authenticateWithBlackduck | @Override
public void authenticateWithBlackduck() throws IntegrationException {
"""
Gets the cookie for the Authorized connection to the Hub server. Returns the response code from the connection.
"""
final URL securityUrl;
try {
securityUrl = new URL(getBaseUrl(), "j_spring_secu... | java | @Override
public void authenticateWithBlackduck() throws IntegrationException {
final URL securityUrl;
try {
securityUrl = new URL(getBaseUrl(), "j_spring_security_check");
} catch (final MalformedURLException e) {
throw new IntegrationException("Error constructing th... | [
"@",
"Override",
"public",
"void",
"authenticateWithBlackduck",
"(",
")",
"throws",
"IntegrationException",
"{",
"final",
"URL",
"securityUrl",
";",
"try",
"{",
"securityUrl",
"=",
"new",
"URL",
"(",
"getBaseUrl",
"(",
")",
",",
"\"j_spring_security_check\"",
")",... | Gets the cookie for the Authorized connection to the Hub server. Returns the response code from the connection. | [
"Gets",
"the",
"cookie",
"for",
"the",
"Authorized",
"connection",
"to",
"the",
"Hub",
"server",
".",
"Returns",
"the",
"response",
"code",
"from",
"the",
"connection",
"."
] | train | https://github.com/blackducksoftware/hub-common-rest/blob/7df7ec1f421dca0fb35d8679f6fcb494cee08a2a/src/main/java/com/synopsys/integration/blackduck/rest/CredentialsRestConnection.java#L75-L117 |
datacleaner/DataCleaner | engine/xml-config/src/main/java/org/datacleaner/configuration/DomConfigurationWriter.java | DomConfigurationWriter.toElement | public Element toElement(final ExcelDatastore datastore, final String filename) {
"""
Externalizes a {@link ExcelDatastore} to a XML element.
@param datastore
@param filename the filename/path to use in the XML element. Since the appropriate path will depend on the
reading application's environment (supported... | java | public Element toElement(final ExcelDatastore datastore, final String filename) {
final Element ds = getDocument().createElement("excel-datastore");
ds.setAttribute("name", datastore.getName());
if (!Strings.isNullOrEmpty(datastore.getDescription())) {
ds.setAttribute("description",... | [
"public",
"Element",
"toElement",
"(",
"final",
"ExcelDatastore",
"datastore",
",",
"final",
"String",
"filename",
")",
"{",
"final",
"Element",
"ds",
"=",
"getDocument",
"(",
")",
".",
"createElement",
"(",
"\"excel-datastore\"",
")",
";",
"ds",
".",
"setAttr... | Externalizes a {@link ExcelDatastore} to a XML element.
@param datastore
@param filename the filename/path to use in the XML element. Since the appropriate path will depend on the
reading application's environment (supported {@link Resource} types), this specific property of the
datastore is provided separately.
@retu... | [
"Externalizes",
"a",
"{",
"@link",
"ExcelDatastore",
"}",
"to",
"a",
"XML",
"element",
"."
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/engine/xml-config/src/main/java/org/datacleaner/configuration/DomConfigurationWriter.java#L909-L928 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/titlepaneforegound/TitlePaneButtonForegroundPainter.java | TitlePaneButtonForegroundPainter.paintEnabled | public void paintEnabled(Graphics2D g, JComponent c, int width, int height) {
"""
Paint the enabled state of the button foreground.
@param g the Graphics2D context to paint with.
@param c the button to paint.
@param width the width to paint.
@param height the height to paint.
"""
paint... | java | public void paintEnabled(Graphics2D g, JComponent c, int width, int height) {
paint(g, c, width, height, enabledBorder, enabledCorner, enabledInterior);
} | [
"public",
"void",
"paintEnabled",
"(",
"Graphics2D",
"g",
",",
"JComponent",
"c",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"paint",
"(",
"g",
",",
"c",
",",
"width",
",",
"height",
",",
"enabledBorder",
",",
"enabledCorner",
",",
"enabledInte... | Paint the enabled state of the button foreground.
@param g the Graphics2D context to paint with.
@param c the button to paint.
@param width the width to paint.
@param height the height to paint. | [
"Paint",
"the",
"enabled",
"state",
"of",
"the",
"button",
"foreground",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/titlepaneforegound/TitlePaneButtonForegroundPainter.java#L34-L36 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/MachinetagsApi.java | MachinetagsApi.getValues | public Values getValues(String namespace, String predicate, int perPage, int page, boolean sign) throws JinxException {
"""
Return a list of unique values for a namespace and predicate.
<br>
This method does not require authentication.
@param namespace (Required) The namespace that all values should be restri... | java | public Values getValues(String namespace, String predicate, int perPage, int page, boolean sign) throws JinxException {
JinxUtils.validateParams(namespace, predicate);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.machinetags.getValues");
if (!JinxUtils.isNullOrEmpty(namespa... | [
"public",
"Values",
"getValues",
"(",
"String",
"namespace",
",",
"String",
"predicate",
",",
"int",
"perPage",
",",
"int",
"page",
",",
"boolean",
"sign",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"namespace",
",",
"predica... | Return a list of unique values for a namespace and predicate.
<br>
This method does not require authentication.
@param namespace (Required) The namespace that all values should be restricted to.
@param predicate (Required) The predicate that all values should be restricted to.
@param perPage Number of photos to retu... | [
"Return",
"a",
"list",
"of",
"unique",
"values",
"for",
"a",
"namespace",
"and",
"predicate",
".",
"<br",
">",
"This",
"method",
"does",
"not",
"require",
"authentication",
"."
] | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/MachinetagsApi.java#L186-L203 |
Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/MBeanStringSanitizer.java | MBeanStringSanitizer.urlDecode | String urlDecode(String name, String encoding) throws UnsupportedEncodingException {
"""
Convert a URL Encoded name back to the original form.
@param name the name to URL urlDecode.
@param encoding the string encoding to be used (i.e. UTF-8)
@return the name in original form.
@throws UnsupportedEncodingExcepti... | java | String urlDecode(String name, String encoding) throws UnsupportedEncodingException {
return URLDecoder.decode(name, encoding);
} | [
"String",
"urlDecode",
"(",
"String",
"name",
",",
"String",
"encoding",
")",
"throws",
"UnsupportedEncodingException",
"{",
"return",
"URLDecoder",
".",
"decode",
"(",
"name",
",",
"encoding",
")",
";",
"}"
] | Convert a URL Encoded name back to the original form.
@param name the name to URL urlDecode.
@param encoding the string encoding to be used (i.e. UTF-8)
@return the name in original form.
@throws UnsupportedEncodingException if the encoding is not supported. | [
"Convert",
"a",
"URL",
"Encoded",
"name",
"back",
"to",
"the",
"original",
"form",
"."
] | train | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/MBeanStringSanitizer.java#L37-L39 |
mfornos/humanize | humanize-slim/src/main/java/humanize/Humanize.java | Humanize.wordWrap | public static String wordWrap(final String value, final int len) {
"""
<p>
Truncate a string to the closest word boundary after a number of
characters.
</p>
@param value
Text to be truncated
@param len
Number of characters
@return String truncated to the closes word boundary
"""
if (len < 0 |... | java | public static String wordWrap(final String value, final int len)
{
if (len < 0 || value.length() <= len)
return value;
BreakIterator bi = BreakIterator.getWordInstance(currentLocale());
bi.setText(value);
return value.substring(0, bi.following(len));
} | [
"public",
"static",
"String",
"wordWrap",
"(",
"final",
"String",
"value",
",",
"final",
"int",
"len",
")",
"{",
"if",
"(",
"len",
"<",
"0",
"||",
"value",
".",
"length",
"(",
")",
"<=",
"len",
")",
"return",
"value",
";",
"BreakIterator",
"bi",
"=",... | <p>
Truncate a string to the closest word boundary after a number of
characters.
</p>
@param value
Text to be truncated
@param len
Number of characters
@return String truncated to the closes word boundary | [
"<p",
">",
"Truncate",
"a",
"string",
"to",
"the",
"closest",
"word",
"boundary",
"after",
"a",
"number",
"of",
"characters",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/mfornos/humanize/blob/59fc103045de9d217c9e77dbcb7621f992f46c63/humanize-slim/src/main/java/humanize/Humanize.java#L2896-L2905 |
trustathsh/ironcommon | src/main/java/de/hshannover/f4/trust/ironcommon/yaml/YamlWriter.java | YamlWriter.persist | public static synchronized void persist(String fileName, Object object)
throws IOException {
"""
Save a given {@link Object} to the yml-file.
@param fileName
The file name of the yml-file.
@param object
The {@link Object} to be stored.
@throws IOException
If the file could not be opened, created (when i... | java | public static synchronized void persist(String fileName, Object object)
throws IOException {
ObjectChecks.checkForNullReference(fileName, "fileName is null");
ObjectChecks.checkForNullReference(object, "object is null");
FileWriter fileWriter = null;
File f = null;
try {
fileWriter = new FileWriter(fi... | [
"public",
"static",
"synchronized",
"void",
"persist",
"(",
"String",
"fileName",
",",
"Object",
"object",
")",
"throws",
"IOException",
"{",
"ObjectChecks",
".",
"checkForNullReference",
"(",
"fileName",
",",
"\"fileName is null\"",
")",
";",
"ObjectChecks",
".",
... | Save a given {@link Object} to the yml-file.
@param fileName
The file name of the yml-file.
@param object
The {@link Object} to be stored.
@throws IOException
If the file could not be opened, created (when it doesn't
exist) or the given filename is a directory. | [
"Save",
"a",
"given",
"{",
"@link",
"Object",
"}",
"to",
"the",
"yml",
"-",
"file",
"."
] | train | https://github.com/trustathsh/ironcommon/blob/fee589a9300ab16744ca12fafae4357dd18c9fcb/src/main/java/de/hshannover/f4/trust/ironcommon/yaml/YamlWriter.java#L80-L103 |
EdwardRaff/JSAT | JSAT/src/jsat/text/topicmodel/OnlineLDAsvi.java | OnlineLDAsvi.setKappa | public void setKappa(double kappa) {
"""
The "forgetfulness" factor in the learning rate. Larger values increase
the rate at which old information is "forgotten"
@param kappa the forgetfulness factor in [0.5, 1]
"""
if(kappa < 0.5 || kappa > 1.0 || Double.isNaN(kappa))
throw new IllegalAr... | java | public void setKappa(double kappa)
{
if(kappa < 0.5 || kappa > 1.0 || Double.isNaN(kappa))
throw new IllegalArgumentException("Kapp must be in [0.5, 1], not " + kappa);
this.kappa = kappa;
} | [
"public",
"void",
"setKappa",
"(",
"double",
"kappa",
")",
"{",
"if",
"(",
"kappa",
"<",
"0.5",
"||",
"kappa",
">",
"1.0",
"||",
"Double",
".",
"isNaN",
"(",
"kappa",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Kapp must be in [0.5, 1], not... | The "forgetfulness" factor in the learning rate. Larger values increase
the rate at which old information is "forgotten"
@param kappa the forgetfulness factor in [0.5, 1] | [
"The",
"forgetfulness",
"factor",
"in",
"the",
"learning",
"rate",
".",
"Larger",
"values",
"increase",
"the",
"rate",
"at",
"which",
"old",
"information",
"is",
"forgotten"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/text/topicmodel/OnlineLDAsvi.java#L331-L336 |
duracloud/duracloud | storageprovider/src/main/java/org/duracloud/storage/util/StorageProviderUtil.java | StorageProviderUtil.compareChecksum | public static String compareChecksum(StorageProvider provider,
String spaceId,
String contentId,
String checksum)
throws StorageException {
"""
Determines if the checksum for a particu... | java | public static String compareChecksum(StorageProvider provider,
String spaceId,
String contentId,
String checksum)
throws StorageException {
String providerChecksum =
pro... | [
"public",
"static",
"String",
"compareChecksum",
"(",
"StorageProvider",
"provider",
",",
"String",
"spaceId",
",",
"String",
"contentId",
",",
"String",
"checksum",
")",
"throws",
"StorageException",
"{",
"String",
"providerChecksum",
"=",
"provider",
".",
"getCont... | Determines if the checksum for a particular piece of content
stored in a StorageProvider matches the expected checksum value.
@param provider The StorageProvider where the content was stored
@param spaceId The Space in which the content was stored
@param contentId The Id of the content
@param checksum The content ... | [
"Determines",
"if",
"the",
"checksum",
"for",
"a",
"particular",
"piece",
"of",
"content",
"stored",
"in",
"a",
"StorageProvider",
"matches",
"the",
"expected",
"checksum",
"value",
"."
] | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/storageprovider/src/main/java/org/duracloud/storage/util/StorageProviderUtil.java#L117-L126 |
RestComm/sipunit | src/main/java/org/cafesip/sipunit/PresenceNotifySender.java | PresenceNotifySender.processSubscribe | public void processSubscribe(long timeout, int statusCode, String reasonPhrase) {
"""
This method starts a thread that waits for up to 'timeout' milliseconds to receive a SUBSCRIBE
and if received, it sends a response with 'statusCode' and 'reasonPhrase' (if not null). This
method waits 500 ms before returning t... | java | public void processSubscribe(long timeout, int statusCode, String reasonPhrase) {
processSubscribe(timeout, statusCode, reasonPhrase, -1, null);
} | [
"public",
"void",
"processSubscribe",
"(",
"long",
"timeout",
",",
"int",
"statusCode",
",",
"String",
"reasonPhrase",
")",
"{",
"processSubscribe",
"(",
"timeout",
",",
"statusCode",
",",
"reasonPhrase",
",",
"-",
"1",
",",
"null",
")",
";",
"}"
] | This method starts a thread that waits for up to 'timeout' milliseconds to receive a SUBSCRIBE
and if received, it sends a response with 'statusCode' and 'reasonPhrase' (if not null). This
method waits 500 ms before returning to allow the thread to get started and begin waiting for
an incoming SUBSCRIBE. This method ad... | [
"This",
"method",
"starts",
"a",
"thread",
"that",
"waits",
"for",
"up",
"to",
"timeout",
"milliseconds",
"to",
"receive",
"a",
"SUBSCRIBE",
"and",
"if",
"received",
"it",
"sends",
"a",
"response",
"with",
"statusCode",
"and",
"reasonPhrase",
"(",
"if",
"not... | train | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/PresenceNotifySender.java#L130-L132 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/AbstractFormBuilder.java | AbstractFormBuilder.createBinding | protected Binding createBinding(String fieldName, JComponent component) {
"""
Create a binding that uses the given component instead of its default
component.
@param fieldName the name of the property to bind.
@param component the component to bind to the property.
@return the {@link Binding} that binds the ... | java | protected Binding createBinding(String fieldName, JComponent component) {
return getBindingFactory().bindControl(component, fieldName);
} | [
"protected",
"Binding",
"createBinding",
"(",
"String",
"fieldName",
",",
"JComponent",
"component",
")",
"{",
"return",
"getBindingFactory",
"(",
")",
".",
"bindControl",
"(",
"component",
",",
"fieldName",
")",
";",
"}"
] | Create a binding that uses the given component instead of its default
component.
@param fieldName the name of the property to bind.
@param component the component to bind to the property.
@return the {@link Binding} that binds the component to the valuemodel of
the property. | [
"Create",
"a",
"binding",
"that",
"uses",
"the",
"given",
"component",
"instead",
"of",
"its",
"default",
"component",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/AbstractFormBuilder.java#L111-L113 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java | CommerceCountryPersistenceImpl.findByG_Tw | @Override
public CommerceCountry findByG_Tw(long groupId, String twoLettersISOCode)
throws NoSuchCountryException {
"""
Returns the commerce country where groupId = ? and twoLettersISOCode = ? or throws a {@link NoSuchCountryException} if it could not be found.
@param groupId the group ID
@param two... | java | @Override
public CommerceCountry findByG_Tw(long groupId, String twoLettersISOCode)
throws NoSuchCountryException {
CommerceCountry commerceCountry = fetchByG_Tw(groupId, twoLettersISOCode);
if (commerceCountry == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
... | [
"@",
"Override",
"public",
"CommerceCountry",
"findByG_Tw",
"(",
"long",
"groupId",
",",
"String",
"twoLettersISOCode",
")",
"throws",
"NoSuchCountryException",
"{",
"CommerceCountry",
"commerceCountry",
"=",
"fetchByG_Tw",
"(",
"groupId",
",",
"twoLettersISOCode",
")",... | Returns the commerce country where groupId = ? and twoLettersISOCode = ? or throws a {@link NoSuchCountryException} if it could not be found.
@param groupId the group ID
@param twoLettersISOCode the two letters iso code
@return the matching commerce country
@throws NoSuchCountryException if a matching commerce... | [
"Returns",
"the",
"commerce",
"country",
"where",
"groupId",
"=",
"?",
";",
"and",
"twoLettersISOCode",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCountryException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java#L2009-L2035 |
fommil/matrix-toolkits-java | src/main/java/no/uib/cipr/matrix/io/MatrixVectorWriter.java | MatrixVectorWriter.printCoordinate | public void printCoordinate(int[] index, long[] data, int offset) {
"""
Prints the coordinate format to the underlying stream. One index and
entry on each line. The offset is added to the index, typically, this can
transform from a 0-based indicing to a 1-based.
"""
int size = index.length;
i... | java | public void printCoordinate(int[] index, long[] data, int offset) {
int size = index.length;
if (size != data.length)
throw new IllegalArgumentException(
"All arrays must be of the same size");
for (int i = 0; i < size; ++i)
format(Locale.ENGLISH, "%10... | [
"public",
"void",
"printCoordinate",
"(",
"int",
"[",
"]",
"index",
",",
"long",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"{",
"int",
"size",
"=",
"index",
".",
"length",
";",
"if",
"(",
"size",
"!=",
"data",
".",
"length",
")",
"throw",
"new",... | Prints the coordinate format to the underlying stream. One index and
entry on each line. The offset is added to the index, typically, this can
transform from a 0-based indicing to a 1-based. | [
"Prints",
"the",
"coordinate",
"format",
"to",
"the",
"underlying",
"stream",
".",
"One",
"index",
"and",
"entry",
"on",
"each",
"line",
".",
"The",
"offset",
"is",
"added",
"to",
"the",
"index",
"typically",
"this",
"can",
"transform",
"from",
"a",
"0",
... | train | https://github.com/fommil/matrix-toolkits-java/blob/6157618bc86bcda3749af2a60bf869d8f3292960/src/main/java/no/uib/cipr/matrix/io/MatrixVectorWriter.java#L239-L246 |
groovy/groovy-core | src/examples/org/codehaus/groovy/grails/compiler/injection/DefaultGrailsDomainClassInjector.java | DefaultGrailsDomainClassInjector.hasProperty | public static boolean hasProperty(ClassNode classNode, String propertyName) {
"""
Returns whether a classNode has the specified property or not
@param classNode The ClassNode
@param propertyName The name of the property
@return True if the property exists in the ClassNode
"""
if(classNode == null... | java | public static boolean hasProperty(ClassNode classNode, String propertyName) {
if(classNode == null || propertyName == null || "".equals(propertyName.trim()))
return false;
List properties = classNode.getProperties();
for (Iterator i = properties.iterator(); i.hasNext();) {
... | [
"public",
"static",
"boolean",
"hasProperty",
"(",
"ClassNode",
"classNode",
",",
"String",
"propertyName",
")",
"{",
"if",
"(",
"classNode",
"==",
"null",
"||",
"propertyName",
"==",
"null",
"||",
"\"\"",
".",
"equals",
"(",
"propertyName",
".",
"trim",
"("... | Returns whether a classNode has the specified property or not
@param classNode The ClassNode
@param propertyName The name of the property
@return True if the property exists in the ClassNode | [
"Returns",
"whether",
"a",
"classNode",
"has",
"the",
"specified",
"property",
"or",
"not"
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/examples/org/codehaus/groovy/grails/compiler/injection/DefaultGrailsDomainClassInjector.java#L210-L221 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/CollectionExtensions.java | CollectionExtensions.operator_add | @Inline(value="$3.$4addAll($1, $2)", imported=Iterables.class)
public static <E> boolean operator_add(Collection<E> collection, Iterable<? extends E> newElements) {
"""
The operator mapping from {@code +=} to {@link #addAll(Collection, Iterable)}. Returns <code>true</code> if the
collection changed due to this o... | java | @Inline(value="$3.$4addAll($1, $2)", imported=Iterables.class)
public static <E> boolean operator_add(Collection<E> collection, Iterable<? extends E> newElements) {
return addAll(collection, newElements);
} | [
"@",
"Inline",
"(",
"value",
"=",
"\"$3.$4addAll($1, $2)\"",
",",
"imported",
"=",
"Iterables",
".",
"class",
")",
"public",
"static",
"<",
"E",
">",
"boolean",
"operator_add",
"(",
"Collection",
"<",
"E",
">",
"collection",
",",
"Iterable",
"<",
"?",
"ext... | The operator mapping from {@code +=} to {@link #addAll(Collection, Iterable)}. Returns <code>true</code> if the
collection changed due to this operation.
@param collection
the to-be-changed collection. May not be <code>null</code>.
@param newElements
elements to be inserted into the collection. May not be <code>null</... | [
"The",
"operator",
"mapping",
"from",
"{",
"@code",
"+",
"=",
"}",
"to",
"{",
"@link",
"#addAll",
"(",
"Collection",
"Iterable",
")",
"}",
".",
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"collection",
"changed",
"due",
"to",
"this... | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/CollectionExtensions.java#L65-L68 |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/firefox/FirefoxProfile.java | FirefoxProfile.layoutOnDisk | public File layoutOnDisk() {
"""
Call this to cause the current profile to be written to disk. The profile directory is
returned. Note that this profile directory is a temporary one and will be deleted when the JVM
exists (at the latest)
This method should be called immediately before starting to use the prof... | java | public File layoutOnDisk() {
try {
File profileDir = TemporaryFilesystem.getDefaultTmpFS()
.createTempDir("anonymous", "webdriver-profile");
File userPrefs = new File(profileDir, "user.js");
copyModel(model, profileDir);
installExtensions(profileDir);
deleteLockFiles(profile... | [
"public",
"File",
"layoutOnDisk",
"(",
")",
"{",
"try",
"{",
"File",
"profileDir",
"=",
"TemporaryFilesystem",
".",
"getDefaultTmpFS",
"(",
")",
".",
"createTempDir",
"(",
"\"anonymous\"",
",",
"\"webdriver-profile\"",
")",
";",
"File",
"userPrefs",
"=",
"new",
... | Call this to cause the current profile to be written to disk. The profile directory is
returned. Note that this profile directory is a temporary one and will be deleted when the JVM
exists (at the latest)
This method should be called immediately before starting to use the profile and should only be
called once per ins... | [
"Call",
"this",
"to",
"cause",
"the",
"current",
"profile",
"to",
"be",
"written",
"to",
"disk",
".",
"The",
"profile",
"directory",
"is",
"returned",
".",
"Note",
"that",
"this",
"profile",
"directory",
"is",
"a",
"temporary",
"one",
"and",
"will",
"be",
... | train | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/firefox/FirefoxProfile.java#L393-L408 |
MGunlogson/CuckooFilter4J | src/main/java/com/github/mgunlogson/cuckoofilter4j/SegmentedBucketLocker.java | SegmentedBucketLocker.unlockBucketsRead | void unlockBucketsRead(long i1, long i2) {
"""
Unlocks segments corresponding to bucket indexes in specific order to prevent deadlocks
"""
int bucket1LockIdx = getBucketLock(i1);
int bucket2LockIdx = getBucketLock(i2);
// always unlock segments in same order to avoid deadlocks
if (bucket1LockIdx ==... | java | void unlockBucketsRead(long i1, long i2) {
int bucket1LockIdx = getBucketLock(i1);
int bucket2LockIdx = getBucketLock(i2);
// always unlock segments in same order to avoid deadlocks
if (bucket1LockIdx == bucket2LockIdx) {
lockAry[bucket1LockIdx].tryUnlockRead();
return;
}
lockAry[bucket1LockId... | [
"void",
"unlockBucketsRead",
"(",
"long",
"i1",
",",
"long",
"i2",
")",
"{",
"int",
"bucket1LockIdx",
"=",
"getBucketLock",
"(",
"i1",
")",
";",
"int",
"bucket2LockIdx",
"=",
"getBucketLock",
"(",
"i2",
")",
";",
"// always unlock segments in same order to avoid d... | Unlocks segments corresponding to bucket indexes in specific order to prevent deadlocks | [
"Unlocks",
"segments",
"corresponding",
"to",
"bucket",
"indexes",
"in",
"specific",
"order",
"to",
"prevent",
"deadlocks"
] | train | https://github.com/MGunlogson/CuckooFilter4J/blob/e8472aa150b201f05046d1c81cac5a5ca4348db8/src/main/java/com/github/mgunlogson/cuckoofilter4j/SegmentedBucketLocker.java#L117-L127 |
yidongnan/grpc-spring-boot-starter | grpc-client-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/client/channelfactory/AbstractChannelFactory.java | AbstractChannelFactory.configureSecurity | protected void configureSecurity(final T builder, final String name) {
"""
Configures the security options that should be used by the channel.
@param builder The channel builder to configure.
@param name The name of the client to configure.
"""
final GrpcChannelProperties properties = getProperties... | java | protected void configureSecurity(final T builder, final String name) {
final GrpcChannelProperties properties = getPropertiesFor(name);
final Security security = properties.getSecurity();
if (properties.getNegotiationType() != NegotiationType.TLS // non-default
|| isNonNullAndNo... | [
"protected",
"void",
"configureSecurity",
"(",
"final",
"T",
"builder",
",",
"final",
"String",
"name",
")",
"{",
"final",
"GrpcChannelProperties",
"properties",
"=",
"getPropertiesFor",
"(",
"name",
")",
";",
"final",
"Security",
"security",
"=",
"properties",
... | Configures the security options that should be used by the channel.
@param builder The channel builder to configure.
@param name The name of the client to configure. | [
"Configures",
"the",
"security",
"options",
"that",
"should",
"be",
"used",
"by",
"the",
"channel",
"."
] | train | https://github.com/yidongnan/grpc-spring-boot-starter/blob/07f8853cfafc9707584f2371aff012e590217b85/grpc-client-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/client/channelfactory/AbstractChannelFactory.java#L183-L195 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java | JDBCStorageConnection.loadPropertyRecord | protected PersistedPropertyData loadPropertyRecord(QPath parentPath, String cname, String cid, String cpid,
int cversion, int cptype, boolean cpmultivalued) throws RepositoryException, SQLException, IOException {
"""
Load PropertyData record.
@param parentPath
parent path
@param cname
Property name
@p... | java | protected PersistedPropertyData loadPropertyRecord(QPath parentPath, String cname, String cid, String cpid,
int cversion, int cptype, boolean cpmultivalued) throws RepositoryException, SQLException, IOException
{
// NOTE: cpid never should be null or root parent (' ')
try
{
QPath q... | [
"protected",
"PersistedPropertyData",
"loadPropertyRecord",
"(",
"QPath",
"parentPath",
",",
"String",
"cname",
",",
"String",
"cid",
",",
"String",
"cpid",
",",
"int",
"cversion",
",",
"int",
"cptype",
",",
"boolean",
"cpmultivalued",
")",
"throws",
"RepositoryEx... | Load PropertyData record.
@param parentPath
parent path
@param cname
Property name
@param cid
Property id
@param cpid
Property parent id
@param cversion
Property persistent verison
@param cptype
Property type
@param cpmultivalued
Property multivalued status
@return PersistedPropertyData
@throws RepositoryException
Rep... | [
"Load",
"PropertyData",
"record",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java#L2496-L2529 |
rometools/rome | rome-modules/src/main/java/com/rometools/modules/mediarss/io/MediaModuleGenerator.java | MediaModuleGenerator.generateEmbed | private void generateEmbed(final Metadata m, final Element e) {
"""
Generation of embed tag.
@param m source
@param e element to attach new element to
"""
if (m.getEmbed() == null) {
return;
}
final Element embedElement = new Element("embed", NS);
addNotNullAttri... | java | private void generateEmbed(final Metadata m, final Element e) {
if (m.getEmbed() == null) {
return;
}
final Element embedElement = new Element("embed", NS);
addNotNullAttribute(embedElement, "url", m.getEmbed().getUrl());
addNotNullAttribute(embedElement, "width", m.g... | [
"private",
"void",
"generateEmbed",
"(",
"final",
"Metadata",
"m",
",",
"final",
"Element",
"e",
")",
"{",
"if",
"(",
"m",
".",
"getEmbed",
"(",
")",
"==",
"null",
")",
"{",
"return",
";",
"}",
"final",
"Element",
"embedElement",
"=",
"new",
"Element",... | Generation of embed tag.
@param m source
@param e element to attach new element to | [
"Generation",
"of",
"embed",
"tag",
"."
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-modules/src/main/java/com/rometools/modules/mediarss/io/MediaModuleGenerator.java#L344-L361 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/DomainsInner.java | DomainsInner.beginUpdateAsync | public Observable<DomainInner> beginUpdateAsync(String resourceGroupName, String domainName, Map<String, String> tags) {
"""
Update a domain.
Asynchronously updates a domain with the specified parameters.
@param resourceGroupName The name of the resource group within the user's subscription.
@param domainName... | java | public Observable<DomainInner> beginUpdateAsync(String resourceGroupName, String domainName, Map<String, String> tags) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, domainName, tags).map(new Func1<ServiceResponse<DomainInner>, DomainInner>() {
@Override
public DomainInn... | [
"public",
"Observable",
"<",
"DomainInner",
">",
"beginUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"domainName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGrou... | Update a domain.
Asynchronously updates a domain with the specified parameters.
@param resourceGroupName The name of the resource group within the user's subscription.
@param domainName Name of the domain
@param tags Tags of the domains resource
@throws IllegalArgumentException thrown if parameters fail the validation... | [
"Update",
"a",
"domain",
".",
"Asynchronously",
"updates",
"a",
"domain",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/DomainsInner.java#L828-L835 |
scireum/s3ninja | src/main/java/ninja/S3Dispatcher.java | S3Dispatcher.deleteObject | private void deleteObject(final WebContext ctx, final Bucket bucket, final String id) {
"""
Handles DELETE /bucket/id
@param ctx the context describing the current request
@param bucket the bucket containing the object to delete
@param id name of the object to delete
"""
StoredObject object... | java | private void deleteObject(final WebContext ctx, final Bucket bucket, final String id) {
StoredObject object = bucket.getObject(id);
object.delete();
ctx.respondWith().status(HttpResponseStatus.OK);
signalObjectSuccess(ctx);
} | [
"private",
"void",
"deleteObject",
"(",
"final",
"WebContext",
"ctx",
",",
"final",
"Bucket",
"bucket",
",",
"final",
"String",
"id",
")",
"{",
"StoredObject",
"object",
"=",
"bucket",
".",
"getObject",
"(",
"id",
")",
";",
"object",
".",
"delete",
"(",
... | Handles DELETE /bucket/id
@param ctx the context describing the current request
@param bucket the bucket containing the object to delete
@param id name of the object to delete | [
"Handles",
"DELETE",
"/",
"bucket",
"/",
"id"
] | train | https://github.com/scireum/s3ninja/blob/445eec55c91780267a7f987818b3fedecae009c5/src/main/java/ninja/S3Dispatcher.java#L477-L483 |
haraldk/TwelveMonkeys | common/common-image/src/main/java/com/twelvemonkeys/image/GraphicsUtil.java | GraphicsUtil.setAlpha | public static void setAlpha(final Graphics pGraphics, final float pAlpha) {
"""
Sets the alpha in the {@code Graphics} object.
<p/>
Alpha is set by casting to {@code Graphics2D} and setting the composite
to the rule {@code AlphaComposite.SRC_OVER} multiplied by the given
alpha.
@param pGraphics the graphics... | java | public static void setAlpha(final Graphics pGraphics, final float pAlpha) {
((Graphics2D) pGraphics).setComposite(
AlphaComposite.getInstance(AlphaComposite.SRC_OVER, pAlpha)
);
} | [
"public",
"static",
"void",
"setAlpha",
"(",
"final",
"Graphics",
"pGraphics",
",",
"final",
"float",
"pAlpha",
")",
"{",
"(",
"(",
"Graphics2D",
")",
"pGraphics",
")",
".",
"setComposite",
"(",
"AlphaComposite",
".",
"getInstance",
"(",
"AlphaComposite",
".",... | Sets the alpha in the {@code Graphics} object.
<p/>
Alpha is set by casting to {@code Graphics2D} and setting the composite
to the rule {@code AlphaComposite.SRC_OVER} multiplied by the given
alpha.
@param pGraphics the graphics object
@param pAlpha the alpha level, {@code alpha} must be a floating point
number in the... | [
"Sets",
"the",
"alpha",
"in",
"the",
"{",
"@code",
"Graphics",
"}",
"object",
".",
"<p",
"/",
">",
"Alpha",
"is",
"set",
"by",
"casting",
"to",
"{",
"@code",
"Graphics2D",
"}",
"and",
"setting",
"the",
"composite",
"to",
"the",
"rule",
"{",
"@code",
... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/GraphicsUtil.java#L79-L83 |
GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.getParentPath | @Deprecated
public static URI getParentPath(PathCodec pathCodec, URI path) {
"""
Gets the parent directory of the given path.
@deprecated This static method is included as a transitional utility and the
instance method variant should be preferred.
@param path Path to convert.
@return Path of parent directo... | java | @Deprecated
public static URI getParentPath(PathCodec pathCodec, URI path) {
Preconditions.checkNotNull(path);
// Root path has no parent.
if (path.equals(GCS_ROOT)) {
return null;
}
StorageResourceId resourceId = pathCodec.validatePathAndGetId(path, true);
if (resourceId.isBucket()) ... | [
"@",
"Deprecated",
"public",
"static",
"URI",
"getParentPath",
"(",
"PathCodec",
"pathCodec",
",",
"URI",
"path",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"path",
")",
";",
"// Root path has no parent.",
"if",
"(",
"path",
".",
"equals",
"(",
"GCS_... | Gets the parent directory of the given path.
@deprecated This static method is included as a transitional utility and the
instance method variant should be preferred.
@param path Path to convert.
@return Path of parent directory of the given item or null for root path. | [
"Gets",
"the",
"parent",
"directory",
"of",
"the",
"given",
"path",
"."
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L1583-L1608 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/event/SequenceHandler.java | SequenceHandler.init | public void init(Record record, BaseField fldDest, BaseField fldSource) {
"""
This Constructor moves the source field to the dest field on valid.
@param record My owner (usually passed as null, and set on addListener in setOwner()).
@param pfldDest tour.field.BaseField The destination field.
@param fldSource Th... | java | public void init(Record record, BaseField fldDest, BaseField fldSource)
{
super.init(record, fldDest, fldSource, null, true, false, false, false, false, null, false);
} | [
"public",
"void",
"init",
"(",
"Record",
"record",
",",
"BaseField",
"fldDest",
",",
"BaseField",
"fldSource",
")",
"{",
"super",
".",
"init",
"(",
"record",
",",
"fldDest",
",",
"fldSource",
",",
"null",
",",
"true",
",",
"false",
",",
"false",
",",
"... | This Constructor moves the source field to the dest field on valid.
@param record My owner (usually passed as null, and set on addListener in setOwner()).
@param pfldDest tour.field.BaseField The destination field.
@param fldSource The source field. | [
"This",
"Constructor",
"moves",
"the",
"source",
"field",
"to",
"the",
"dest",
"field",
"on",
"valid",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/SequenceHandler.java#L55-L58 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/chrono/ChronoLocalDateImpl.java | ChronoLocalDateImpl.ensureValid | static <D extends ChronoLocalDate> D ensureValid(Chronology chrono, Temporal temporal) {
"""
Casts the {@code Temporal} to {@code ChronoLocalDate} ensuring it bas the specified chronology.
@param chrono the chronology to check for, not null
@param temporal a date-time to cast, not null
@return the date-time... | java | static <D extends ChronoLocalDate> D ensureValid(Chronology chrono, Temporal temporal) {
@SuppressWarnings("unchecked")
D other = (D) temporal;
if (chrono.equals(other.getChronology()) == false) {
throw new ClassCastException("Chronology mismatch, expected: " + chrono.getId() + ", ac... | [
"static",
"<",
"D",
"extends",
"ChronoLocalDate",
">",
"D",
"ensureValid",
"(",
"Chronology",
"chrono",
",",
"Temporal",
"temporal",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"D",
"other",
"=",
"(",
"D",
")",
"temporal",
";",
"if",
"(",... | Casts the {@code Temporal} to {@code ChronoLocalDate} ensuring it bas the specified chronology.
@param chrono the chronology to check for, not null
@param temporal a date-time to cast, not null
@return the date-time checked and cast to {@code ChronoLocalDate}, not null
@throws ClassCastException if the date-time can... | [
"Casts",
"the",
"{",
"@code",
"Temporal",
"}",
"to",
"{",
"@code",
"ChronoLocalDate",
"}",
"ensuring",
"it",
"bas",
"the",
"specified",
"chronology",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/chrono/ChronoLocalDateImpl.java#L160-L167 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/xml/RaXmlGen.java | RaXmlGen.writeInbound | private void writeInbound(Definition def, Writer out, int indent) throws IOException {
"""
Output inbound xml part
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException
"""
writeIndent(out, indent);
out.write("<inbound-resourceadapter>");
... | java | private void writeInbound(Definition def, Writer out, int indent) throws IOException
{
writeIndent(out, indent);
out.write("<inbound-resourceadapter>");
writeEol(out);
writeIndent(out, indent + 1);
out.write("<messageadapter>");
writeEol(out);
writeIndent(out, indent + 2);
... | [
"private",
"void",
"writeInbound",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeIndent",
"(",
"out",
",",
"indent",
")",
";",
"out",
".",
"write",
"(",
"\"<inbound-resourceadapter>\"",
")",
";... | Output inbound xml part
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"inbound",
"xml",
"part"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/xml/RaXmlGen.java#L243-L286 |
VoltDB/voltdb | src/frontend/org/voltcore/utils/CoreUtils.java | CoreUtils.getCachedSingleThreadExecutor | public static ListeningExecutorService getCachedSingleThreadExecutor(String name, long keepAlive) {
"""
Get a single thread executor that caches its thread meaning that the thread will terminate
after keepAlive milliseconds. A new thread will be created the next time a task arrives and that will be kept
around f... | java | public static ListeningExecutorService getCachedSingleThreadExecutor(String name, long keepAlive) {
return MoreExecutors.listeningDecorator(new ThreadPoolExecutor(
0,
1,
keepAlive,
TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runn... | [
"public",
"static",
"ListeningExecutorService",
"getCachedSingleThreadExecutor",
"(",
"String",
"name",
",",
"long",
"keepAlive",
")",
"{",
"return",
"MoreExecutors",
".",
"listeningDecorator",
"(",
"new",
"ThreadPoolExecutor",
"(",
"0",
",",
"1",
",",
"keepAlive",
... | Get a single thread executor that caches its thread meaning that the thread will terminate
after keepAlive milliseconds. A new thread will be created the next time a task arrives and that will be kept
around for keepAlive milliseconds. On creation no thread is allocated, the first task creates a thread.
Uses LinkedTra... | [
"Get",
"a",
"single",
"thread",
"executor",
"that",
"caches",
"its",
"thread",
"meaning",
"that",
"the",
"thread",
"will",
"terminate",
"after",
"keepAlive",
"milliseconds",
".",
"A",
"new",
"thread",
"will",
"be",
"created",
"the",
"next",
"time",
"a",
"tas... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/utils/CoreUtils.java#L429-L437 |
eclipse/xtext-core | org.eclipse.xtext/src/org/eclipse/xtext/formatting/impl/NodeModelStreamer.java | NodeModelStreamer.getFormattedDatatypeValue | protected String getFormattedDatatypeValue(ICompositeNode node, AbstractRule rule, String text) throws ValueConverterException {
"""
Create a canonical represenation of the data type value. Defaults to the value converter.
@since 2.9
"""
Object value = valueConverter.toValue(text, rule.getName(), node);
... | java | protected String getFormattedDatatypeValue(ICompositeNode node, AbstractRule rule, String text) throws ValueConverterException {
Object value = valueConverter.toValue(text, rule.getName(), node);
text = valueConverter.toString(value, rule.getName());
return text;
} | [
"protected",
"String",
"getFormattedDatatypeValue",
"(",
"ICompositeNode",
"node",
",",
"AbstractRule",
"rule",
",",
"String",
"text",
")",
"throws",
"ValueConverterException",
"{",
"Object",
"value",
"=",
"valueConverter",
".",
"toValue",
"(",
"text",
",",
"rule",
... | Create a canonical represenation of the data type value. Defaults to the value converter.
@since 2.9 | [
"Create",
"a",
"canonical",
"represenation",
"of",
"the",
"data",
"type",
"value",
".",
"Defaults",
"to",
"the",
"value",
"converter",
"."
] | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext/src/org/eclipse/xtext/formatting/impl/NodeModelStreamer.java#L163-L167 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/UniversalTimeScale.java | UniversalTimeScale.getTimeScaleValue | public static long getTimeScaleValue(int scale, int value) {
"""
Get a value associated with a particular time scale.
@param scale - the time scale
@param value - a constant representing the value to get
@return - the value.
"""
TimeScaleData data = getTimeScaleData(scale);
swit... | java | public static long getTimeScaleValue(int scale, int value)
{
TimeScaleData data = getTimeScaleData(scale);
switch (value)
{
case UNITS_VALUE:
return data.units;
case EPOCH_OFFSET_VALUE:
return data.epochOffset;
ca... | [
"public",
"static",
"long",
"getTimeScaleValue",
"(",
"int",
"scale",
",",
"int",
"value",
")",
"{",
"TimeScaleData",
"data",
"=",
"getTimeScaleData",
"(",
"scale",
")",
";",
"switch",
"(",
"value",
")",
"{",
"case",
"UNITS_VALUE",
":",
"return",
"data",
"... | Get a value associated with a particular time scale.
@param scale - the time scale
@param value - a constant representing the value to get
@return - the value. | [
"Get",
"a",
"value",
"associated",
"with",
"a",
"particular",
"time",
"scale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/UniversalTimeScale.java#L518-L560 |
foundation-runtime/service-directory | 1.2/sd-core/src/main/java/com/cisco/oss/foundation/directory/utils/ServiceInstanceUtils.java | ServiceInstanceUtils.validateRequiredField | public static boolean validateRequiredField(String field, String reg) {
"""
Validate the required field String against the regex.
@param field
the field value String.
@param reg
the regex.
@return true if matched.
"""
return !(field == null || field.isEmpty()) && Pattern.matches(reg, field);
... | java | public static boolean validateRequiredField(String field, String reg) {
return !(field == null || field.isEmpty()) && Pattern.matches(reg, field);
} | [
"public",
"static",
"boolean",
"validateRequiredField",
"(",
"String",
"field",
",",
"String",
"reg",
")",
"{",
"return",
"!",
"(",
"field",
"==",
"null",
"||",
"field",
".",
"isEmpty",
"(",
")",
")",
"&&",
"Pattern",
".",
"matches",
"(",
"reg",
",",
"... | Validate the required field String against the regex.
@param field
the field value String.
@param reg
the regex.
@return true if matched. | [
"Validate",
"the",
"required",
"field",
"String",
"against",
"the",
"regex",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/1.2/sd-core/src/main/java/com/cisco/oss/foundation/directory/utils/ServiceInstanceUtils.java#L125-L127 |
elki-project/elki | elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/rdknn/RdKNNNode.java | RdKNNNode.integrityCheckParameters | @Override
protected void integrityCheckParameters(RdKNNNode parent, int index) {
"""
Tests, if the parameters of the entry representing this node, are correctly
set. Subclasses may need to overwrite this method.
@param parent the parent holding the entry representing this node
@param index the index of the ... | java | @Override
protected void integrityCheckParameters(RdKNNNode parent, int index) {
super.integrityCheckParameters(parent, index);
// test if knn distance is correctly set
RdKNNEntry entry = parent.getEntry(index);
double knnDistance = kNNDistance();
if(entry.getKnnDistance() != knnDistance) {
... | [
"@",
"Override",
"protected",
"void",
"integrityCheckParameters",
"(",
"RdKNNNode",
"parent",
",",
"int",
"index",
")",
"{",
"super",
".",
"integrityCheckParameters",
"(",
"parent",
",",
"index",
")",
";",
"// test if knn distance is correctly set",
"RdKNNEntry",
"ent... | Tests, if the parameters of the entry representing this node, are correctly
set. Subclasses may need to overwrite this method.
@param parent the parent holding the entry representing this node
@param index the index of the entry in the parents child array | [
"Tests",
"if",
"the",
"parameters",
"of",
"the",
"entry",
"representing",
"this",
"node",
"are",
"correctly",
"set",
".",
"Subclasses",
"may",
"need",
"to",
"overwrite",
"this",
"method",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/rdknn/RdKNNNode.java#L82-L93 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/Identity.java | Identity.valueOf | public static Identity valueOf(String identityStr) {
"""
Converts a string to an {@code Identity}. Used primarily for converting protobuf-generated
policy identities to {@code Identity} objects.
"""
String[] info = identityStr.split(":");
Type type = Type.valueOf(CaseFormat.LOWER_CAMEL.to(CaseFormat.U... | java | public static Identity valueOf(String identityStr) {
String[] info = identityStr.split(":");
Type type = Type.valueOf(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, info[0]));
if (info.length == 1) {
return new Identity(type, null);
} else if (info.length == 2) {
return new Identity(... | [
"public",
"static",
"Identity",
"valueOf",
"(",
"String",
"identityStr",
")",
"{",
"String",
"[",
"]",
"info",
"=",
"identityStr",
".",
"split",
"(",
"\":\"",
")",
";",
"Type",
"type",
"=",
"Type",
".",
"valueOf",
"(",
"CaseFormat",
".",
"LOWER_CAMEL",
"... | Converts a string to an {@code Identity}. Used primarily for converting protobuf-generated
policy identities to {@code Identity} objects. | [
"Converts",
"a",
"string",
"to",
"an",
"{"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/Identity.java#L257-L267 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java | JSONHelpers.hasPoint | public static <P extends Enum<P>> boolean hasPoint(final JSONObject json, P e) {
"""
Checks whether the value mapped by enum exists, is a {@link JSONObject}, has at least one
field named either "x" or "y", and that if either field is present, it is a number. If at
least one of the fields is present, it can be a... | java | public static <P extends Enum<P>> boolean hasPoint(final JSONObject json, P e) {
Object o = opt(json, e);
return o != null && o != JSONObject.NULL && o instanceof JSONObject &&
isPoint((JSONObject) o);
} | [
"public",
"static",
"<",
"P",
"extends",
"Enum",
"<",
"P",
">",
">",
"boolean",
"hasPoint",
"(",
"final",
"JSONObject",
"json",
",",
"P",
"e",
")",
"{",
"Object",
"o",
"=",
"opt",
"(",
"json",
",",
"e",
")",
";",
"return",
"o",
"!=",
"null",
"&&"... | Checks whether the value mapped by enum exists, is a {@link JSONObject}, has at least one
field named either "x" or "y", and that if either field is present, it is a number. If at
least one of the fields is present, it can be assumed that the missing field is defaulted to
zero. If both are missing, it's ambiguous, at... | [
"Checks",
"whether",
"the",
"value",
"mapped",
"by",
"enum",
"exists",
"is",
"a",
"{",
"@link",
"JSONObject",
"}",
"has",
"at",
"least",
"one",
"field",
"named",
"either",
"x",
"or",
"y",
"and",
"that",
"if",
"either",
"field",
"is",
"present",
"it",
"... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java#L716-L720 |
google/closure-compiler | src/com/google/javascript/jscomp/J2clConstantHoisterPass.java | J2clConstantHoisterPass.isHoistableFunction | private static boolean isHoistableFunction(NodeTraversal t, Node node) {
"""
Returns whether the specified rValue is a function which does not receive any variables from
its containing scope, and is thus 'hoistable'.
"""
// TODO(michaelthomas): This could be improved slightly by not assuming that any vari... | java | private static boolean isHoistableFunction(NodeTraversal t, Node node) {
// TODO(michaelthomas): This could be improved slightly by not assuming that any variable in the
// outer scope is used in the function.
return node.isFunction() && t.getScope().getVarCount() == 0;
} | [
"private",
"static",
"boolean",
"isHoistableFunction",
"(",
"NodeTraversal",
"t",
",",
"Node",
"node",
")",
"{",
"// TODO(michaelthomas): This could be improved slightly by not assuming that any variable in the",
"// outer scope is used in the function.",
"return",
"node",
".",
"is... | Returns whether the specified rValue is a function which does not receive any variables from
its containing scope, and is thus 'hoistable'. | [
"Returns",
"whether",
"the",
"specified",
"rValue",
"is",
"a",
"function",
"which",
"does",
"not",
"receive",
"any",
"variables",
"from",
"its",
"containing",
"scope",
"and",
"is",
"thus",
"hoistable",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/J2clConstantHoisterPass.java#L73-L77 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/RuntimeExceptionsFactory.java | RuntimeExceptionsFactory.newTypeNotPresentException | public static TypeNotPresentException newTypeNotPresentException(Throwable cause, String message, Object... args) {
"""
Constructs and initializes a new {@link TypeNotPresentException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param ... | java | public static TypeNotPresentException newTypeNotPresentException(Throwable cause, String message, Object... args) {
return new TypeNotPresentException(format(message, args), cause);
} | [
"public",
"static",
"TypeNotPresentException",
"newTypeNotPresentException",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"TypeNotPresentException",
"(",
"format",
"(",
"message",
",",
"args",
")",
"... | Constructs and initializes a new {@link TypeNotPresentException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throwable} identified as the reason this {@link TypeNotPresentException} was thrown.
@param message {@link String} ... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"TypeNotPresentException",
"}",
"with",
"the",
"given",
"{",
"@link",
"Throwable",
"cause",
"}",
"and",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/RuntimeExceptionsFactory.java#L239-L241 |
jenkinsci/jenkins | core/src/main/java/hudson/PluginManager.java | PluginManager.containsHpiJpi | private boolean containsHpiJpi(Collection<String> bundledPlugins, String name) {
"""
/*
contains operation that considers xxx.hpi and xxx.jpi as equal
this is necessary since the bundled plugins are still called *.hpi
"""
return bundledPlugins.contains(name.replaceAll("\\.hpi",".jpi"))
... | java | private boolean containsHpiJpi(Collection<String> bundledPlugins, String name) {
return bundledPlugins.contains(name.replaceAll("\\.hpi",".jpi"))
|| bundledPlugins.contains(name.replaceAll("\\.jpi",".hpi"));
} | [
"private",
"boolean",
"containsHpiJpi",
"(",
"Collection",
"<",
"String",
">",
"bundledPlugins",
",",
"String",
"name",
")",
"{",
"return",
"bundledPlugins",
".",
"contains",
"(",
"name",
".",
"replaceAll",
"(",
"\"\\\\.hpi\"",
",",
"\".jpi\"",
")",
")",
"||",... | /*
contains operation that considers xxx.hpi and xxx.jpi as equal
this is necessary since the bundled plugins are still called *.hpi | [
"/",
"*",
"contains",
"operation",
"that",
"considers",
"xxx",
".",
"hpi",
"and",
"xxx",
".",
"jpi",
"as",
"equal",
"this",
"is",
"necessary",
"since",
"the",
"bundled",
"plugins",
"are",
"still",
"called",
"*",
".",
"hpi"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/PluginManager.java#L835-L838 |
Netflix/netflix-graph | src/main/java/com/netflix/nfgraph/NFGraph.java | NFGraph.getConnectionSet | public OrdinalSet getConnectionSet(String nodeType, int ordinal, String propertyName) {
"""
Retrieve an {@link OrdinalSet} over all connected ordinals, given the type and ordinal of the originating node, and the property by which this node is connected.
@return an {@link OrdinalSet} over all connected ordinals
... | java | public OrdinalSet getConnectionSet(String nodeType, int ordinal, String propertyName) {
return getConnectionSet(0, nodeType, ordinal, propertyName);
} | [
"public",
"OrdinalSet",
"getConnectionSet",
"(",
"String",
"nodeType",
",",
"int",
"ordinal",
",",
"String",
"propertyName",
")",
"{",
"return",
"getConnectionSet",
"(",
"0",
",",
"nodeType",
",",
"ordinal",
",",
"propertyName",
")",
";",
"}"
] | Retrieve an {@link OrdinalSet} over all connected ordinals, given the type and ordinal of the originating node, and the property by which this node is connected.
@return an {@link OrdinalSet} over all connected ordinals | [
"Retrieve",
"an",
"{",
"@link",
"OrdinalSet",
"}",
"over",
"all",
"connected",
"ordinals",
"given",
"the",
"type",
"and",
"ordinal",
"of",
"the",
"originating",
"node",
"and",
"the",
"property",
"by",
"which",
"this",
"node",
"is",
"connected",
"."
] | train | https://github.com/Netflix/netflix-graph/blob/ee129252a08a9f51dd296d6fca2f0b28b7be284e/src/main/java/com/netflix/nfgraph/NFGraph.java#L144-L146 |
elki-project/elki | elki-index-preprocessed/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/knn/NNDescent.java | NNDescent.clearAll | private void clearAll(DBIDs ids, WritableDataStore<HashSetModifiableDBIDs> sets) {
"""
Clear (but reuse) all sets in the given storage.
@param ids Ids to process
@param sets Sets to clear
"""
for(DBIDIter it = ids.iter(); it.valid(); it.advance()) {
sets.get(it).clear();
}
} | java | private void clearAll(DBIDs ids, WritableDataStore<HashSetModifiableDBIDs> sets) {
for(DBIDIter it = ids.iter(); it.valid(); it.advance()) {
sets.get(it).clear();
}
} | [
"private",
"void",
"clearAll",
"(",
"DBIDs",
"ids",
",",
"WritableDataStore",
"<",
"HashSetModifiableDBIDs",
">",
"sets",
")",
"{",
"for",
"(",
"DBIDIter",
"it",
"=",
"ids",
".",
"iter",
"(",
")",
";",
"it",
".",
"valid",
"(",
")",
";",
"it",
".",
"a... | Clear (but reuse) all sets in the given storage.
@param ids Ids to process
@param sets Sets to clear | [
"Clear",
"(",
"but",
"reuse",
")",
"all",
"sets",
"in",
"the",
"given",
"storage",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-preprocessed/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/knn/NNDescent.java#L269-L273 |
FINRAOS/JTAF-ExtWebDriver | src/main/java/org/finra/jtaf/ewd/properties/GUIHierarchyConcatenationProperties.java | GUIHierarchyConcatenationProperties.getPropertyValue | public String getPropertyValue(String key, String... parameters) {
"""
Searches over the group of {@code GUIProperties} for a property
corresponding to the given key.
@param key
key to be found
@param parameters
instances of the {@code String} literal <code>"{n}"</code> in
the retrieved value will be repla... | java | public String getPropertyValue(String key, String... parameters) {
return getPropertyValue(new String[] { key }, parameters);
} | [
"public",
"String",
"getPropertyValue",
"(",
"String",
"key",
",",
"String",
"...",
"parameters",
")",
"{",
"return",
"getPropertyValue",
"(",
"new",
"String",
"[",
"]",
"{",
"key",
"}",
",",
"parameters",
")",
";",
"}"
] | Searches over the group of {@code GUIProperties} for a property
corresponding to the given key.
@param key
key to be found
@param parameters
instances of the {@code String} literal <code>"{n}"</code> in
the retrieved value will be replaced by {@code params[n]}
@return the first property found associated with a concate... | [
"Searches",
"over",
"the",
"group",
"of",
"{",
"@code",
"GUIProperties",
"}",
"for",
"a",
"property",
"corresponding",
"to",
"the",
"given",
"key",
"."
] | train | https://github.com/FINRAOS/JTAF-ExtWebDriver/blob/78d646def1bf0904f79b19a81df0241e07f2c73a/src/main/java/org/finra/jtaf/ewd/properties/GUIHierarchyConcatenationProperties.java#L237-L239 |
couchbase/java-dcp-client | src/main/java/com/couchbase/client/dcp/transport/netty/DcpMessageHandler.java | DcpMessageHandler.userEventTriggered | @Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
"""
Close dead connection in response to idle event from IdleStateHandler.
"""
if (evt instanceof IdleStateEvent) {
IdleStateEvent e = (IdleStateEvent) evt;
if (e.state() == IdleState.READER_IDL... | java | @Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
if (evt instanceof IdleStateEvent) {
IdleStateEvent e = (IdleStateEvent) evt;
if (e.state() == IdleState.READER_IDLE) {
LOGGER.warn("Closing dead connection.");
ctx.close();
retur... | [
"@",
"Override",
"public",
"void",
"userEventTriggered",
"(",
"ChannelHandlerContext",
"ctx",
",",
"Object",
"evt",
")",
"throws",
"Exception",
"{",
"if",
"(",
"evt",
"instanceof",
"IdleStateEvent",
")",
"{",
"IdleStateEvent",
"e",
"=",
"(",
"IdleStateEvent",
")... | Close dead connection in response to idle event from IdleStateHandler. | [
"Close",
"dead",
"connection",
"in",
"response",
"to",
"idle",
"event",
"from",
"IdleStateHandler",
"."
] | train | https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/transport/netty/DcpMessageHandler.java#L323-L335 |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java | ReceiveMessageBuilder.extractFromPayload | public T extractFromPayload(String path, String variable) {
"""
Extract message element via XPath or JSONPath from message payload as new test variable.
@param path
@param variable
@return
"""
if (JsonPathMessageValidationContext.isJsonPathExpression(path)) {
getJsonPathVariableExtractor... | java | public T extractFromPayload(String path, String variable) {
if (JsonPathMessageValidationContext.isJsonPathExpression(path)) {
getJsonPathVariableExtractor().getJsonPathExpressions().put(path, variable);
} else {
getXpathVariableExtractor().getXpathExpressions().put(path, variabl... | [
"public",
"T",
"extractFromPayload",
"(",
"String",
"path",
",",
"String",
"variable",
")",
"{",
"if",
"(",
"JsonPathMessageValidationContext",
".",
"isJsonPathExpression",
"(",
"path",
")",
")",
"{",
"getJsonPathVariableExtractor",
"(",
")",
".",
"getJsonPathExpres... | Extract message element via XPath or JSONPath from message payload as new test variable.
@param path
@param variable
@return | [
"Extract",
"message",
"element",
"via",
"XPath",
"or",
"JSONPath",
"from",
"message",
"payload",
"as",
"new",
"test",
"variable",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L795-L802 |
graphql-java/graphql-java | src/main/java/graphql/execution/ExecutionStrategy.java | ExecutionStrategy.resolveFieldWithInfo | protected CompletableFuture<FieldValueInfo> resolveFieldWithInfo(ExecutionContext executionContext, ExecutionStrategyParameters parameters) {
"""
Called to fetch a value for a field and its extra runtime info and resolve it further in terms of the graphql query. This will call
#fetchField followed by #completeFi... | java | protected CompletableFuture<FieldValueInfo> resolveFieldWithInfo(ExecutionContext executionContext, ExecutionStrategyParameters parameters) {
GraphQLFieldDefinition fieldDef = getFieldDef(executionContext, parameters, parameters.getField().getSingleField());
Instrumentation instrumentation = executionC... | [
"protected",
"CompletableFuture",
"<",
"FieldValueInfo",
">",
"resolveFieldWithInfo",
"(",
"ExecutionContext",
"executionContext",
",",
"ExecutionStrategyParameters",
"parameters",
")",
"{",
"GraphQLFieldDefinition",
"fieldDef",
"=",
"getFieldDef",
"(",
"executionContext",
",... | Called to fetch a value for a field and its extra runtime info and resolve it further in terms of the graphql query. This will call
#fetchField followed by #completeField and the completed {@link graphql.execution.FieldValueInfo} is returned.
<p>
An execution strategy can iterate the fields to be executed and call thi... | [
"Called",
"to",
"fetch",
"a",
"value",
"for",
"a",
"field",
"and",
"its",
"extra",
"runtime",
"info",
"and",
"resolve",
"it",
"further",
"in",
"terms",
"of",
"the",
"graphql",
"query",
".",
"This",
"will",
"call",
"#fetchField",
"followed",
"by",
"#complet... | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/execution/ExecutionStrategy.java#L189-L206 |
phax/ph-oton | ph-oton-security/src/main/java/com/helger/photon/security/util/SecurityHelper.java | SecurityHelper.getUserDisplayName | @Nullable
public static String getUserDisplayName (@Nullable final String sUserID, @Nonnull final Locale aDisplayLocale) {
"""
Get the display name of the user.
@param sUserID
User ID. May be <code>null</code>.
@param aDisplayLocale
The display locale to be used.
@return The "guest" text if no user ID was... | java | @Nullable
public static String getUserDisplayName (@Nullable final String sUserID, @Nonnull final Locale aDisplayLocale)
{
if (StringHelper.hasNoText (sUserID))
return getGuestUserDisplayName (aDisplayLocale);
final IUser aUser = PhotonSecurityManager.getUserMgr ().getUserOfID (sUserID);
return a... | [
"@",
"Nullable",
"public",
"static",
"String",
"getUserDisplayName",
"(",
"@",
"Nullable",
"final",
"String",
"sUserID",
",",
"@",
"Nonnull",
"final",
"Locale",
"aDisplayLocale",
")",
"{",
"if",
"(",
"StringHelper",
".",
"hasNoText",
"(",
"sUserID",
")",
")",
... | Get the display name of the user.
@param sUserID
User ID. May be <code>null</code>.
@param aDisplayLocale
The display locale to be used.
@return The "guest" text if no user ID was provided, the display name of
the user if a valid user ID was provided or the ID of the user if
an invalid user was provided. | [
"Get",
"the",
"display",
"name",
"of",
"the",
"user",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-security/src/main/java/com/helger/photon/security/util/SecurityHelper.java#L164-L172 |
buschmais/jqa-maven3-plugin | src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java | MavenProjectScannerPlugin.resolveProject | protected <T extends MavenProjectDescriptor> T resolveProject(MavenProject project, Class<T> expectedType, ScannerContext scannerContext) {
"""
Resolves a maven project.
@param project
The project
@param expectedType
The expected descriptor type.
@param scannerContext
The scanner context.
@param <T>
The ... | java | protected <T extends MavenProjectDescriptor> T resolveProject(MavenProject project, Class<T> expectedType, ScannerContext scannerContext) {
Store store = scannerContext.getStore();
String id = project.getGroupId() + ":" + project.getArtifactId() + ":" + project.getVersion();
MavenProjectDescript... | [
"protected",
"<",
"T",
"extends",
"MavenProjectDescriptor",
">",
"T",
"resolveProject",
"(",
"MavenProject",
"project",
",",
"Class",
"<",
"T",
">",
"expectedType",
",",
"ScannerContext",
"scannerContext",
")",
"{",
"Store",
"store",
"=",
"scannerContext",
".",
... | Resolves a maven project.
@param project
The project
@param expectedType
The expected descriptor type.
@param scannerContext
The scanner context.
@param <T>
The expected descriptor type.
@return The maven project descriptor. | [
"Resolves",
"a",
"maven",
"project",
"."
] | train | https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java#L140-L156 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/util/StringUtil.java | StringUtil.fromBytes | public static String fromBytes(byte[] bytes, ProcessEngine processEngine) {
"""
converts a byte array into a string using the provided process engine's default charset as
returned by {@link ProcessEngineConfigurationImpl#getDefaultCharset()}
@param bytes the byte array
@param processEngine the process engine
... | java | public static String fromBytes(byte[] bytes, ProcessEngine processEngine) {
ProcessEngineConfigurationImpl processEngineConfiguration = ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration();
Charset charset = processEngineConfiguration.getDefaultCharset();
return new String(bytes, charset);
... | [
"public",
"static",
"String",
"fromBytes",
"(",
"byte",
"[",
"]",
"bytes",
",",
"ProcessEngine",
"processEngine",
")",
"{",
"ProcessEngineConfigurationImpl",
"processEngineConfiguration",
"=",
"(",
"(",
"ProcessEngineImpl",
")",
"processEngine",
")",
".",
"getProcessE... | converts a byte array into a string using the provided process engine's default charset as
returned by {@link ProcessEngineConfigurationImpl#getDefaultCharset()}
@param bytes the byte array
@param processEngine the process engine
@return a string representing the bytes | [
"converts",
"a",
"byte",
"array",
"into",
"a",
"string",
"using",
"the",
"provided",
"process",
"engine",
"s",
"default",
"charset",
"as",
"returned",
"by",
"{",
"@link",
"ProcessEngineConfigurationImpl#getDefaultCharset",
"()",
"}"
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/util/StringUtil.java#L123-L127 |
NessComputing/syslog4j | src/main/java/com/nesscomputing/syslog4j/util/Base64.java | Base64.decode4to3 | private static int decode4to3( byte[] source, int srcOffset, byte[] destination, int destOffset, int options ) {
"""
Decodes four bytes from array <var>source</var>
and writes the resulting bytes (up to three of them)
to <var>destination</var>.
The source and destination arrays can be manipulated
anywhere alon... | java | private static int decode4to3( byte[] source, int srcOffset, byte[] destination, int destOffset, int options )
{
byte[] DECODABET = getDecodabet( options );
// Example: Dk==
if( source[ srcOffset + 2] == EQUALS_SIGN )
{
// Two ways to do the same thing. Don't know... | [
"private",
"static",
"int",
"decode4to3",
"(",
"byte",
"[",
"]",
"source",
",",
"int",
"srcOffset",
",",
"byte",
"[",
"]",
"destination",
",",
"int",
"destOffset",
",",
"int",
"options",
")",
"{",
"byte",
"[",
"]",
"DECODABET",
"=",
"getDecodabet",
"(",
... | Decodes four bytes from array <var>source</var>
and writes the resulting bytes (up to three of them)
to <var>destination</var>.
The source and destination arrays can be manipulated
anywhere along their length by specifying
<var>srcOffset</var> and <var>destOffset</var>.
This method does not check to make sure your arra... | [
"Decodes",
"four",
"bytes",
"from",
"array",
"<var",
">",
"source<",
"/",
"var",
">",
"and",
"writes",
"the",
"resulting",
"bytes",
"(",
"up",
"to",
"three",
"of",
"them",
")",
"to",
"<var",
">",
"destination<",
"/",
"var",
">",
".",
"The",
"source",
... | train | https://github.com/NessComputing/syslog4j/blob/698fe4ce926cfc46524329d089052507cdb8cba4/src/main/java/com/nesscomputing/syslog4j/util/Base64.java#L776-L837 |
spring-cloud/spring-cloud-sleuth | spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/messaging/TracingChannelInterceptor.java | TracingChannelInterceptor.addTags | void addTags(Message<?> message, SpanCustomizer result, MessageChannel channel) {
"""
When an upstream context was not present, lookup keys are unlikely added.
@param message a message to append tags to
@param result span to customize
@param channel channel to which a message was sent
"""
// TODO topic et... | java | void addTags(Message<?> message, SpanCustomizer result, MessageChannel channel) {
// TODO topic etc
if (channel != null) {
result.tag("channel", messageChannelName(channel));
}
} | [
"void",
"addTags",
"(",
"Message",
"<",
"?",
">",
"message",
",",
"SpanCustomizer",
"result",
",",
"MessageChannel",
"channel",
")",
"{",
"// TODO topic etc",
"if",
"(",
"channel",
"!=",
"null",
")",
"{",
"result",
".",
"tag",
"(",
"\"channel\"",
",",
"mes... | When an upstream context was not present, lookup keys are unlikely added.
@param message a message to append tags to
@param result span to customize
@param channel channel to which a message was sent | [
"When",
"an",
"upstream",
"context",
"was",
"not",
"present",
"lookup",
"keys",
"are",
"unlikely",
"added",
"."
] | train | https://github.com/spring-cloud/spring-cloud-sleuth/blob/f29c05fb8fba33e23aa21bb13aeb13ab8d27b485/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/messaging/TracingChannelInterceptor.java#L353-L358 |
JavaMoney/jsr354-ri | moneta-core/src/main/java/org/javamoney/moneta/function/MonetaryFunctions.java | MonetaryFunctions.max | static MonetaryAmount max(MonetaryAmount a, MonetaryAmount b) {
"""
Returns the greater of two {@code MonetaryAmount} values. If the
arguments have the same value, the result is that same value.
@param a an argument.
@param b another argument.
@return the larger of {@code a} and {@code b}.
"""
Mone... | java | static MonetaryAmount max(MonetaryAmount a, MonetaryAmount b) {
MoneyUtils.checkAmountParameter(Objects.requireNonNull(a), Objects.requireNonNull(b.getCurrency()));
return a.isGreaterThan(b) ? a : b;
} | [
"static",
"MonetaryAmount",
"max",
"(",
"MonetaryAmount",
"a",
",",
"MonetaryAmount",
"b",
")",
"{",
"MoneyUtils",
".",
"checkAmountParameter",
"(",
"Objects",
".",
"requireNonNull",
"(",
"a",
")",
",",
"Objects",
".",
"requireNonNull",
"(",
"b",
".",
"getCurr... | Returns the greater of two {@code MonetaryAmount} values. If the
arguments have the same value, the result is that same value.
@param a an argument.
@param b another argument.
@return the larger of {@code a} and {@code b}. | [
"Returns",
"the",
"greater",
"of",
"two",
"{"
] | train | https://github.com/JavaMoney/jsr354-ri/blob/cf8ff2bbaf9b115acc05eb9b0c76c8397c308284/moneta-core/src/main/java/org/javamoney/moneta/function/MonetaryFunctions.java#L297-L300 |
apereo/cas | core/cas-server-core-authentication-mfa-api/src/main/java/org/apereo/cas/authentication/bypass/BaseMultifactorAuthenticationProviderBypass.java | BaseMultifactorAuthenticationProviderBypass.locateMatchingAttributeValue | protected static boolean locateMatchingAttributeValue(final String attrName, final String attrValue,
final Map<String, List<Object>> attributes) {
"""
Locate matching attribute value boolean.
@param attrName the attr name
@param attrValue the attr va... | java | protected static boolean locateMatchingAttributeValue(final String attrName, final String attrValue,
final Map<String, List<Object>> attributes) {
return locateMatchingAttributeValue(attrName, attrValue, attributes, true);
} | [
"protected",
"static",
"boolean",
"locateMatchingAttributeValue",
"(",
"final",
"String",
"attrName",
",",
"final",
"String",
"attrValue",
",",
"final",
"Map",
"<",
"String",
",",
"List",
"<",
"Object",
">",
">",
"attributes",
")",
"{",
"return",
"locateMatching... | Locate matching attribute value boolean.
@param attrName the attr name
@param attrValue the attr value
@param attributes the attributes
@return true/false | [
"Locate",
"matching",
"attribute",
"value",
"boolean",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-authentication-mfa-api/src/main/java/org/apereo/cas/authentication/bypass/BaseMultifactorAuthenticationProviderBypass.java#L88-L91 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularRotate_F64.java | EquirectangularRotate_F64.setEquirectangularShape | @Override
public void setEquirectangularShape( int width , int height ) {
"""
Specifies the image's width and height
@param width Image width
@param height Image height
"""
super.setEquirectangularShape(width, height);
declareVectors(width, height);
// precompute vectors for each pixel
for (int y... | java | @Override
public void setEquirectangularShape( int width , int height ) {
super.setEquirectangularShape(width, height);
declareVectors(width, height);
// precompute vectors for each pixel
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
tools.equiToNormFV(x,y,vectors[y*width+x]);
... | [
"@",
"Override",
"public",
"void",
"setEquirectangularShape",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"super",
".",
"setEquirectangularShape",
"(",
"width",
",",
"height",
")",
";",
"declareVectors",
"(",
"width",
",",
"height",
")",
";",
"// pr... | Specifies the image's width and height
@param width Image width
@param height Image height | [
"Specifies",
"the",
"image",
"s",
"width",
"and",
"height"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularRotate_F64.java#L35-L46 |
alkacon/opencms-core | src/org/opencms/db/generic/CmsVfsDriver.java | CmsVfsDriver.getPreparedStatementForFilter | PreparedStatement getPreparedStatementForFilter(Connection conn, String baseQuery, CmsUrlNameMappingFilter filter)
throws SQLException {
"""
Creates a prepared statement by combining a base query with the generated SQL conditions for a given
URL name mapping filter.<p>
@param conn the connection to use for... | java | PreparedStatement getPreparedStatementForFilter(Connection conn, String baseQuery, CmsUrlNameMappingFilter filter)
throws SQLException {
CmsPair<String, List<I_CmsPreparedStatementParameter>> conditionData = prepareUrlNameMappingConditions(filter);
String whereClause = "";
if (!conditionDat... | [
"PreparedStatement",
"getPreparedStatementForFilter",
"(",
"Connection",
"conn",
",",
"String",
"baseQuery",
",",
"CmsUrlNameMappingFilter",
"filter",
")",
"throws",
"SQLException",
"{",
"CmsPair",
"<",
"String",
",",
"List",
"<",
"I_CmsPreparedStatementParameter",
">",
... | Creates a prepared statement by combining a base query with the generated SQL conditions for a given
URL name mapping filter.<p>
@param conn the connection to use for creating the prepared statement
@param baseQuery the base query to which the conditions should be appended
@param filter the filter from which to genera... | [
"Creates",
"a",
"prepared",
"statement",
"by",
"combining",
"a",
"base",
"query",
"with",
"the",
"generated",
"SQL",
"conditions",
"for",
"a",
"given",
"URL",
"name",
"mapping",
"filter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsVfsDriver.java#L4742-L4758 |
JOML-CI/JOML | src/org/joml/AABBd.java | AABBd.intersectRay | public boolean intersectRay(double originX, double originY, double originZ, double dirX, double dirY, double dirZ, Vector2d result) {
"""
Determine whether the given ray with the origin <code>(originX, originY, originZ)</code> and direction <code>(dirX, dirY, dirZ)</code>
intersects this AABB, and return the valu... | java | public boolean intersectRay(double originX, double originY, double originZ, double dirX, double dirY, double dirZ, Vector2d result) {
return Intersectiond.intersectRayAab(originX, originY, originZ, dirX, dirY, dirZ, minX, minY, minZ, maxX, maxY, maxZ, result);
} | [
"public",
"boolean",
"intersectRay",
"(",
"double",
"originX",
",",
"double",
"originY",
",",
"double",
"originZ",
",",
"double",
"dirX",
",",
"double",
"dirY",
",",
"double",
"dirZ",
",",
"Vector2d",
"result",
")",
"{",
"return",
"Intersectiond",
".",
"inte... | Determine whether the given ray with the origin <code>(originX, originY, originZ)</code> and direction <code>(dirX, dirY, dirZ)</code>
intersects this AABB, and return the values of the parameter <i>t</i> in the ray equation
<i>p(t) = origin + t * dir</i> of the near and far point of intersection.
<p>
This method retur... | [
"Determine",
"whether",
"the",
"given",
"ray",
"with",
"the",
"origin",
"<code",
">",
"(",
"originX",
"originY",
"originZ",
")",
"<",
"/",
"code",
">",
"and",
"direction",
"<code",
">",
"(",
"dirX",
"dirY",
"dirZ",
")",
"<",
"/",
"code",
">",
"intersec... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/AABBd.java#L453-L455 |
apache/spark | common/network-common/src/main/java/org/apache/spark/network/crypto/AuthEngine.java | AuthEngine.checkSubArray | private void checkSubArray(byte[] test, byte[] data, int offset) {
"""
Checks that the "test" array is in the data array starting at the given offset.
"""
Preconditions.checkArgument(data.length >= test.length + offset);
for (int i = 0; i < test.length; i++) {
Preconditions.checkArgument(test[i] ... | java | private void checkSubArray(byte[] test, byte[] data, int offset) {
Preconditions.checkArgument(data.length >= test.length + offset);
for (int i = 0; i < test.length; i++) {
Preconditions.checkArgument(test[i] == data[i + offset]);
}
} | [
"private",
"void",
"checkSubArray",
"(",
"byte",
"[",
"]",
"test",
",",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"data",
".",
"length",
">=",
"test",
".",
"length",
"+",
"offset",
")",
";",
... | Checks that the "test" array is in the data array starting at the given offset. | [
"Checks",
"that",
"the",
"test",
"array",
"is",
"in",
"the",
"data",
"array",
"starting",
"at",
"the",
"given",
"offset",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/crypto/AuthEngine.java#L308-L313 |
aws/aws-sdk-java | aws-java-sdk-datapipeline/src/main/java/com/amazonaws/services/datapipeline/model/TaskObject.java | TaskObject.withObjects | public TaskObject withObjects(java.util.Map<String, PipelineObject> objects) {
"""
<p>
Connection information for the location where the task runner will publish the output of the task.
</p>
@param objects
Connection information for the location where the task runner will publish the output of the task.
@re... | java | public TaskObject withObjects(java.util.Map<String, PipelineObject> objects) {
setObjects(objects);
return this;
} | [
"public",
"TaskObject",
"withObjects",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"PipelineObject",
">",
"objects",
")",
"{",
"setObjects",
"(",
"objects",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Connection information for the location where the task runner will publish the output of the task.
</p>
@param objects
Connection information for the location where the task runner will publish the output of the task.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Connection",
"information",
"for",
"the",
"location",
"where",
"the",
"task",
"runner",
"will",
"publish",
"the",
"output",
"of",
"the",
"task",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-datapipeline/src/main/java/com/amazonaws/services/datapipeline/model/TaskObject.java#L225-L228 |
fullcontact/hadoop-sstable | sstable-core/src/main/java/com/fullcontact/sstable/util/CQLUtil.java | CQLUtil.parseCreateStatement | public static CFMetaData parseCreateStatement(String cql) throws RequestValidationException {
"""
Parses a CQL CREATE statement into its CFMetaData object
@param cql
@return CFMetaData
@throws RequestValidationException if CQL is invalid
"""
final CreateColumnFamilyStatement statement =
... | java | public static CFMetaData parseCreateStatement(String cql) throws RequestValidationException {
final CreateColumnFamilyStatement statement =
(CreateColumnFamilyStatement) QueryProcessor.parseStatement(cql).prepare().statement;
final CFMetaData cfm =
new CFMetaData("assess... | [
"public",
"static",
"CFMetaData",
"parseCreateStatement",
"(",
"String",
"cql",
")",
"throws",
"RequestValidationException",
"{",
"final",
"CreateColumnFamilyStatement",
"statement",
"=",
"(",
"CreateColumnFamilyStatement",
")",
"QueryProcessor",
".",
"parseStatement",
"(",... | Parses a CQL CREATE statement into its CFMetaData object
@param cql
@return CFMetaData
@throws RequestValidationException if CQL is invalid | [
"Parses",
"a",
"CQL",
"CREATE",
"statement",
"into",
"its",
"CFMetaData",
"object"
] | train | https://github.com/fullcontact/hadoop-sstable/blob/1189c2cb3a2cbbe03b75fda1cf02698e6283dfb2/sstable-core/src/main/java/com/fullcontact/sstable/util/CQLUtil.java#L22-L31 |
ykrasik/jaci | jaci-cli-core/src/main/java/com/github/ykrasik/jaci/cli/directory/CliDirectory.java | CliDirectory.autoCompleteDirectory | public AutoComplete autoCompleteDirectory(String prefix) {
"""
Auto complete the given prefix with child directory possibilities.
@param prefix Prefix to offer auto complete for.
@return Auto complete for child {@link CliDirectory}s that starts with the given prefix. Case insensitive.
"""
final Tri... | java | public AutoComplete autoCompleteDirectory(String prefix) {
final Trie<CliValueType> possibilities = childDirectories.subTrie(prefix).mapValues(CliValueType.DIRECTORY.<CliDirectory>getMapper());
return new AutoComplete(prefix, possibilities);
} | [
"public",
"AutoComplete",
"autoCompleteDirectory",
"(",
"String",
"prefix",
")",
"{",
"final",
"Trie",
"<",
"CliValueType",
">",
"possibilities",
"=",
"childDirectories",
".",
"subTrie",
"(",
"prefix",
")",
".",
"mapValues",
"(",
"CliValueType",
".",
"DIRECTORY",
... | Auto complete the given prefix with child directory possibilities.
@param prefix Prefix to offer auto complete for.
@return Auto complete for child {@link CliDirectory}s that starts with the given prefix. Case insensitive. | [
"Auto",
"complete",
"the",
"given",
"prefix",
"with",
"child",
"directory",
"possibilities",
"."
] | train | https://github.com/ykrasik/jaci/blob/4615edef7c76288ad5ea8d678132b161645ca1e3/jaci-cli-core/src/main/java/com/github/ykrasik/jaci/cli/directory/CliDirectory.java#L122-L125 |
mangstadt/biweekly | src/main/java/biweekly/io/scribe/property/RecurrencePropertyScribe.java | RecurrencePropertyScribe.integerValueOf | private static Integer integerValueOf(String value) {
"""
Same as {@link Integer#valueOf(String)}, but throws a
{@link CannotParseException} when it fails.
@param value the string to parse
@return the parse integer
@throws CannotParseException if the string cannot be parsed
"""
try {
return Integer.va... | java | private static Integer integerValueOf(String value) {
try {
return Integer.valueOf(value);
} catch (NumberFormatException e) {
throw new CannotParseException(40, value);
}
} | [
"private",
"static",
"Integer",
"integerValueOf",
"(",
"String",
"value",
")",
"{",
"try",
"{",
"return",
"Integer",
".",
"valueOf",
"(",
"value",
")",
";",
"}",
"catch",
"(",
"NumberFormatException",
"e",
")",
"{",
"throw",
"new",
"CannotParseException",
"(... | Same as {@link Integer#valueOf(String)}, but throws a
{@link CannotParseException} when it fails.
@param value the string to parse
@return the parse integer
@throws CannotParseException if the string cannot be parsed | [
"Same",
"as",
"{"
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/property/RecurrencePropertyScribe.java#L550-L556 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/internal/InternalUtils.java | InternalUtils.getQualifiedBundleName | public static String getQualifiedBundleName( String bundleName, ServletRequest request ) {
"""
Qualify the given bundle name with the current module path to return a full bundle name.
@return the qualified Bundle name
"""
if ( bundleName != null )
{
if ( bundleName.indexOf( '/' )... | java | public static String getQualifiedBundleName( String bundleName, ServletRequest request )
{
if ( bundleName != null )
{
if ( bundleName.indexOf( '/' ) == -1 )
{
ModuleConfig mc = ( ModuleConfig ) request.getAttribute( Globals.MODULE_KEY );
// N... | [
"public",
"static",
"String",
"getQualifiedBundleName",
"(",
"String",
"bundleName",
",",
"ServletRequest",
"request",
")",
"{",
"if",
"(",
"bundleName",
"!=",
"null",
")",
"{",
"if",
"(",
"bundleName",
".",
"indexOf",
"(",
"'",
"'",
")",
"==",
"-",
"1",
... | Qualify the given bundle name with the current module path to return a full bundle name.
@return the qualified Bundle name | [
"Qualify",
"the",
"given",
"bundle",
"name",
"with",
"the",
"current",
"module",
"path",
"to",
"return",
"a",
"full",
"bundle",
"name",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/internal/InternalUtils.java#L1220-L1243 |
cqframework/clinical_quality_language | Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/Cql2ElmVisitor.java | Cql2ElmVisitor.consolidateAnd | private Expression consolidateAnd(And and) {
"""
If any branches in the <code>And</code> tree contain a <code>true</code>, refactor it out.
@param and the <code>And</code> tree to attempt to consolidate
@return the potentially consolidated <code>And</code>
"""
Expression result = and;
Expre... | java | private Expression consolidateAnd(And and) {
Expression result = and;
Expression lhs = and.getOperand().get(0);
Expression rhs = and.getOperand().get(1);
if (isBooleanLiteral(lhs, true)) {
result = rhs;
} else if (isBooleanLiteral(rhs, true)) {
result = lh... | [
"private",
"Expression",
"consolidateAnd",
"(",
"And",
"and",
")",
"{",
"Expression",
"result",
"=",
"and",
";",
"Expression",
"lhs",
"=",
"and",
".",
"getOperand",
"(",
")",
".",
"get",
"(",
"0",
")",
";",
"Expression",
"rhs",
"=",
"and",
".",
"getOpe... | If any branches in the <code>And</code> tree contain a <code>true</code>, refactor it out.
@param and the <code>And</code> tree to attempt to consolidate
@return the potentially consolidated <code>And</code> | [
"If",
"any",
"branches",
"in",
"the",
"<code",
">",
"And<",
"/",
"code",
">",
"tree",
"contain",
"a",
"<code",
">",
"true<",
"/",
"code",
">",
"refactor",
"it",
"out",
"."
] | train | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/Cql2ElmVisitor.java#L3114-L3129 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.createBuildVariable | public GitlabBuildVariable createBuildVariable(Integer projectId, GitlabBuildVariable variable)
throws IOException {
"""
Creates a new variable.
@param projectId The ID of the project containing the variable.
@param variable The variable to create.
@return The newly created variable.
"""
... | java | public GitlabBuildVariable createBuildVariable(Integer projectId, GitlabBuildVariable variable)
throws IOException {
String key = variable.getKey();
String value = variable.getValue();
return createBuildVariable(projectId, key, value);
} | [
"public",
"GitlabBuildVariable",
"createBuildVariable",
"(",
"Integer",
"projectId",
",",
"GitlabBuildVariable",
"variable",
")",
"throws",
"IOException",
"{",
"String",
"key",
"=",
"variable",
".",
"getKey",
"(",
")",
";",
"String",
"value",
"=",
"variable",
".",... | Creates a new variable.
@param projectId The ID of the project containing the variable.
@param variable The variable to create.
@return The newly created variable. | [
"Creates",
"a",
"new",
"variable",
"."
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L3692-L3697 |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/util/StringUtils.java | StringUtils.appendCompactedString | public static void appendCompactedString(final StringBuilder destination, final String source) {
"""
This method appends a string to a string builder and collapses contiguous
white space is a single space.
This is equivalent to:
destination.append(source.replaceAll("\\s+", " "))
but does not create a Pattern... | java | public static void appendCompactedString(final StringBuilder destination, final String source) {
boolean previousIsWhiteSpace = false;
int length = source.length();
for (int i = 0; i < length; i++) {
char ch = source.charAt(i);
if (isWhiteSpace(ch)) {
if ... | [
"public",
"static",
"void",
"appendCompactedString",
"(",
"final",
"StringBuilder",
"destination",
",",
"final",
"String",
"source",
")",
"{",
"boolean",
"previousIsWhiteSpace",
"=",
"false",
";",
"int",
"length",
"=",
"source",
".",
"length",
"(",
")",
";",
"... | This method appends a string to a string builder and collapses contiguous
white space is a single space.
This is equivalent to:
destination.append(source.replaceAll("\\s+", " "))
but does not create a Pattern object that needs to compile the match
string; it also prevents us from having to make a Matcher object as wel... | [
"This",
"method",
"appends",
"a",
"string",
"to",
"a",
"string",
"builder",
"and",
"collapses",
"contiguous",
"white",
"space",
"is",
"a",
"single",
"space",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/util/StringUtils.java#L300-L317 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.