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 |
|---|---|---|---|---|---|---|---|---|---|---|
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/GlobalizationPreferences.java | GlobalizationPreferences.setBreakIterator | public GlobalizationPreferences setBreakIterator(int type, BreakIterator iterator) {
"""
Explicitly set the break iterator for this object.
@param type break type - BI_CHARACTER or BI_WORD, BI_LINE, BI_SENTENCE, BI_TITLE
@param iterator a break iterator
@return this, for chaining
@hide draft / provisional / ... | java | public GlobalizationPreferences setBreakIterator(int type, BreakIterator iterator) {
if (type < BI_CHARACTER || type >= BI_LIMIT) {
throw new IllegalArgumentException("Illegal break iterator type");
}
if (isFrozen()) {
throw new UnsupportedOperationException("Attempt to m... | [
"public",
"GlobalizationPreferences",
"setBreakIterator",
"(",
"int",
"type",
",",
"BreakIterator",
"iterator",
")",
"{",
"if",
"(",
"type",
"<",
"BI_CHARACTER",
"||",
"type",
">=",
"BI_LIMIT",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Illegal ... | Explicitly set the break iterator for this object.
@param type break type - BI_CHARACTER or BI_WORD, BI_LINE, BI_SENTENCE, BI_TITLE
@param iterator a break iterator
@return this, for chaining
@hide draft / provisional / internal are hidden on Android | [
"Explicitly",
"set",
"the",
"break",
"iterator",
"for",
"this",
"object",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/GlobalizationPreferences.java#L514-L525 |
mojohaus/jaxb2-maven-plugin | src/main/java/org/codehaus/mojo/jaxb2/shared/FileSystemUtilities.java | FileSystemUtilities.getFileFor | public static File getFileFor(final URL anURL, final String encoding) {
"""
Acquires the file for a supplied URL, provided that its protocol is is either a file or a jar.
@param anURL a non-null URL.
@param encoding The encoding to be used by the URLDecoder to decode the path found.
@return The File pointi... | java | public static File getFileFor(final URL anURL, final String encoding) {
// Check sanity
Validate.notNull(anURL, "anURL");
Validate.notNull(encoding, "encoding");
final String protocol = anURL.getProtocol();
File toReturn = null;
if ("file".equalsIgnoreCase(protocol)) {
... | [
"public",
"static",
"File",
"getFileFor",
"(",
"final",
"URL",
"anURL",
",",
"final",
"String",
"encoding",
")",
"{",
"// Check sanity",
"Validate",
".",
"notNull",
"(",
"anURL",
",",
"\"anURL\"",
")",
";",
"Validate",
".",
"notNull",
"(",
"encoding",
",",
... | Acquires the file for a supplied URL, provided that its protocol is is either a file or a jar.
@param anURL a non-null URL.
@param encoding The encoding to be used by the URLDecoder to decode the path found.
@return The File pointing to the supplied URL, for file or jar protocol URLs and null otherwise. | [
"Acquires",
"the",
"file",
"for",
"a",
"supplied",
"URL",
"provided",
"that",
"its",
"protocol",
"is",
"is",
"either",
"a",
"file",
"or",
"a",
"jar",
"."
] | train | https://github.com/mojohaus/jaxb2-maven-plugin/blob/e3c4e47943b15282e5a6e850bbfb1588d8452a0a/src/main/java/org/codehaus/mojo/jaxb2/shared/FileSystemUtilities.java#L193-L236 |
respoke/respoke-sdk-android | respokeSDK/src/main/java/com/digium/respokesdk/RespokeCall.java | RespokeCall.startCall | public void startCall(final Context context, GLSurfaceView glView, boolean isAudioOnly) {
"""
Start the outgoing call process. This method is used internally by the SDK and should never be called directly from your client application
@param context An application context with which to access shared resourc... | java | public void startCall(final Context context, GLSurfaceView glView, boolean isAudioOnly) {
caller = true;
audioOnly = isAudioOnly;
if (directConnectionOnly) {
if (null == directConnection) {
actuallyAddDirectConnection();
}
directConnectionDid... | [
"public",
"void",
"startCall",
"(",
"final",
"Context",
"context",
",",
"GLSurfaceView",
"glView",
",",
"boolean",
"isAudioOnly",
")",
"{",
"caller",
"=",
"true",
";",
"audioOnly",
"=",
"isAudioOnly",
";",
"if",
"(",
"directConnectionOnly",
")",
"{",
"if",
"... | Start the outgoing call process. This method is used internally by the SDK and should never be called directly from your client application
@param context An application context with which to access shared resources
@param glView The GLSurfaceView on which to render video if applicable
@param isAudioOnly S... | [
"Start",
"the",
"outgoing",
"call",
"process",
".",
"This",
"method",
"is",
"used",
"internally",
"by",
"the",
"SDK",
"and",
"should",
"never",
"be",
"called",
"directly",
"from",
"your",
"client",
"application"
] | train | https://github.com/respoke/respoke-sdk-android/blob/34a15f0558d29b1f1bc8481bbc5c505e855e05ef/respokeSDK/src/main/java/com/digium/respokesdk/RespokeCall.java#L278-L306 |
jnr/jnr-x86asm | src/main/java/jnr/x86asm/SerializerIntrinsics.java | SerializerIntrinsics.j_short | public final void j_short(CONDITION cc, Label label, int hint) {
"""
! continues with the instruction following the Jcc instruction.
"""
// Adjust returned condition to jxx_short version.
_emitJcc(INST_CODE.valueOf(conditionToJCC(cc).ordinal() + INST_J_SHORT.ordinal() - INST_J.ordinal()), label, hint);... | java | public final void j_short(CONDITION cc, Label label, int hint)
{
// Adjust returned condition to jxx_short version.
_emitJcc(INST_CODE.valueOf(conditionToJCC(cc).ordinal() + INST_J_SHORT.ordinal() - INST_J.ordinal()), label, hint);
} | [
"public",
"final",
"void",
"j_short",
"(",
"CONDITION",
"cc",
",",
"Label",
"label",
",",
"int",
"hint",
")",
"{",
"// Adjust returned condition to jxx_short version.",
"_emitJcc",
"(",
"INST_CODE",
".",
"valueOf",
"(",
"conditionToJCC",
"(",
"cc",
")",
".",
"or... | ! continues with the instruction following the Jcc instruction. | [
"!",
"continues",
"with",
"the",
"instruction",
"following",
"the",
"Jcc",
"instruction",
"."
] | train | https://github.com/jnr/jnr-x86asm/blob/fdcf68fb3dae49e607a49e33399e3dad1ada5536/src/main/java/jnr/x86asm/SerializerIntrinsics.java#L779-L783 |
ops4j/org.ops4j.pax.exam2 | core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/war/WarBuilder.java | WarBuilder.toJar | private File toJar(File root) throws IOException {
"""
Creates a JAR file from the contents of the given root directory. The file is located in
a temporary directory and is named <code>${artifactId}-${version}.jar</code> according to
Maven conventions, if there is a {@code pom.properties} res... | java | private File toJar(File root) throws IOException {
String artifactName = findArtifactName(root);
File jar = new File(tempDir, artifactName);
ZipBuilder builder = new ZipBuilder(jar);
builder.addDirectory(root, "");
builder.close();
return jar;
} | [
"private",
"File",
"toJar",
"(",
"File",
"root",
")",
"throws",
"IOException",
"{",
"String",
"artifactName",
"=",
"findArtifactName",
"(",
"root",
")",
";",
"File",
"jar",
"=",
"new",
"File",
"(",
"tempDir",
",",
"artifactName",
")",
";",
"ZipBuilder",
"b... | Creates a JAR file from the contents of the given root directory. The file is located in
a temporary directory and is named <code>${artifactId}-${version}.jar</code> according to
Maven conventions, if there is a {@code pom.properties} resource located anywhere under
{@code META-INF/maven} defining t... | [
"Creates",
"a",
"JAR",
"file",
"from",
"the",
"contents",
"of",
"the",
"given",
"root",
"directory",
".",
"The",
"file",
"is",
"located",
"in",
"a",
"temporary",
"directory",
"and",
"is",
"named",
"<code",
">",
"${",
";",
"artifactId}",
";",
"-",
... | train | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/war/WarBuilder.java#L132-L139 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java | ScopedRequestImpl.addParameter | public void addParameter( String name, String value ) {
"""
Add a parameter to the request.
@param name the parameter name.
@param value the parameter value.
"""
if ( _additionalParameters == null )
{
_additionalParameters = new HashMap();
}
_additionalP... | java | public void addParameter( String name, String value )
{
if ( _additionalParameters == null )
{
_additionalParameters = new HashMap();
}
_additionalParameters.put( name, value );
} | [
"public",
"void",
"addParameter",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"_additionalParameters",
"==",
"null",
")",
"{",
"_additionalParameters",
"=",
"new",
"HashMap",
"(",
")",
";",
"}",
"_additionalParameters",
".",
"put",
"(... | Add a parameter to the request.
@param name the parameter name.
@param value the parameter value. | [
"Add",
"a",
"parameter",
"to",
"the",
"request",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/internal/ScopedRequestImpl.java#L184-L192 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java | MultiLayerNetwork.feedForwardToLayer | public List<INDArray> feedForwardToLayer(int layerNum, INDArray input) {
"""
Compute the activations from the input to the specified layer.<br>
To compute activations for all layers, use feedForward(...) methods<br>
Note: output list includes the original input. So list.get(0) is always the original input, and
... | java | public List<INDArray> feedForwardToLayer(int layerNum, INDArray input) {
try{
return ffToLayerActivationsDetached(false, FwdPassType.STANDARD, false, layerNum, input, mask, null, true);
} catch (OutOfMemoryError e) {
CrashReportingUtil.writeMemoryCrashDump(this, e);
t... | [
"public",
"List",
"<",
"INDArray",
">",
"feedForwardToLayer",
"(",
"int",
"layerNum",
",",
"INDArray",
"input",
")",
"{",
"try",
"{",
"return",
"ffToLayerActivationsDetached",
"(",
"false",
",",
"FwdPassType",
".",
"STANDARD",
",",
"false",
",",
"layerNum",
",... | Compute the activations from the input to the specified layer.<br>
To compute activations for all layers, use feedForward(...) methods<br>
Note: output list includes the original input. So list.get(0) is always the original input, and
list.get(i+1) is the activations of the ith layer.
@param layerNum Index of the last ... | [
"Compute",
"the",
"activations",
"from",
"the",
"input",
"to",
"the",
"specified",
"layer",
".",
"<br",
">",
"To",
"compute",
"activations",
"for",
"all",
"layers",
"use",
"feedForward",
"(",
"...",
")",
"methods<br",
">",
"Note",
":",
"output",
"list",
"i... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/multilayer/MultiLayerNetwork.java#L900-L907 |
structr/structr | structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java | HtmlServlet.findIndexPage | private Page findIndexPage(final SecurityContext securityContext, List<Page> pages, final EditMode edit) throws FrameworkException {
"""
Find the page with the lowest non-empty position value which is visible in the
current security context and for the given site.
@param securityContext
@param pages
@param e... | java | private Page findIndexPage(final SecurityContext securityContext, List<Page> pages, final EditMode edit) throws FrameworkException {
final PropertyKey<Integer> positionKey = StructrApp.key(Page.class, "position");
if (pages == null) {
pages = StructrApp.getInstance(securityContext).nodeQuery(Page.class).getAs... | [
"private",
"Page",
"findIndexPage",
"(",
"final",
"SecurityContext",
"securityContext",
",",
"List",
"<",
"Page",
">",
"pages",
",",
"final",
"EditMode",
"edit",
")",
"throws",
"FrameworkException",
"{",
"final",
"PropertyKey",
"<",
"Integer",
">",
"positionKey",
... | Find the page with the lowest non-empty position value which is visible in the
current security context and for the given site.
@param securityContext
@param pages
@param edit
@return page
@throws FrameworkException | [
"Find",
"the",
"page",
"with",
"the",
"lowest",
"non",
"-",
"empty",
"position",
"value",
"which",
"is",
"visible",
"in",
"the",
"current",
"security",
"context",
"and",
"for",
"the",
"given",
"site",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java#L1110-L1129 |
Netflix/Hystrix | hystrix-contrib/hystrix-javanica/src/main/java/com/netflix/hystrix/contrib/javanica/utils/AopUtils.java | AopUtils.getMethodFromTarget | public static Method getMethodFromTarget(JoinPoint joinPoint, String methodName) {
"""
Gets a {@link Method} object from target object by specified method name.
@param joinPoint the {@link JoinPoint}
@param methodName the method name
@return a {@link Method} object or null if method with specified <code>meth... | java | public static Method getMethodFromTarget(JoinPoint joinPoint, String methodName) {
return getDeclaredMethod(joinPoint.getTarget().getClass(), methodName,
getParameterTypes(joinPoint));
} | [
"public",
"static",
"Method",
"getMethodFromTarget",
"(",
"JoinPoint",
"joinPoint",
",",
"String",
"methodName",
")",
"{",
"return",
"getDeclaredMethod",
"(",
"joinPoint",
".",
"getTarget",
"(",
")",
".",
"getClass",
"(",
")",
",",
"methodName",
",",
"getParamet... | Gets a {@link Method} object from target object by specified method name.
@param joinPoint the {@link JoinPoint}
@param methodName the method name
@return a {@link Method} object or null if method with specified <code>methodName</code> doesn't exist | [
"Gets",
"a",
"{",
"@link",
"Method",
"}",
"object",
"from",
"target",
"object",
"by",
"specified",
"method",
"name",
"."
] | train | https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-contrib/hystrix-javanica/src/main/java/com/netflix/hystrix/contrib/javanica/utils/AopUtils.java#L63-L66 |
aol/cyclops | cyclops-futurestream/src/main/java/cyclops/futurestream/Pipes.java | Pipes.subscribeTo | public void subscribeTo(final K key, final Subscriber<V> subscriber, final Executor subscribeOn) {
"""
Subscribe asynchronously to a pipe
<pre>
{@code
SeqSubscriber<String> reactiveSubscriber = SeqSubscriber.reactiveSubscriber();
Queue<String> queue = new Queue();
pipes.register("hello", queue);
pipes.subs... | java | public void subscribeTo(final K key, final Subscriber<V> subscriber, final Executor subscribeOn) {
CompletableFuture.runAsync(() -> subscribeTo(key, subscriber), subscribeOn);
} | [
"public",
"void",
"subscribeTo",
"(",
"final",
"K",
"key",
",",
"final",
"Subscriber",
"<",
"V",
">",
"subscriber",
",",
"final",
"Executor",
"subscribeOn",
")",
"{",
"CompletableFuture",
".",
"runAsync",
"(",
"(",
")",
"->",
"subscribeTo",
"(",
"key",
","... | Subscribe asynchronously to a pipe
<pre>
{@code
SeqSubscriber<String> reactiveSubscriber = SeqSubscriber.reactiveSubscriber();
Queue<String> queue = new Queue();
pipes.register("hello", queue);
pipes.subscribeTo("hello",reactiveSubscriber,ForkJoinPool.commonPool());
queue.offer("world");
queue.close();
assertThat(rea... | [
"Subscribe",
"asynchronously",
"to",
"a",
"pipe"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops-futurestream/src/main/java/cyclops/futurestream/Pipes.java#L573-L576 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/guid/Guid.java | Guid.append | public Guid append(byte[]... byteArrays) throws IOException {
"""
Creates a new {@link Guid} which is a unique, replicable representation of the pair (this, byteArrays).
@param byteArrays an array of byte arrays.
@return a new {@link Guid}.
@throws IOException
"""
if (byteArrays == null || byteArrays.le... | java | public Guid append(byte[]... byteArrays) throws IOException {
if (byteArrays == null || byteArrays.length == 0) {
return this;
}
return fromByteArrays(ArrayUtils.add(byteArrays, this.sha));
} | [
"public",
"Guid",
"append",
"(",
"byte",
"[",
"]",
"...",
"byteArrays",
")",
"throws",
"IOException",
"{",
"if",
"(",
"byteArrays",
"==",
"null",
"||",
"byteArrays",
".",
"length",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"return",
"fromByteArray... | Creates a new {@link Guid} which is a unique, replicable representation of the pair (this, byteArrays).
@param byteArrays an array of byte arrays.
@return a new {@link Guid}.
@throws IOException | [
"Creates",
"a",
"new",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/guid/Guid.java#L148-L153 |
threerings/narya | tools/src/main/java/com/threerings/presents/tools/GeneratedSourceMerger.java | GeneratedSourceMerger.merge | public String merge (String newlyGenerated, String previouslyGenerated)
throws Exception {
"""
Returns <code>previouslyGenerated</code> with marked sections updated from the same marked
sections in <code>newlyGenerated</code>. Everything outside these sections in
<code>previouslyGenerated</code> is retur... | java | public String merge (String newlyGenerated, String previouslyGenerated)
throws Exception
{
// Extract the generated section names from the output and make sure they're all matched
Map<String, Section> sections = Maps.newLinkedHashMap();
Matcher m = _sectionDelimiter.matcher(newlyGene... | [
"public",
"String",
"merge",
"(",
"String",
"newlyGenerated",
",",
"String",
"previouslyGenerated",
")",
"throws",
"Exception",
"{",
"// Extract the generated section names from the output and make sure they're all matched",
"Map",
"<",
"String",
",",
"Section",
">",
"section... | Returns <code>previouslyGenerated</code> with marked sections updated from the same marked
sections in <code>newlyGenerated</code>. Everything outside these sections in
<code>previouslyGenerated</code> is returned as is. A marked section starts with <code>//
GENERATED {name} START</code> and ends with <code>// GENERATE... | [
"Returns",
"<code",
">",
"previouslyGenerated<",
"/",
"code",
">",
"with",
"marked",
"sections",
"updated",
"from",
"the",
"same",
"marked",
"sections",
"in",
"<code",
">",
"newlyGenerated<",
"/",
"code",
">",
".",
"Everything",
"outside",
"these",
"sections",
... | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/GeneratedSourceMerger.java#L46-L92 |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/extensions/ChocoUtils.java | ChocoUtils.postImplies | public static void postImplies(ReconfigurationProblem rp, BoolVar b1, Constraint c2) {
"""
Make and post an implies constraint where the first operand is a boolean: b1 -> c2.
The constraint is translated into (or(not(b1,c2))
@param rp the problem to solve
@param b1 the first constraint as boolean
@param c2 t... | java | public static void postImplies(ReconfigurationProblem rp, BoolVar b1, Constraint c2) {
Model s = rp.getModel();
BoolVar bC2 = s.boolVar(rp.makeVarLabel(c2.toString(), " satisfied"));
c2.reifyWith(bC2);
BoolVar notB1 = b1.not();
s.post(rp.getModel().arithm(b1, "!=", notB1));
... | [
"public",
"static",
"void",
"postImplies",
"(",
"ReconfigurationProblem",
"rp",
",",
"BoolVar",
"b1",
",",
"Constraint",
"c2",
")",
"{",
"Model",
"s",
"=",
"rp",
".",
"getModel",
"(",
")",
";",
"BoolVar",
"bC2",
"=",
"s",
".",
"boolVar",
"(",
"rp",
"."... | Make and post an implies constraint where the first operand is a boolean: b1 -> c2.
The constraint is translated into (or(not(b1,c2))
@param rp the problem to solve
@param b1 the first constraint as boolean
@param c2 the second constraint | [
"Make",
"and",
"post",
"an",
"implies",
"constraint",
"where",
"the",
"first",
"operand",
"is",
"a",
"boolean",
":",
"b1",
"-",
">",
"c2",
".",
"The",
"constraint",
"is",
"translated",
"into",
"(",
"or",
"(",
"not",
"(",
"b1",
"c2",
"))"
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/extensions/ChocoUtils.java#L45-L54 |
JodaOrg/joda-time | src/main/java/org/joda/time/field/FieldUtils.java | FieldUtils.safeDivide | public static long safeDivide(long dividend, long divisor) {
"""
Divides the dividend by the divisor throwing an exception if
overflow occurs or the divisor is zero.
@param dividend the dividend
@param divisor the divisor
@return the new total
@throws ArithmeticException if the operation overflows or the ... | java | public static long safeDivide(long dividend, long divisor) {
if (dividend == Long.MIN_VALUE && divisor == -1L) {
throw new ArithmeticException("Multiplication overflows a long: " + dividend + " / " + divisor);
}
return dividend / divisor;
} | [
"public",
"static",
"long",
"safeDivide",
"(",
"long",
"dividend",
",",
"long",
"divisor",
")",
"{",
"if",
"(",
"dividend",
"==",
"Long",
".",
"MIN_VALUE",
"&&",
"divisor",
"==",
"-",
"1L",
")",
"{",
"throw",
"new",
"ArithmeticException",
"(",
"\"Multiplic... | Divides the dividend by the divisor throwing an exception if
overflow occurs or the divisor is zero.
@param dividend the dividend
@param divisor the divisor
@return the new total
@throws ArithmeticException if the operation overflows or the divisor is zero | [
"Divides",
"the",
"dividend",
"by",
"the",
"divisor",
"throwing",
"an",
"exception",
"if",
"overflow",
"occurs",
"or",
"the",
"divisor",
"is",
"zero",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/FieldUtils.java#L191-L196 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Checker.java | Checker.isButtonChecked | public <T extends CompoundButton> boolean isButtonChecked(Class<T> expectedClass, int index) {
"""
Checks if a {@link CompoundButton} with a given index is checked.
@param expectedClass the expected class, e.g. {@code CheckBox.class} or {@code RadioButton.class}
@param index of the {@code CompoundButton} to ch... | java | public <T extends CompoundButton> boolean isButtonChecked(Class<T> expectedClass, int index)
{
return (waiter.waitForAndGetView(index, expectedClass).isChecked());
} | [
"public",
"<",
"T",
"extends",
"CompoundButton",
">",
"boolean",
"isButtonChecked",
"(",
"Class",
"<",
"T",
">",
"expectedClass",
",",
"int",
"index",
")",
"{",
"return",
"(",
"waiter",
".",
"waitForAndGetView",
"(",
"index",
",",
"expectedClass",
")",
".",
... | Checks if a {@link CompoundButton} with a given index is checked.
@param expectedClass the expected class, e.g. {@code CheckBox.class} or {@code RadioButton.class}
@param index of the {@code CompoundButton} to check. {@code 0} if only one is available
@return {@code true} if {@code CompoundButton} is checked and {@cod... | [
"Checks",
"if",
"a",
"{",
"@link",
"CompoundButton",
"}",
"with",
"a",
"given",
"index",
"is",
"checked",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Checker.java#L44-L47 |
zxing/zxing | core/src/main/java/com/google/zxing/datamatrix/DataMatrixReader.java | DataMatrixReader.extractPureBits | private static BitMatrix extractPureBits(BitMatrix image) throws NotFoundException {
"""
This method detects a code in a "pure" image -- that is, pure monochrome image
which contains only an unrotated, unskewed, image of a code, with some white border
around it. This is a specialized method that works exceptiona... | java | private static BitMatrix extractPureBits(BitMatrix image) throws NotFoundException {
int[] leftTopBlack = image.getTopLeftOnBit();
int[] rightBottomBlack = image.getBottomRightOnBit();
if (leftTopBlack == null || rightBottomBlack == null) {
throw NotFoundException.getNotFoundInstance();
}
in... | [
"private",
"static",
"BitMatrix",
"extractPureBits",
"(",
"BitMatrix",
"image",
")",
"throws",
"NotFoundException",
"{",
"int",
"[",
"]",
"leftTopBlack",
"=",
"image",
".",
"getTopLeftOnBit",
"(",
")",
";",
"int",
"[",
"]",
"rightBottomBlack",
"=",
"image",
".... | This method detects a code in a "pure" image -- that is, pure monochrome image
which contains only an unrotated, unskewed, image of a code, with some white border
around it. This is a specialized method that works exceptionally fast in this special
case. | [
"This",
"method",
"detects",
"a",
"code",
"in",
"a",
"pure",
"image",
"--",
"that",
"is",
"pure",
"monochrome",
"image",
"which",
"contains",
"only",
"an",
"unrotated",
"unskewed",
"image",
"of",
"a",
"code",
"with",
"some",
"white",
"border",
"around",
"i... | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/datamatrix/DataMatrixReader.java#L100-L139 |
spring-projects/spring-social | spring-social-security/src/main/java/org/springframework/social/security/SocialAuthenticationFilter.java | SocialAuthenticationFilter.setPostFailureUrl | public void setPostFailureUrl(String postFailureUrl) {
"""
The URL to redirect to if authentication fails or if authorization is denied by the user.
@param postFailureUrl The failure URL. Defaults to "/signin" (relative to the servlet context).
"""
AuthenticationFailureHandler failureHandler = getFailureHan... | java | public void setPostFailureUrl(String postFailureUrl) {
AuthenticationFailureHandler failureHandler = getFailureHandler();
if (failureHandler instanceof SocialAuthenticationFailureHandler) {
failureHandler = ((SocialAuthenticationFailureHandler)failureHandler).getDelegate();
}
if (failureHandler instanceof ... | [
"public",
"void",
"setPostFailureUrl",
"(",
"String",
"postFailureUrl",
")",
"{",
"AuthenticationFailureHandler",
"failureHandler",
"=",
"getFailureHandler",
"(",
")",
";",
"if",
"(",
"failureHandler",
"instanceof",
"SocialAuthenticationFailureHandler",
")",
"{",
"failure... | The URL to redirect to if authentication fails or if authorization is denied by the user.
@param postFailureUrl The failure URL. Defaults to "/signin" (relative to the servlet context). | [
"The",
"URL",
"to",
"redirect",
"to",
"if",
"authentication",
"fails",
"or",
"if",
"authorization",
"is",
"denied",
"by",
"the",
"user",
"."
] | train | https://github.com/spring-projects/spring-social/blob/e41cfecb288022b83c79413b58f52511c3c9d4fc/spring-social-security/src/main/java/org/springframework/social/security/SocialAuthenticationFilter.java#L140-L153 |
oboehm/jfachwert | src/main/java/de/jfachwert/pruefung/LengthValidator.java | LengthValidator.validate | public static String validate(String value, int min, int max) {
"""
Validiert die Laenge des uebergebenen Wertes.
@param value zu pruefender Wert
@param min geforderte Minimal-Laenge
@param max Maximal-Laenge
@return der gepruefte Wert (zur evtl. Weiterverarbeitung)
"""
if (min == max) {
... | java | public static String validate(String value, int min, int max) {
if (min == max) {
return validate(value, min);
}
if ((value.length() < min) || (value.length() > max)) {
throw new InvalidLengthException(value, min, max);
}
return value;
} | [
"public",
"static",
"String",
"validate",
"(",
"String",
"value",
",",
"int",
"min",
",",
"int",
"max",
")",
"{",
"if",
"(",
"min",
"==",
"max",
")",
"{",
"return",
"validate",
"(",
"value",
",",
"min",
")",
";",
"}",
"if",
"(",
"(",
"value",
"."... | Validiert die Laenge des uebergebenen Wertes.
@param value zu pruefender Wert
@param min geforderte Minimal-Laenge
@param max Maximal-Laenge
@return der gepruefte Wert (zur evtl. Weiterverarbeitung) | [
"Validiert",
"die",
"Laenge",
"des",
"uebergebenen",
"Wertes",
"."
] | train | https://github.com/oboehm/jfachwert/blob/67b513d29e3114c7aee65cd1ea7a5b7e540b0d1b/src/main/java/de/jfachwert/pruefung/LengthValidator.java#L106-L114 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.deleteHierarchicalEntityRoleAsync | public Observable<OperationStatus> deleteHierarchicalEntityRoleAsync(UUID appId, String versionId, UUID hEntityId, UUID roleId) {
"""
Delete an entity role.
@param appId The application ID.
@param versionId The version ID.
@param hEntityId The hierarchical entity extractor ID.
@param roleId The entity role I... | java | public Observable<OperationStatus> deleteHierarchicalEntityRoleAsync(UUID appId, String versionId, UUID hEntityId, UUID roleId) {
return deleteHierarchicalEntityRoleWithServiceResponseAsync(appId, versionId, hEntityId, roleId).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() {
@Ove... | [
"public",
"Observable",
"<",
"OperationStatus",
">",
"deleteHierarchicalEntityRoleAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"hEntityId",
",",
"UUID",
"roleId",
")",
"{",
"return",
"deleteHierarchicalEntityRoleWithServiceResponseAsync",
"(",
... | Delete an entity role.
@param appId The application ID.
@param versionId The version ID.
@param hEntityId The hierarchical entity extractor ID.
@param roleId The entity role Id.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the OperationStatus object | [
"Delete",
"an",
"entity",
"role",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L13494-L13501 |
aws/aws-cloudtrail-processing-library | src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java | AbstractEventSerializer.parseSessionContext | private void parseSessionContext(UserIdentity userIdentity) throws IOException {
"""
Parses the {@link SessionContext} object.
@param userIdentity the {@link com.amazonaws.services.cloudtrail.processinglibrary.model.internal.UserIdentity}
@throws IOException
@throws JsonParseException
"""
if (json... | java | private void parseSessionContext(UserIdentity userIdentity) throws IOException {
if (jsonParser.nextToken() != JsonToken.START_OBJECT) {
throw new JsonParseException("Not a SessionContext object", jsonParser.getCurrentLocation());
}
SessionContext sessionContext = new SessionContext... | [
"private",
"void",
"parseSessionContext",
"(",
"UserIdentity",
"userIdentity",
")",
"throws",
"IOException",
"{",
"if",
"(",
"jsonParser",
".",
"nextToken",
"(",
")",
"!=",
"JsonToken",
".",
"START_OBJECT",
")",
"{",
"throw",
"new",
"JsonParseException",
"(",
"\... | Parses the {@link SessionContext} object.
@param userIdentity the {@link com.amazonaws.services.cloudtrail.processinglibrary.model.internal.UserIdentity}
@throws IOException
@throws JsonParseException | [
"Parses",
"the",
"{",
"@link",
"SessionContext",
"}",
"object",
"."
] | train | https://github.com/aws/aws-cloudtrail-processing-library/blob/411315808d8d3dc6b45e4182212e3e04d82e3782/src/main/java/com/amazonaws/services/cloudtrail/processinglibrary/serializer/AbstractEventSerializer.java#L274-L302 |
spring-projects/spring-social | spring-social-security/src/main/java/org/springframework/social/security/SocialAuthenticationFilter.java | SocialAuthenticationFilter.requiresAuthentication | @Deprecated
protected boolean requiresAuthentication(HttpServletRequest request, HttpServletResponse response) {
"""
Indicates whether this filter should attempt to process a social network login request for the current invocation.
<p>Check if request URL matches filterProcessesUrl with valid providerId.
The UR... | java | @Deprecated
protected boolean requiresAuthentication(HttpServletRequest request, HttpServletResponse response) {
String providerId = getRequestedProviderId(request);
if (providerId != null){
Set<String> authProviders = authServiceLocator.registeredAuthenticationProviderIds();
return authProviders.contains(pr... | [
"@",
"Deprecated",
"protected",
"boolean",
"requiresAuthentication",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"{",
"String",
"providerId",
"=",
"getRequestedProviderId",
"(",
"request",
")",
";",
"if",
"(",
"providerId",
"!=",... | Indicates whether this filter should attempt to process a social network login request for the current invocation.
<p>Check if request URL matches filterProcessesUrl with valid providerId.
The URL must be like {filterProcessesUrl}/{providerId}.
@return <code>true</code> if the filter should attempt authentication, <cod... | [
"Indicates",
"whether",
"this",
"filter",
"should",
"attempt",
"to",
"process",
"a",
"social",
"network",
"login",
"request",
"for",
"the",
"current",
"invocation",
".",
"<p",
">",
"Check",
"if",
"request",
"URL",
"matches",
"filterProcessesUrl",
"with",
"valid"... | train | https://github.com/spring-projects/spring-social/blob/e41cfecb288022b83c79413b58f52511c3c9d4fc/spring-social-security/src/main/java/org/springframework/social/security/SocialAuthenticationFilter.java#L225-L233 |
powermock/powermock | powermock-core/src/main/java/org/powermock/core/MockRepository.java | MockRepository.putMethodToStub | public static synchronized Object putMethodToStub(Method method, Object value) {
"""
Set a substitute return value for a method. Whenever this method will be
called the {@code value} will be returned instead.
@return The previous substitute value if any.
"""
return substituteReturnValues.put(method, valu... | java | public static synchronized Object putMethodToStub(Method method, Object value) {
return substituteReturnValues.put(method, value);
} | [
"public",
"static",
"synchronized",
"Object",
"putMethodToStub",
"(",
"Method",
"method",
",",
"Object",
"value",
")",
"{",
"return",
"substituteReturnValues",
".",
"put",
"(",
"method",
",",
"value",
")",
";",
"}"
] | Set a substitute return value for a method. Whenever this method will be
called the {@code value} will be returned instead.
@return The previous substitute value if any. | [
"Set",
"a",
"substitute",
"return",
"value",
"for",
"a",
"method",
".",
"Whenever",
"this",
"method",
"will",
"be",
"called",
"the",
"{",
"@code",
"value",
"}",
"will",
"be",
"returned",
"instead",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-core/src/main/java/org/powermock/core/MockRepository.java#L364-L366 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/uri/BitcoinURI.java | BitcoinURI.putWithValidation | private void putWithValidation(String key, Object value) throws BitcoinURIParseException {
"""
Put the value against the key in the map checking for duplication. This avoids address field overwrite etc.
@param key The key for the map
@param value The value to store
"""
if (parameterMap.containsKey(... | java | private void putWithValidation(String key, Object value) throws BitcoinURIParseException {
if (parameterMap.containsKey(key)) {
throw new BitcoinURIParseException(String.format(Locale.US, "'%s' is duplicated, URI is invalid", key));
} else {
parameterMap.put(key, value);
... | [
"private",
"void",
"putWithValidation",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"throws",
"BitcoinURIParseException",
"{",
"if",
"(",
"parameterMap",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"throw",
"new",
"BitcoinURIParseException",
"(",
"Stri... | Put the value against the key in the map checking for duplication. This avoids address field overwrite etc.
@param key The key for the map
@param value The value to store | [
"Put",
"the",
"value",
"against",
"the",
"key",
"in",
"the",
"map",
"checking",
"for",
"duplication",
".",
"This",
"avoids",
"address",
"field",
"overwrite",
"etc",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/uri/BitcoinURI.java#L250-L256 |
contentful/contentful-management.java | src/main/java/com/contentful/java/cma/ModuleAssets.java | ModuleAssets.fetchAll | public CMAArray<CMAAsset> fetchAll(String spaceId, String environmentId) {
"""
Fetch all Assets from the given space and environment.
<p>
This fetch uses the default parameter defined in {@link DefaultQueryParameter#FETCH}
@param spaceId Space ID
@param environmentId Environment ID
@return {@link CMAA... | java | public CMAArray<CMAAsset> fetchAll(String spaceId, String environmentId) {
return fetchAll(spaceId, environmentId, new HashMap<>());
} | [
"public",
"CMAArray",
"<",
"CMAAsset",
">",
"fetchAll",
"(",
"String",
"spaceId",
",",
"String",
"environmentId",
")",
"{",
"return",
"fetchAll",
"(",
"spaceId",
",",
"environmentId",
",",
"new",
"HashMap",
"<>",
"(",
")",
")",
";",
"}"
] | Fetch all Assets from the given space and environment.
<p>
This fetch uses the default parameter defined in {@link DefaultQueryParameter#FETCH}
@param spaceId Space ID
@param environmentId Environment ID
@return {@link CMAArray} result instance
@throws IllegalArgumentException if spaceId is null.
@throws Illegal... | [
"Fetch",
"all",
"Assets",
"from",
"the",
"given",
"space",
"and",
"environment",
".",
"<p",
">",
"This",
"fetch",
"uses",
"the",
"default",
"parameter",
"defined",
"in",
"{",
"@link",
"DefaultQueryParameter#FETCH",
"}"
] | train | https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/ModuleAssets.java#L194-L196 |
dropwizard/metrics | metrics-healthchecks/src/main/java/com/codahale/metrics/health/SharedHealthCheckRegistries.java | SharedHealthCheckRegistries.setDefault | public synchronized static HealthCheckRegistry setDefault(String name) {
"""
Creates a new registry and sets it as the default one under the provided name.
@param name the registry name
@return the default registry
@throws IllegalStateException if the name has already been set
"""
final HealthChec... | java | public synchronized static HealthCheckRegistry setDefault(String name) {
final HealthCheckRegistry registry = getOrCreate(name);
return setDefault(name, registry);
} | [
"public",
"synchronized",
"static",
"HealthCheckRegistry",
"setDefault",
"(",
"String",
"name",
")",
"{",
"final",
"HealthCheckRegistry",
"registry",
"=",
"getOrCreate",
"(",
"name",
")",
";",
"return",
"setDefault",
"(",
"name",
",",
"registry",
")",
";",
"}"
] | Creates a new registry and sets it as the default one under the provided name.
@param name the registry name
@return the default registry
@throws IllegalStateException if the name has already been set | [
"Creates",
"a",
"new",
"registry",
"and",
"sets",
"it",
"as",
"the",
"default",
"one",
"under",
"the",
"provided",
"name",
"."
] | train | https://github.com/dropwizard/metrics/blob/3c6105a0b9b4416c59e16b6b841b123052d6f57d/metrics-healthchecks/src/main/java/com/codahale/metrics/health/SharedHealthCheckRegistries.java#L60-L63 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java | SerializedFormBuilder.buildSerializableMethods | public void buildSerializableMethods(XMLNode node, Content classContentTree) throws DocletException {
"""
Build the summaries for the methods that belong to the given
class.
@param node the XML element that specifies which components to document
@param classContentTree content tree to which the documentation ... | java | public void buildSerializableMethods(XMLNode node, Content classContentTree) throws DocletException {
Content serializableMethodTree = methodWriter.getSerializableMethodsHeader();
SortedSet<ExecutableElement> members = utils.serializationMethods(currentTypeElement);
if (!members.isEmpty()) {
... | [
"public",
"void",
"buildSerializableMethods",
"(",
"XMLNode",
"node",
",",
"Content",
"classContentTree",
")",
"throws",
"DocletException",
"{",
"Content",
"serializableMethodTree",
"=",
"methodWriter",
".",
"getSerializableMethodsHeader",
"(",
")",
";",
"SortedSet",
"<... | Build the summaries for the methods that belong to the given
class.
@param node the XML element that specifies which components to document
@param classContentTree content tree to which the documentation will be added
@throws DocletException if there is a problem while building the documentation | [
"Build",
"the",
"summaries",
"for",
"the",
"methods",
"that",
"belong",
"to",
"the",
"given",
"class",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java#L288-L314 |
Netflix/Hystrix | hystrix-core/src/main/java/com/netflix/hystrix/strategy/executionhook/HystrixCommandExecutionHook.java | HystrixCommandExecutionHook.onRunError | @Deprecated
public <T> Exception onRunError(HystrixCommand<T> commandInstance, Exception e) {
"""
DEPRECATED: Change usages of this to {@link #onExecutionError}
Invoked after failed execution of {@link HystrixCommand#run()} with thrown Exception.
@param commandInstance
The executing HystrixCommand insta... | java | @Deprecated
public <T> Exception onRunError(HystrixCommand<T> commandInstance, Exception e) {
// pass-thru by default
return e;
} | [
"@",
"Deprecated",
"public",
"<",
"T",
">",
"Exception",
"onRunError",
"(",
"HystrixCommand",
"<",
"T",
">",
"commandInstance",
",",
"Exception",
"e",
")",
"{",
"// pass-thru by default",
"return",
"e",
";",
"}"
] | DEPRECATED: Change usages of this to {@link #onExecutionError}
Invoked after failed execution of {@link HystrixCommand#run()} with thrown Exception.
@param commandInstance
The executing HystrixCommand instance.
@param e
Exception thrown by {@link HystrixCommand#run()}
@return Exception that can be decorated, replaced... | [
"DEPRECATED",
":",
"Change",
"usages",
"of",
"this",
"to",
"{",
"@link",
"#onExecutionError",
"}"
] | train | https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/strategy/executionhook/HystrixCommandExecutionHook.java#L317-L321 |
eurekaclinical/eurekaclinical-common | src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java | EurekaClinicalClient.doGet | protected <T> T doGet(String path, Class<T> cls) throws ClientException {
"""
Gets the resource specified by the path. Sends to the server an Accepts
header for JSON.
@param <T> the type of the resource.
@param path the path to the resource. Cannot be <code>null</code>.
@param cls the type of the resource. C... | java | protected <T> T doGet(String path, Class<T> cls) throws ClientException {
return doGet(path, cls, null);
} | [
"protected",
"<",
"T",
">",
"T",
"doGet",
"(",
"String",
"path",
",",
"Class",
"<",
"T",
">",
"cls",
")",
"throws",
"ClientException",
"{",
"return",
"doGet",
"(",
"path",
",",
"cls",
",",
"null",
")",
";",
"}"
] | Gets the resource specified by the path. Sends to the server an Accepts
header for JSON.
@param <T> the type of the resource.
@param path the path to the resource. Cannot be <code>null</code>.
@param cls the type of the resource. Cannot be <code>null</code>.
@return the resource.
@throws ClientException if a status ... | [
"Gets",
"the",
"resource",
"specified",
"by",
"the",
"path",
".",
"Sends",
"to",
"the",
"server",
"an",
"Accepts",
"header",
"for",
"JSON",
"."
] | train | https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L225-L227 |
Waikato/moa | moa/src/main/java/moa/clusterers/streamkm/TreeCoreset.java | TreeCoreset.treeNodeCostOfPoint | double treeNodeCostOfPoint(treeNode node, Point p) {
"""
computes the cost of point p with the centre of treenode node
"""
if(p.weight == 0.0){
return 0.0;
}
//stores the distance between centre and p
double distance = 0.0;
//loop counter variable
int l;
for(l=0;l<p.dimension;l++){
//c... | java | double treeNodeCostOfPoint(treeNode node, Point p){
if(p.weight == 0.0){
return 0.0;
}
//stores the distance between centre and p
double distance = 0.0;
//loop counter variable
int l;
for(l=0;l<p.dimension;l++){
//centroid coordinate of the point
double centroidCoordinatePoint;
if(p.weigh... | [
"double",
"treeNodeCostOfPoint",
"(",
"treeNode",
"node",
",",
"Point",
"p",
")",
"{",
"if",
"(",
"p",
".",
"weight",
"==",
"0.0",
")",
"{",
"return",
"0.0",
";",
"}",
"//stores the distance between centre and p",
"double",
"distance",
"=",
"0.0",
";",
"//lo... | computes the cost of point p with the centre of treenode node | [
"computes",
"the",
"cost",
"of",
"point",
"p",
"with",
"the",
"centre",
"of",
"treenode",
"node"
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/clusterers/streamkm/TreeCoreset.java#L213-L244 |
gitblit/fathom | fathom-mailer/src/main/java/fathom/mailer/Mailer.java | Mailer.newTextMailRequest | public MailRequest newTextMailRequest(String subject, String body) {
"""
Creates a plain text MailRequest with the specified subject and body.
A request id is automatically generated.
@param subject
@param body
@return a text mail request
"""
return createMailRequest(generateRequestId(), false, s... | java | public MailRequest newTextMailRequest(String subject, String body) {
return createMailRequest(generateRequestId(), false, subject, body);
} | [
"public",
"MailRequest",
"newTextMailRequest",
"(",
"String",
"subject",
",",
"String",
"body",
")",
"{",
"return",
"createMailRequest",
"(",
"generateRequestId",
"(",
")",
",",
"false",
",",
"subject",
",",
"body",
")",
";",
"}"
] | Creates a plain text MailRequest with the specified subject and body.
A request id is automatically generated.
@param subject
@param body
@return a text mail request | [
"Creates",
"a",
"plain",
"text",
"MailRequest",
"with",
"the",
"specified",
"subject",
"and",
"body",
".",
"A",
"request",
"id",
"is",
"automatically",
"generated",
"."
] | train | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-mailer/src/main/java/fathom/mailer/Mailer.java#L97-L99 |
davidcarboni/cryptolite-java | src/main/java/com/github/davidcarboni/cryptolite/KeyWrapper.java | KeyWrapper.unwrapKeyPair | public KeyPair unwrapKeyPair(String wrappedPrivateKey, String encodedPublicKey) {
"""
Convenience method to unwrap a public-private key pain in a single call.
@param wrappedPrivateKey The wrapped key, base-64 encoded, as returned by
{@link #wrapPrivateKey(PrivateKey)}.
@param encodedPublicKey The public key,... | java | public KeyPair unwrapKeyPair(String wrappedPrivateKey, String encodedPublicKey) {
PrivateKey privateKey = unwrapPrivateKey(wrappedPrivateKey);
PublicKey publicKey = decodePublicKey(encodedPublicKey);
return new KeyPair(publicKey, privateKey);
} | [
"public",
"KeyPair",
"unwrapKeyPair",
"(",
"String",
"wrappedPrivateKey",
",",
"String",
"encodedPublicKey",
")",
"{",
"PrivateKey",
"privateKey",
"=",
"unwrapPrivateKey",
"(",
"wrappedPrivateKey",
")",
";",
"PublicKey",
"publicKey",
"=",
"decodePublicKey",
"(",
"enco... | Convenience method to unwrap a public-private key pain in a single call.
@param wrappedPrivateKey The wrapped key, base-64 encoded, as returned by
{@link #wrapPrivateKey(PrivateKey)}.
@param encodedPublicKey The public key, base-64 encoded, as returned by
{@link #encodePublicKey(PublicKey)}.
@return A {@link KeyPair}... | [
"Convenience",
"method",
"to",
"unwrap",
"a",
"public",
"-",
"private",
"key",
"pain",
"in",
"a",
"single",
"call",
"."
] | train | https://github.com/davidcarboni/cryptolite-java/blob/e67954181a04ffc9beb1d9abca1421195fcf9764/src/main/java/com/github/davidcarboni/cryptolite/KeyWrapper.java#L264-L269 |
glyptodon/guacamole-client | extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/RestrictedGuacamoleTunnelService.java | RestrictedGuacamoleTunnelService.tryIncrement | private boolean tryIncrement(AtomicInteger counter, int max) {
"""
Attempts to increment the given AtomicInteger without exceeding the
specified maximum value. If the AtomicInteger cannot be incremented
without exceeding the maximum, false is returned.
@param counter
The AtomicInteger to attempt to increment... | java | private boolean tryIncrement(AtomicInteger counter, int max) {
// Repeatedly attempt to increment the given AtomicInteger until we
// explicitly succeed or explicitly fail
while (true) {
// Get current value
int count = counter.get();
// Bail out if the max... | [
"private",
"boolean",
"tryIncrement",
"(",
"AtomicInteger",
"counter",
",",
"int",
"max",
")",
"{",
"// Repeatedly attempt to increment the given AtomicInteger until we",
"// explicitly succeed or explicitly fail",
"while",
"(",
"true",
")",
"{",
"// Get current value",
"int",
... | Attempts to increment the given AtomicInteger without exceeding the
specified maximum value. If the AtomicInteger cannot be incremented
without exceeding the maximum, false is returned.
@param counter
The AtomicInteger to attempt to increment.
@param max
The maximum value that the given AtomicInteger should contain, ... | [
"Attempts",
"to",
"increment",
"the",
"given",
"AtomicInteger",
"without",
"exceeding",
"the",
"specified",
"maximum",
"value",
".",
"If",
"the",
"AtomicInteger",
"cannot",
"be",
"incremented",
"without",
"exceeding",
"the",
"maximum",
"false",
"is",
"returned",
"... | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/RestrictedGuacamoleTunnelService.java#L149-L170 |
cdapio/tigon | tigon-hbase-compat-0.94/src/main/java/co/cask/tigon/data/transaction/queue/hbase/HBase94QueueConsumer.java | HBase94QueueConsumer.createStateFilter | private Filter createStateFilter() {
"""
Creates a HBase filter that will filter out rows with state column state = PROCESSED (ignoring transaction).
"""
byte[] processedMask = new byte[Ints.BYTES * 2 + 1];
processedMask[processedMask.length - 1] = ConsumerEntryState.PROCESSED.getState();
return ne... | java | private Filter createStateFilter() {
byte[] processedMask = new byte[Ints.BYTES * 2 + 1];
processedMask[processedMask.length - 1] = ConsumerEntryState.PROCESSED.getState();
return new SingleColumnValueFilter(QueueEntryRow.COLUMN_FAMILY, stateColumnName,
CompareFilter.C... | [
"private",
"Filter",
"createStateFilter",
"(",
")",
"{",
"byte",
"[",
"]",
"processedMask",
"=",
"new",
"byte",
"[",
"Ints",
".",
"BYTES",
"*",
"2",
"+",
"1",
"]",
";",
"processedMask",
"[",
"processedMask",
".",
"length",
"-",
"1",
"]",
"=",
"Consumer... | Creates a HBase filter that will filter out rows with state column state = PROCESSED (ignoring transaction). | [
"Creates",
"a",
"HBase",
"filter",
"that",
"will",
"filter",
"out",
"rows",
"with",
"state",
"column",
"state",
"=",
"PROCESSED",
"(",
"ignoring",
"transaction",
")",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-hbase-compat-0.94/src/main/java/co/cask/tigon/data/transaction/queue/hbase/HBase94QueueConsumer.java#L76-L82 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/spillover/spilloverpolicy_binding.java | spilloverpolicy_binding.get | public static spilloverpolicy_binding get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch spilloverpolicy_binding resource of given name .
"""
spilloverpolicy_binding obj = new spilloverpolicy_binding();
obj.set_name(name);
spilloverpolicy_binding response = (spilloverpol... | java | public static spilloverpolicy_binding get(nitro_service service, String name) throws Exception{
spilloverpolicy_binding obj = new spilloverpolicy_binding();
obj.set_name(name);
spilloverpolicy_binding response = (spilloverpolicy_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"spilloverpolicy_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"spilloverpolicy_binding",
"obj",
"=",
"new",
"spilloverpolicy_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"nam... | Use this API to fetch spilloverpolicy_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"spilloverpolicy_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/spillover/spilloverpolicy_binding.java#L125-L130 |
classgraph/classgraph | src/main/java/io/github/classgraph/ReferenceTypeSignature.java | ReferenceTypeSignature.parseClassBound | static ReferenceTypeSignature parseClassBound(final Parser parser, final String definingClassName)
throws ParseException {
"""
Parse a class bound.
@param parser
The parser.
@param definingClassName
The class containing the type descriptor.
@return The parsed class bound.
@throws ParseException... | java | static ReferenceTypeSignature parseClassBound(final Parser parser, final String definingClassName)
throws ParseException {
parser.expect(':');
// May return null if there is no signature after ':' (class bound signature may be empty)
return parseReferenceTypeSignature(parser, definin... | [
"static",
"ReferenceTypeSignature",
"parseClassBound",
"(",
"final",
"Parser",
"parser",
",",
"final",
"String",
"definingClassName",
")",
"throws",
"ParseException",
"{",
"parser",
".",
"expect",
"(",
"'",
"'",
")",
";",
"// May return null if there is no signature aft... | Parse a class bound.
@param parser
The parser.
@param definingClassName
The class containing the type descriptor.
@return The parsed class bound.
@throws ParseException
If the type signature could not be parsed. | [
"Parse",
"a",
"class",
"bound",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ReferenceTypeSignature.java#L83-L88 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/jboss/logging/Logger.java | Logger.fatalf | public void fatalf(String format, Object param1) {
"""
Issue a formatted log message with a level of FATAL.
@param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor
@param param1 the sole parameter
"""
if (isEnabled(Level.FATAL)) {
... | java | public void fatalf(String format, Object param1) {
if (isEnabled(Level.FATAL)) {
doLogf(Level.FATAL, FQCN, format, new Object[] { param1 }, null);
}
} | [
"public",
"void",
"fatalf",
"(",
"String",
"format",
",",
"Object",
"param1",
")",
"{",
"if",
"(",
"isEnabled",
"(",
"Level",
".",
"FATAL",
")",
")",
"{",
"doLogf",
"(",
"Level",
".",
"FATAL",
",",
"FQCN",
",",
"format",
",",
"new",
"Object",
"[",
... | Issue a formatted log message with a level of FATAL.
@param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor
@param param1 the sole parameter | [
"Issue",
"a",
"formatted",
"log",
"message",
"with",
"a",
"level",
"of",
"FATAL",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L1947-L1951 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/connect/DirectoryConnection.java | DirectoryConnection.queuePacket | private Packet queuePacket(ProtocolHeader header, Protocol protocol,
ProtocolCallback cb, Object context, ServiceDirectoryFuture future, WatcherRegistration wr) {
"""
Queue the Packet to Connection.
The DirectoryConnect Queue the Packet to the internal Queue and send it to remote
Directory Server.
... | java | private Packet queuePacket(ProtocolHeader header, Protocol protocol,
ProtocolCallback cb, Object context, ServiceDirectoryFuture future, WatcherRegistration wr)
{
Packet packet = new Packet(header, protocol, wr);
PacketLatency.initPacket(packet);
header.createTime = packet.create... | [
"private",
"Packet",
"queuePacket",
"(",
"ProtocolHeader",
"header",
",",
"Protocol",
"protocol",
",",
"ProtocolCallback",
"cb",
",",
"Object",
"context",
",",
"ServiceDirectoryFuture",
"future",
",",
"WatcherRegistration",
"wr",
")",
"{",
"Packet",
"packet",
"=",
... | Queue the Packet to Connection.
The DirectoryConnect Queue the Packet to the internal Queue and send it to remote
Directory Server.
@param header
the ProtocolHeader.
@param protocol
the Protocol.
@param cb
the Callback.
@param context
the context Object of the Callback.
@param future
the Future.
@param wr
WatcherRegi... | [
"Queue",
"the",
"Packet",
"to",
"Connection",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/connect/DirectoryConnection.java#L428-L466 |
code4everything/util | src/main/java/com/zhazhapan/util/LoggerUtils.java | LoggerUtils.fatal | public static void fatal(Class<?> clazz, String message, String... values) {
"""
严重错误
@param clazz 类
@param message 消息
@param values 格式化参数
@since 1.0.8
"""
getLogger(clazz).fatal(formatString(message, values));
} | java | public static void fatal(Class<?> clazz, String message, String... values) {
getLogger(clazz).fatal(formatString(message, values));
} | [
"public",
"static",
"void",
"fatal",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"message",
",",
"String",
"...",
"values",
")",
"{",
"getLogger",
"(",
"clazz",
")",
".",
"fatal",
"(",
"formatString",
"(",
"message",
",",
"values",
")",
")",
... | 严重错误
@param clazz 类
@param message 消息
@param values 格式化参数
@since 1.0.8 | [
"严重错误"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/LoggerUtils.java#L261-L263 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/MapView.java | MapView.setCurrentScale | public void setCurrentScale(final double newScale, final ZoomOption option) {
"""
Apply a new scale level on the map. In case the are fixed resolutions defined on this MapView, it will
automatically snap to the nearest resolution. In case the maximum extents are exceeded, it will pan to avoid
this.
@param new... | java | public void setCurrentScale(final double newScale, final ZoomOption option) {
setCurrentScale(newScale, option, new Coordinate(viewState.getX(), viewState.getY()));
} | [
"public",
"void",
"setCurrentScale",
"(",
"final",
"double",
"newScale",
",",
"final",
"ZoomOption",
"option",
")",
"{",
"setCurrentScale",
"(",
"newScale",
",",
"option",
",",
"new",
"Coordinate",
"(",
"viewState",
".",
"getX",
"(",
")",
",",
"viewState",
"... | Apply a new scale level on the map. In case the are fixed resolutions defined on this MapView, it will
automatically snap to the nearest resolution. In case the maximum extents are exceeded, it will pan to avoid
this.
@param newScale
The preferred new scale.
@param option
zoom option, {@link org.geomajas.gwt.client.ma... | [
"Apply",
"a",
"new",
"scale",
"level",
"on",
"the",
"map",
".",
"In",
"case",
"the",
"are",
"fixed",
"resolutions",
"defined",
"on",
"this",
"MapView",
"it",
"will",
"automatically",
"snap",
"to",
"the",
"nearest",
"resolution",
".",
"In",
"case",
"the",
... | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapView.java#L244-L246 |
cubedtear/aritzh | aritzh-core/src/main/java/io/github/aritzhack/aritzh/config/Configuration.java | Configuration.getDouble | public double getDouble(String category, String key) {
"""
Same as {@link Configuration#getProperty(String, String)}, but a double is parsed.
@param category The category of the property
@param key The key (identifier) of the property
@return the double value parsed from the property
"""
String val... | java | public double getDouble(String category, String key) {
String value = this.getProperty(category, key).toLowerCase().trim();
return Double.parseDouble(value);
} | [
"public",
"double",
"getDouble",
"(",
"String",
"category",
",",
"String",
"key",
")",
"{",
"String",
"value",
"=",
"this",
".",
"getProperty",
"(",
"category",
",",
"key",
")",
".",
"toLowerCase",
"(",
")",
".",
"trim",
"(",
")",
";",
"return",
"Doubl... | Same as {@link Configuration#getProperty(String, String)}, but a double is parsed.
@param category The category of the property
@param key The key (identifier) of the property
@return the double value parsed from the property | [
"Same",
"as",
"{",
"@link",
"Configuration#getProperty",
"(",
"String",
"String",
")",
"}",
"but",
"a",
"double",
"is",
"parsed",
"."
] | train | https://github.com/cubedtear/aritzh/blob/bc7493447a1a6088c4a7306ca4d0f0c20278364f/aritzh-core/src/main/java/io/github/aritzhack/aritzh/config/Configuration.java#L328-L331 |
openbase/jul | extension/protobuf/src/main/java/org/openbase/jul/extension/protobuf/processing/ProtoBufJSonProcessor.java | ProtoBufJSonProcessor.getServiceStateClassName | public String getServiceStateClassName(final Object serviceState) throws CouldNotPerformException {
"""
Get the string representation for a given serviceState which can be a
proto message, enumeration or a java primitive.
@param serviceState the serviceState
@return a string representation of the serviceSta... | java | public String getServiceStateClassName(final Object serviceState) throws CouldNotPerformException {
// todo: move to dal or any bco component. Jul should be independent from bco architecture.
if (serviceState.getClass().getName().startsWith("org.openbase.type")) {
return serviceState.getClas... | [
"public",
"String",
"getServiceStateClassName",
"(",
"final",
"Object",
"serviceState",
")",
"throws",
"CouldNotPerformException",
"{",
"// todo: move to dal or any bco component. Jul should be independent from bco architecture.",
"if",
"(",
"serviceState",
".",
"getClass",
"(",
... | Get the string representation for a given serviceState which can be a
proto message, enumeration or a java primitive.
@param serviceState the serviceState
@return a string representation of the serviceState type
@throws CouldNotPerformException | [
"Get",
"the",
"string",
"representation",
"for",
"a",
"given",
"serviceState",
"which",
"can",
"be",
"a",
"proto",
"message",
"enumeration",
"or",
"a",
"java",
"primitive",
"."
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/extension/protobuf/src/main/java/org/openbase/jul/extension/protobuf/processing/ProtoBufJSonProcessor.java#L91-L111 |
alipay/sofa-rpc | core/api/src/main/java/com/alipay/sofa/rpc/transport/ChannelContext.java | ChannelContext.invalidateHeadCache | public void invalidateHeadCache(Byte key, String value) {
"""
Invalidate head cache.
@param key the key
@param value the value
"""
if (headerCache != null && headerCache.containsKey(key)) {
String old = headerCache.get(key);
if (!old.equals(value)) {
throw ... | java | public void invalidateHeadCache(Byte key, String value) {
if (headerCache != null && headerCache.containsKey(key)) {
String old = headerCache.get(key);
if (!old.equals(value)) {
throw new SofaRpcRuntimeException("Value of old is not match current");
}
... | [
"public",
"void",
"invalidateHeadCache",
"(",
"Byte",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"headerCache",
"!=",
"null",
"&&",
"headerCache",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"String",
"old",
"=",
"headerCache",
".",
"get",
"(... | Invalidate head cache.
@param key the key
@param value the value | [
"Invalidate",
"head",
"cache",
"."
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/transport/ChannelContext.java#L83-L91 |
mapbox/mapbox-navigation-android | libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/MapboxNavigation.java | MapboxNavigation.startNavigation | public void startNavigation(@NonNull DirectionsRoute directionsRoute, @NonNull DirectionsRouteType routeType) {
"""
Calling this method with {@link DirectionsRouteType#NEW_ROUTE} begins a new navigation session using the
provided directions route. If called with {@link DirectionsRouteType#FRESH_ROUTE}, only leg ... | java | public void startNavigation(@NonNull DirectionsRoute directionsRoute, @NonNull DirectionsRouteType routeType) {
startNavigationWith(directionsRoute, routeType);
} | [
"public",
"void",
"startNavigation",
"(",
"@",
"NonNull",
"DirectionsRoute",
"directionsRoute",
",",
"@",
"NonNull",
"DirectionsRouteType",
"routeType",
")",
"{",
"startNavigationWith",
"(",
"directionsRoute",
",",
"routeType",
")",
";",
"}"
] | Calling this method with {@link DirectionsRouteType#NEW_ROUTE} begins a new navigation session using the
provided directions route. If called with {@link DirectionsRouteType#FRESH_ROUTE}, only leg annotation data
will be update - can be used with {@link RouteRefresh}.
@param directionsRoute a {@link DirectionsRoute} ... | [
"Calling",
"this",
"method",
"with",
"{",
"@link",
"DirectionsRouteType#NEW_ROUTE",
"}",
"begins",
"a",
"new",
"navigation",
"session",
"using",
"the",
"provided",
"directions",
"route",
".",
"If",
"called",
"with",
"{",
"@link",
"DirectionsRouteType#FRESH_ROUTE",
"... | train | https://github.com/mapbox/mapbox-navigation-android/blob/375a89c017d360b9defc2c90d0c03468165162ec/libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/navigation/MapboxNavigation.java#L359-L361 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ch/Subtypes2.java | Subtypes2.addClassVertexForMissingClass | private ClassVertex addClassVertexForMissingClass(ClassDescriptor missingClassDescriptor, boolean isInterfaceEdge) {
"""
Add a ClassVertex representing a missing class.
@param missingClassDescriptor
ClassDescriptor naming a missing class
@param isInterfaceEdge
@return the ClassVertex representing the missing... | java | private ClassVertex addClassVertexForMissingClass(ClassDescriptor missingClassDescriptor, boolean isInterfaceEdge) {
ClassVertex missingClassVertex = ClassVertex.createMissingClassVertex(missingClassDescriptor, isInterfaceEdge);
missingClassVertex.setFinished(true);
addVertexToGraph(missingClass... | [
"private",
"ClassVertex",
"addClassVertexForMissingClass",
"(",
"ClassDescriptor",
"missingClassDescriptor",
",",
"boolean",
"isInterfaceEdge",
")",
"{",
"ClassVertex",
"missingClassVertex",
"=",
"ClassVertex",
".",
"createMissingClassVertex",
"(",
"missingClassDescriptor",
","... | Add a ClassVertex representing a missing class.
@param missingClassDescriptor
ClassDescriptor naming a missing class
@param isInterfaceEdge
@return the ClassVertex representing the missing class | [
"Add",
"a",
"ClassVertex",
"representing",
"a",
"missing",
"class",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ch/Subtypes2.java#L1381-L1390 |
facebookarchive/hadoop-20 | src/contrib/benchmark/src/java/org/apache/hadoop/mapred/MapOutputCorrectness.java | MapOutputCorrectness.getMapperId | private static int getMapperId(long key, int numReducers, int maxKeySpace) {
"""
Which mapper sent this key sum?
@param key Key to check
@param numReducers Number of reducers
@param maxKeySpace Max key space
@return Mapper that send this key sum
"""
key = key - getFirstSumKey(numReducers, maxKeySpace);... | java | private static int getMapperId(long key, int numReducers, int maxKeySpace) {
key = key - getFirstSumKey(numReducers, maxKeySpace);
return (int) (key / numReducers);
} | [
"private",
"static",
"int",
"getMapperId",
"(",
"long",
"key",
",",
"int",
"numReducers",
",",
"int",
"maxKeySpace",
")",
"{",
"key",
"=",
"key",
"-",
"getFirstSumKey",
"(",
"numReducers",
",",
"maxKeySpace",
")",
";",
"return",
"(",
"int",
")",
"(",
"ke... | Which mapper sent this key sum?
@param key Key to check
@param numReducers Number of reducers
@param maxKeySpace Max key space
@return Mapper that send this key sum | [
"Which",
"mapper",
"sent",
"this",
"key",
"sum?"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/benchmark/src/java/org/apache/hadoop/mapred/MapOutputCorrectness.java#L339-L342 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java | FastDatePrinter.applyRules | private <B extends Appendable> B applyRules(final Calendar calendar, final B buf) {
"""
<p>Performs the formatting by applying the rules to the
specified calendar.</p>
@param calendar the calendar to format
@param buf the buffer to format into
@param <B> the Appendable class type, usually StringBuilder or ... | java | private <B extends Appendable> B applyRules(final Calendar calendar, final B buf) {
try {
for (final Rule rule : mRules) {
rule.appendTo(buf, calendar);
}
} catch (final IOException ioe) {
ExceptionUtils.rethrow(ioe);
}
return buf;
... | [
"private",
"<",
"B",
"extends",
"Appendable",
">",
"B",
"applyRules",
"(",
"final",
"Calendar",
"calendar",
",",
"final",
"B",
"buf",
")",
"{",
"try",
"{",
"for",
"(",
"final",
"Rule",
"rule",
":",
"mRules",
")",
"{",
"rule",
".",
"appendTo",
"(",
"b... | <p>Performs the formatting by applying the rules to the
specified calendar.</p>
@param calendar the calendar to format
@param buf the buffer to format into
@param <B> the Appendable class type, usually StringBuilder or StringBuffer.
@return the specified string buffer | [
"<p",
">",
"Performs",
"the",
"formatting",
"by",
"applying",
"the",
"rules",
"to",
"the",
"specified",
"calendar",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/FastDatePrinter.java#L573-L582 |
alkacon/opencms-core | src/org/opencms/util/CmsMacroResolver.java | CmsMacroResolver.updateProperties | private static void updateProperties(CmsObject cms, CmsResource resource, CmsMacroResolver macroResolver)
throws CmsException {
"""
Updates all properties of the given resource with the given macro resolver.<p>
@param cms the cms context
@param resource the resource to update the properties for
@param mac... | java | private static void updateProperties(CmsObject cms, CmsResource resource, CmsMacroResolver macroResolver)
throws CmsException {
Iterator<CmsProperty> it = cms.readPropertyObjects(resource, false).iterator();
while (it.hasNext()) {
CmsProperty property = it.next();
String res... | [
"private",
"static",
"void",
"updateProperties",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
",",
"CmsMacroResolver",
"macroResolver",
")",
"throws",
"CmsException",
"{",
"Iterator",
"<",
"CmsProperty",
">",
"it",
"=",
"cms",
".",
"readPropertyObjects",... | Updates all properties of the given resource with the given macro resolver.<p>
@param cms the cms context
@param resource the resource to update the properties for
@param macroResolver the macro resolver to use
@throws CmsException if something goes wrong | [
"Updates",
"all",
"properties",
"of",
"the",
"given",
"resource",
"with",
"the",
"given",
"macro",
"resolver",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsMacroResolver.java#L750-L767 |
looly/hutool | hutool-aop/src/main/java/cn/hutool/aop/ProxyUtil.java | ProxyUtil.proxy | public static <T> T proxy(T target, Class<? extends Aspect> aspectClass) {
"""
使用切面代理对象
@param <T> 切面对象类型
@param target 目标对象
@param aspectClass 切面对象类
@return 代理对象
"""
return ProxyFactory.createProxy(target, aspectClass);
} | java | public static <T> T proxy(T target, Class<? extends Aspect> aspectClass){
return ProxyFactory.createProxy(target, aspectClass);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"proxy",
"(",
"T",
"target",
",",
"Class",
"<",
"?",
"extends",
"Aspect",
">",
"aspectClass",
")",
"{",
"return",
"ProxyFactory",
".",
"createProxy",
"(",
"target",
",",
"aspectClass",
")",
";",
"}"
] | 使用切面代理对象
@param <T> 切面对象类型
@param target 目标对象
@param aspectClass 切面对象类
@return 代理对象 | [
"使用切面代理对象"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-aop/src/main/java/cn/hutool/aop/ProxyUtil.java#L25-L27 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/http/TemplateFaxJob2HTTPRequestConverter.java | TemplateFaxJob2HTTPRequestConverter.createHTTPRequest | protected HTTPRequest createHTTPRequest(HTTPFaxClientSpi faxClientSpi,FaxActionType faxActionType,Enum<?> templateNameEnum,FaxJob faxJob) {
"""
Creates the HTTP request from the fax job data.
@param faxClientSpi
The HTTP fax client SPI
@param faxActionType
The fax action type
@param templateNameEnum
... | java | protected HTTPRequest createHTTPRequest(HTTPFaxClientSpi faxClientSpi,FaxActionType faxActionType,Enum<?> templateNameEnum,FaxJob faxJob)
{
//get template name string
String templateName=templateNameEnum.toString();
//get template
String template=this.httpRequestTemplateMap.get(temp... | [
"protected",
"HTTPRequest",
"createHTTPRequest",
"(",
"HTTPFaxClientSpi",
"faxClientSpi",
",",
"FaxActionType",
"faxActionType",
",",
"Enum",
"<",
"?",
">",
"templateNameEnum",
",",
"FaxJob",
"faxJob",
")",
"{",
"//get template name string",
"String",
"templateName",
"=... | Creates the HTTP request from the fax job data.
@param faxClientSpi
The HTTP fax client SPI
@param faxActionType
The fax action type
@param templateNameEnum
The template name
@param faxJob
The fax job object
@return The HTTP request to send | [
"Creates",
"the",
"HTTP",
"request",
"from",
"the",
"fax",
"job",
"data",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/http/TemplateFaxJob2HTTPRequestConverter.java#L352-L382 |
finmath/finmath-lib | src/main/java6/net/finmath/montecarlo/interestrate/products/FlexiCap.java | FlexiCap.getValue | @Override
public RandomVariableInterface getValue(double evaluationTime, LIBORModelMonteCarloSimulationInterface model) throws CalculationException {
"""
This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is ofte... | java | @Override
public RandomVariableInterface getValue(double evaluationTime, LIBORModelMonteCarloSimulationInterface model) throws CalculationException {
// Allocate accumulator for values
RandomVariableInterface values = new RandomVariable(0.0);
/*
* We go forward in time and on each path we remember the numbe... | [
"@",
"Override",
"public",
"RandomVariableInterface",
"getValue",
"(",
"double",
"evaluationTime",
",",
"LIBORModelMonteCarloSimulationInterface",
"model",
")",
"throws",
"CalculationException",
"{",
"// Allocate accumulator for values",
"RandomVariableInterface",
"values",
"=",
... | This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time.
Cashflows prior evaluationTime... | [
"This",
"method",
"returns",
"the",
"value",
"random",
"variable",
"of",
"the",
"product",
"within",
"the",
"specified",
"model",
"evaluated",
"at",
"a",
"given",
"evalutationTime",
".",
"Note",
":",
"For",
"a",
"lattice",
"this",
"is",
"often",
"the",
"valu... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java6/net/finmath/montecarlo/interestrate/products/FlexiCap.java#L62-L110 |
networknt/light-4j | config/src/main/java/com/networknt/config/CentralizedManagement.java | CentralizedManagement.mergeObject | public static Object mergeObject(Object config, Class clazz) {
"""
Merge map config with values generated by ConfigInjection.class and return mapping object
"""
merge(config);
return convertMapToObj((Map<String, Object>) config, clazz);
} | java | public static Object mergeObject(Object config, Class clazz) {
merge(config);
return convertMapToObj((Map<String, Object>) config, clazz);
} | [
"public",
"static",
"Object",
"mergeObject",
"(",
"Object",
"config",
",",
"Class",
"clazz",
")",
"{",
"merge",
"(",
"config",
")",
";",
"return",
"convertMapToObj",
"(",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"config",
",",
"clazz",
")",
... | Merge map config with values generated by ConfigInjection.class and return mapping object | [
"Merge",
"map",
"config",
"with",
"values",
"generated",
"by",
"ConfigInjection",
".",
"class",
"and",
"return",
"mapping",
"object"
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/config/src/main/java/com/networknt/config/CentralizedManagement.java#L42-L45 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/ItemDataMoveVisitor.java | ItemDataMoveVisitor.createStates | private void createStates(PropertyData prevProperty, PropertyData newProperty) {
"""
Creates item states and adds them to changes log. If possible tries
to inject {@link ChangedSizeHandler} to manage data size changes.
@param prevProperty
{@link PropertyData} currently exists into storage.
@param newProperty... | java | private void createStates(PropertyData prevProperty, PropertyData newProperty)
{
ReadOnlyChangedSizeHandler delChangedSizeHandler = null;
ReadOnlyChangedSizeHandler addChangedSizeHandler = null;
if (prevProperty instanceof PersistedPropertyData)
{
PersistedPropertyData persistedPrev... | [
"private",
"void",
"createStates",
"(",
"PropertyData",
"prevProperty",
",",
"PropertyData",
"newProperty",
")",
"{",
"ReadOnlyChangedSizeHandler",
"delChangedSizeHandler",
"=",
"null",
";",
"ReadOnlyChangedSizeHandler",
"addChangedSizeHandler",
"=",
"null",
";",
"if",
"(... | Creates item states and adds them to changes log. If possible tries
to inject {@link ChangedSizeHandler} to manage data size changes.
@param prevProperty
{@link PropertyData} currently exists into storage.
@param newProperty
{@link PropertyData} will be saved to the storage | [
"Creates",
"item",
"states",
"and",
"adds",
"them",
"to",
"changes",
"log",
".",
"If",
"possible",
"tries",
"to",
"inject",
"{",
"@link",
"ChangedSizeHandler",
"}",
"to",
"manage",
"data",
"size",
"changes",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/ItemDataMoveVisitor.java#L355-L372 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/MessageDigestSpi.java | MessageDigestSpi.engineDigest | protected int engineDigest(byte[] buf, int offset, int len)
throws DigestException {
"""
Completes the hash computation by performing final
operations such as padding. Once {@code engineDigest} has
been called, the engine should be reset (see
{@link #engineReset()... | java | protected int engineDigest(byte[] buf, int offset, int len)
throws DigestException {
byte[] digest = engineDigest();
if (len < digest.length)
throw new DigestException("partial digests not returned");
if (buf.length - offset < dige... | [
"protected",
"int",
"engineDigest",
"(",
"byte",
"[",
"]",
"buf",
",",
"int",
"offset",
",",
"int",
"len",
")",
"throws",
"DigestException",
"{",
"byte",
"[",
"]",
"digest",
"=",
"engineDigest",
"(",
")",
";",
"if",
"(",
"len",
"<",
"digest",
".",
"l... | Completes the hash computation by performing final
operations such as padding. Once {@code engineDigest} has
been called, the engine should be reset (see
{@link #engineReset() engineReset}).
Resetting is the responsibility of the
engine implementor.
This method should be abstract, but we leave it concrete for
binary c... | [
"Completes",
"the",
"hash",
"computation",
"by",
"performing",
"final",
"operations",
"such",
"as",
"padding",
".",
"Once",
"{",
"@code",
"engineDigest",
"}",
"has",
"been",
"called",
"the",
"engine",
"should",
"be",
"reset",
"(",
"see",
"{",
"@link",
"#engi... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/MessageDigestSpi.java#L173-L184 |
VoltDB/voltdb | src/frontend/org/voltdb/planner/FilterMatcher.java | FilterMatcher.equalsAsCVE | private static boolean equalsAsCVE(AbstractExpression e1, AbstractExpression e2) {
"""
Check whether two expressions, each either a CVE or PVE, have same content.
\pre both must be either CVE or PVE.
@param e1 first expression
@param e2 second expression
@return whether their contents match.
"""
fi... | java | private static boolean equalsAsCVE(AbstractExpression e1, AbstractExpression e2) {
final ConstantValueExpression ce1 = asCVE(e1), ce2 = asCVE(e2);
return ce1 == null || ce2 == null ? ce1 == ce2 : ce1.equals(ce2);
} | [
"private",
"static",
"boolean",
"equalsAsCVE",
"(",
"AbstractExpression",
"e1",
",",
"AbstractExpression",
"e2",
")",
"{",
"final",
"ConstantValueExpression",
"ce1",
"=",
"asCVE",
"(",
"e1",
")",
",",
"ce2",
"=",
"asCVE",
"(",
"e2",
")",
";",
"return",
"ce1"... | Check whether two expressions, each either a CVE or PVE, have same content.
\pre both must be either CVE or PVE.
@param e1 first expression
@param e2 second expression
@return whether their contents match. | [
"Check",
"whether",
"two",
"expressions",
"each",
"either",
"a",
"CVE",
"or",
"PVE",
"have",
"same",
"content",
".",
"\\",
"pre",
"both",
"must",
"be",
"either",
"CVE",
"or",
"PVE",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/FilterMatcher.java#L149-L152 |
mike706574/java-map-support | src/main/java/fun/mike/map/alpha/Get.java | Get.requiredStringEnum | public static <T> String requiredStringEnum(Map<String, T> map, String key, List<String> options) {
"""
Validates that the value from {@code map} for the given {@code key} is a
string and is present in {@code options}. Returns the value when valid;
otherwise, throws an {@code IllegalArgumentException}.
@param m... | java | public static <T> String requiredStringEnum(Map<String, T> map, String key, List<String> options) {
String value = requiredString(map, key);
List<String> uppercaseOptions = options.stream().map(String::toUpperCase).collect(Collectors.toList());
if (!uppercaseOptions.contains(value.toUpperCase())... | [
"public",
"static",
"<",
"T",
">",
"String",
"requiredStringEnum",
"(",
"Map",
"<",
"String",
",",
"T",
">",
"map",
",",
"String",
"key",
",",
"List",
"<",
"String",
">",
"options",
")",
"{",
"String",
"value",
"=",
"requiredString",
"(",
"map",
",",
... | Validates that the value from {@code map} for the given {@code key} is a
string and is present in {@code options}. Returns the value when valid;
otherwise, throws an {@code IllegalArgumentException}.
@param map a map
@param key a key
@param options acceptable values
@param <T> the type of value
@return The string value... | [
"Validates",
"that",
"the",
"value",
"from",
"{"
] | train | https://github.com/mike706574/java-map-support/blob/7cb09f34c24adfaca73ad25a3c3e05abec72eafe/src/main/java/fun/mike/map/alpha/Get.java#L24-L38 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java | SarlBatchCompiler.reportInternalError | protected void reportInternalError(String message, Object... parameters) {
"""
Reports the given error message.
@param message the warning message.
@param parameters the values of the parameters that must be dynamically replaced within the message text.
@since 0.8
"""
getLogger().error(message, paramete... | java | protected void reportInternalError(String message, Object... parameters) {
getLogger().error(message, parameters);
if (getReportInternalProblemsAsIssues()) {
final org.eclipse.emf.common.util.URI uri = null;
final Issue.IssueImpl issue = new Issue.IssueImpl();
issue.setCode(INTERNAL_ERROR_CODE);
issue.... | [
"protected",
"void",
"reportInternalError",
"(",
"String",
"message",
",",
"Object",
"...",
"parameters",
")",
"{",
"getLogger",
"(",
")",
".",
"error",
"(",
"message",
",",
"parameters",
")",
";",
"if",
"(",
"getReportInternalProblemsAsIssues",
"(",
")",
")",... | Reports the given error message.
@param message the warning message.
@param parameters the values of the parameters that must be dynamically replaced within the message text.
@since 0.8 | [
"Reports",
"the",
"given",
"error",
"message",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1513-L1524 |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/sms/SmsClient.java | SmsClient.searchMessages | public SearchSmsResponse searchMessages(Date date, String to) throws IOException, NexmoClientException {
"""
Search for completed SMS transactions by date and recipient MSISDN.
@param date the date of the SMS message to be looked up
@param to the MSISDN number of the SMS recipient
@return SMS data matchin... | java | public SearchSmsResponse searchMessages(Date date, String to) throws IOException, NexmoClientException {
return this.searchMessages(new SmsDateSearchRequest(date, to));
} | [
"public",
"SearchSmsResponse",
"searchMessages",
"(",
"Date",
"date",
",",
"String",
"to",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"this",
".",
"searchMessages",
"(",
"new",
"SmsDateSearchRequest",
"(",
"date",
",",
"to",
")",
"... | Search for completed SMS transactions by date and recipient MSISDN.
@param date the date of the SMS message to be looked up
@param to the MSISDN number of the SMS recipient
@return SMS data matching the provided criteria | [
"Search",
"for",
"completed",
"SMS",
"transactions",
"by",
"date",
"and",
"recipient",
"MSISDN",
"."
] | train | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/sms/SmsClient.java#L114-L116 |
joelittlejohn/jsonschema2pojo | jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/EnumRule.java | EnumRule.apply | @Override
public JType apply(String nodeName, JsonNode node, JsonNode parent, JClassContainer container, Schema schema) {
"""
Applies this schema rule to take the required code generation steps.
<p>
A Java {@link Enum} is created, with constants for each of the enum
values present in the schema. The enum na... | java | @Override
public JType apply(String nodeName, JsonNode node, JsonNode parent, JClassContainer container, Schema schema) {
JDefinedClass _enum;
try {
_enum = createEnum(node, nodeName, container);
} catch (ClassAlreadyExistsException e) {
return e.getExistingClass();
... | [
"@",
"Override",
"public",
"JType",
"apply",
"(",
"String",
"nodeName",
",",
"JsonNode",
"node",
",",
"JsonNode",
"parent",
",",
"JClassContainer",
"container",
",",
"Schema",
"schema",
")",
"{",
"JDefinedClass",
"_enum",
";",
"try",
"{",
"_enum",
"=",
"crea... | Applies this schema rule to take the required code generation steps.
<p>
A Java {@link Enum} is created, with constants for each of the enum
values present in the schema. The enum name is derived from the nodeName,
and the enum type itself is created as an inner class of the owning type.
In the rare case that no owning... | [
"Applies",
"this",
"schema",
"rule",
"to",
"take",
"the",
"required",
"code",
"generation",
"steps",
".",
"<p",
">",
"A",
"Java",
"{",
"@link",
"Enum",
"}",
"is",
"created",
"with",
"constants",
"for",
"each",
"of",
"the",
"enum",
"values",
"present",
"i... | train | https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/EnumRule.java#L99-L138 |
scoverage/scoverage-maven-plugin | src/main/java/org/scoverage/plugin/SCoverageReportMojo.java | SCoverageReportMojo.execute | @Override
public void execute()
throws MojoExecutionException {
"""
Generates SCoverage report.
@throws MojoExecutionException if unexpected problem occurs
"""
if ( !canGenerateReport() )
{
getLog().info( "Skipping SCoverage report generation" );
return;
... | java | @Override
public void execute()
throws MojoExecutionException
{
if ( !canGenerateReport() )
{
getLog().info( "Skipping SCoverage report generation" );
return;
}
try
{
RenderingContext context = new RenderingContext( outputDirec... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"if",
"(",
"!",
"canGenerateReport",
"(",
")",
")",
"{",
"getLog",
"(",
")",
".",
"info",
"(",
"\"Skipping SCoverage report generation\"",
")",
";",
"return",
";",... | Generates SCoverage report.
@throws MojoExecutionException if unexpected problem occurs | [
"Generates",
"SCoverage",
"report",
"."
] | train | https://github.com/scoverage/scoverage-maven-plugin/blob/b1c874aba521a65c85bcccfa8bff2213b5639c78/src/main/java/org/scoverage/plugin/SCoverageReportMojo.java#L369-L391 |
eobermuhlner/big-math | ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigComplexMath.java | BigComplexMath.atan | public static BigComplex atan(BigComplex x, MathContext mathContext) {
"""
Calculates the arc tangens (inverted tangens) of {@link BigComplex} x in the complex domain.
<p>See: <a href="https://en.wikipedia.org/wiki/Inverse_trigonometric_functions#Extension_to_complex_plane">Wikipedia: Inverse trigonometric func... | java | public static BigComplex atan(BigComplex x, MathContext mathContext) {
MathContext mc = new MathContext(mathContext.getPrecision() + 4, mathContext.getRoundingMode());
return log(I.subtract(x, mc).divide(I.add(x, mc), mc), mc).divide(I, mc).divide(TWO, mc).round(mathContext);
} | [
"public",
"static",
"BigComplex",
"atan",
"(",
"BigComplex",
"x",
",",
"MathContext",
"mathContext",
")",
"{",
"MathContext",
"mc",
"=",
"new",
"MathContext",
"(",
"mathContext",
".",
"getPrecision",
"(",
")",
"+",
"4",
",",
"mathContext",
".",
"getRoundingMod... | Calculates the arc tangens (inverted tangens) of {@link BigComplex} x in the complex domain.
<p>See: <a href="https://en.wikipedia.org/wiki/Inverse_trigonometric_functions#Extension_to_complex_plane">Wikipedia: Inverse trigonometric functions (Extension to complex plane)</a></p>
@param x the {@link BigComplex} to cal... | [
"Calculates",
"the",
"arc",
"tangens",
"(",
"inverted",
"tangens",
")",
"of",
"{",
"@link",
"BigComplex",
"}",
"x",
"in",
"the",
"complex",
"domain",
"."
] | train | https://github.com/eobermuhlner/big-math/blob/52c4fc334d0d722b295de740c1018ee400e3e8f2/ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigComplexMath.java#L224-L228 |
Swagger2Markup/swagger2markup | src/main/java/io/github/swagger2markup/internal/document/DefinitionsDocument.java | DefinitionsDocument.definitionRef | private void definitionRef(MarkupDocBuilder markupDocBuilder, String definitionName) {
"""
Builds a cross-reference to a separated definition file.
@param definitionName definition name to target
"""
buildDefinitionTitle(markupDocBuilder, crossReference(markupDocBuilder, definitionDocumentResolverDe... | java | private void definitionRef(MarkupDocBuilder markupDocBuilder, String definitionName) {
buildDefinitionTitle(markupDocBuilder, crossReference(markupDocBuilder, definitionDocumentResolverDefault.apply(definitionName), definitionName, definitionName), "ref-" + definitionName);
} | [
"private",
"void",
"definitionRef",
"(",
"MarkupDocBuilder",
"markupDocBuilder",
",",
"String",
"definitionName",
")",
"{",
"buildDefinitionTitle",
"(",
"markupDocBuilder",
",",
"crossReference",
"(",
"markupDocBuilder",
",",
"definitionDocumentResolverDefault",
".",
"apply... | Builds a cross-reference to a separated definition file.
@param definitionName definition name to target | [
"Builds",
"a",
"cross",
"-",
"reference",
"to",
"a",
"separated",
"definition",
"file",
"."
] | train | https://github.com/Swagger2Markup/swagger2markup/blob/da83465f19a2f8a0f1fba873b5762bca8587896b/src/main/java/io/github/swagger2markup/internal/document/DefinitionsDocument.java#L171-L173 |
doanduyhai/Achilles | achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java | AbstractManagerFactoryBuilder.withRuntimeCodec | public <FROM, TO> T withRuntimeCodec(CodecSignature<FROM, TO> codecSignature, Codec<FROM, TO> codec) {
"""
Specify a runtime codec to register with Achilles
<br/>
<pre class="code"><code class="java">
<strong>final Codec<MyBean, String> beanCodec = new .... // Create your codec with initialization logic... | java | public <FROM, TO> T withRuntimeCodec(CodecSignature<FROM, TO> codecSignature, Codec<FROM, TO> codec) {
if (!configMap.containsKey(RUNTIME_CODECS)) {
configMap.put(RUNTIME_CODECS, new HashMap<CodecSignature<?, ?>, Codec<?, ?>>());
}
configMap.<Map<CodecSignature<?, ?>, Codec<?, ?>>>ge... | [
"public",
"<",
"FROM",
",",
"TO",
">",
"T",
"withRuntimeCodec",
"(",
"CodecSignature",
"<",
"FROM",
",",
"TO",
">",
"codecSignature",
",",
"Codec",
"<",
"FROM",
",",
"TO",
">",
"codec",
")",
"{",
"if",
"(",
"!",
"configMap",
".",
"containsKey",
"(",
... | Specify a runtime codec to register with Achilles
<br/>
<pre class="code"><code class="java">
<strong>final Codec<MyBean, String> beanCodec = new .... // Create your codec with initialization logic here</strong>
<strong>final Codec<MyEnum, String> enumCodec = new .... // Create your codec with initializati... | [
"Specify",
"a",
"runtime",
"codec",
"to",
"register",
"with",
"Achilles",
"<br",
"/",
">",
"<pre",
"class",
"=",
"code",
">",
"<code",
"class",
"=",
"java",
">"
] | train | https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java#L506-L512 |
jnidzwetzki/bitfinex-v2-wss-api-java | src/main/java/com/github/jnidzwetzki/bitfinex/v2/BitfinexApiCallbackListeners.java | BitfinexApiCallbackListeners.onOrderbookEvent | public Closeable onOrderbookEvent(final BiConsumer<BitfinexOrderBookSymbol, Collection<BitfinexOrderBookEntry>> listener) {
"""
registers listener for orderbook events
@param listener of event
@return hook of this listener
"""
orderbookEntryConsumers.offer(listener);
return () -> orderbookEnt... | java | public Closeable onOrderbookEvent(final BiConsumer<BitfinexOrderBookSymbol, Collection<BitfinexOrderBookEntry>> listener) {
orderbookEntryConsumers.offer(listener);
return () -> orderbookEntryConsumers.remove(listener);
} | [
"public",
"Closeable",
"onOrderbookEvent",
"(",
"final",
"BiConsumer",
"<",
"BitfinexOrderBookSymbol",
",",
"Collection",
"<",
"BitfinexOrderBookEntry",
">",
">",
"listener",
")",
"{",
"orderbookEntryConsumers",
".",
"offer",
"(",
"listener",
")",
";",
"return",
"("... | registers listener for orderbook events
@param listener of event
@return hook of this listener | [
"registers",
"listener",
"for",
"orderbook",
"events"
] | train | https://github.com/jnidzwetzki/bitfinex-v2-wss-api-java/blob/2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee/src/main/java/com/github/jnidzwetzki/bitfinex/v2/BitfinexApiCallbackListeners.java#L168-L171 |
voldemort/voldemort | src/java/voldemort/versioning/VectorClockUtils.java | VectorClockUtils.makeClock | public static VectorClock makeClock(Set<Integer> serverIds, long clockValue, long timestamp) {
"""
Generates a vector clock with the provided values
@param serverIds servers in the clock
@param clockValue value of the clock for each server entry
@param timestamp ts value to be set for the clock
@return
"... | java | public static VectorClock makeClock(Set<Integer> serverIds, long clockValue, long timestamp) {
List<ClockEntry> clockEntries = new ArrayList<ClockEntry>(serverIds.size());
for(Integer serverId: serverIds) {
clockEntries.add(new ClockEntry(serverId.shortValue(), clockValue));
}
... | [
"public",
"static",
"VectorClock",
"makeClock",
"(",
"Set",
"<",
"Integer",
">",
"serverIds",
",",
"long",
"clockValue",
",",
"long",
"timestamp",
")",
"{",
"List",
"<",
"ClockEntry",
">",
"clockEntries",
"=",
"new",
"ArrayList",
"<",
"ClockEntry",
">",
"(",... | Generates a vector clock with the provided values
@param serverIds servers in the clock
@param clockValue value of the clock for each server entry
@param timestamp ts value to be set for the clock
@return | [
"Generates",
"a",
"vector",
"clock",
"with",
"the",
"provided",
"values"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/versioning/VectorClockUtils.java#L137-L143 |
google/closure-compiler | src/com/google/javascript/jscomp/TypeValidator.java | TypeValidator.expectStringOrNumber | void expectStringOrNumber(Node n, JSType type, String msg) {
"""
Expect the type to be a number or string or symbol, or a type convertible to a number or
string. If the expectation is not met, issue a warning at the provided node's source code
position.
"""
if (!type.matchesNumberContext()
&& !ty... | java | void expectStringOrNumber(Node n, JSType type, String msg) {
if (!type.matchesNumberContext()
&& !type.matchesStringContext()
&& !type.matchesStringContext()) {
mismatch(n, msg, type, NUMBER_STRING);
} else {
expectStringOrNumberOrSymbolStrict(n, type, msg);
}
} | [
"void",
"expectStringOrNumber",
"(",
"Node",
"n",
",",
"JSType",
"type",
",",
"String",
"msg",
")",
"{",
"if",
"(",
"!",
"type",
".",
"matchesNumberContext",
"(",
")",
"&&",
"!",
"type",
".",
"matchesStringContext",
"(",
")",
"&&",
"!",
"type",
".",
"m... | Expect the type to be a number or string or symbol, or a type convertible to a number or
string. If the expectation is not met, issue a warning at the provided node's source code
position. | [
"Expect",
"the",
"type",
"to",
"be",
"a",
"number",
"or",
"string",
"or",
"symbol",
"or",
"a",
"type",
"convertible",
"to",
"a",
"number",
"or",
"string",
".",
"If",
"the",
"expectation",
"is",
"not",
"met",
"issue",
"a",
"warning",
"at",
"the",
"provi... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L434-L442 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java | Session.grantResource | public void grantResource(ResourceRequestInfo req, ResourceGrant grant) {
"""
Grant a resource to a session to satisfy a request. Update the finalized
first resource type times if not already set
@param req the request being satisfied
@param grant the grant satisfying the request
"""
if (deleted) {
... | java | public void grantResource(ResourceRequestInfo req, ResourceGrant grant) {
if (deleted) {
throw new RuntimeException("Session: " +
sessionId + " has been deleted");
}
removePendingRequest(req);
idToGrant.put(req.getId(), grant);
addGrantedRequest(req);
// Handle the first wait m... | [
"public",
"void",
"grantResource",
"(",
"ResourceRequestInfo",
"req",
",",
"ResourceGrant",
"grant",
")",
"{",
"if",
"(",
"deleted",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Session: \"",
"+",
"sessionId",
"+",
"\" has been deleted\"",
")",
";",
"}"... | Grant a resource to a session to satisfy a request. Update the finalized
first resource type times if not already set
@param req the request being satisfied
@param grant the grant satisfying the request | [
"Grant",
"a",
"resource",
"to",
"a",
"session",
"to",
"satisfy",
"a",
"request",
".",
"Update",
"the",
"finalized",
"first",
"resource",
"type",
"times",
"if",
"not",
"already",
"set"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/Session.java#L1004-L1026 |
javagl/ND | nd-arrays/src/main/java/de/javagl/nd/arrays/d/DoubleArraysND.java | DoubleArraysND.wrap | public static MutableDoubleArrayND wrap(
MutableDoubleTuple t, IntTuple size) {
"""
Creates a <i>view</i> on the given tuple as a {@link DoubleArrayND}.
Changes in the given tuple will be visible in the returned array,
and vice versa.
@param t The tuple
@param size The size of the array
@return The... | java | public static MutableDoubleArrayND wrap(
MutableDoubleTuple t, IntTuple size)
{
Objects.requireNonNull(t, "The tuple is null");
Objects.requireNonNull(size, "The size is null");
int totalSize = IntTupleFunctions.reduce(size, 1, (a, b) -> a * b);
if (t.getSize() != total... | [
"public",
"static",
"MutableDoubleArrayND",
"wrap",
"(",
"MutableDoubleTuple",
"t",
",",
"IntTuple",
"size",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"t",
",",
"\"The tuple is null\"",
")",
";",
"Objects",
".",
"requireNonNull",
"(",
"size",
",",
"\"The ... | Creates a <i>view</i> on the given tuple as a {@link DoubleArrayND}.
Changes in the given tuple will be visible in the returned array,
and vice versa.
@param t The tuple
@param size The size of the array
@return The view on the tuple
@throws NullPointerException If any argument is <code>null</code>
@throws IllegalArgu... | [
"Creates",
"a",
"<i",
">",
"view<",
"/",
"i",
">",
"on",
"the",
"given",
"tuple",
"as",
"a",
"{",
"@link",
"DoubleArrayND",
"}",
".",
"Changes",
"in",
"the",
"given",
"tuple",
"will",
"be",
"visible",
"in",
"the",
"returned",
"array",
"and",
"vice",
... | train | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-arrays/src/main/java/de/javagl/nd/arrays/d/DoubleArraysND.java#L141-L154 |
ops4j/org.ops4j.base | ops4j-base-io/src/main/java/org/ops4j/io/PrintStreamMonitor.java | PrintStreamMonitor.notifyError | public void notifyError( URL resource, String message ) {
"""
Notify the monitor of the an error during the download
process.
@param resource the name of the remote resource.
@param message a non-localized message describing the problem in english.
"""
m_out.println( resource.toExternalForm() + "... | java | public void notifyError( URL resource, String message )
{
m_out.println( resource.toExternalForm() + " : " + message );
} | [
"public",
"void",
"notifyError",
"(",
"URL",
"resource",
",",
"String",
"message",
")",
"{",
"m_out",
".",
"println",
"(",
"resource",
".",
"toExternalForm",
"(",
")",
"+",
"\" : \"",
"+",
"message",
")",
";",
"}"
] | Notify the monitor of the an error during the download
process.
@param resource the name of the remote resource.
@param message a non-localized message describing the problem in english. | [
"Notify",
"the",
"monitor",
"of",
"the",
"an",
"error",
"during",
"the",
"download",
"process",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/PrintStreamMonitor.java#L93-L96 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/TableBuilder.java | TableBuilder.setSettings | public void setSettings(final String viewId, final String item, final String value) {
"""
Set one of the settings
@param viewId the id of the view
@param item the item name
@param value the item value
"""
this.configEntry.set(item, value);
} | java | public void setSettings(final String viewId, final String item, final String value) {
this.configEntry.set(item, value);
} | [
"public",
"void",
"setSettings",
"(",
"final",
"String",
"viewId",
",",
"final",
"String",
"item",
",",
"final",
"String",
"value",
")",
"{",
"this",
".",
"configEntry",
".",
"set",
"(",
"item",
",",
"value",
")",
";",
"}"
] | Set one of the settings
@param viewId the id of the view
@param item the item name
@param value the item value | [
"Set",
"one",
"of",
"the",
"settings"
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/TableBuilder.java#L394-L396 |
astrapi69/mystic-crypt | crypt-data/src/main/java/de/alpharogroup/crypto/key/reader/PublicKeyReader.java | PublicKeyReader.readPublicKey | public static PublicKey readPublicKey(final byte[] publicKeyBytes, final String algorithm)
throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException {
"""
Read public key.
@param publicKeyBytes
the public key bytes
@param algorithm
the algorithm for the {@link KeyFactory}
@return t... | java | public static PublicKey readPublicKey(final byte[] publicKeyBytes, final String algorithm)
throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException
{
final X509EncodedKeySpec keySpec = new X509EncodedKeySpec(publicKeyBytes);
final KeyFactory keyFactory = KeyFactory.getInstance(algorithm)... | [
"public",
"static",
"PublicKey",
"readPublicKey",
"(",
"final",
"byte",
"[",
"]",
"publicKeyBytes",
",",
"final",
"String",
"algorithm",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeySpecException",
",",
"NoSuchProviderException",
"{",
"final",
"X509Encoded... | Read public key.
@param publicKeyBytes
the public key bytes
@param algorithm
the algorithm for the {@link KeyFactory}
@return the public key
@throws NoSuchAlgorithmException
is thrown if instantiation of the cypher object fails.
@throws InvalidKeySpecException
is thrown if generation of the SecretKey object fails.
@th... | [
"Read",
"public",
"key",
"."
] | train | https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-data/src/main/java/de/alpharogroup/crypto/key/reader/PublicKeyReader.java#L116-L123 |
waldheinz/fat32-lib | src/main/java/de/waldheinz/fs/fat/LittleEndian.java | LittleEndian.getUInt16 | public static int getUInt16(byte[] src, int offset) {
"""
Gets a 16-bit unsigned integer from the given byte array at the given offset.
@param src
@param offset
"""
final int v0 = src[offset + 0] & 0xFF;
final int v1 = src[offset + 1] & 0xFF;
return ((v1 << 8) | v0);
} | java | public static int getUInt16(byte[] src, int offset) {
final int v0 = src[offset + 0] & 0xFF;
final int v1 = src[offset + 1] & 0xFF;
return ((v1 << 8) | v0);
} | [
"public",
"static",
"int",
"getUInt16",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"offset",
")",
"{",
"final",
"int",
"v0",
"=",
"src",
"[",
"offset",
"+",
"0",
"]",
"&",
"0xFF",
";",
"final",
"int",
"v1",
"=",
"src",
"[",
"offset",
"+",
"1",
"... | Gets a 16-bit unsigned integer from the given byte array at the given offset.
@param src
@param offset | [
"Gets",
"a",
"16",
"-",
"bit",
"unsigned",
"integer",
"from",
"the",
"given",
"byte",
"array",
"at",
"the",
"given",
"offset",
"."
] | train | https://github.com/waldheinz/fat32-lib/blob/3d8f1a986339573576e02eb0b6ea49bfdc9cce26/src/main/java/de/waldheinz/fs/fat/LittleEndian.java#L50-L54 |
graphql-java/graphql-java | src/main/java/graphql/schema/idl/TypeRuntimeWiring.java | TypeRuntimeWiring.newTypeWiring | public static TypeRuntimeWiring newTypeWiring(String typeName, UnaryOperator<Builder> builderFunction) {
"""
This form allows a lambda to be used as the builder
@param typeName the name of the type to wire
@param builderFunction a function that will be given the builder to use
@return the same builde... | java | public static TypeRuntimeWiring newTypeWiring(String typeName, UnaryOperator<Builder> builderFunction) {
return builderFunction.apply(newTypeWiring(typeName)).build();
} | [
"public",
"static",
"TypeRuntimeWiring",
"newTypeWiring",
"(",
"String",
"typeName",
",",
"UnaryOperator",
"<",
"Builder",
">",
"builderFunction",
")",
"{",
"return",
"builderFunction",
".",
"apply",
"(",
"newTypeWiring",
"(",
"typeName",
")",
")",
".",
"build",
... | This form allows a lambda to be used as the builder
@param typeName the name of the type to wire
@param builderFunction a function that will be given the builder to use
@return the same builder back please | [
"This",
"form",
"allows",
"a",
"lambda",
"to",
"be",
"used",
"as",
"the",
"builder"
] | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/schema/idl/TypeRuntimeWiring.java#L53-L55 |
Zappos/zappos-json | src/main/java/com/zappos/json/JsonReaderCodeGenerator.java | JsonReaderCodeGenerator.getTypeInfo | private TypeInfo getTypeInfo(Map<String, TypeInfo> typeMaps, String path, Class<?> superType) {
"""
Get the TypeInfo object from specified path or return the new one if it does not exist.
@param typeMaps
@param path
@param superType
@return
"""
TypeInfo typeInfo = typeMaps.get(path);
if (typeIn... | java | private TypeInfo getTypeInfo(Map<String, TypeInfo> typeMaps, String path, Class<?> superType) {
TypeInfo typeInfo = typeMaps.get(path);
if (typeInfo == null) {
typeInfo = new TypeInfo(superType);
typeMaps.put(path, typeInfo);
}
return typeInfo;
} | [
"private",
"TypeInfo",
"getTypeInfo",
"(",
"Map",
"<",
"String",
",",
"TypeInfo",
">",
"typeMaps",
",",
"String",
"path",
",",
"Class",
"<",
"?",
">",
"superType",
")",
"{",
"TypeInfo",
"typeInfo",
"=",
"typeMaps",
".",
"get",
"(",
"path",
")",
";",
"i... | Get the TypeInfo object from specified path or return the new one if it does not exist.
@param typeMaps
@param path
@param superType
@return | [
"Get",
"the",
"TypeInfo",
"object",
"from",
"specified",
"path",
"or",
"return",
"the",
"new",
"one",
"if",
"it",
"does",
"not",
"exist",
"."
] | train | https://github.com/Zappos/zappos-json/blob/340633f5db75c2e09ce49bfc3e5f67e8823f5a37/src/main/java/com/zappos/json/JsonReaderCodeGenerator.java#L354-L364 |
molgenis/molgenis | molgenis-core-ui/src/main/java/org/molgenis/core/ui/thememanager/ThemeManagerController.java | ThemeManagerController.addBootstrapTheme | @PreAuthorize("hasAnyRole('ROLE_SU')")
@PostMapping(value = "/add-bootstrap-theme")
public @ResponseBody Style addBootstrapTheme(
@RequestParam(value = "bootstrap3-style") MultipartFile bootstrap3Style,
@RequestParam(value = "bootstrap4-style", required = false) MultipartFile bootstrap4Style)
thro... | java | @PreAuthorize("hasAnyRole('ROLE_SU')")
@PostMapping(value = "/add-bootstrap-theme")
public @ResponseBody Style addBootstrapTheme(
@RequestParam(value = "bootstrap3-style") MultipartFile bootstrap3Style,
@RequestParam(value = "bootstrap4-style", required = false) MultipartFile bootstrap4Style)
thro... | [
"@",
"PreAuthorize",
"(",
"\"hasAnyRole('ROLE_SU')\"",
")",
"@",
"PostMapping",
"(",
"value",
"=",
"\"/add-bootstrap-theme\"",
")",
"public",
"@",
"ResponseBody",
"Style",
"addBootstrapTheme",
"(",
"@",
"RequestParam",
"(",
"value",
"=",
"\"bootstrap3-style\"",
")",
... | Add a new bootstrap theme, theme is passed as a bootstrap css file. It is mandatory to pass a
bootstrap3 style file but optional to pass a bootstrap 4 style file | [
"Add",
"a",
"new",
"bootstrap",
"theme",
"theme",
"is",
"passed",
"as",
"a",
"bootstrap",
"css",
"file",
".",
"It",
"is",
"mandatory",
"to",
"pass",
"a",
"bootstrap3",
"style",
"file",
"but",
"optional",
"to",
"pass",
"a",
"bootstrap",
"4",
"style",
"fil... | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-core-ui/src/main/java/org/molgenis/core/ui/thememanager/ThemeManagerController.java#L65-L99 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/geometry/GeometryUtilities.java | GeometryUtilities.angleBetween | public static double angleBetween( LineSegment l1, LineSegment l2 ) {
"""
Calculates the angle between two {@link LineSegment}s.
@param l1 the first segment.
@param l2 the second segment.
@return the angle between the two segments, starting from the first segment
moving clockwise.
"""
double azim... | java | public static double angleBetween( LineSegment l1, LineSegment l2 ) {
double azimuth1 = azimuth(l1.p0, l1.p1);
double azimuth2 = azimuth(l2.p0, l2.p1);
if (azimuth1 < azimuth2) {
return azimuth2 - azimuth1;
} else {
return 360 - azimuth1 + azimuth2;
}
... | [
"public",
"static",
"double",
"angleBetween",
"(",
"LineSegment",
"l1",
",",
"LineSegment",
"l2",
")",
"{",
"double",
"azimuth1",
"=",
"azimuth",
"(",
"l1",
".",
"p0",
",",
"l1",
".",
"p1",
")",
";",
"double",
"azimuth2",
"=",
"azimuth",
"(",
"l2",
"."... | Calculates the angle between two {@link LineSegment}s.
@param l1 the first segment.
@param l2 the second segment.
@return the angle between the two segments, starting from the first segment
moving clockwise. | [
"Calculates",
"the",
"angle",
"between",
"two",
"{",
"@link",
"LineSegment",
"}",
"s",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/geometry/GeometryUtilities.java#L200-L209 |
dkpro/dkpro-argumentation | dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java | JCasUtil2.hasNo | public static <T extends TOP> boolean hasNo(final Class<T> type, final JCas aJCas) {
"""
Returns whether there is no feature structure of the given type
@param type the type
@param aJCas the JCas
@return whether there is no feature structure of the given type
"""
return !hasAny(type, aJCas);
... | java | public static <T extends TOP> boolean hasNo(final Class<T> type, final JCas aJCas)
{
return !hasAny(type, aJCas);
} | [
"public",
"static",
"<",
"T",
"extends",
"TOP",
">",
"boolean",
"hasNo",
"(",
"final",
"Class",
"<",
"T",
">",
"type",
",",
"final",
"JCas",
"aJCas",
")",
"{",
"return",
"!",
"hasAny",
"(",
"type",
",",
"aJCas",
")",
";",
"}"
] | Returns whether there is no feature structure of the given type
@param type the type
@param aJCas the JCas
@return whether there is no feature structure of the given type | [
"Returns",
"whether",
"there",
"is",
"no",
"feature",
"structure",
"of",
"the",
"given",
"type"
] | train | https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L78-L81 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsADEManager.java | CmsADEManager.getPermissionInfo | public CmsPermissionInfo getPermissionInfo(CmsObject cms, CmsResource resource, String contextPath)
throws CmsException {
"""
Returns the permission info for the given resource.<p>
@param cms the cms context
@param resource the resource
@param contextPath the context path
@return the permission info
... | java | public CmsPermissionInfo getPermissionInfo(CmsObject cms, CmsResource resource, String contextPath)
throws CmsException {
boolean hasView = cms.hasPermissions(
resource,
CmsPermissionSet.ACCESS_VIEW,
false,
CmsResourceFilter.ALL.addRequireVisible());
... | [
"public",
"CmsPermissionInfo",
"getPermissionInfo",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
",",
"String",
"contextPath",
")",
"throws",
"CmsException",
"{",
"boolean",
"hasView",
"=",
"cms",
".",
"hasPermissions",
"(",
"resource",
",",
"CmsPermissi... | Returns the permission info for the given resource.<p>
@param cms the cms context
@param resource the resource
@param contextPath the context path
@return the permission info
@throws CmsException if checking the permissions fails | [
"Returns",
"the",
"permission",
"info",
"for",
"the",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsADEManager.java#L795-L844 |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/xml/XmlUtil.java | XmlUtil.parseXmlString | public static Document parseXmlString(String _xmlStr, boolean _validating, boolean _namespaceAware) throws IOException {
"""
Read the given string as XML document.
@param _xmlStr xml string
@param _validating boolean
@param _namespaceAware boolean
@return {@link org.w3c.dom.Document}
@throws IOException on ... | java | public static Document parseXmlString(String _xmlStr, boolean _validating, boolean _namespaceAware) throws IOException {
DocumentBuilderFactory dbFac = DocumentBuilderFactory.newInstance();
dbFac.setNamespaceAware(_namespaceAware);
dbFac.setValidating(_validating);
try {
re... | [
"public",
"static",
"Document",
"parseXmlString",
"(",
"String",
"_xmlStr",
",",
"boolean",
"_validating",
",",
"boolean",
"_namespaceAware",
")",
"throws",
"IOException",
"{",
"DocumentBuilderFactory",
"dbFac",
"=",
"DocumentBuilderFactory",
".",
"newInstance",
"(",
... | Read the given string as XML document.
@param _xmlStr xml string
@param _validating boolean
@param _namespaceAware boolean
@return {@link org.w3c.dom.Document}
@throws IOException on error | [
"Read",
"the",
"given",
"string",
"as",
"XML",
"document",
"."
] | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/xml/XmlUtil.java#L112-L127 |
wdtinc/mapbox-vector-tile-java | src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/MvtReader.java | MvtReader.readPoints | private static Geometry readPoints(GeometryFactory geomFactory, List<Integer> geomCmds, Vec2d cursor) {
"""
Create {@link Point} or {@link MultiPoint} from MVT geometry drawing commands.
@param geomFactory creates JTS geometry
@param geomCmds contains MVT geometry commands
@param cursor contains current MVT e... | java | private static Geometry readPoints(GeometryFactory geomFactory, List<Integer> geomCmds, Vec2d cursor) {
// Guard: must have header
if(geomCmds.isEmpty()) {
return null;
}
/** Geometry command index */
int i = 0;
// Read command header
final int cmdH... | [
"private",
"static",
"Geometry",
"readPoints",
"(",
"GeometryFactory",
"geomFactory",
",",
"List",
"<",
"Integer",
">",
"geomCmds",
",",
"Vec2d",
"cursor",
")",
"{",
"// Guard: must have header",
"if",
"(",
"geomCmds",
".",
"isEmpty",
"(",
")",
")",
"{",
"retu... | Create {@link Point} or {@link MultiPoint} from MVT geometry drawing commands.
@param geomFactory creates JTS geometry
@param geomCmds contains MVT geometry commands
@param cursor contains current MVT extent position
@return JTS geometry or null on failure | [
"Create",
"{",
"@link",
"Point",
"}",
"or",
"{",
"@link",
"MultiPoint",
"}",
"from",
"MVT",
"geometry",
"drawing",
"commands",
"."
] | train | https://github.com/wdtinc/mapbox-vector-tile-java/blob/e5e3df3fc2260709e289f972a1348c0a1ea30339/src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/MvtReader.java#L187-L234 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.saveRule | public JSONObject saveRule(String objectID, JSONObject rule, boolean forwardToReplicas) throws AlgoliaException {
"""
Save a query rule
@param objectID the objectId of the query rule to save
@param rule the content of this query rule
@param forwardToReplicas Forward this operation to the... | java | public JSONObject saveRule(String objectID, JSONObject rule, boolean forwardToReplicas) throws AlgoliaException {
return this.saveRule(objectID, rule, forwardToReplicas, RequestOptions.empty);
} | [
"public",
"JSONObject",
"saveRule",
"(",
"String",
"objectID",
",",
"JSONObject",
"rule",
",",
"boolean",
"forwardToReplicas",
")",
"throws",
"AlgoliaException",
"{",
"return",
"this",
".",
"saveRule",
"(",
"objectID",
",",
"rule",
",",
"forwardToReplicas",
",",
... | Save a query rule
@param objectID the objectId of the query rule to save
@param rule the content of this query rule
@param forwardToReplicas Forward this operation to the replica indices | [
"Save",
"a",
"query",
"rule"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L1687-L1689 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/classify/LinearClassifierFactory.java | LinearClassifierFactory.heldOutSetSigma | public double[] heldOutSetSigma(final GeneralDataset<L, F> trainSet, final GeneralDataset<L, F> devSet, final Scorer<L> scorer, LineSearcher minimizer) {
"""
Sets the sigma parameter to a value that optimizes the held-out score given by <code>scorer</code>. Search for an optimal value
is carried out by <code>min... | java | public double[] heldOutSetSigma(final GeneralDataset<L, F> trainSet, final GeneralDataset<L, F> devSet, final Scorer<L> scorer, LineSearcher minimizer) {
featureIndex = trainSet.featureIndex;
labelIndex = trainSet.labelIndex;
//double[] resultWeights = null;
Timing timer = new Timing();
Neg... | [
"public",
"double",
"[",
"]",
"heldOutSetSigma",
"(",
"final",
"GeneralDataset",
"<",
"L",
",",
"F",
">",
"trainSet",
",",
"final",
"GeneralDataset",
"<",
"L",
",",
"F",
">",
"devSet",
",",
"final",
"Scorer",
"<",
"L",
">",
"scorer",
",",
"LineSearcher",... | Sets the sigma parameter to a value that optimizes the held-out score given by <code>scorer</code>. Search for an optimal value
is carried out by <code>minimizer</code>
dataset the data set to optimize sigma on.
kfold
@return an interim set of optimal weights: the weights | [
"Sets",
"the",
"sigma",
"parameter",
"to",
"a",
"value",
"that",
"optimizes",
"the",
"held",
"-",
"out",
"score",
"given",
"by",
"<code",
">",
"scorer<",
"/",
"code",
">",
".",
"Search",
"for",
"an",
"optimal",
"value",
"is",
"carried",
"out",
"by",
"<... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/classify/LinearClassifierFactory.java#L647-L662 |
waldheinz/fat32-lib | src/main/java/de/waldheinz/fs/fat/DosUtils.java | DosUtils.decodeDateTime | public static long decodeDateTime(int dosDate, int dosTime) {
"""
Decode a 16-bit encoded DOS date/time into a java date/time.
@param dosDate
@param dosTime
@return long
"""
final Calendar cal = Calendar.getInstance();
cal.set(Calendar.MILLISECOND, 0);
cal.set(Calendar.SEC... | java | public static long decodeDateTime(int dosDate, int dosTime) {
final Calendar cal = Calendar.getInstance();
cal.set(Calendar.MILLISECOND, 0);
cal.set(Calendar.SECOND, (dosTime & 0x1f) * 2);
cal.set(Calendar.MINUTE, (dosTime >> 5) & 0x3f);
cal.set(Calendar.HOUR_OF_DAY, dos... | [
"public",
"static",
"long",
"decodeDateTime",
"(",
"int",
"dosDate",
",",
"int",
"dosTime",
")",
"{",
"final",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"set",
"(",
"Calendar",
".",
"MILLISECOND",
",",
"0",
")",
... | Decode a 16-bit encoded DOS date/time into a java date/time.
@param dosDate
@param dosTime
@return long | [
"Decode",
"a",
"16",
"-",
"bit",
"encoded",
"DOS",
"date",
"/",
"time",
"into",
"a",
"java",
"date",
"/",
"time",
"."
] | train | https://github.com/waldheinz/fat32-lib/blob/3d8f1a986339573576e02eb0b6ea49bfdc9cce26/src/main/java/de/waldheinz/fs/fat/DosUtils.java#L41-L54 |
landawn/AbacusUtil | src/com/landawn/abacus/util/DateUtil.java | DateUtil.parseTime | public static Time parseTime(final String date, final String format, final TimeZone timeZone) {
"""
Converts the specified <code>date</code> with the specified {@code format} to a new instance of Time.
<code>null</code> is returned if the specified <code>date</code> is null or empty.
@param date
@param format... | java | public static Time parseTime(final String date, final String format, final TimeZone timeZone) {
if (N.isNullOrEmpty(date) || (date.length() == 4 && "null".equalsIgnoreCase(date))) {
return null;
}
return createTime(parse(date, format, timeZone));
} | [
"public",
"static",
"Time",
"parseTime",
"(",
"final",
"String",
"date",
",",
"final",
"String",
"format",
",",
"final",
"TimeZone",
"timeZone",
")",
"{",
"if",
"(",
"N",
".",
"isNullOrEmpty",
"(",
"date",
")",
"||",
"(",
"date",
".",
"length",
"(",
")... | Converts the specified <code>date</code> with the specified {@code format} to a new instance of Time.
<code>null</code> is returned if the specified <code>date</code> is null or empty.
@param date
@param format
@param timeZone
@return | [
"Converts",
"the",
"specified",
"<code",
">",
"date<",
"/",
"code",
">",
"with",
"the",
"specified",
"{",
"@code",
"format",
"}",
"to",
"a",
"new",
"instance",
"of",
"Time",
".",
"<code",
">",
"null<",
"/",
"code",
">",
"is",
"returned",
"if",
"the",
... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/DateUtil.java#L433-L439 |
Impetus/Kundera | src/kundera-mongo/src/main/java/com/impetus/client/mongodb/query/MongoDBQuery.java | MongoDBQuery.createLikeRegex | public static String createLikeRegex(String expr, boolean ignoreCase) {
"""
Create regular expression equivalent to any like operator string match
function.
@param expr
the expr
@param ignoreCase
whether to ignore the case
@return the string
"""
String regex = createRegex(expr, ignoreCase);
... | java | public static String createLikeRegex(String expr, boolean ignoreCase)
{
String regex = createRegex(expr, ignoreCase);
regex = regex.replace("_", ".").replace("%", ".*?");
return regex;
} | [
"public",
"static",
"String",
"createLikeRegex",
"(",
"String",
"expr",
",",
"boolean",
"ignoreCase",
")",
"{",
"String",
"regex",
"=",
"createRegex",
"(",
"expr",
",",
"ignoreCase",
")",
";",
"regex",
"=",
"regex",
".",
"replace",
"(",
"\"_\"",
",",
"\".\... | Create regular expression equivalent to any like operator string match
function.
@param expr
the expr
@param ignoreCase
whether to ignore the case
@return the string | [
"Create",
"regular",
"expression",
"equivalent",
"to",
"any",
"like",
"operator",
"string",
"match",
"function",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-mongo/src/main/java/com/impetus/client/mongodb/query/MongoDBQuery.java#L1278-L1284 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/org/semanticweb/owlapi/model/AxiomType_CustomFieldSerializer.java | AxiomType_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, AxiomType instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, AxiomType instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"AxiomType",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.client.rp... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{"
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/org/semanticweb/owlapi/model/AxiomType_CustomFieldSerializer.java#L62-L65 |
jboss/jboss-jstl-api_spec | src/main/java/org/apache/taglibs/standard/tag/common/xml/ParseSupport.java | ParseSupport.parseInputSourceWithFilter | private Document parseInputSourceWithFilter(InputSource s, XMLFilter f) throws JspException {
"""
Parses the given InputSource after, applying the given XMLFilter.
"""
try {
XMLReader xr = XmlUtil.newXMLReader(entityResolver);
// (note that we overwrite the filter's parent. t... | java | private Document parseInputSourceWithFilter(InputSource s, XMLFilter f) throws JspException {
try {
XMLReader xr = XmlUtil.newXMLReader(entityResolver);
// (note that we overwrite the filter's parent. this seems
// to be expected usage. we could cache and reset the old... | [
"private",
"Document",
"parseInputSourceWithFilter",
"(",
"InputSource",
"s",
",",
"XMLFilter",
"f",
")",
"throws",
"JspException",
"{",
"try",
"{",
"XMLReader",
"xr",
"=",
"XmlUtil",
".",
"newXMLReader",
"(",
"entityResolver",
")",
";",
"// (note that we overwrit... | Parses the given InputSource after, applying the given XMLFilter. | [
"Parses",
"the",
"given",
"InputSource",
"after",
"applying",
"the",
"given",
"XMLFilter",
"."
] | train | https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/org/apache/taglibs/standard/tag/common/xml/ParseSupport.java#L142-L167 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/tracing/ThresholdLogSpanContext.java | ThresholdLogSpanContext.baggageItem | public ThresholdLogSpanContext baggageItem(final String item, final String value) {
"""
Stores the given baggage item/value.
If an item already exists, it will be overridden.
@param item the item to store.
@param value the value to store.
@return this {@link ThresholdLogSpanContext} for chaining purposes.
... | java | public ThresholdLogSpanContext baggageItem(final String item, final String value) {
baggageItems.put(item, value);
return this;
} | [
"public",
"ThresholdLogSpanContext",
"baggageItem",
"(",
"final",
"String",
"item",
",",
"final",
"String",
"value",
")",
"{",
"baggageItems",
".",
"put",
"(",
"item",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Stores the given baggage item/value.
If an item already exists, it will be overridden.
@param item the item to store.
@param value the value to store.
@return this {@link ThresholdLogSpanContext} for chaining purposes. | [
"Stores",
"the",
"given",
"baggage",
"item",
"/",
"value",
"."
] | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/tracing/ThresholdLogSpanContext.java#L61-L64 |
jeremylong/DependencyCheck | cli/src/main/java/org/owasp/dependencycheck/App.java | App.ensureCanonicalPath | protected String ensureCanonicalPath(String path) {
"""
Takes a path and resolves it to be a canonical & absolute path. The
caveats are that this method will take an Ant style file selector path
(../someDir/**\/*.jar) and convert it to an absolute/canonical path (at
least to the left of the first * or ?).
... | java | protected String ensureCanonicalPath(String path) {
final String basePath;
String wildCards = null;
final String file = path.replace('\\', '/');
if (file.contains("*") || file.contains("?")) {
int pos = getLastFileSeparator(file);
if (pos < 0) {
r... | [
"protected",
"String",
"ensureCanonicalPath",
"(",
"String",
"path",
")",
"{",
"final",
"String",
"basePath",
";",
"String",
"wildCards",
"=",
"null",
";",
"final",
"String",
"file",
"=",
"path",
".",
"replace",
"(",
"'",
"'",
",",
"'",
"'",
")",
";",
... | Takes a path and resolves it to be a canonical & absolute path. The
caveats are that this method will take an Ant style file selector path
(../someDir/**\/*.jar) and convert it to an absolute/canonical path (at
least to the left of the first * or ?).
@param path the path to canonicalize
@return the canonical path | [
"Takes",
"a",
"path",
"and",
"resolves",
"it",
"to",
"be",
"a",
"canonical",
"&",
";",
"absolute",
"path",
".",
"The",
"caveats",
"are",
"that",
"this",
"method",
"will",
"take",
"an",
"Ant",
"style",
"file",
"selector",
"path",
"(",
"..",
"/",
"som... | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/cli/src/main/java/org/owasp/dependencycheck/App.java#L565-L593 |
aws/aws-sdk-java | aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/CreateLoggerDefinitionRequest.java | CreateLoggerDefinitionRequest.withTags | public CreateLoggerDefinitionRequest withTags(java.util.Map<String, String> tags) {
"""
Tag(s) to add to the new resource
@param tags
Tag(s) to add to the new resource
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return this;
... | java | public CreateLoggerDefinitionRequest withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"CreateLoggerDefinitionRequest",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | Tag(s) to add to the new resource
@param tags
Tag(s) to add to the new resource
@return Returns a reference to this object so that method calls can be chained together. | [
"Tag",
"(",
"s",
")",
"to",
"add",
"to",
"the",
"new",
"resource"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-greengrass/src/main/java/com/amazonaws/services/greengrass/model/CreateLoggerDefinitionRequest.java#L168-L171 |
threerings/narya | core/src/main/java/com/threerings/bureau/server/BureauRegistry.java | BureauRegistry.agentCreated | protected void agentCreated (ClientObject client, int agentId) {
"""
Callback for when the bureau client acknowledges the creation of an agent.
"""
FoundAgent found = resolve(client, agentId, "agentCreated");
if (found == null) {
return;
}
log.info("Agent creation c... | java | protected void agentCreated (ClientObject client, int agentId)
{
FoundAgent found = resolve(client, agentId, "agentCreated");
if (found == null) {
return;
}
log.info("Agent creation confirmed", "agent", found.agent.which());
if (found.state == AgentState.STARTED... | [
"protected",
"void",
"agentCreated",
"(",
"ClientObject",
"client",
",",
"int",
"agentId",
")",
"{",
"FoundAgent",
"found",
"=",
"resolve",
"(",
"client",
",",
"agentId",
",",
"\"agentCreated\"",
")",
";",
"if",
"(",
"found",
"==",
"null",
")",
"{",
"retur... | Callback for when the bureau client acknowledges the creation of an agent. | [
"Callback",
"for",
"when",
"the",
"bureau",
"client",
"acknowledges",
"the",
"creation",
"of",
"an",
"agent",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/bureau/server/BureauRegistry.java#L426-L452 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetsInner.java | AssetsInner.getEncryptionKey | public StorageEncryptedAssetDecryptionDataInner getEncryptionKey(String resourceGroupName, String accountName, String assetName) {
"""
Gets the Asset storage key.
Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API.
@param resourceGroupName The name of ... | java | public StorageEncryptedAssetDecryptionDataInner getEncryptionKey(String resourceGroupName, String accountName, String assetName) {
return getEncryptionKeyWithServiceResponseAsync(resourceGroupName, accountName, assetName).toBlocking().single().body();
} | [
"public",
"StorageEncryptedAssetDecryptionDataInner",
"getEncryptionKey",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"assetName",
")",
"{",
"return",
"getEncryptionKeyWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
... | Gets the Asset storage key.
Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param assetName The Asset name.
@throws ... | [
"Gets",
"the",
"Asset",
"storage",
"key",
".",
"Gets",
"the",
"Asset",
"storage",
"encryption",
"keys",
"used",
"to",
"decrypt",
"content",
"created",
"by",
"version",
"2",
"of",
"the",
"Media",
"Services",
"API",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/AssetsInner.java#L895-L897 |
LearnLib/learnlib | algorithms/active/lstar/src/main/java/de/learnlib/algorithms/lstar/AbstractLStar.java | AbstractLStar.completeConsistentTable | protected boolean completeConsistentTable(List<List<Row<I>>> unclosed, boolean checkConsistency) {
"""
Iteratedly checks for unclosedness and inconsistencies in the table, and fixes any occurrences thereof. This
process is repeated until the observation table is both closed and consistent.
@param unclosed
the... | java | protected boolean completeConsistentTable(List<List<Row<I>>> unclosed, boolean checkConsistency) {
boolean refined = false;
List<List<Row<I>>> unclosedIter = unclosed;
do {
while (!unclosedIter.isEmpty()) {
List<Row<I>> closingRows = selectClosingRows(unclosedIter);
... | [
"protected",
"boolean",
"completeConsistentTable",
"(",
"List",
"<",
"List",
"<",
"Row",
"<",
"I",
">",
">",
">",
"unclosed",
",",
"boolean",
"checkConsistency",
")",
"{",
"boolean",
"refined",
"=",
"false",
";",
"List",
"<",
"List",
"<",
"Row",
"<",
"I"... | Iteratedly checks for unclosedness and inconsistencies in the table, and fixes any occurrences thereof. This
process is repeated until the observation table is both closed and consistent.
@param unclosed
the unclosed rows (equivalence classes) to start with. | [
"Iteratedly",
"checks",
"for",
"unclosedness",
"and",
"inconsistencies",
"in",
"the",
"table",
"and",
"fixes",
"any",
"occurrences",
"thereof",
".",
"This",
"process",
"is",
"repeated",
"until",
"the",
"observation",
"table",
"is",
"both",
"closed",
"and",
"cons... | train | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/lstar/src/main/java/de/learnlib/algorithms/lstar/AbstractLStar.java#L136-L160 |
rainu/dbc | src/main/java/de/raysha/lib/dbc/meta/MetadataManager.java | MetadataManager.updateMetadata | public void updateMetadata(String tableName, String metadata) {
"""
Aktualisiert die Metadaten eines Eintrages.
@param tableName Name der Tabelle
@param metadata Metadaten die eingetragen werden sollen.
"""
try {
updateStatement.setString(1, metadata);
updateStatement.setLong(2, tableName.hashCode(... | java | public void updateMetadata(String tableName, String metadata){
try {
updateStatement.setString(1, metadata);
updateStatement.setLong(2, tableName.hashCode());
updateStatement.executeUpdate();
} catch (SQLException e) {
throw new BackendException("Could not update metadata for table '" + tableName + "'",... | [
"public",
"void",
"updateMetadata",
"(",
"String",
"tableName",
",",
"String",
"metadata",
")",
"{",
"try",
"{",
"updateStatement",
".",
"setString",
"(",
"1",
",",
"metadata",
")",
";",
"updateStatement",
".",
"setLong",
"(",
"2",
",",
"tableName",
".",
"... | Aktualisiert die Metadaten eines Eintrages.
@param tableName Name der Tabelle
@param metadata Metadaten die eingetragen werden sollen. | [
"Aktualisiert",
"die",
"Metadaten",
"eines",
"Eintrages",
"."
] | train | https://github.com/rainu/dbc/blob/bdf1d1945ccaa8db8ed0b91bd08d5ef9802777f7/src/main/java/de/raysha/lib/dbc/meta/MetadataManager.java#L159-L167 |
ixa-ehu/ixa-pipe-ml | src/main/java/eus/ixa/ixa/pipe/ml/utils/IOUtils.java | IOUtils.checkInputFile | private static void checkInputFile(final String name, final File inFile) {
"""
Check input file integrity.
@param name
the name of the file
@param inFile
the file
"""
String isFailure = null;
if (inFile.isDirectory()) {
isFailure = "The " + name + " file is a directory!";
} else if (!... | java | private static void checkInputFile(final String name, final File inFile) {
String isFailure = null;
if (inFile.isDirectory()) {
isFailure = "The " + name + " file is a directory!";
} else if (!inFile.exists()) {
isFailure = "The " + name + " file does not exist!";
} else if (!inFile.canRea... | [
"private",
"static",
"void",
"checkInputFile",
"(",
"final",
"String",
"name",
",",
"final",
"File",
"inFile",
")",
"{",
"String",
"isFailure",
"=",
"null",
";",
"if",
"(",
"inFile",
".",
"isDirectory",
"(",
")",
")",
"{",
"isFailure",
"=",
"\"The \"",
"... | Check input file integrity.
@param name
the name of the file
@param inFile
the file | [
"Check",
"input",
"file",
"integrity",
"."
] | train | https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/utils/IOUtils.java#L143-L159 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Agg.java | Agg.denseRank | public static <T extends Comparable<? super T>> Collector<T, ?, Optional<Long>> denseRank(T value) {
"""
Get a {@link Collector} that calculates the <code>DENSE_RANK()</code> function given natural ordering.
"""
return denseRankBy(value, t -> t, naturalOrder());
} | java | public static <T extends Comparable<? super T>> Collector<T, ?, Optional<Long>> denseRank(T value) {
return denseRankBy(value, t -> t, naturalOrder());
} | [
"public",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"?",
"super",
"T",
">",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"Optional",
"<",
"Long",
">",
">",
"denseRank",
"(",
"T",
"value",
")",
"{",
"return",
"denseRankBy",
"(",
"value",
",",
... | Get a {@link Collector} that calculates the <code>DENSE_RANK()</code> function given natural ordering. | [
"Get",
"a",
"{"
] | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Agg.java#L699-L701 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/GroupsPoolsApi.java | GroupsPoolsApi.getGroups | public GroupSearch getGroups(int page, int perPage) throws JinxException {
"""
Returns a list of groups to which you can add photos.
<br>
This method requires authentication with 'read' permission.
@param page The page of results to return. If this argument is less than 1, it defaults to 1.
@param perPage... | java | public GroupSearch getGroups(int page, int perPage) throws JinxException {
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.groups.pools.getGroups");
if (page > 0) {
params.put("page", Integer.toString(page));
}
if (perPage > 0) {
params.put("per_page", Integer.... | [
"public",
"GroupSearch",
"getGroups",
"(",
"int",
"page",
",",
"int",
"perPage",
")",
"throws",
"JinxException",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"TreeMap",
"<>",
"(",
")",
";",
"params",
".",
"put",
"(",
"\"method\"",... | Returns a list of groups to which you can add photos.
<br>
This method requires authentication with 'read' permission.
@param page The page of results to return. If this argument is less than 1, it defaults to 1.
@param perPage Number of groups to return per page. If this argument is less than 1, it defaults to 400... | [
"Returns",
"a",
"list",
"of",
"groups",
"to",
"which",
"you",
"can",
"add",
"photos",
".",
"<br",
">",
"This",
"method",
"requires",
"authentication",
"with",
"read",
"permission",
"."
] | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/GroupsPoolsApi.java#L99-L109 |
Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/shared/Applications.java | Applications.getReconcileHashCode | public static String getReconcileHashCode(Map<String, AtomicInteger> instanceCountMap) {
"""
Gets the reconciliation hashcode. The hashcode is used to determine
whether the applications list has changed since the last time it was
acquired.
@param instanceCountMap
the instance count map to use for generating ... | java | public static String getReconcileHashCode(Map<String, AtomicInteger> instanceCountMap) {
StringBuilder reconcileHashCode = new StringBuilder(75);
for (Map.Entry<String, AtomicInteger> mapEntry : instanceCountMap.entrySet()) {
reconcileHashCode.append(mapEntry.getKey()).append(STATUS_DELIMITE... | [
"public",
"static",
"String",
"getReconcileHashCode",
"(",
"Map",
"<",
"String",
",",
"AtomicInteger",
">",
"instanceCountMap",
")",
"{",
"StringBuilder",
"reconcileHashCode",
"=",
"new",
"StringBuilder",
"(",
"75",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"... | Gets the reconciliation hashcode. The hashcode is used to determine
whether the applications list has changed since the last time it was
acquired.
@param instanceCountMap
the instance count map to use for generating the hash
@return the hash code for this instance | [
"Gets",
"the",
"reconciliation",
"hashcode",
".",
"The",
"hashcode",
"is",
"used",
"to",
"determine",
"whether",
"the",
"applications",
"list",
"has",
"changed",
"since",
"the",
"last",
"time",
"it",
"was",
"acquired",
"."
] | train | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/shared/Applications.java#L265-L272 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_ssl_certkey.java | ns_ssl_certkey.gen_csr | public static ns_ssl_certkey gen_csr(nitro_service client, ns_ssl_certkey resource) throws Exception {
"""
<pre>
Use this operation to generate CSR for the certificate.
</pre>
"""
return ((ns_ssl_certkey[]) resource.perform_operation(client, "gen_csr"))[0];
} | java | public static ns_ssl_certkey gen_csr(nitro_service client, ns_ssl_certkey resource) throws Exception
{
return ((ns_ssl_certkey[]) resource.perform_operation(client, "gen_csr"))[0];
} | [
"public",
"static",
"ns_ssl_certkey",
"gen_csr",
"(",
"nitro_service",
"client",
",",
"ns_ssl_certkey",
"resource",
")",
"throws",
"Exception",
"{",
"return",
"(",
"(",
"ns_ssl_certkey",
"[",
"]",
")",
"resource",
".",
"perform_operation",
"(",
"client",
",",
"\... | <pre>
Use this operation to generate CSR for the certificate.
</pre> | [
"<pre",
">",
"Use",
"this",
"operation",
"to",
"generate",
"CSR",
"for",
"the",
"certificate",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns_ssl_certkey.java#L553-L556 |
inkstand-io/scribble | scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/util/XMLContentHandler.java | XMLContentHandler.startElement | @Override
public void startElement(final String uri, final String localName, final String qName, final Attributes attributes)
throws SAXException {
"""
Depending on the element, which has to be in the correct namespace, the method either creates a new node, adds a
mixin type or creates a property ... | java | @Override
public void startElement(final String uri, final String localName, final String qName, final Attributes attributes)
throws SAXException {
LOG.trace("startElement uri={} localName={} qName={} attributes={}", uri, localName, qName, attributes);
if (this.isNotInkstandNamespace(u... | [
"@",
"Override",
"public",
"void",
"startElement",
"(",
"final",
"String",
"uri",
",",
"final",
"String",
"localName",
",",
"final",
"String",
"qName",
",",
"final",
"Attributes",
"attributes",
")",
"throws",
"SAXException",
"{",
"LOG",
".",
"trace",
"(",
"\... | Depending on the element, which has to be in the correct namespace, the method either creates a new node, adds a
mixin type or creates a property (properties are not yet written to the node). | [
"Depending",
"on",
"the",
"element",
"which",
"has",
"to",
"be",
"in",
"the",
"correct",
"namespace",
"the",
"method",
"either",
"creates",
"a",
"new",
"node",
"adds",
"a",
"mixin",
"type",
"or",
"creates",
"a",
"property",
"(",
"properties",
"are",
"not",... | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/util/XMLContentHandler.java#L163-L188 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/dom/DOMOutputElement.java | DOMOutputElement.relink | private void relink(DOMOutputElement parent, Element element) {
"""
Method called to reuse a pooled instance.
@returns Chained pooled instance that should now be head of the
reuse chain
"""
super.relink(parent);
mParent = parent;
mElement = element;
parent.appendNode(ele... | java | private void relink(DOMOutputElement parent, Element element)
{
super.relink(parent);
mParent = parent;
mElement = element;
parent.appendNode(element);
mDefaultNsSet = false;
} | [
"private",
"void",
"relink",
"(",
"DOMOutputElement",
"parent",
",",
"Element",
"element",
")",
"{",
"super",
".",
"relink",
"(",
"parent",
")",
";",
"mParent",
"=",
"parent",
";",
"mElement",
"=",
"element",
";",
"parent",
".",
"appendNode",
"(",
"element... | Method called to reuse a pooled instance.
@returns Chained pooled instance that should now be head of the
reuse chain | [
"Method",
"called",
"to",
"reuse",
"a",
"pooled",
"instance",
"."
] | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dom/DOMOutputElement.java#L77-L84 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.