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 |
|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java | DevicesInner.beginCreateOrUpdateSecuritySettingsAsync | public Observable<Void> beginCreateOrUpdateSecuritySettingsAsync(String deviceName, String resourceGroupName, AsymmetricEncryptedSecret deviceAdminPassword) {
"""
Updates the security settings on a data box edge/gateway device.
@param deviceName The device name.
@param resourceGroupName The resource group name... | java | public Observable<Void> beginCreateOrUpdateSecuritySettingsAsync(String deviceName, String resourceGroupName, AsymmetricEncryptedSecret deviceAdminPassword) {
return beginCreateOrUpdateSecuritySettingsWithServiceResponseAsync(deviceName, resourceGroupName, deviceAdminPassword).map(new Func1<ServiceResponse<Void... | [
"public",
"Observable",
"<",
"Void",
">",
"beginCreateOrUpdateSecuritySettingsAsync",
"(",
"String",
"deviceName",
",",
"String",
"resourceGroupName",
",",
"AsymmetricEncryptedSecret",
"deviceAdminPassword",
")",
"{",
"return",
"beginCreateOrUpdateSecuritySettingsWithServiceRespo... | Updates the security settings on a data box edge/gateway device.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@param deviceAdminPassword Device administrator password as an encrypted string (encrypted using RSA PKCS #1) is used to sign into the local web UI of the device. The A... | [
"Updates",
"the",
"security",
"settings",
"on",
"a",
"data",
"box",
"edge",
"/",
"gateway",
"device",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java#L1942-L1949 |
alibaba/java-dns-cache-manipulator | library/src/main/java/com/alibaba/dcm/DnsCacheManipulator.java | DnsCacheManipulator.listDnsCache | public static List<DnsCacheEntry> listDnsCache() {
"""
Get all dns cache entries.
@return dns cache entries
@throws DnsCacheManipulatorException Operation fail
@see #getWholeDnsCache()
@since 1.2.0
"""
try {
return InetAddressCacheUtil.listInetAddressCache().getCache();
} catc... | java | public static List<DnsCacheEntry> listDnsCache() {
try {
return InetAddressCacheUtil.listInetAddressCache().getCache();
} catch (Exception e) {
throw new DnsCacheManipulatorException("Fail to listDnsCache, cause: " + e.toString(), e);
}
} | [
"public",
"static",
"List",
"<",
"DnsCacheEntry",
">",
"listDnsCache",
"(",
")",
"{",
"try",
"{",
"return",
"InetAddressCacheUtil",
".",
"listInetAddressCache",
"(",
")",
".",
"getCache",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw... | Get all dns cache entries.
@return dns cache entries
@throws DnsCacheManipulatorException Operation fail
@see #getWholeDnsCache()
@since 1.2.0 | [
"Get",
"all",
"dns",
"cache",
"entries",
"."
] | train | https://github.com/alibaba/java-dns-cache-manipulator/blob/eab50ee5c27671f9159b55458301f9429b2fcc47/library/src/main/java/com/alibaba/dcm/DnsCacheManipulator.java#L162-L168 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuEventElapsedTime | public static int cuEventElapsedTime(float pMilliseconds[], CUevent hStart, CUevent hEnd) {
"""
Computes the elapsed time between two events.
<pre>
CUresult cuEventElapsedTime (
float* pMilliseconds,
CUevent hStart,
CUevent hEnd )
</pre>
<div>
<p>Computes the elapsed time between two
events. Computes t... | java | public static int cuEventElapsedTime(float pMilliseconds[], CUevent hStart, CUevent hEnd)
{
return checkResult(cuEventElapsedTimeNative(pMilliseconds, hStart, hEnd));
} | [
"public",
"static",
"int",
"cuEventElapsedTime",
"(",
"float",
"pMilliseconds",
"[",
"]",
",",
"CUevent",
"hStart",
",",
"CUevent",
"hEnd",
")",
"{",
"return",
"checkResult",
"(",
"cuEventElapsedTimeNative",
"(",
"pMilliseconds",
",",
"hStart",
",",
"hEnd",
")",... | Computes the elapsed time between two events.
<pre>
CUresult cuEventElapsedTime (
float* pMilliseconds,
CUevent hStart,
CUevent hEnd )
</pre>
<div>
<p>Computes the elapsed time between two
events. Computes the elapsed time between two events (in milliseconds
with a resolution
of around 0.5 microseconds).
</p>
<p>If e... | [
"Computes",
"the",
"elapsed",
"time",
"between",
"two",
"events",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L13657-L13660 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/res/XPATHMessages.java | XPATHMessages.createXPATHMessage | public static final String createXPATHMessage(String msgKey, Object args[]) //throws Exception {
"""
Creates a message from the specified key and replacement
arguments, localized to the given locale.
@param msgKey The key for the message text.
@param args The arguments to be used as replacement text
... | java | public static final String createXPATHMessage(String msgKey, Object args[]) //throws Exception
{
// BEGIN android-changed
// don't localize exception messages
return createXPATHMsg(XPATHBundle, msgKey, args);
// END android-changed
} | [
"public",
"static",
"final",
"String",
"createXPATHMessage",
"(",
"String",
"msgKey",
",",
"Object",
"args",
"[",
"]",
")",
"//throws Exception ",
"{",
"// BEGIN android-changed",
"// don't localize exception messages",
"return",
"createXPATHMsg",
"(",
"XPATHBundle",
... | Creates a message from the specified key and replacement
arguments, localized to the given locale.
@param msgKey The key for the message text.
@param args The arguments to be used as replacement text
in the message created.
@return The formatted message string. | [
"Creates",
"a",
"message",
"from",
"the",
"specified",
"key",
"and",
"replacement",
"arguments",
"localized",
"to",
"the",
"given",
"locale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/res/XPATHMessages.java#L50-L56 |
icode/ameba | src/main/java/ameba/core/ws/rs/ParamConverters.java | ParamConverters.parseDate | public static Date parseDate(String value, ParsePosition pos) {
"""
<p>parseDate.</p>
@param value a {@link java.lang.String} object.
@param pos a {@link java.text.ParsePosition} object.
@return a {@link java.util.Date} object.
"""
Long timestamp = parseTimestamp(value);
if (timestamp !=... | java | public static Date parseDate(String value, ParsePosition pos) {
Long timestamp = parseTimestamp(value);
if (timestamp != null) {
return new Date(timestamp);
}
if (value.contains(" ")) {
value = value.replace(" ", "+");
}
if (!(value.contains("-") |... | [
"public",
"static",
"Date",
"parseDate",
"(",
"String",
"value",
",",
"ParsePosition",
"pos",
")",
"{",
"Long",
"timestamp",
"=",
"parseTimestamp",
"(",
"value",
")",
";",
"if",
"(",
"timestamp",
"!=",
"null",
")",
"{",
"return",
"new",
"Date",
"(",
"tim... | <p>parseDate.</p>
@param value a {@link java.lang.String} object.
@param pos a {@link java.text.ParsePosition} object.
@return a {@link java.util.Date} object. | [
"<p",
">",
"parseDate",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/core/ws/rs/ParamConverters.java#L76-L92 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/validation/ValidationUtils.java | ValidationUtils.buildValueMismatchErrorMessage | public static String buildValueMismatchErrorMessage(String baseMessage, Object controlValue, Object actualValue) {
"""
Constructs proper error message with expected value and actual value.
@param baseMessage the base error message.
@param controlValue the expected value.
@param actualValue the actual value.
@r... | java | public static String buildValueMismatchErrorMessage(String baseMessage, Object controlValue, Object actualValue) {
return baseMessage + ", expected '" + controlValue + "' but was '" + actualValue + "'";
} | [
"public",
"static",
"String",
"buildValueMismatchErrorMessage",
"(",
"String",
"baseMessage",
",",
"Object",
"controlValue",
",",
"Object",
"actualValue",
")",
"{",
"return",
"baseMessage",
"+",
"\", expected '\"",
"+",
"controlValue",
"+",
"\"' but was '\"",
"+",
"ac... | Constructs proper error message with expected value and actual value.
@param baseMessage the base error message.
@param controlValue the expected value.
@param actualValue the actual value.
@return | [
"Constructs",
"proper",
"error",
"message",
"with",
"expected",
"value",
"and",
"actual",
"value",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/ValidationUtils.java#L155-L157 |
haifengl/smile | math/src/main/java/smile/math/Math.java | Math.row | private static int row(int[] r, int f) {
"""
Returns the index of given frequency.
@param r the frequency list.
@param f the given frequency.
@return the index of given frequency or -1 if it doesn't exist in the list.
"""
int i = 0;
while (i < r.length && r[i] < f) {
++i;
... | java | private static int row(int[] r, int f) {
int i = 0;
while (i < r.length && r[i] < f) {
++i;
}
return ((i < r.length && r[i] == f) ? i : -1);
} | [
"private",
"static",
"int",
"row",
"(",
"int",
"[",
"]",
"r",
",",
"int",
"f",
")",
"{",
"int",
"i",
"=",
"0",
";",
"while",
"(",
"i",
"<",
"r",
".",
"length",
"&&",
"r",
"[",
"i",
"]",
"<",
"f",
")",
"{",
"++",
"i",
";",
"}",
"return",
... | Returns the index of given frequency.
@param r the frequency list.
@param f the given frequency.
@return the index of given frequency or -1 if it doesn't exist in the list. | [
"Returns",
"the",
"index",
"of",
"given",
"frequency",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/math/src/main/java/smile/math/Math.java#L3258-L3266 |
camunda/camunda-bpmn-model | src/main/java/org/camunda/bpm/model/bpmn/builder/AbstractUserTaskBuilder.java | AbstractUserTaskBuilder.camundaFormField | public CamundaUserTaskFormFieldBuilder camundaFormField() {
"""
Creates a new camunda form field extension element.
@return the builder object
"""
CamundaFormData camundaFormData = getCreateSingleExtensionElement(CamundaFormData.class);
CamundaFormField camundaFormField = createChild(camundaFormData... | java | public CamundaUserTaskFormFieldBuilder camundaFormField() {
CamundaFormData camundaFormData = getCreateSingleExtensionElement(CamundaFormData.class);
CamundaFormField camundaFormField = createChild(camundaFormData, CamundaFormField.class);
return new CamundaUserTaskFormFieldBuilder(modelInstance, element, c... | [
"public",
"CamundaUserTaskFormFieldBuilder",
"camundaFormField",
"(",
")",
"{",
"CamundaFormData",
"camundaFormData",
"=",
"getCreateSingleExtensionElement",
"(",
"CamundaFormData",
".",
"class",
")",
";",
"CamundaFormField",
"camundaFormField",
"=",
"createChild",
"(",
"ca... | Creates a new camunda form field extension element.
@return the builder object | [
"Creates",
"a",
"new",
"camunda",
"form",
"field",
"extension",
"element",
"."
] | train | https://github.com/camunda/camunda-bpmn-model/blob/debcadf041d10fa62b799de0307b832cea84e5d4/src/main/java/org/camunda/bpm/model/bpmn/builder/AbstractUserTaskBuilder.java#L176-L180 |
sonyxperiadev/gerrit-events | src/main/java/com/sonymobile/tools/gerrit/gerritevents/ssh/SshConnectionImpl.java | SshConnectionImpl.executeCommandChannel | @Override
public ChannelExec executeCommandChannel(String command) throws SshException, IOException {
"""
This version takes a command to run, and then returns a wrapper instance
that exposes all the standard state of the channel (stdin, stdout,
stderr, exit status, etc).
@param command the command to exe... | java | @Override
public ChannelExec executeCommandChannel(String command) throws SshException, IOException {
return executeCommandChannel(command, true);
} | [
"@",
"Override",
"public",
"ChannelExec",
"executeCommandChannel",
"(",
"String",
"command",
")",
"throws",
"SshException",
",",
"IOException",
"{",
"return",
"executeCommandChannel",
"(",
"command",
",",
"true",
")",
";",
"}"
] | This version takes a command to run, and then returns a wrapper instance
that exposes all the standard state of the channel (stdin, stdout,
stderr, exit status, etc).
@param command the command to execute.
@return a Channel with access to all streams and the exit code.
@throws IOException if it is so.
@throws SshExce... | [
"This",
"version",
"takes",
"a",
"command",
"to",
"run",
"and",
"then",
"returns",
"a",
"wrapper",
"instance",
"that",
"exposes",
"all",
"the",
"standard",
"state",
"of",
"the",
"channel",
"(",
"stdin",
"stdout",
"stderr",
"exit",
"status",
"etc",
")",
"."... | train | https://github.com/sonyxperiadev/gerrit-events/blob/9a443d13dded85cc4709136ac33989f2bbb34fe2/src/main/java/com/sonymobile/tools/gerrit/gerritevents/ssh/SshConnectionImpl.java#L356-L359 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/GroupsDiscussRepliesApi.java | GroupsDiscussRepliesApi.getInfo | public ReplyInfo getInfo(String topicId, String replyId) throws JinxException {
"""
Get information on a group topic reply.
<br>
@param topicId (Required) The ID of the topic the post is in.
@param replyId (Required) The ID of the reply to fetch.
@return reply information.
@throws JinxException if required ... | java | public ReplyInfo getInfo(String topicId, String replyId) throws JinxException {
JinxUtils.validateParams(topicId, replyId);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.groups.discuss.replies.getInfo");
params.put("topic_id", topicId);
params.put("reply_id", replyId);
... | [
"public",
"ReplyInfo",
"getInfo",
"(",
"String",
"topicId",
",",
"String",
"replyId",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"topicId",
",",
"replyId",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=",
... | Get information on a group topic reply.
<br>
@param topicId (Required) The ID of the topic the post is in.
@param replyId (Required) The ID of the reply to fetch.
@return reply information.
@throws JinxException if required parameters are missing, or if there are any errors.
@see <a href="https://www.flickr.com/servic... | [
"Get",
"information",
"on",
"a",
"group",
"topic",
"reply",
".",
"<br",
">"
] | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/GroupsDiscussRepliesApi.java#L115-L122 |
ehcache/ehcache3 | core/src/main/java/org/ehcache/core/exceptions/ExceptionFactory.java | ExceptionFactory.newCacheLoadingException | public static CacheLoadingException newCacheLoadingException(Exception e, Exception suppressed) {
"""
Creates a new {@code CacheLoadingException} with the provided exception as cause and a suppressed one.
@param e the cause
@param suppressed the suppressed exception to add to the new exception
@return a cache... | java | public static CacheLoadingException newCacheLoadingException(Exception e, Exception suppressed) {
CacheLoadingException ne = new CacheLoadingException(e);
ne.addSuppressed(e);
return ne;
} | [
"public",
"static",
"CacheLoadingException",
"newCacheLoadingException",
"(",
"Exception",
"e",
",",
"Exception",
"suppressed",
")",
"{",
"CacheLoadingException",
"ne",
"=",
"new",
"CacheLoadingException",
"(",
"e",
")",
";",
"ne",
".",
"addSuppressed",
"(",
"e",
... | Creates a new {@code CacheLoadingException} with the provided exception as cause and a suppressed one.
@param e the cause
@param suppressed the suppressed exception to add to the new exception
@return a cache loading exception | [
"Creates",
"a",
"new",
"{",
"@code",
"CacheLoadingException",
"}",
"with",
"the",
"provided",
"exception",
"as",
"cause",
"and",
"a",
"suppressed",
"one",
"."
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/core/src/main/java/org/ehcache/core/exceptions/ExceptionFactory.java#L71-L75 |
wildfly/wildfly-core | jmx/src/main/java/org/jboss/as/jmx/model/ObjectNameAddressUtil.java | ObjectNameAddressUtil.createObjectName | static ObjectName createObjectName(final String domain, final PathAddress pathAddress) {
"""
Creates an ObjectName representation of a {@link PathAddress}.
@param domain the JMX domain to use for the ObjectName. Cannot be {@code null}
@param pathAddress the address. Cannot be {@code null}
@return the ObjectName... | java | static ObjectName createObjectName(final String domain, final PathAddress pathAddress) {
return createObjectName(domain, pathAddress, null);
} | [
"static",
"ObjectName",
"createObjectName",
"(",
"final",
"String",
"domain",
",",
"final",
"PathAddress",
"pathAddress",
")",
"{",
"return",
"createObjectName",
"(",
"domain",
",",
"pathAddress",
",",
"null",
")",
";",
"}"
] | Creates an ObjectName representation of a {@link PathAddress}.
@param domain the JMX domain to use for the ObjectName. Cannot be {@code null}
@param pathAddress the address. Cannot be {@code null}
@return the ObjectName. Will not return {@code null} | [
"Creates",
"an",
"ObjectName",
"representation",
"of",
"a",
"{"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/jmx/src/main/java/org/jboss/as/jmx/model/ObjectNameAddressUtil.java#L135-L137 |
Red5/red5-io | src/main/java/org/red5/io/matroska/VINT.java | VINT.fromValue | public static VINT fromValue(long value) {
"""
method to construct {@link VINT} based on its value
@param value
- value of {@link VINT}
@return {@link VINT} corresponding to this value
"""
BitSet bs = BitSet.valueOf(new long[] { value });
byte length = (byte) (1 + bs.length() / BIT_IN_BYTE... | java | public static VINT fromValue(long value) {
BitSet bs = BitSet.valueOf(new long[] { value });
byte length = (byte) (1 + bs.length() / BIT_IN_BYTE);
if (bs.length() == length * BIT_IN_BYTE) {
length++;
}
bs.set(length * BIT_IN_BYTE - length);
long binary = bs.to... | [
"public",
"static",
"VINT",
"fromValue",
"(",
"long",
"value",
")",
"{",
"BitSet",
"bs",
"=",
"BitSet",
".",
"valueOf",
"(",
"new",
"long",
"[",
"]",
"{",
"value",
"}",
")",
";",
"byte",
"length",
"=",
"(",
"byte",
")",
"(",
"1",
"+",
"bs",
".",
... | method to construct {@link VINT} based on its value
@param value
- value of {@link VINT}
@return {@link VINT} corresponding to this value | [
"method",
"to",
"construct",
"{",
"@link",
"VINT",
"}",
"based",
"on",
"its",
"value"
] | train | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/matroska/VINT.java#L144-L153 |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/PhoneIntents.java | PhoneIntents.newSmsIntent | public static Intent newSmsIntent(Context context, String body) {
"""
Creates an intent that will allow to send an SMS without specifying the phone number
@param body The text to send
@return the intent
"""
return newSmsIntent(context, body, (String[]) null);
} | java | public static Intent newSmsIntent(Context context, String body) {
return newSmsIntent(context, body, (String[]) null);
} | [
"public",
"static",
"Intent",
"newSmsIntent",
"(",
"Context",
"context",
",",
"String",
"body",
")",
"{",
"return",
"newSmsIntent",
"(",
"context",
",",
"body",
",",
"(",
"String",
"[",
"]",
")",
"null",
")",
";",
"}"
] | Creates an intent that will allow to send an SMS without specifying the phone number
@param body The text to send
@return the intent | [
"Creates",
"an",
"intent",
"that",
"will",
"allow",
"to",
"send",
"an",
"SMS",
"without",
"specifying",
"the",
"phone",
"number"
] | train | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/PhoneIntents.java#L71-L73 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.rotateAffine | public Matrix4d rotateAffine(Quaternionfc quat, Matrix4d dest) {
"""
Apply the rotation - and possibly scaling - transformation of the given {@link Quaternionfc} to this {@link #isAffine() affine} matrix and store
the result in <code>dest</code>.
<p>
This method assumes <code>this</code> to be {@link #isAffine(... | java | public Matrix4d rotateAffine(Quaternionfc quat, Matrix4d dest) {
double w2 = quat.w() * quat.w();
double x2 = quat.x() * quat.x();
double y2 = quat.y() * quat.y();
double z2 = quat.z() * quat.z();
double zw = quat.z() * quat.w();
double xy = quat.x() * quat.y();
d... | [
"public",
"Matrix4d",
"rotateAffine",
"(",
"Quaternionfc",
"quat",
",",
"Matrix4d",
"dest",
")",
"{",
"double",
"w2",
"=",
"quat",
".",
"w",
"(",
")",
"*",
"quat",
".",
"w",
"(",
")",
";",
"double",
"x2",
"=",
"quat",
".",
"x",
"(",
")",
"*",
"qu... | Apply the rotation - and possibly scaling - transformation of the given {@link Quaternionfc} to this {@link #isAffine() affine} matrix and store
the result in <code>dest</code>.
<p>
This method assumes <code>this</code> to be {@link #isAffine() affine}.
<p>
When used with a right-handed coordinate system, the produced ... | [
"Apply",
"the",
"rotation",
"-",
"and",
"possibly",
"scaling",
"-",
"transformation",
"of",
"the",
"given",
"{",
"@link",
"Quaternionfc",
"}",
"to",
"this",
"{",
"@link",
"#isAffine",
"()",
"affine",
"}",
"matrix",
"and",
"store",
"the",
"result",
"in",
"<... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L8133-L8177 |
pac4j/pac4j | pac4j-http/src/main/java/org/pac4j/http/credentials/DigestCredentials.java | DigestCredentials.calculateServerDigest | public String calculateServerDigest(boolean passwordAlreadyEncoded, String password) {
"""
This calculates the server digest value based on user stored password. If the server stores password in clear format
then passwordAlreadyEncoded should be false. If the server stores the password in ha1, digest then the
pa... | java | public String calculateServerDigest(boolean passwordAlreadyEncoded, String password) {
return generateDigest(passwordAlreadyEncoded, username,
realm, password, httpMethod, uri, qop, nonce, nc, cnonce);
} | [
"public",
"String",
"calculateServerDigest",
"(",
"boolean",
"passwordAlreadyEncoded",
",",
"String",
"password",
")",
"{",
"return",
"generateDigest",
"(",
"passwordAlreadyEncoded",
",",
"username",
",",
"realm",
",",
"password",
",",
"httpMethod",
",",
"uri",
",",... | This calculates the server digest value based on user stored password. If the server stores password in clear format
then passwordAlreadyEncoded should be false. If the server stores the password in ha1, digest then the
passwordAlreadyEncoded should be true.
@param passwordAlreadyEncoded false if the server stored pass... | [
"This",
"calculates",
"the",
"server",
"digest",
"value",
"based",
"on",
"user",
"stored",
"password",
".",
"If",
"the",
"server",
"stores",
"password",
"in",
"clear",
"format",
"then",
"passwordAlreadyEncoded",
"should",
"be",
"false",
".",
"If",
"the",
"serv... | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-http/src/main/java/org/pac4j/http/credentials/DigestCredentials.java#L68-L71 |
agmip/ace-lookup | src/main/java/org/agmip/ace/util/AcePathfinderUtil.java | AcePathfinderUtil.insertValue | public static void insertValue(HashMap m, String var, String val) {
"""
Inserts the variable in the appropriate place in a {@link HashMap},
according to the AcePathfinder.
@param m the HashMap to add the variable to.
@param var Variable to lookup
@param val the value to insert into the HashMap
"""
... | java | public static void insertValue(HashMap m, String var, String val) {
insertValue(m, var, val, null);
} | [
"public",
"static",
"void",
"insertValue",
"(",
"HashMap",
"m",
",",
"String",
"var",
",",
"String",
"val",
")",
"{",
"insertValue",
"(",
"m",
",",
"var",
",",
"val",
",",
"null",
")",
";",
"}"
] | Inserts the variable in the appropriate place in a {@link HashMap},
according to the AcePathfinder.
@param m the HashMap to add the variable to.
@param var Variable to lookup
@param val the value to insert into the HashMap | [
"Inserts",
"the",
"variable",
"in",
"the",
"appropriate",
"place",
"in",
"a",
"{",
"@link",
"HashMap",
"}",
"according",
"to",
"the",
"AcePathfinder",
"."
] | train | https://github.com/agmip/ace-lookup/blob/d8224a231cb8c01729e63010916a2a85517ce4c1/src/main/java/org/agmip/ace/util/AcePathfinderUtil.java#L90-L92 |
Azure/azure-sdk-for-java | keyvault/resource-manager/v2016_10_01/src/main/java/com/microsoft/azure/management/keyvault/v2016_10_01/implementation/VaultsInner.java | VaultsInner.purgeDeletedAsync | public Observable<Void> purgeDeletedAsync(String vaultName, String location) {
"""
Permanently deletes the specified vault. aka Purges the deleted Azure key vault.
@param vaultName The name of the soft-deleted vault.
@param location The location of the soft-deleted vault.
@throws IllegalArgumentException thro... | java | public Observable<Void> purgeDeletedAsync(String vaultName, String location) {
return purgeDeletedWithServiceResponseAsync(vaultName, location).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return response.body... | [
"public",
"Observable",
"<",
"Void",
">",
"purgeDeletedAsync",
"(",
"String",
"vaultName",
",",
"String",
"location",
")",
"{",
"return",
"purgeDeletedWithServiceResponseAsync",
"(",
"vaultName",
",",
"location",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"Servi... | Permanently deletes the specified vault. aka Purges the deleted Azure key vault.
@param vaultName The name of the soft-deleted vault.
@param location The location of the soft-deleted vault.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Permanently",
"deletes",
"the",
"specified",
"vault",
".",
"aka",
"Purges",
"the",
"deleted",
"Azure",
"key",
"vault",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/resource-manager/v2016_10_01/src/main/java/com/microsoft/azure/management/keyvault/v2016_10_01/implementation/VaultsInner.java#L1278-L1285 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewaysInner.java | LocalNetworkGatewaysInner.createOrUpdateAsync | public Observable<LocalNetworkGatewayInner> createOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) {
"""
Creates or updates a local network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param localN... | java | public Observable<LocalNetworkGatewayInner> createOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).map(new Func1<ServiceResponse<LocalNetworkGateway... | [
"public",
"Observable",
"<",
"LocalNetworkGatewayInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"localNetworkGatewayName",
",",
"LocalNetworkGatewayInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
... | Creates or updates a local network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param localNetworkGatewayName The name of the local network gateway.
@param parameters Parameters supplied to the create or update local network gateway operation.
@throws IllegalArgume... | [
"Creates",
"or",
"updates",
"a",
"local",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/LocalNetworkGatewaysInner.java#L145-L152 |
google/closure-compiler | src/com/google/javascript/jscomp/JSModuleGraph.java | JSModuleGraph.getDeepestCommonDependency | JSModule getDeepestCommonDependency(JSModule m1, JSModule m2) {
"""
Finds the deepest common dependency of two modules, not including the two
modules themselves.
@param m1 A module in this graph
@param m2 A module in this graph
@return The deepest common dep of {@code m1} and {@code m2}, or null if
they hav... | java | JSModule getDeepestCommonDependency(JSModule m1, JSModule m2) {
int m1Depth = m1.getDepth();
int m2Depth = m2.getDepth();
// According our definition of depth, the result must have a strictly
// smaller depth than either m1 or m2.
for (int depth = Math.min(m1Depth, m2Depth) - 1; depth >= 0; depth--)... | [
"JSModule",
"getDeepestCommonDependency",
"(",
"JSModule",
"m1",
",",
"JSModule",
"m2",
")",
"{",
"int",
"m1Depth",
"=",
"m1",
".",
"getDepth",
"(",
")",
";",
"int",
"m2Depth",
"=",
"m2",
".",
"getDepth",
"(",
")",
";",
"// According our definition of depth, t... | Finds the deepest common dependency of two modules, not including the two
modules themselves.
@param m1 A module in this graph
@param m2 A module in this graph
@return The deepest common dep of {@code m1} and {@code m2}, or null if
they have no common dependencies | [
"Finds",
"the",
"deepest",
"common",
"dependency",
"of",
"two",
"modules",
"not",
"including",
"the",
"two",
"modules",
"themselves",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/JSModuleGraph.java#L406-L423 |
wildfly/wildfly-core | cli/src/main/java/org/jboss/as/cli/handlers/DefaultFilenameTabCompleter.java | DefaultFilenameTabCompleter.completeCandidates | @Override
void completeCandidates(CommandContext ctx, String buffer, int cursor, List<String> candidates) {
"""
The only supported syntax at command execution is fully quoted, e.g.:
"/My Files\..." or not quoted at all. Completion supports only these 2
syntaxes.
"""
boolean quoted = buffer.starts... | java | @Override
void completeCandidates(CommandContext ctx, String buffer, int cursor, List<String> candidates) {
boolean quoted = buffer.startsWith("\"");
if (candidates.size() == 1) {
// Escaping must occur in all cases.
// if quoted, only " will be escaped.
EscapeSel... | [
"@",
"Override",
"void",
"completeCandidates",
"(",
"CommandContext",
"ctx",
",",
"String",
"buffer",
",",
"int",
"cursor",
",",
"List",
"<",
"String",
">",
"candidates",
")",
"{",
"boolean",
"quoted",
"=",
"buffer",
".",
"startsWith",
"(",
"\"\\\"\"",
")",
... | The only supported syntax at command execution is fully quoted, e.g.:
"/My Files\..." or not quoted at all. Completion supports only these 2
syntaxes. | [
"The",
"only",
"supported",
"syntax",
"at",
"command",
"execution",
"is",
"fully",
"quoted",
"e",
".",
"g",
".",
":",
"/",
"My",
"Files",
"\\",
"...",
"or",
"not",
"quoted",
"at",
"all",
".",
"Completion",
"supports",
"only",
"these",
"2",
"syntaxes",
... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/cli/src/main/java/org/jboss/as/cli/handlers/DefaultFilenameTabCompleter.java#L59-L69 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/MappingUtils.java | MappingUtils.returnField | public static Object returnField(Object object, String fieldName) throws MjdbcException {
"""
Returns class field value
Is used to return Constants
@param object Class field of which would be returned
@param fieldName field name
@return field value
@throws org.midao.jdbc.core.exception.MjdbcException if... | java | public static Object returnField(Object object, String fieldName) throws MjdbcException {
AssertUtils.assertNotNull(object);
Object result = null;
Field field = null;
try {
field = object.getClass().getField(fieldName);
result = field.get(object);
... | [
"public",
"static",
"Object",
"returnField",
"(",
"Object",
"object",
",",
"String",
"fieldName",
")",
"throws",
"MjdbcException",
"{",
"AssertUtils",
".",
"assertNotNull",
"(",
"object",
")",
";",
"Object",
"result",
"=",
"null",
";",
"Field",
"field",
"=",
... | Returns class field value
Is used to return Constants
@param object Class field of which would be returned
@param fieldName field name
@return field value
@throws org.midao.jdbc.core.exception.MjdbcException if field is not present or access is prohibited | [
"Returns",
"class",
"field",
"value",
"Is",
"used",
"to",
"return",
"Constants"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/MappingUtils.java#L451-L467 |
lightbend/config | config/src/main/java/com/typesafe/config/ConfigRenderOptions.java | ConfigRenderOptions.setJson | public ConfigRenderOptions setJson(boolean value) {
"""
Returns options with JSON toggled. JSON means that HOCON extensions
(omitting commas, quotes for example) won't be used. However, whether to
use comments is controlled by the separate {@link #setComments(boolean)}
and {@link #setOriginComments(boolean)} op... | java | public ConfigRenderOptions setJson(boolean value) {
if (value == json)
return this;
else
return new ConfigRenderOptions(originComments, comments, formatted, value);
} | [
"public",
"ConfigRenderOptions",
"setJson",
"(",
"boolean",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"json",
")",
"return",
"this",
";",
"else",
"return",
"new",
"ConfigRenderOptions",
"(",
"originComments",
",",
"comments",
",",
"formatted",
",",
"value",... | Returns options with JSON toggled. JSON means that HOCON extensions
(omitting commas, quotes for example) won't be used. However, whether to
use comments is controlled by the separate {@link #setComments(boolean)}
and {@link #setOriginComments(boolean)} options. So if you enable
comments you will get invalid JSON despi... | [
"Returns",
"options",
"with",
"JSON",
"toggled",
".",
"JSON",
"means",
"that",
"HOCON",
"extensions",
"(",
"omitting",
"commas",
"quotes",
"for",
"example",
")",
"won",
"t",
"be",
"used",
".",
"However",
"whether",
"to",
"use",
"comments",
"is",
"controlled"... | train | https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/ConfigRenderOptions.java#L149-L154 |
square/spoon | spoon-runner/src/main/java/com/squareup/spoon/misc/StackTrace.java | StackTrace.from | public static StackTrace from(Throwable exception) {
"""
Convert a {@link Throwable} to its equivalent {@link StackTrace}.
"""
checkNotNull(exception);
StackTrace cause = null;
Throwable realCause = exception.getCause();
if (realCause != null && realCause != exception) {
cause = from(rea... | java | public static StackTrace from(Throwable exception) {
checkNotNull(exception);
StackTrace cause = null;
Throwable realCause = exception.getCause();
if (realCause != null && realCause != exception) {
cause = from(realCause);
}
Deque<Element> elements = new ArrayDeque<>();
for (StackTra... | [
"public",
"static",
"StackTrace",
"from",
"(",
"Throwable",
"exception",
")",
"{",
"checkNotNull",
"(",
"exception",
")",
";",
"StackTrace",
"cause",
"=",
"null",
";",
"Throwable",
"realCause",
"=",
"exception",
".",
"getCause",
"(",
")",
";",
"if",
"(",
"... | Convert a {@link Throwable} to its equivalent {@link StackTrace}. | [
"Convert",
"a",
"{"
] | train | https://github.com/square/spoon/blob/ebd51fbc1498f6bdcb61aa1281bbac2af99117b3/spoon-runner/src/main/java/com/squareup/spoon/misc/StackTrace.java#L21-L38 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowControllerFactory.java | FlowControllerFactory.getPageFlowForRequest | public static PageFlowController getPageFlowForRequest( HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext ) {
"""
Get the page flow instance that should be a... | java | public static PageFlowController getPageFlowForRequest( HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext )
{
return getPageFlowForRelativeURI( reques... | [
"public",
"static",
"PageFlowController",
"getPageFlowForRequest",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"ServletContext",
"servletContext",
")",
"{",
"return",
"getPageFlowForRelativeURI",
"(",
"request",
",",
"response",
",",
... | Get the page flow instance that should be associated with the given request. If it doesn't exist, create it.
If one is created, the page flow stack (for nesting) will be cleared or pushed, and the new instance will be
stored as the current page flow.
@deprecated Use {@link #getPageFlowForRequest(RequestContext)} inste... | [
"Get",
"the",
"page",
"flow",
"instance",
"that",
"should",
"be",
"associated",
"with",
"the",
"given",
"request",
".",
"If",
"it",
"doesn",
"t",
"exist",
"create",
"it",
".",
"If",
"one",
"is",
"created",
"the",
"page",
"flow",
"stack",
"(",
"for",
"n... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowControllerFactory.java#L567-L572 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistriesInner.java | RegistriesInner.beginUpdatePolicies | public RegistryPoliciesInner beginUpdatePolicies(String resourceGroupName, String registryName, RegistryPoliciesInner registryPoliciesUpdateParameters) {
"""
Updates the policies for the specified container registry.
@param resourceGroupName The name of the resource group to which the container registry belongs... | java | public RegistryPoliciesInner beginUpdatePolicies(String resourceGroupName, String registryName, RegistryPoliciesInner registryPoliciesUpdateParameters) {
return beginUpdatePoliciesWithServiceResponseAsync(resourceGroupName, registryName, registryPoliciesUpdateParameters).toBlocking().single().body();
} | [
"public",
"RegistryPoliciesInner",
"beginUpdatePolicies",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"RegistryPoliciesInner",
"registryPoliciesUpdateParameters",
")",
"{",
"return",
"beginUpdatePoliciesWithServiceResponseAsync",
"(",
"resourceGroupName"... | Updates the policies for the specified container registry.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param registryPoliciesUpdateParameters The parameters for updating policies of a container registry.
@thro... | [
"Updates",
"the",
"policies",
"for",
"the",
"specified",
"container",
"registry",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistriesInner.java#L1655-L1657 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerIdentityImpl.java | TransformerIdentityImpl.getOutputProperty | public String getOutputProperty(String name) throws IllegalArgumentException {
"""
Get an output property that is in effect for the
transformation. The property specified may be a property
that was set with setOutputProperty, or it may be a
property specified in the stylesheet.
@param name A non-null String... | java | public String getOutputProperty(String name) throws IllegalArgumentException
{
String value = null;
OutputProperties props = m_outputFormat;
value = props.getProperty(name);
if (null == value)
{
if (!OutputProperties.isLegalPropertyKey(name))
throw new IllegalArgumentException(XSL... | [
"public",
"String",
"getOutputProperty",
"(",
"String",
"name",
")",
"throws",
"IllegalArgumentException",
"{",
"String",
"value",
"=",
"null",
";",
"OutputProperties",
"props",
"=",
"m_outputFormat",
";",
"value",
"=",
"props",
".",
"getProperty",
"(",
"name",
... | Get an output property that is in effect for the
transformation. The property specified may be a property
that was set with setOutputProperty, or it may be a
property specified in the stylesheet.
@param name A non-null String that specifies an output
property name, which may be namespace qualified.
@return The strin... | [
"Get",
"an",
"output",
"property",
"that",
"is",
"in",
"effect",
"for",
"the",
"transformation",
".",
"The",
"property",
"specified",
"may",
"be",
"a",
"property",
"that",
"was",
"set",
"with",
"setOutputProperty",
"or",
"it",
"may",
"be",
"a",
"property",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerIdentityImpl.java#L762-L778 |
offbynull/coroutines | instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java | GenericGenerators.tableSwitch | public static InsnList tableSwitch(InsnList indexInsnList, InsnList defaultInsnList, int caseStartIdx, InsnList... caseInsnLists) {
"""
Generates instructions for a switch table. This does not automatically generate jumps at the end of each default/case statement. It's
your responsibility to either add the releva... | java | public static InsnList tableSwitch(InsnList indexInsnList, InsnList defaultInsnList, int caseStartIdx, InsnList... caseInsnLists) {
Validate.notNull(defaultInsnList);
Validate.notNull(indexInsnList);
Validate.isTrue(caseStartIdx >= 0);
Validate.notNull(caseInsnLists);
Validate.no... | [
"public",
"static",
"InsnList",
"tableSwitch",
"(",
"InsnList",
"indexInsnList",
",",
"InsnList",
"defaultInsnList",
",",
"int",
"caseStartIdx",
",",
"InsnList",
"...",
"caseInsnLists",
")",
"{",
"Validate",
".",
"notNull",
"(",
"defaultInsnList",
")",
";",
"Valid... | Generates instructions for a switch table. This does not automatically generate jumps at the end of each default/case statement. It's
your responsibility to either add the relevant jumps, throws, or returns at each default/case statement, otherwise the code will
just fall through (which is likely not what you want).
@p... | [
"Generates",
"instructions",
"for",
"a",
"switch",
"table",
".",
"This",
"does",
"not",
"automatically",
"generate",
"jumps",
"at",
"the",
"end",
"of",
"each",
"default",
"/",
"case",
"statement",
".",
"It",
"s",
"your",
"responsibility",
"to",
"either",
"ad... | train | https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L936-L970 |
michel-kraemer/gradle-download-task | src/main/java/de/undercouch/gradle/tasks/download/DownloadAction.java | DownloadAction.getCachedETag | private String getCachedETag(HttpHost host, String file) {
"""
Get the cached ETag for the given host and file
@param host the host
@param file the file
@return the cached ETag or null if there is no ETag in the cache
"""
Map<String, Object> cachedETags = readCachedETags();
@SuppressWarning... | java | private String getCachedETag(HttpHost host, String file) {
Map<String, Object> cachedETags = readCachedETags();
@SuppressWarnings("unchecked")
Map<String, Object> hostMap =
(Map<String, Object>)cachedETags.get(host.toURI());
if (hostMap == null) {
return null... | [
"private",
"String",
"getCachedETag",
"(",
"HttpHost",
"host",
",",
"String",
"file",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"cachedETags",
"=",
"readCachedETags",
"(",
")",
";",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"Map",
"<",
... | Get the cached ETag for the given host and file
@param host the host
@param file the file
@return the cached ETag or null if there is no ETag in the cache | [
"Get",
"the",
"cached",
"ETag",
"for",
"the",
"given",
"host",
"and",
"file"
] | train | https://github.com/michel-kraemer/gradle-download-task/blob/a20c7f29c15ccb699700518f860373692148e3fc/src/main/java/de/undercouch/gradle/tasks/download/DownloadAction.java#L416-L433 |
BlueBrain/bluima | modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/utils/StructuredDirectory.java | StructuredDirectory.getFilePath | public static String getFilePath(int docId, String extention) {
"""
@param docId
usually PubMed id
@param extention
e.g. "gz", or "pdf" (WITHOUT dot!)
@return a path, e.g.:
<ul>
<li>2345678, "gz" -> "2/345/678.gz"</li>
<li>78, "pdf" -> "0/0/78.pdf"</li>
</ul>
"""
int[] split = getSplit(docId);
... | java | public static String getFilePath(int docId, String extention) {
int[] split = getSplit(docId);
return split[0] + "/" + split[1] + "/" + split[2] + "." + extention;
} | [
"public",
"static",
"String",
"getFilePath",
"(",
"int",
"docId",
",",
"String",
"extention",
")",
"{",
"int",
"[",
"]",
"split",
"=",
"getSplit",
"(",
"docId",
")",
";",
"return",
"split",
"[",
"0",
"]",
"+",
"\"/\"",
"+",
"split",
"[",
"1",
"]",
... | @param docId
usually PubMed id
@param extention
e.g. "gz", or "pdf" (WITHOUT dot!)
@return a path, e.g.:
<ul>
<li>2345678, "gz" -> "2/345/678.gz"</li>
<li>78, "pdf" -> "0/0/78.pdf"</li>
</ul> | [
"@param",
"docId",
"usually",
"PubMed",
"id",
"@param",
"extention",
"e",
".",
"g",
".",
"gz",
"or",
"pdf",
"(",
"WITHOUT",
"dot!",
")",
"@return",
"a",
"path",
"e",
".",
"g",
".",
":",
"<ul",
">",
"<li",
">",
"2345678",
"gz",
"-",
">",
"2",
"/",... | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/utils/StructuredDirectory.java#L108-L111 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/GridRansacLineDetector.java | GridRansacLineDetector.process | public void process( D derivX , D derivY , GrayU8 binaryEdges ) {
"""
Detects line segments through the image inside of grids.
@param derivX Image derivative along x-axis. Not modified.
@param derivY Image derivative along x-axis. Not modified.
@param binaryEdges True values indicate that a pixel is an edge p... | java | public void process( D derivX , D derivY , GrayU8 binaryEdges )
{
InputSanityCheck.checkSameShape(derivX,derivY,binaryEdges);
int w = derivX.width-regionSize+1;
int h = derivY.height-regionSize+1;
foundLines.reshape(derivX.width / regionSize, derivX.height / regionSize);
foundLines.reset();
// avoid par... | [
"public",
"void",
"process",
"(",
"D",
"derivX",
",",
"D",
"derivY",
",",
"GrayU8",
"binaryEdges",
")",
"{",
"InputSanityCheck",
".",
"checkSameShape",
"(",
"derivX",
",",
"derivY",
",",
"binaryEdges",
")",
";",
"int",
"w",
"=",
"derivX",
".",
"width",
"... | Detects line segments through the image inside of grids.
@param derivX Image derivative along x-axis. Not modified.
@param derivY Image derivative along x-axis. Not modified.
@param binaryEdges True values indicate that a pixel is an edge pixel. Not modified. | [
"Detects",
"line",
"segments",
"through",
"the",
"image",
"inside",
"of",
"grids",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/line/GridRansacLineDetector.java#L104-L129 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FileUtil.java | FileUtil.fullyDelete | @Deprecated
public static void fullyDelete(FileSystem fs, Path dir)
throws IOException {
"""
Recursively delete a directory.
@param fs {@link FileSystem} on which the path is present
@param dir directory to recursively delete
@throws IOException
@deprecated Use {@link FileSystem#delete(Path, boolean)}
... | java | @Deprecated
public static void fullyDelete(FileSystem fs, Path dir)
throws IOException {
fs.delete(dir, true);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"fullyDelete",
"(",
"FileSystem",
"fs",
",",
"Path",
"dir",
")",
"throws",
"IOException",
"{",
"fs",
".",
"delete",
"(",
"dir",
",",
"true",
")",
";",
"}"
] | Recursively delete a directory.
@param fs {@link FileSystem} on which the path is present
@param dir directory to recursively delete
@throws IOException
@deprecated Use {@link FileSystem#delete(Path, boolean)} | [
"Recursively",
"delete",
"a",
"directory",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileUtil.java#L120-L124 |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/sms/SmsClient.java | SmsClient.searchRejectedMessages | public SearchRejectedMessagesResponse searchRejectedMessages(Date date, String to) throws IOException, NexmoClientException {
"""
Search for rejected SMS transactions by date and recipient MSISDN.
@param date the date of the rejected SMS message to be looked up
@param to the MSISDN number of the SMS recipien... | java | public SearchRejectedMessagesResponse searchRejectedMessages(Date date, String to) throws IOException, NexmoClientException {
return this.searchRejectedMessages(new SearchRejectedMessagesRequest(date, to));
} | [
"public",
"SearchRejectedMessagesResponse",
"searchRejectedMessages",
"(",
"Date",
"date",
",",
"String",
"to",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"this",
".",
"searchRejectedMessages",
"(",
"new",
"SearchRejectedMessagesRequest",
"(... | Search for rejected SMS transactions by date and recipient MSISDN.
@param date the date of the rejected SMS message to be looked up
@param to the MSISDN number of the SMS recipient
@return rejection data matching the provided criteria | [
"Search",
"for",
"rejected",
"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#L137-L139 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/dataformats/json/to/GeoJsonToAssembler.java | GeoJsonToAssembler.createPolygon | private Polygon createPolygon(double[][][] coordinates, CrsId crsId) {
"""
Creates a polygon starting from its geojson coordinate array
@param coordinates the geojson coordinate array
@param crsId the srid of the crs to use
@return a geolatte polygon instance
"""
LinearRing[] rings = new Lin... | java | private Polygon createPolygon(double[][][] coordinates, CrsId crsId) {
LinearRing[] rings = new LinearRing[coordinates.length];
for (int i = 0; i < coordinates.length; i++) {
rings[i] = new LinearRing(createPointSequence(coordinates[i], crsId));
}
return new Polygon(rings);
... | [
"private",
"Polygon",
"createPolygon",
"(",
"double",
"[",
"]",
"[",
"]",
"[",
"]",
"coordinates",
",",
"CrsId",
"crsId",
")",
"{",
"LinearRing",
"[",
"]",
"rings",
"=",
"new",
"LinearRing",
"[",
"coordinates",
".",
"length",
"]",
";",
"for",
"(",
"int... | Creates a polygon starting from its geojson coordinate array
@param coordinates the geojson coordinate array
@param crsId the srid of the crs to use
@return a geolatte polygon instance | [
"Creates",
"a",
"polygon",
"starting",
"from",
"its",
"geojson",
"coordinate",
"array"
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/to/GeoJsonToAssembler.java#L446-L452 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/selenium/by/GridBy.java | GridBy.getXPathForColumnInRowByValueInOtherColumn | public static String getXPathForColumnInRowByValueInOtherColumn(String value, String columnName, String... extraColumnNames) {
"""
Creates an XPath expression that will find a cell in a row, selecting the row based on the
text in a specific column (identified by its header text).
@param value text to find in col... | java | public static String getXPathForColumnInRowByValueInOtherColumn(String value, String columnName, String... extraColumnNames) {
String selectIndex = getXPathForColumnIndex(columnName);
String rowXPath = getXPathForRowByValueInOtherColumn(selectIndex, value);
String headerXPath = getXPathForHeader... | [
"public",
"static",
"String",
"getXPathForColumnInRowByValueInOtherColumn",
"(",
"String",
"value",
",",
"String",
"columnName",
",",
"String",
"...",
"extraColumnNames",
")",
"{",
"String",
"selectIndex",
"=",
"getXPathForColumnIndex",
"(",
"columnName",
")",
";",
"S... | Creates an XPath expression that will find a cell in a row, selecting the row based on the
text in a specific column (identified by its header text).
@param value text to find in column with the supplied header.
@param columnName header text of the column to find value in.
@param extraColumnNames name of other header t... | [
"Creates",
"an",
"XPath",
"expression",
"that",
"will",
"find",
"a",
"cell",
"in",
"a",
"row",
"selecting",
"the",
"row",
"based",
"on",
"the",
"text",
"in",
"a",
"specific",
"column",
"(",
"identified",
"by",
"its",
"header",
"text",
")",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/selenium/by/GridBy.java#L50-L56 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/cert/X509CertSelector.java | X509CertSelector.equalNames | static boolean equalNames(Collection<?> object1, Collection<?> object2) {
"""
Compare for equality two objects of the form passed to
setSubjectAlternativeNames (or X509CRLSelector.setIssuerNames).
Throw an {@code IllegalArgumentException} or a
{@code ClassCastException} if one of the objects is malformed.
@p... | java | static boolean equalNames(Collection<?> object1, Collection<?> object2) {
if ((object1 == null) || (object2 == null)) {
return object1 == object2;
}
return object1.equals(object2);
} | [
"static",
"boolean",
"equalNames",
"(",
"Collection",
"<",
"?",
">",
"object1",
",",
"Collection",
"<",
"?",
">",
"object2",
")",
"{",
"if",
"(",
"(",
"object1",
"==",
"null",
")",
"||",
"(",
"object2",
"==",
"null",
")",
")",
"{",
"return",
"object1... | Compare for equality two objects of the form passed to
setSubjectAlternativeNames (or X509CRLSelector.setIssuerNames).
Throw an {@code IllegalArgumentException} or a
{@code ClassCastException} if one of the objects is malformed.
@param object1 a Collection containing the first object to compare
@param object2 a Collec... | [
"Compare",
"for",
"equality",
"two",
"objects",
"of",
"the",
"form",
"passed",
"to",
"setSubjectAlternativeNames",
"(",
"or",
"X509CRLSelector",
".",
"setIssuerNames",
")",
".",
"Throw",
"an",
"{",
"@code",
"IllegalArgumentException",
"}",
"or",
"a",
"{",
"@code... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/cert/X509CertSelector.java#L876-L881 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/AVA.java | AVA.toRFC1779String | public String toRFC1779String(Map<String, String> oidMap) {
"""
Returns a printable form of this attribute, using RFC 1779
syntax for individual attribute/value assertions. It
emits standardised keywords, as well as keywords contained in the
OID/keyword map.
"""
return toKeywordValueString(toKeyword... | java | public String toRFC1779String(Map<String, String> oidMap) {
return toKeywordValueString(toKeyword(RFC1779, oidMap));
} | [
"public",
"String",
"toRFC1779String",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"oidMap",
")",
"{",
"return",
"toKeywordValueString",
"(",
"toKeyword",
"(",
"RFC1779",
",",
"oidMap",
")",
")",
";",
"}"
] | Returns a printable form of this attribute, using RFC 1779
syntax for individual attribute/value assertions. It
emits standardised keywords, as well as keywords contained in the
OID/keyword map. | [
"Returns",
"a",
"printable",
"form",
"of",
"this",
"attribute",
"using",
"RFC",
"1779",
"syntax",
"for",
"individual",
"attribute",
"/",
"value",
"assertions",
".",
"It",
"emits",
"standardised",
"keywords",
"as",
"well",
"as",
"keywords",
"contained",
"in",
"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/AVA.java#L711-L713 |
EsotericSoftware/kryo | src/com/esotericsoftware/kryo/serializers/FieldSerializer.java | FieldSerializer.createCopy | protected T createCopy (Kryo kryo, T original) {
"""
Used by {@link #copy(Kryo, Object)} to create a new object. This can be overridden to customize object creation, eg to call
a constructor with arguments. The default implementation uses {@link Kryo#newInstance(Class)}.
"""
return (T)kryo.newInstance(orig... | java | protected T createCopy (Kryo kryo, T original) {
return (T)kryo.newInstance(original.getClass());
} | [
"protected",
"T",
"createCopy",
"(",
"Kryo",
"kryo",
",",
"T",
"original",
")",
"{",
"return",
"(",
"T",
")",
"kryo",
".",
"newInstance",
"(",
"original",
".",
"getClass",
"(",
")",
")",
";",
"}"
] | Used by {@link #copy(Kryo, Object)} to create a new object. This can be overridden to customize object creation, eg to call
a constructor with arguments. The default implementation uses {@link Kryo#newInstance(Class)}. | [
"Used",
"by",
"{"
] | train | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/serializers/FieldSerializer.java#L206-L208 |
NordicSemiconductor/Android-DFU-Library | dfu/src/main/java/no/nordicsemi/android/dfu/BaseDfuImpl.java | BaseDfuImpl.requestMtu | @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
void requestMtu(@IntRange(from = 0, to = 517) final int mtu)
throws DeviceDisconnectedException, UploadAbortedException {
"""
Requests given MTU. This method is only supported on Android Lollipop or newer versions.
Only DFU from SDK 14.1 or newer suppo... | java | @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
void requestMtu(@IntRange(from = 0, to = 517) final int mtu)
throws DeviceDisconnectedException, UploadAbortedException {
if (mAborted)
throw new UploadAbortedException();
mRequestCompleted = false;
mService.sendLogBroadcast(DfuBaseService.LOG_LEVE... | [
"@",
"RequiresApi",
"(",
"api",
"=",
"Build",
".",
"VERSION_CODES",
".",
"LOLLIPOP",
")",
"void",
"requestMtu",
"(",
"@",
"IntRange",
"(",
"from",
"=",
"0",
",",
"to",
"=",
"517",
")",
"final",
"int",
"mtu",
")",
"throws",
"DeviceDisconnectedException",
... | Requests given MTU. This method is only supported on Android Lollipop or newer versions.
Only DFU from SDK 14.1 or newer supports MTU > 23.
@param mtu new MTU to be requested. | [
"Requests",
"given",
"MTU",
".",
"This",
"method",
"is",
"only",
"supported",
"on",
"Android",
"Lollipop",
"or",
"newer",
"versions",
".",
"Only",
"DFU",
"from",
"SDK",
"14",
".",
"1",
"or",
"newer",
"supports",
"MTU",
">",
"23",
"."
] | train | https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/BaseDfuImpl.java#L679-L702 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobAgentsInner.java | JobAgentsInner.updateAsync | public Observable<JobAgentInner> updateAsync(String resourceGroupName, String serverName, String jobAgentName) {
"""
Updates a job agent.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serve... | java | public Observable<JobAgentInner> updateAsync(String resourceGroupName, String serverName, String jobAgentName) {
return updateWithServiceResponseAsync(resourceGroupName, serverName, jobAgentName).map(new Func1<ServiceResponse<JobAgentInner>, JobAgentInner>() {
@Override
public JobAgentIn... | [
"public",
"Observable",
"<",
"JobAgentInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"jobAgentName",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",
"j... | Updates a job agent.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param jobAgentName The name of the job agent to be updated.
@throws IllegalArgumentException t... | [
"Updates",
"a",
"job",
"agent",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobAgentsInner.java#L715-L722 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java | XmlResponsesSaxParser.parseListBucketObjectsResponse | public ListBucketHandler parseListBucketObjectsResponse(InputStream inputStream, final boolean shouldSDKDecodeResponse)
throws IOException {
"""
Parses a ListBucket response XML document from an input stream.
@param inputStream
XML data input stream.
@return the XML handler object populated with d... | java | public ListBucketHandler parseListBucketObjectsResponse(InputStream inputStream, final boolean shouldSDKDecodeResponse)
throws IOException {
ListBucketHandler handler = new ListBucketHandler(shouldSDKDecodeResponse);
parseXmlInputStream(handler, sanitizeXmlDocument(handler, inputStream));
... | [
"public",
"ListBucketHandler",
"parseListBucketObjectsResponse",
"(",
"InputStream",
"inputStream",
",",
"final",
"boolean",
"shouldSDKDecodeResponse",
")",
"throws",
"IOException",
"{",
"ListBucketHandler",
"handler",
"=",
"new",
"ListBucketHandler",
"(",
"shouldSDKDecodeRes... | Parses a ListBucket response XML document from an input stream.
@param inputStream
XML data input stream.
@return the XML handler object populated with data parsed from the XML
stream.
@throws SdkClientException | [
"Parses",
"a",
"ListBucket",
"response",
"XML",
"document",
"from",
"an",
"input",
"stream",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java#L319-L325 |
craftercms/commons | utilities/src/main/java/org/craftercms/commons/http/CookieManager.java | CookieManager.addCookie | public void addCookie(String name, String value, HttpServletResponse response) {
"""
Add a new cookie, using the configured domain, path and max age, to the response.
@param name the name of the cookie
@param value the value of the cookie
"""
Cookie cookie = new Cookie(name, value);
cookie... | java | public void addCookie(String name, String value, HttpServletResponse response) {
Cookie cookie = new Cookie(name, value);
cookie.setHttpOnly(httpOnly);
cookie.setSecure(secure);
if (StringUtils.isNotEmpty(domain)) {
cookie.setDomain(domain);
}
if (StringUtils.... | [
"public",
"void",
"addCookie",
"(",
"String",
"name",
",",
"String",
"value",
",",
"HttpServletResponse",
"response",
")",
"{",
"Cookie",
"cookie",
"=",
"new",
"Cookie",
"(",
"name",
",",
"value",
")",
";",
"cookie",
".",
"setHttpOnly",
"(",
"httpOnly",
")... | Add a new cookie, using the configured domain, path and max age, to the response.
@param name the name of the cookie
@param value the value of the cookie | [
"Add",
"a",
"new",
"cookie",
"using",
"the",
"configured",
"domain",
"path",
"and",
"max",
"age",
"to",
"the",
"response",
"."
] | train | https://github.com/craftercms/commons/blob/3074fe49e56c2a4aae0832f40b17ae563335dc83/utilities/src/main/java/org/craftercms/commons/http/CookieManager.java#L71-L88 |
vdmeer/skb-java-base | src/main/java/de/vandermeer/skb/base/shell/SkbShellFactory.java | SkbShellFactory.newCommand | public static SkbShellCommand newCommand(String command, SkbShellCommandCategory category, String description, String addedHelp) {
"""
Returns a new shell command without formal arguments, use the factory to create one.
@param command the actual command
@param category the command's category, can be null
@param... | java | public static SkbShellCommand newCommand(String command, SkbShellCommandCategory category, String description, String addedHelp){
return new AbstractShellCommand(command, null, category, description, addedHelp);
} | [
"public",
"static",
"SkbShellCommand",
"newCommand",
"(",
"String",
"command",
",",
"SkbShellCommandCategory",
"category",
",",
"String",
"description",
",",
"String",
"addedHelp",
")",
"{",
"return",
"new",
"AbstractShellCommand",
"(",
"command",
",",
"null",
",",
... | Returns a new shell command without formal arguments, use the factory to create one.
@param command the actual command
@param category the command's category, can be null
@param description the command's description
@param addedHelp additional help, can be null
@return new shell command
@throws IllegalArgumentException... | [
"Returns",
"a",
"new",
"shell",
"command",
"without",
"formal",
"arguments",
"use",
"the",
"factory",
"to",
"create",
"one",
"."
] | train | https://github.com/vdmeer/skb-java-base/blob/6d845bcc482aa9344d016e80c0c3455aeae13a13/src/main/java/de/vandermeer/skb/base/shell/SkbShellFactory.java#L140-L142 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/Duration.java | Duration.ofNanos | public static Duration ofNanos(long nanos) {
"""
Obtains a {@code Duration} representing a number of nanoseconds.
<p>
The seconds and nanoseconds are extracted from the specified nanoseconds.
@param nanos the number of nanoseconds, positive or negative
@return a {@code Duration}, not null
"""
lo... | java | public static Duration ofNanos(long nanos) {
long secs = nanos / NANOS_PER_SECOND;
int nos = (int) (nanos % NANOS_PER_SECOND);
if (nos < 0) {
nos += NANOS_PER_SECOND;
secs--;
}
return create(secs, nos);
} | [
"public",
"static",
"Duration",
"ofNanos",
"(",
"long",
"nanos",
")",
"{",
"long",
"secs",
"=",
"nanos",
"/",
"NANOS_PER_SECOND",
";",
"int",
"nos",
"=",
"(",
"int",
")",
"(",
"nanos",
"%",
"NANOS_PER_SECOND",
")",
";",
"if",
"(",
"nos",
"<",
"0",
")... | Obtains a {@code Duration} representing a number of nanoseconds.
<p>
The seconds and nanoseconds are extracted from the specified nanoseconds.
@param nanos the number of nanoseconds, positive or negative
@return a {@code Duration}, not null | [
"Obtains",
"a",
"{",
"@code",
"Duration",
"}",
"representing",
"a",
"number",
"of",
"nanoseconds",
".",
"<p",
">",
"The",
"seconds",
"and",
"nanoseconds",
"are",
"extracted",
"from",
"the",
"specified",
"nanoseconds",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/Duration.java#L272-L280 |
jboss/jboss-jstl-api_spec | src/main/java/javax/servlet/jsp/jstl/core/Config.java | Config.get | public static Object get(ServletRequest request, String name) {
"""
Looks up a configuration variable in the "request" scope.
<p> The lookup of configuration variables is performed as if each scope
had its own name space, that is, the same configuration variable name
in one scope does not replace one stored in ... | java | public static Object get(ServletRequest request, String name) {
return request.getAttribute(name + REQUEST_SCOPE_SUFFIX);
} | [
"public",
"static",
"Object",
"get",
"(",
"ServletRequest",
"request",
",",
"String",
"name",
")",
"{",
"return",
"request",
".",
"getAttribute",
"(",
"name",
"+",
"REQUEST_SCOPE_SUFFIX",
")",
";",
"}"
] | Looks up a configuration variable in the "request" scope.
<p> The lookup of configuration variables is performed as if each scope
had its own name space, that is, the same configuration variable name
in one scope does not replace one stored in a different scope.
@param request Request object in which the configuration... | [
"Looks",
"up",
"a",
"configuration",
"variable",
"in",
"the",
"request",
"scope",
".",
"<p",
">",
"The",
"lookup",
"of",
"configuration",
"variables",
"is",
"performed",
"as",
"if",
"each",
"scope",
"had",
"its",
"own",
"name",
"space",
"that",
"is",
"the"... | train | https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/javax/servlet/jsp/jstl/core/Config.java#L125-L127 |
samskivert/pythagoras | src/main/java/pythagoras/d/Arc.java | Arc.setArc | public void setArc (XY point, IDimension size, double start, double extent, int type) {
"""
Sets the location, size, angular extents, and closure type of this arc to the specified
values.
"""
setArc(point.x(), point.y(), size.width(), size.height(), start, extent, type);
} | java | public void setArc (XY point, IDimension size, double start, double extent, int type) {
setArc(point.x(), point.y(), size.width(), size.height(), start, extent, type);
} | [
"public",
"void",
"setArc",
"(",
"XY",
"point",
",",
"IDimension",
"size",
",",
"double",
"start",
",",
"double",
"extent",
",",
"int",
"type",
")",
"{",
"setArc",
"(",
"point",
".",
"x",
"(",
")",
",",
"point",
".",
"y",
"(",
")",
",",
"size",
"... | Sets the location, size, angular extents, and closure type of this arc to the specified
values. | [
"Sets",
"the",
"location",
"size",
"angular",
"extents",
"and",
"closure",
"type",
"of",
"this",
"arc",
"to",
"the",
"specified",
"values",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Arc.java#L143-L145 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/lss/LssClient.java | LssClient.getAllDomainsPlayCount | public GetAllDomainsPlayCountResponse getAllDomainsPlayCount(GetAllDomainsStatisticsRequest request) {
"""
get all domains' total play count statistics in the live stream service.
@param request The request object containing all options for getting all domains' play count statistics
@return the response
""... | java | public GetAllDomainsPlayCountResponse getAllDomainsPlayCount(GetAllDomainsStatisticsRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getTimeInterval(), "timeInterval should NOT be null");
checkStringNotEmpty(request.getStartTime(... | [
"public",
"GetAllDomainsPlayCountResponse",
"getAllDomainsPlayCount",
"(",
"GetAllDomainsStatisticsRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getTime... | get all domains' total play count statistics in the live stream service.
@param request The request object containing all options for getting all domains' play count statistics
@return the response | [
"get",
"all",
"domains",
"total",
"play",
"count",
"statistics",
"in",
"the",
"live",
"stream",
"service",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L1853-L1867 |
burberius/eve-esi | src/main/java/net/troja/eve/esi/api/UniverseApi.java | UniverseApi.getUniverseStarsStarId | public StarResponse getUniverseStarsStarId(Integer starId, String datasource, String ifNoneMatch)
throws ApiException {
"""
Get star information Get information on a star --- This route expires
daily at 11:05
@param starId
star_id integer (required)
@param datasource
The server name you would li... | java | public StarResponse getUniverseStarsStarId(Integer starId, String datasource, String ifNoneMatch)
throws ApiException {
ApiResponse<StarResponse> resp = getUniverseStarsStarIdWithHttpInfo(starId, datasource, ifNoneMatch);
return resp.getData();
} | [
"public",
"StarResponse",
"getUniverseStarsStarId",
"(",
"Integer",
"starId",
",",
"String",
"datasource",
",",
"String",
"ifNoneMatch",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"StarResponse",
">",
"resp",
"=",
"getUniverseStarsStarIdWithHttpInfo",
"(",
... | Get star information Get information on a star --- This route expires
daily at 11:05
@param starId
star_id integer (required)
@param datasource
The server name you would like data from (optional, default to
tranquility)
@param ifNoneMatch
ETag from a previous request. A 304 will be returned if this
matches the current... | [
"Get",
"star",
"information",
"Get",
"information",
"on",
"a",
"star",
"---",
"This",
"route",
"expires",
"daily",
"at",
"11",
":",
"05"
] | train | https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/UniverseApi.java#L2935-L2939 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/analyzer/AbstractNpmAnalyzer.java | AbstractNpmAnalyzer.createDependency | protected Dependency createDependency(Dependency dependency, String name, String version, String scope) {
"""
Construct a dependency object.
@param dependency the parent dependency
@param name the name of the dependency to create
@param version the version of the dependency to create
@param scope the scope o... | java | protected Dependency createDependency(Dependency dependency, String name, String version, String scope) {
final Dependency nodeModule = new Dependency(new File(dependency.getActualFile() + "?" + name), true);
nodeModule.setEcosystem(NPM_DEPENDENCY_ECOSYSTEM);
//this is virtual - the sha1 is pure... | [
"protected",
"Dependency",
"createDependency",
"(",
"Dependency",
"dependency",
",",
"String",
"name",
",",
"String",
"version",
",",
"String",
"scope",
")",
"{",
"final",
"Dependency",
"nodeModule",
"=",
"new",
"Dependency",
"(",
"new",
"File",
"(",
"dependency... | Construct a dependency object.
@param dependency the parent dependency
@param name the name of the dependency to create
@param version the version of the dependency to create
@param scope the scope of the dependency being created
@return the generated dependency | [
"Construct",
"a",
"dependency",
"object",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/AbstractNpmAnalyzer.java#L127-L160 |
facebookarchive/hadoop-20 | src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/Gridmix.java | Gridmix.startThreads | private void startThreads(Configuration conf, String traceIn, Path ioPath,
Path scratchDir, CountDownLatch startFlag) throws IOException {
"""
Create each component in the pipeline and start it.
@param conf Configuration data, no keys specific to this context
@param traceIn Either a Path to the trace data ... | java | private void startThreads(Configuration conf, String traceIn, Path ioPath,
Path scratchDir, CountDownLatch startFlag) throws IOException {
monitor = createJobMonitor();
submitter = createJobSubmitter(monitor,
conf.getInt(GRIDMIX_SUB_THR,
Runtime.getRuntime().availableProcessors() + 1),
... | [
"private",
"void",
"startThreads",
"(",
"Configuration",
"conf",
",",
"String",
"traceIn",
",",
"Path",
"ioPath",
",",
"Path",
"scratchDir",
",",
"CountDownLatch",
"startFlag",
")",
"throws",
"IOException",
"{",
"monitor",
"=",
"createJobMonitor",
"(",
")",
";",... | Create each component in the pipeline and start it.
@param conf Configuration data, no keys specific to this context
@param traceIn Either a Path to the trace data or "-" for
stdin
@param ioPath Path from which input data is read
@param scratchDir Path into which job output is written
@param startFlag Semapho... | [
"Create",
"each",
"component",
"in",
"the",
"pipeline",
"and",
"start",
"it",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/gridmix/src/java/org/apache/hadoop/mapred/gridmix/Gridmix.java#L130-L142 |
mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.toObjectOrNull | @Deprecated
public static Scriptable toObjectOrNull(Context cx, Object obj) {
"""
<strong>Warning</strong>: This doesn't allow to resolve primitive
prototype properly when many top scopes are involved
@deprecated Use {@link #toObjectOrNull(Context, Object, Scriptable)} instead
"""
if (obj insta... | java | @Deprecated
public static Scriptable toObjectOrNull(Context cx, Object obj)
{
if (obj instanceof Scriptable) {
return (Scriptable)obj;
} else if (obj != null && obj != Undefined.instance) {
return toObject(cx, getTopCallScope(cx), obj);
}
return null;
... | [
"@",
"Deprecated",
"public",
"static",
"Scriptable",
"toObjectOrNull",
"(",
"Context",
"cx",
",",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"instanceof",
"Scriptable",
")",
"{",
"return",
"(",
"Scriptable",
")",
"obj",
";",
"}",
"else",
"if",
"(",
"ob... | <strong>Warning</strong>: This doesn't allow to resolve primitive
prototype properly when many top scopes are involved
@deprecated Use {@link #toObjectOrNull(Context, Object, Scriptable)} instead | [
"<strong",
">",
"Warning<",
"/",
"strong",
">",
":",
"This",
"doesn",
"t",
"allow",
"to",
"resolve",
"primitive",
"prototype",
"properly",
"when",
"many",
"top",
"scopes",
"are",
"involved"
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L1068-L1077 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/MetamodelImpl.java | MetamodelImpl.assignMappedSuperClass | public void assignMappedSuperClass(Map<Class<?>, ManagedType<?>> mappedSuperClass) {
"""
Adds mapped super class to mapped super class collection.
@param mappedSuperClass
the mappedSuperClassTypes to set
"""
if (this.mappedSuperClassTypes == null)
{
this.mappedSuperClassTypes... | java | public void assignMappedSuperClass(Map<Class<?>, ManagedType<?>> mappedSuperClass)
{
if (this.mappedSuperClassTypes == null)
{
this.mappedSuperClassTypes = mappedSuperClass;
}
else
{
this.mappedSuperClassTypes.putAll(mappedSuperClassTypes);
... | [
"public",
"void",
"assignMappedSuperClass",
"(",
"Map",
"<",
"Class",
"<",
"?",
">",
",",
"ManagedType",
"<",
"?",
">",
">",
"mappedSuperClass",
")",
"{",
"if",
"(",
"this",
".",
"mappedSuperClassTypes",
"==",
"null",
")",
"{",
"this",
".",
"mappedSuperCla... | Adds mapped super class to mapped super class collection.
@param mappedSuperClass
the mappedSuperClassTypes to set | [
"Adds",
"mapped",
"super",
"class",
"to",
"mapped",
"super",
"class",
"collection",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/MetamodelImpl.java#L333-L343 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java | WorkflowsInner.updateAsync | public Observable<WorkflowInner> updateAsync(String resourceGroupName, String workflowName, WorkflowInner workflow) {
"""
Updates a workflow.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param workflow The workflow.
@throws IllegalArgumentException thrown if param... | java | public Observable<WorkflowInner> updateAsync(String resourceGroupName, String workflowName, WorkflowInner workflow) {
return updateWithServiceResponseAsync(resourceGroupName, workflowName, workflow).map(new Func1<ServiceResponse<WorkflowInner>, WorkflowInner>() {
@Override
public Workflo... | [
"public",
"Observable",
"<",
"WorkflowInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"workflowName",
",",
"WorkflowInner",
"workflow",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"workflowName",
",... | Updates a workflow.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param workflow The workflow.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the WorkflowInner object | [
"Updates",
"a",
"workflow",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java#L816-L823 |
Omertron/api-omdb | src/main/java/com/omertron/omdbapi/tools/OmdbUrlBuilder.java | OmdbUrlBuilder.generateUrl | public static URL generateUrl(final String url) throws OMDBException {
"""
Generate a URL object from a String URL
@param url
@return
@throws OMDBException
"""
try {
return new URL(url);
} catch (MalformedURLException ex) {
throw new OMDBException(ApiExceptionType.I... | java | public static URL generateUrl(final String url) throws OMDBException {
try {
return new URL(url);
} catch (MalformedURLException ex) {
throw new OMDBException(ApiExceptionType.INVALID_URL, "Failed to create URL", url, ex);
}
} | [
"public",
"static",
"URL",
"generateUrl",
"(",
"final",
"String",
"url",
")",
"throws",
"OMDBException",
"{",
"try",
"{",
"return",
"new",
"URL",
"(",
"url",
")",
";",
"}",
"catch",
"(",
"MalformedURLException",
"ex",
")",
"{",
"throw",
"new",
"OMDBExcepti... | Generate a URL object from a String URL
@param url
@return
@throws OMDBException | [
"Generate",
"a",
"URL",
"object",
"from",
"a",
"String",
"URL"
] | train | https://github.com/Omertron/api-omdb/blob/acb506ded2d7b8a4159b48161ffab8cb5b7bad44/src/main/java/com/omertron/omdbapi/tools/OmdbUrlBuilder.java#L134-L140 |
thymeleaf/thymeleaf | src/main/java/org/thymeleaf/context/AbstractContext.java | AbstractContext.setVariables | public void setVariables(final Map<String,Object> variables) {
"""
<p>
Sets several variables at a time into the context.
</p>
@param variables the variables to be set.
"""
if (variables == null) {
return;
}
this.variables.putAll(variables);
} | java | public void setVariables(final Map<String,Object> variables) {
if (variables == null) {
return;
}
this.variables.putAll(variables);
} | [
"public",
"void",
"setVariables",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"variables",
")",
"{",
"if",
"(",
"variables",
"==",
"null",
")",
"{",
"return",
";",
"}",
"this",
".",
"variables",
".",
"putAll",
"(",
"variables",
")",
";",
... | <p>
Sets several variables at a time into the context.
</p>
@param variables the variables to be set. | [
"<p",
">",
"Sets",
"several",
"variables",
"at",
"a",
"time",
"into",
"the",
"context",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/context/AbstractContext.java#L122-L127 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/NotificationManager.java | NotificationManager.removeClientNotification | public void removeClientNotification(RESTRequest request, ObjectName objectName, int clientID) {
"""
Removes a corresponding client notification for the given ObjectName
"""
//Get the client area
ClientNotificationArea clientArea = getInboxIfAvailable(clientID, null);
//Remove the cor... | java | public void removeClientNotification(RESTRequest request, ObjectName objectName, int clientID) {
//Get the client area
ClientNotificationArea clientArea = getInboxIfAvailable(clientID, null);
//Remove the corresponding listener (will also remove from MBeanServer)
clientArea.removeClien... | [
"public",
"void",
"removeClientNotification",
"(",
"RESTRequest",
"request",
",",
"ObjectName",
"objectName",
",",
"int",
"clientID",
")",
"{",
"//Get the client area ",
"ClientNotificationArea",
"clientArea",
"=",
"getInboxIfAvailable",
"(",
"clientID",
",",
"null",
")... | Removes a corresponding client notification for the given ObjectName | [
"Removes",
"a",
"corresponding",
"client",
"notification",
"for",
"the",
"given",
"ObjectName"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/NotificationManager.java#L158-L164 |
kmi/iserve | iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/Util.java | Util.getIntegerValue | public static Integer getIntegerValue(QuerySolution resultRow, String variableName) {
"""
Given a query result from a SPARQL query, obtain the number value at the
given variable
@param resultRow the result from a SPARQL query
@param variableName the name of the variable to obtain
@return the Integer value... | java | public static Integer getIntegerValue(QuerySolution resultRow, String variableName) {
if (resultRow != null) {
Resource res = resultRow.getResource(variableName);
if (res != null && res.isLiteral()) {
Literal val = res.asLiteral();
if (val != null) {
... | [
"public",
"static",
"Integer",
"getIntegerValue",
"(",
"QuerySolution",
"resultRow",
",",
"String",
"variableName",
")",
"{",
"if",
"(",
"resultRow",
"!=",
"null",
")",
"{",
"Resource",
"res",
"=",
"resultRow",
".",
"getResource",
"(",
"variableName",
")",
";"... | Given a query result from a SPARQL query, obtain the number value at the
given variable
@param resultRow the result from a SPARQL query
@param variableName the name of the variable to obtain
@return the Integer value, or null otherwise | [
"Given",
"a",
"query",
"result",
"from",
"a",
"SPARQL",
"query",
"obtain",
"the",
"number",
"value",
"at",
"the",
"given",
"variable"
] | train | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/Util.java#L181-L194 |
joniles/mpxj | src/main/java/net/sf/mpxj/utility/DataExportUtility.java | DataExportUtility.escapeText | private String escapeText(StringBuilder sb, String text) {
"""
Quick and dirty XML text escape.
@param sb working string buffer
@param text input text
@return escaped text
"""
int length = text.length();
char c;
sb.setLength(0);
for (int loop = 0; loop < length; loop++)
{
... | java | private String escapeText(StringBuilder sb, String text)
{
int length = text.length();
char c;
sb.setLength(0);
for (int loop = 0; loop < length; loop++)
{
c = text.charAt(loop);
switch (c)
{
case '<':
{
sb.append("<... | [
"private",
"String",
"escapeText",
"(",
"StringBuilder",
"sb",
",",
"String",
"text",
")",
"{",
"int",
"length",
"=",
"text",
".",
"length",
"(",
")",
";",
"char",
"c",
";",
"sb",
".",
"setLength",
"(",
"0",
")",
";",
"for",
"(",
"int",
"loop",
"="... | Quick and dirty XML text escape.
@param sb working string buffer
@param text input text
@return escaped text | [
"Quick",
"and",
"dirty",
"XML",
"text",
"escape",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/utility/DataExportUtility.java#L328-L379 |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java | BigDecimal.needIncrement | private static boolean needIncrement(MutableBigInteger mdivisor, int roundingMode,
int qsign, MutableBigInteger mq, MutableBigInteger mr) {
"""
Tests if quotient has to be incremented according the roundingMode
"""
assert !mr.isZero();
int cmpFracHalf = ... | java | private static boolean needIncrement(MutableBigInteger mdivisor, int roundingMode,
int qsign, MutableBigInteger mq, MutableBigInteger mr) {
assert !mr.isZero();
int cmpFracHalf = mr.compareHalf(mdivisor);
return commonNeedIncrement(roundingMode, qsign, cm... | [
"private",
"static",
"boolean",
"needIncrement",
"(",
"MutableBigInteger",
"mdivisor",
",",
"int",
"roundingMode",
",",
"int",
"qsign",
",",
"MutableBigInteger",
"mq",
",",
"MutableBigInteger",
"mr",
")",
"{",
"assert",
"!",
"mr",
".",
"isZero",
"(",
")",
";",... | Tests if quotient has to be incremented according the roundingMode | [
"Tests",
"if",
"quotient",
"has",
"to",
"be",
"incremented",
"according",
"the",
"roundingMode"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java#L4353-L4358 |
assertthat/selenium-shutterbug | src/main/java/com/assertthat/selenium_shutterbug/utils/image/ImageProcessor.java | ImageProcessor.imagesAreEqualsWithDiff | public static boolean imagesAreEqualsWithDiff(BufferedImage image1, BufferedImage image2, String pathFileName, double deviation) {
"""
Extends the functionality of imagesAreEqualsWithDiff, but creates a third BufferedImage and applies pixel manipulation to it.
@param image1 The first image to compare
@param imag... | java | public static boolean imagesAreEqualsWithDiff(BufferedImage image1, BufferedImage image2, String pathFileName, double deviation) {
BufferedImage output = new BufferedImage(image1.getWidth(), image1.getHeight(), BufferedImage.TYPE_INT_RGB);
int width1 = image1.getWidth(null);
int width2 = image2... | [
"public",
"static",
"boolean",
"imagesAreEqualsWithDiff",
"(",
"BufferedImage",
"image1",
",",
"BufferedImage",
"image2",
",",
"String",
"pathFileName",
",",
"double",
"deviation",
")",
"{",
"BufferedImage",
"output",
"=",
"new",
"BufferedImage",
"(",
"image1",
".",... | Extends the functionality of imagesAreEqualsWithDiff, but creates a third BufferedImage and applies pixel manipulation to it.
@param image1 The first image to compare
@param image2 The second image to compare
@param pathFileName The output path filename for the third image, if null then is ignored
@param deviation The ... | [
"Extends",
"the",
"functionality",
"of",
"imagesAreEqualsWithDiff",
"but",
"creates",
"a",
"third",
"BufferedImage",
"and",
"applies",
"pixel",
"manipulation",
"to",
"it",
"."
] | train | https://github.com/assertthat/selenium-shutterbug/blob/770d9b92423200d262c9ab70e40405921d81e262/src/main/java/com/assertthat/selenium_shutterbug/utils/image/ImageProcessor.java#L147-L191 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getRepeated | @Nonnull
public static String getRepeated (final char cElement, @Nonnegative final int nRepeats) {
"""
Get the passed string element repeated for a certain number of times. Each
string element is simply appended at the end of the string.
@param cElement
The character to get repeated.
@param nRepeats
The n... | java | @Nonnull
public static String getRepeated (final char cElement, @Nonnegative final int nRepeats)
{
ValueEnforcer.isGE0 (nRepeats, "Repeats");
if (nRepeats == 0)
return "";
if (nRepeats == 1)
return Character.toString (cElement);
final char [] aElement = new char [nRepeats];
Arrays.... | [
"@",
"Nonnull",
"public",
"static",
"String",
"getRepeated",
"(",
"final",
"char",
"cElement",
",",
"@",
"Nonnegative",
"final",
"int",
"nRepeats",
")",
"{",
"ValueEnforcer",
".",
"isGE0",
"(",
"nRepeats",
",",
"\"Repeats\"",
")",
";",
"if",
"(",
"nRepeats",... | Get the passed string element repeated for a certain number of times. Each
string element is simply appended at the end of the string.
@param cElement
The character to get repeated.
@param nRepeats
The number of repetitions to retrieve. May not be < 0.
@return A non-<code>null</code> string containing the string el... | [
"Get",
"the",
"passed",
"string",
"element",
"repeated",
"for",
"a",
"certain",
"number",
"of",
"times",
".",
"Each",
"string",
"element",
"is",
"simply",
"appended",
"at",
"the",
"end",
"of",
"the",
"string",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L2353-L2366 |
GerdHolz/TOVAL | src/de/invation/code/toval/time/TimeUtils.java | TimeUtils.diffFromDate | private static Date diffFromDate(Date date, long diff, boolean clearTimeOfDay) {
"""
Caution: Difference calculation is based on adding/subtracting milliseconds and omits time zones.<br>
In some cases the method might return possibly unexpected results due to time zones.<br>
When for example to the last day of C... | java | private static Date diffFromDate(Date date, long diff, boolean clearTimeOfDay){
Date result = convertToUtilDate(convertToLocalDateTime(date).plusNanos(diff*1000000));
if(!clearTimeOfDay)
return result;
return clearTimeOfDay(result);
} | [
"private",
"static",
"Date",
"diffFromDate",
"(",
"Date",
"date",
",",
"long",
"diff",
",",
"boolean",
"clearTimeOfDay",
")",
"{",
"Date",
"result",
"=",
"convertToUtilDate",
"(",
"convertToLocalDateTime",
"(",
"date",
")",
".",
"plusNanos",
"(",
"diff",
"*",
... | Caution: Difference calculation is based on adding/subtracting milliseconds and omits time zones.<br>
In some cases the method might return possibly unexpected results due to time zones.<br>
When for example to the last day of CEST without time of day information (in 2016: 30.10.2016 00:00:00 000) milliseconds for one ... | [
"Caution",
":",
"Difference",
"calculation",
"is",
"based",
"on",
"adding",
"/",
"subtracting",
"milliseconds",
"and",
"omits",
"time",
"zones",
".",
"<br",
">",
"In",
"some",
"cases",
"the",
"method",
"might",
"return",
"possibly",
"unexpected",
"results",
"d... | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/time/TimeUtils.java#L128-L133 |
kiegroup/drools | kie-dmn/kie-dmn-core/src/main/java/org/kie/dmn/core/compiler/DecisionServiceCompiler.java | DecisionServiceCompiler.inputQualifiedNamePrefix | private static String inputQualifiedNamePrefix(DMNNode input, DMNModelImpl model) {
"""
DMN v1.2 specification, chapter "10.4 Execution Semantics of Decision Services"
The qualified name of an element named E that is defined in the same decision model as S is simply E.
Otherwise, the qualified name is I.E, where... | java | private static String inputQualifiedNamePrefix(DMNNode input, DMNModelImpl model) {
if (input.getModelNamespace().equals(model.getNamespace())) {
return null;
} else {
Optional<String> importAlias = model.getImportAliasFor(input.getModelNamespace(), input.getModelName());
... | [
"private",
"static",
"String",
"inputQualifiedNamePrefix",
"(",
"DMNNode",
"input",
",",
"DMNModelImpl",
"model",
")",
"{",
"if",
"(",
"input",
".",
"getModelNamespace",
"(",
")",
".",
"equals",
"(",
"model",
".",
"getNamespace",
"(",
")",
")",
")",
"{",
"... | DMN v1.2 specification, chapter "10.4 Execution Semantics of Decision Services"
The qualified name of an element named E that is defined in the same decision model as S is simply E.
Otherwise, the qualified name is I.E, where I is the name of the import element that refers to the model where E is defined. | [
"DMN",
"v1",
".",
"2",
"specification",
"chapter",
"10",
".",
"4",
"Execution",
"Semantics",
"of",
"Decision",
"Services",
"The",
"qualified",
"name",
"of",
"an",
"element",
"named",
"E",
"that",
"is",
"defined",
"in",
"the",
"same",
"decision",
"model",
"... | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/kie-dmn/kie-dmn-core/src/main/java/org/kie/dmn/core/compiler/DecisionServiceCompiler.java#L88-L107 |
JoeKerouac/utils | src/main/java/com/joe/utils/reflect/BeanUtils.java | BeanUtils.copy | public static <E> E copy(Object source, Class<E> targetClass) {
"""
将source中与targetClass同名的字段从source中复制到targetClass的实例中,source中的{@link Alias Alias}注解将会生效,需要注
意的是source中的Alias注解不要对应dest中的多个字段,否则会发生不可预测错误
@param source 被复制的源对象
@param targetClass 要复制的目标对象的class对象
@param <E> 目标对象的实际类型
@return targe... | java | public static <E> E copy(Object source, Class<E> targetClass) {
if (source == null || targetClass == null) {
return null;
}
E target;
String targetClassName = targetClass.getName();
log.debug("生成{}的实例", targetClassName);
try {
// 没有权限访问该类或者该类(为接口、抽... | [
"public",
"static",
"<",
"E",
">",
"E",
"copy",
"(",
"Object",
"source",
",",
"Class",
"<",
"E",
">",
"targetClass",
")",
"{",
"if",
"(",
"source",
"==",
"null",
"||",
"targetClass",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"E",
"target"... | 将source中与targetClass同名的字段从source中复制到targetClass的实例中,source中的{@link Alias Alias}注解将会生效,需要注
意的是source中的Alias注解不要对应dest中的多个字段,否则会发生不可预测错误
@param source 被复制的源对象
@param targetClass 要复制的目标对象的class对象
@param <E> 目标对象的实际类型
@return targetClass的实例,当targetClass或者source的class为接口、抽象类或者不是public时返回null | [
"将source中与targetClass同名的字段从source中复制到targetClass的实例中,source中的",
"{",
"@link",
"Alias",
"Alias",
"}",
"注解将会生效,需要注",
"意的是source中的Alias注解不要对应dest中的多个字段,否则会发生不可预测错误"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/reflect/BeanUtils.java#L140-L156 |
audit4j/audit4j-core | src/main/java/org/audit4j/core/schedule/TaskUtils.java | TaskUtils.decorateTaskWithErrorHandler | public static DelegatingErrorHandlingRunnable decorateTaskWithErrorHandler(Runnable task,
ErrorHandler errorHandler, boolean isRepeatingTask) {
"""
Decorate the task for error handling. If the provided
@param task the task
@param errorHandler the error handler
@param isRepeatingTask the is repeati... | java | public static DelegatingErrorHandlingRunnable decorateTaskWithErrorHandler(Runnable task,
ErrorHandler errorHandler, boolean isRepeatingTask) {
if (task instanceof DelegatingErrorHandlingRunnable) {
return (DelegatingErrorHandlingRunnable) task;
}
ErrorHandler eh = errorH... | [
"public",
"static",
"DelegatingErrorHandlingRunnable",
"decorateTaskWithErrorHandler",
"(",
"Runnable",
"task",
",",
"ErrorHandler",
"errorHandler",
",",
"boolean",
"isRepeatingTask",
")",
"{",
"if",
"(",
"task",
"instanceof",
"DelegatingErrorHandlingRunnable",
")",
"{",
... | Decorate the task for error handling. If the provided
@param task the task
@param errorHandler the error handler
@param isRepeatingTask the is repeating task
@return the delegating error handling runnable
{@link ErrorHandler} is not {@code null}, it will be used. Otherwise,
repeating tasks will have errors suppressed ... | [
"Decorate",
"the",
"task",
"for",
"error",
"handling",
".",
"If",
"the",
"provided"
] | train | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/schedule/TaskUtils.java#L53-L60 |
Samsung/GearVRf | GVRf/Extensions/gvrf-particlesystem/src/main/java/org/gearvrf/particlesystem/GVRSphericalEmitter.java | GVRSphericalEmitter.generateParticleVelocities | private float[] generateParticleVelocities() {
"""
Generate random velocities for every particle. The direction is obtained by assuming
the position of a particle as a vector. This normalised vector is scaled by
the speed range.
@return
"""
float [] particleVelocities = new float[mEmitRate * 3];
... | java | private float[] generateParticleVelocities()
{
float [] particleVelocities = new float[mEmitRate * 3];
Vector3f temp = new Vector3f(0,0,0);
for ( int i = 0; i < mEmitRate * 3 ; i +=3 )
{
temp.x = mParticlePositions[i];
temp.y = mParticlePositions[i+1];
... | [
"private",
"float",
"[",
"]",
"generateParticleVelocities",
"(",
")",
"{",
"float",
"[",
"]",
"particleVelocities",
"=",
"new",
"float",
"[",
"mEmitRate",
"*",
"3",
"]",
";",
"Vector3f",
"temp",
"=",
"new",
"Vector3f",
"(",
"0",
",",
"0",
",",
"0",
")"... | Generate random velocities for every particle. The direction is obtained by assuming
the position of a particle as a vector. This normalised vector is scaled by
the speed range.
@return | [
"Generate",
"random",
"velocities",
"for",
"every",
"particle",
".",
"The",
"direction",
"is",
"obtained",
"by",
"assuming",
"the",
"position",
"of",
"a",
"particle",
"as",
"a",
"vector",
".",
"This",
"normalised",
"vector",
"is",
"scaled",
"by",
"the",
"spe... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/gvrf-particlesystem/src/main/java/org/gearvrf/particlesystem/GVRSphericalEmitter.java#L113-L142 |
geomajas/geomajas-project-client-gwt2 | plugin/tilebasedlayer/impl/src/main/java/org/geomajas/gwt2/plugin/tilebasedlayer/client/TileBasedLayerClient.java | TileBasedLayerClient.createDefaultOsmLayer | @Deprecated
public OsmLayer createDefaultOsmLayer(String id, TileConfiguration conf) {
"""
Create a new OSM layer with the given ID and tile configuration. The layer will be configured
with the default OSM tile services so you don't have to specify these URLs yourself.
@param id The unique ID of the layer.
@... | java | @Deprecated
public OsmLayer createDefaultOsmLayer(String id, TileConfiguration conf) {
OsmLayer layer = new OsmLayer(id, conf);
layer.addUrls(Arrays.asList(DEFAULT_OSM_URLS));
return layer;
} | [
"@",
"Deprecated",
"public",
"OsmLayer",
"createDefaultOsmLayer",
"(",
"String",
"id",
",",
"TileConfiguration",
"conf",
")",
"{",
"OsmLayer",
"layer",
"=",
"new",
"OsmLayer",
"(",
"id",
",",
"conf",
")",
";",
"layer",
".",
"addUrls",
"(",
"Arrays",
".",
"... | Create a new OSM layer with the given ID and tile configuration. The layer will be configured
with the default OSM tile services so you don't have to specify these URLs yourself.
@param id The unique ID of the layer.
@param conf The tile configuration.
@return A new OSM layer.
@deprecated use {@link #createDefaultOsmL... | [
"Create",
"a",
"new",
"OSM",
"layer",
"with",
"the",
"given",
"ID",
"and",
"tile",
"configuration",
".",
"The",
"layer",
"will",
"be",
"configured",
"with",
"the",
"default",
"OSM",
"tile",
"services",
"so",
"you",
"don",
"t",
"have",
"to",
"specify",
"t... | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/tilebasedlayer/impl/src/main/java/org/geomajas/gwt2/plugin/tilebasedlayer/client/TileBasedLayerClient.java#L132-L137 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionGraph.java | ExecutionGraph.getOutputVertex | public ExecutionVertex getOutputVertex(final int stage, final int index) {
"""
Returns the output vertex with the specified index for the given stage.
@param stage
the index of the stage
@param index
the index of the output vertex to return
@return the output vertex with the specified index or <code>null</c... | java | public ExecutionVertex getOutputVertex(final int stage, final int index) {
try {
final ExecutionStage s = this.stages.get(stage);
if (s == null) {
return null;
}
return s.getOutputExecutionVertex(index);
} catch (ArrayIndexOutOfBoundsException e) {
return null;
}
} | [
"public",
"ExecutionVertex",
"getOutputVertex",
"(",
"final",
"int",
"stage",
",",
"final",
"int",
"index",
")",
"{",
"try",
"{",
"final",
"ExecutionStage",
"s",
"=",
"this",
".",
"stages",
".",
"get",
"(",
"stage",
")",
";",
"if",
"(",
"s",
"==",
"nul... | Returns the output vertex with the specified index for the given stage.
@param stage
the index of the stage
@param index
the index of the output vertex to return
@return the output vertex with the specified index or <code>null</code> if no output vertex with such an index
exists in that stage | [
"Returns",
"the",
"output",
"vertex",
"with",
"the",
"specified",
"index",
"for",
"the",
"given",
"stage",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionGraph.java#L701-L714 |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.addItem | public void addItem(T value, String text, boolean reload) {
"""
Adds an item to the list box, specifying an initial value for the item.
@param value the item's value, to be submitted if it is part of a
{@link FormPanel}; cannot be <code>null</code>
@param text the text of the item to be added
@param reloa... | java | public void addItem(T value, String text, boolean reload) {
values.add(value);
listBox.addItem(text, keyFactory.generateKey(value));
if (reload) {
reload();
}
} | [
"public",
"void",
"addItem",
"(",
"T",
"value",
",",
"String",
"text",
",",
"boolean",
"reload",
")",
"{",
"values",
".",
"add",
"(",
"value",
")",
";",
"listBox",
".",
"addItem",
"(",
"text",
",",
"keyFactory",
".",
"generateKey",
"(",
"value",
")",
... | Adds an item to the list box, specifying an initial value for the item.
@param value the item's value, to be submitted if it is part of a
{@link FormPanel}; cannot be <code>null</code>
@param text the text of the item to be added
@param reload perform a 'material select' reload to update the DOM. | [
"Adds",
"an",
"item",
"to",
"the",
"list",
"box",
"specifying",
"an",
"initial",
"value",
"for",
"the",
"item",
"."
] | train | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L258-L265 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.telephony_billingAccount_line_POST | public OvhOrder telephony_billingAccount_line_POST(String billingAccount, String brand, Boolean[] displayUniversalDirectories, Long[] extraSimultaneousLines, String mondialRelayId, String[] offers, Long[] ownerContactIds, Long quantity, Boolean retractation, Long shippingContactId, OvhLineTypeEnum[] types, String[] zon... | java | public OvhOrder telephony_billingAccount_line_POST(String billingAccount, String brand, Boolean[] displayUniversalDirectories, Long[] extraSimultaneousLines, String mondialRelayId, String[] offers, Long[] ownerContactIds, Long quantity, Boolean retractation, Long shippingContactId, OvhLineTypeEnum[] types, String[] zon... | [
"public",
"OvhOrder",
"telephony_billingAccount_line_POST",
"(",
"String",
"billingAccount",
",",
"String",
"brand",
",",
"Boolean",
"[",
"]",
"displayUniversalDirectories",
",",
"Long",
"[",
"]",
"extraSimultaneousLines",
",",
"String",
"mondialRelayId",
",",
"String",... | Create order
REST: POST /order/telephony/{billingAccount}/line
@param extraSimultaneousLines [required] Additional simultaneous numbers. Set several simultaneous lines for each line per phone
@param quantity [required] Quantity of request repetition in this configuration
@param retractation [required] Retractation rig... | [
"Create",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L6370-L6387 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/vbs/VBSFaxClientSpi.java | VBSFaxClientSpi.invokeScript | protected FaxJobStatus invokeScript(FaxJob faxJob,String name,Object[] input,FaxActionType faxActionType) {
"""
Invokes the VB script and returns its output.
@param faxJob
The fax job object containing the needed information
@param name
The script name
@param input
The script input
@param faxActio... | java | protected FaxJobStatus invokeScript(FaxJob faxJob,String name,Object[] input,FaxActionType faxActionType)
{
//generate script
String script=this.generateScript(name,input);
//invoke script
ProcessOutput processOutput=this.invokeScript(script);
//validate out... | [
"protected",
"FaxJobStatus",
"invokeScript",
"(",
"FaxJob",
"faxJob",
",",
"String",
"name",
",",
"Object",
"[",
"]",
"input",
",",
"FaxActionType",
"faxActionType",
")",
"{",
"//generate script",
"String",
"script",
"=",
"this",
".",
"generateScript",
"(",
"nam... | Invokes the VB script and returns its output.
@param faxJob
The fax job object containing the needed information
@param name
The script name
@param input
The script input
@param faxActionType
The fax action type
@return The fax job status (only for get fax job status action, for others null will be returned) | [
"Invokes",
"the",
"VB",
"script",
"and",
"returns",
"its",
"output",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/vbs/VBSFaxClientSpi.java#L620-L647 |
js-lib-com/dom | src/main/java/js/dom/w3c/DocumentImpl.java | DocumentImpl.evaluateXPathNodeNS | Element evaluateXPathNodeNS(Node contextNode, NamespaceContext namespaceContext, String expression, Object... args) {
"""
Name space aware variant for {@link #evaluateXPathNode(Node, String, Object...)}.
@param contextNode evaluation context node,
@param namespaceContext name space context maps prefixes to nam... | java | Element evaluateXPathNodeNS(Node contextNode, NamespaceContext namespaceContext, String expression, Object... args) {
if (args.length > 0) {
expression = Strings.format(expression, args);
}
Node node = null;
try {
XPath xpath = XPathFactory.newInstance().newXPath();
if (namespaceContext != nul... | [
"Element",
"evaluateXPathNodeNS",
"(",
"Node",
"contextNode",
",",
"NamespaceContext",
"namespaceContext",
",",
"String",
"expression",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"args",
".",
"length",
">",
"0",
")",
"{",
"expression",
"=",
"Strings",
... | Name space aware variant for {@link #evaluateXPathNode(Node, String, Object...)}.
@param contextNode evaluation context node,
@param namespaceContext name space context maps prefixes to name space URIs,
@param expression XPath expression, formatting tags supported,
@param args optional formatting arguments.
@return ev... | [
"Name",
"space",
"aware",
"variant",
"for",
"{",
"@link",
"#evaluateXPathNode",
"(",
"Node",
"String",
"Object",
"...",
")",
"}",
"."
] | train | https://github.com/js-lib-com/dom/blob/8c7cd7c802977f210674dec7c2a8f61e8de05b63/src/main/java/js/dom/w3c/DocumentImpl.java#L300-L324 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/StringUtils.java | StringUtils.indexOfAny | public static int indexOfAny(final CharSequence cs, final String searchChars) {
"""
<p>Search a CharSequence to find the first index of any
character in the given set of characters.</p>
<p>A {@code null} String will return {@code -1}.
A {@code null} search string will return {@code -1}.</p>
<pre>
StringUt... | java | public static int indexOfAny(final CharSequence cs, final String searchChars) {
if (isEmpty(cs) || isEmpty(searchChars)) {
return INDEX_NOT_FOUND;
}
return indexOfAny(cs, searchChars.toCharArray());
} | [
"public",
"static",
"int",
"indexOfAny",
"(",
"final",
"CharSequence",
"cs",
",",
"final",
"String",
"searchChars",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"cs",
")",
"||",
"isEmpty",
"(",
"searchChars",
")",
")",
"{",
"return",
"INDEX_NOT_FOUND",
";",
"}",
... | <p>Search a CharSequence to find the first index of any
character in the given set of characters.</p>
<p>A {@code null} String will return {@code -1}.
A {@code null} search string will return {@code -1}.</p>
<pre>
StringUtils.indexOfAny(null, *) = -1
StringUtils.indexOfAny("", *) = -1
StringUt... | [
"<p",
">",
"Search",
"a",
"CharSequence",
"to",
"find",
"the",
"first",
"index",
"of",
"any",
"character",
"in",
"the",
"given",
"set",
"of",
"characters",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/StringUtils.java#L2122-L2127 |
Trilarion/java-vorbis-support | src/main/java/com/github/trilarion/sound/vorbis/sampled/spi/VorbisAudioFileReader.java | VorbisAudioFileReader.getAudioFileFormat | @Override
public AudioFileFormat getAudioFileFormat(InputStream inputStream) throws UnsupportedAudioFileException, IOException {
"""
Return the AudioFileFormat from the given InputStream.
@return
@throws javax.sound.sampled.UnsupportedAudioFileException
@throws java.io.IOException
"""
LOG.log(... | java | @Override
public AudioFileFormat getAudioFileFormat(InputStream inputStream) throws UnsupportedAudioFileException, IOException {
LOG.log(Level.FINE, "getAudioFileFormat(InputStream inputStream)");
try {
if (!inputStream.markSupported()) {
inputStream = new BufferedInputSt... | [
"@",
"Override",
"public",
"AudioFileFormat",
"getAudioFileFormat",
"(",
"InputStream",
"inputStream",
")",
"throws",
"UnsupportedAudioFileException",
",",
"IOException",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"FINE",
",",
"\"getAudioFileFormat(InputStream inputStream... | Return the AudioFileFormat from the given InputStream.
@return
@throws javax.sound.sampled.UnsupportedAudioFileException
@throws java.io.IOException | [
"Return",
"the",
"AudioFileFormat",
"from",
"the",
"given",
"InputStream",
"."
] | train | https://github.com/Trilarion/java-vorbis-support/blob/f72aba7d97167fe0ff20b1b719fdb5bb662ff736/src/main/java/com/github/trilarion/sound/vorbis/sampled/spi/VorbisAudioFileReader.java#L138-L150 |
alibaba/Tangram-Android | tangram/src/main/java/com/tmall/wireless/tangram/core/adapter/GroupBasicAdapter.java | GroupBasicAdapter.insertGroup | public void insertGroup(int inserted, @Nullable List<L> groups) {
"""
insert groups after position inserted
@param inserted index that will inserted after
@param groups new groups
"""
if (inserted < 0 || inserted >= mCards.size() || groups == null || groups.size() == 0)
return;
... | java | public void insertGroup(int inserted, @Nullable List<L> groups) {
if (inserted < 0 || inserted >= mCards.size() || groups == null || groups.size() == 0)
return;
List<L> cards = getGroups();
boolean changed = cards.addAll(inserted, groups);
if (changed)
setData(... | [
"public",
"void",
"insertGroup",
"(",
"int",
"inserted",
",",
"@",
"Nullable",
"List",
"<",
"L",
">",
"groups",
")",
"{",
"if",
"(",
"inserted",
"<",
"0",
"||",
"inserted",
">=",
"mCards",
".",
"size",
"(",
")",
"||",
"groups",
"==",
"null",
"||",
... | insert groups after position inserted
@param inserted index that will inserted after
@param groups new groups | [
"insert",
"groups",
"after",
"position",
"inserted"
] | train | https://github.com/alibaba/Tangram-Android/blob/caa57f54e009c8dacd34a2322d5761956ebed321/tangram/src/main/java/com/tmall/wireless/tangram/core/adapter/GroupBasicAdapter.java#L543-L553 |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/lexinduct/CfgAlignmentModel.java | CfgAlignmentModel.getRootFactor | public Factor getRootFactor(ExpressionTree tree, VariableNumMap expressionVar) {
"""
This method is a hack that enables the use of the "substitutions"
field of ExpressionTree at the root of the CFG parse. In the future,
these substitutions should be handled using unary rules in the
CFG parser.
"""
List<... | java | public Factor getRootFactor(ExpressionTree tree, VariableNumMap expressionVar) {
List<Assignment> roots = Lists.newArrayList();
if (tree.getSubstitutions().size() == 0) {
roots.add(expressionVar.outcomeArrayToAssignment(tree.getExpressionNode()));
} else {
for (ExpressionTree substitution : tree... | [
"public",
"Factor",
"getRootFactor",
"(",
"ExpressionTree",
"tree",
",",
"VariableNumMap",
"expressionVar",
")",
"{",
"List",
"<",
"Assignment",
">",
"roots",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"if",
"(",
"tree",
".",
"getSubstitutions",
"(",
... | This method is a hack that enables the use of the "substitutions"
field of ExpressionTree at the root of the CFG parse. In the future,
these substitutions should be handled using unary rules in the
CFG parser. | [
"This",
"method",
"is",
"a",
"hack",
"that",
"enables",
"the",
"use",
"of",
"the",
"substitutions",
"field",
"of",
"ExpressionTree",
"at",
"the",
"root",
"of",
"the",
"CFG",
"parse",
".",
"In",
"the",
"future",
"these",
"substitutions",
"should",
"be",
"ha... | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/lexinduct/CfgAlignmentModel.java#L327-L338 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/core/TraceNLSHelper.java | TraceNLSHelper.getString | public String getString(String key, String defaultString) {
"""
Look for a translated message using the input key. If it is not found, then
the provided default string is returned.
@param key
@param defaultString
@return String
"""
if (tnls != null)
return tnls.getString(key, defaultS... | java | public String getString(String key, String defaultString) {
if (tnls != null)
return tnls.getString(key, defaultString);
return defaultString;
} | [
"public",
"String",
"getString",
"(",
"String",
"key",
",",
"String",
"defaultString",
")",
"{",
"if",
"(",
"tnls",
"!=",
"null",
")",
"return",
"tnls",
".",
"getString",
"(",
"key",
",",
"defaultString",
")",
";",
"return",
"defaultString",
";",
"}"
] | Look for a translated message using the input key. If it is not found, then
the provided default string is returned.
@param key
@param defaultString
@return String | [
"Look",
"for",
"a",
"translated",
"message",
"using",
"the",
"input",
"key",
".",
"If",
"it",
"is",
"not",
"found",
"then",
"the",
"provided",
"default",
"string",
"is",
"returned",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/core/TraceNLSHelper.java#L52-L57 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/Jinx.java | Jinx.getAuthorizationUrl | public String getAuthorizationUrl(Token requestToken, JinxConstants.OAuthPermissions permissions) throws JinxException {
"""
OAuth workflow, step two: Get an authorization URL.
<br>
Once you have a request token pass it to this method to get the authorization URL.
The user should be directed to the returned URL... | java | public String getAuthorizationUrl(Token requestToken, JinxConstants.OAuthPermissions permissions) throws JinxException {
JinxUtils.validateParams(requestToken, permissions);
String url = this.oAuthService.getAuthorizationUrl(requestToken);
return url + "&perms=" + permissions.toString();
} | [
"public",
"String",
"getAuthorizationUrl",
"(",
"Token",
"requestToken",
",",
"JinxConstants",
".",
"OAuthPermissions",
"permissions",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"requestToken",
",",
"permissions",
")",
";",
"String",... | OAuth workflow, step two: Get an authorization URL.
<br>
Once you have a request token pass it to this method to get the authorization URL.
The user should be directed to the returned URL, where they can authorize your
application. Once they have authorized your application, they will receive a
verification code, which... | [
"OAuth",
"workflow",
"step",
"two",
":",
"Get",
"an",
"authorization",
"URL",
".",
"<br",
">",
"Once",
"you",
"have",
"a",
"request",
"token",
"pass",
"it",
"to",
"this",
"method",
"to",
"get",
"the",
"authorization",
"URL",
".",
"The",
"user",
"should",... | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/Jinx.java#L267-L271 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.typeTextInWebElement | public void typeTextInWebElement(WebElement webElement, String text) {
"""
Types text in the specified WebElement.
@param webElement the WebElement to type text in
@param text the text to enter in the {@link WebElement} field
"""
if(config.commandLogging){
Log.d(config.commandLoggingTag, "typeTextInWe... | java | public void typeTextInWebElement(WebElement webElement, String text){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "typeTextInWebElement("+webElement+", \""+text+"\")");
}
clickOnWebElement(webElement);
dialogUtils.hideSoftKeyboard(null, true, true);
instrumentation.sendStringSync(text);
... | [
"public",
"void",
"typeTextInWebElement",
"(",
"WebElement",
"webElement",
",",
"String",
"text",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"typeTextInWebElement(\"",
"+",
"... | Types text in the specified WebElement.
@param webElement the WebElement to type text in
@param text the text to enter in the {@link WebElement} field | [
"Types",
"text",
"in",
"the",
"specified",
"WebElement",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L2777-L2785 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/SignatureFileVerifier.java | SignatureFileVerifier.getTimestamp | private Timestamp getTimestamp(SignerInfo info)
throws IOException, NoSuchAlgorithmException, SignatureException,
CertificateException {
"""
/*
Examines a signature timestamp token to generate a timestamp object.
Examines the signer's unsigned attributes for a
<tt>signatureTimestampToken</... | java | private Timestamp getTimestamp(SignerInfo info)
throws IOException, NoSuchAlgorithmException, SignatureException,
CertificateException {
Timestamp timestamp = null;
// Extract the signer's unsigned attributes
PKCS9Attributes unsignedAttrs = info.getUnauthenticatedAttributes... | [
"private",
"Timestamp",
"getTimestamp",
"(",
"SignerInfo",
"info",
")",
"throws",
"IOException",
",",
"NoSuchAlgorithmException",
",",
"SignatureException",
",",
"CertificateException",
"{",
"Timestamp",
"timestamp",
"=",
"null",
";",
"// Extract the signer's unsigned attri... | /*
Examines a signature timestamp token to generate a timestamp object.
Examines the signer's unsigned attributes for a
<tt>signatureTimestampToken</tt> attribute. If present,
then it is parsed to extract the date and time at which the
timestamp was generated.
@param info A signer information element of a PKCS 7 bloc... | [
"/",
"*",
"Examines",
"a",
"signature",
"timestamp",
"token",
"to",
"generate",
"a",
"timestamp",
"object",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/SignatureFileVerifier.java#L523-L559 |
bullhorn/sdk-rest | src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java | StandardBullhornData.handleDeleteFile | protected FileApiResponse handleDeleteFile(Class<? extends FileEntity> type, Integer entityId, Integer fileId) {
"""
Makes the api call to delete a file attached to an entity.
@param type
@param entityId
@param fileId
@return
"""
Map<String, String> uriVariables = restUriVariablesFactory.getUriVa... | java | protected FileApiResponse handleDeleteFile(Class<? extends FileEntity> type, Integer entityId, Integer fileId) {
Map<String, String> uriVariables = restUriVariablesFactory.getUriVariablesDeleteFile(BullhornEntityInfo.getTypesRestEntityName(type),
entityId, fileId);
String url = restUrlFa... | [
"protected",
"FileApiResponse",
"handleDeleteFile",
"(",
"Class",
"<",
"?",
"extends",
"FileEntity",
">",
"type",
",",
"Integer",
"entityId",
",",
"Integer",
"fileId",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"uriVariables",
"=",
"restUriVariablesFact... | Makes the api call to delete a file attached to an entity.
@param type
@param entityId
@param fileId
@return | [
"Makes",
"the",
"api",
"call",
"to",
"delete",
"a",
"file",
"attached",
"to",
"an",
"entity",
"."
] | train | https://github.com/bullhorn/sdk-rest/blob/0c75a141c768bb31510afc3a412c11bd101eca06/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java#L1746-L1754 |
irmen/Pyrolite | java/src/main/java/net/razorvine/pyro/PyroProxy.java | PyroProxy.call_oneway | public void call_oneway(String method, Object... arguments) throws PickleException, PyroException, IOException {
"""
Call a method on the remote Pyro object this proxy is for, using Oneway call semantics (return immediately).
@param method the name of the method you want to call
@param arguments zero or more arg... | java | public void call_oneway(String method, Object... arguments) throws PickleException, PyroException, IOException {
internal_call(method, null, Message.FLAGS_ONEWAY, true, arguments);
} | [
"public",
"void",
"call_oneway",
"(",
"String",
"method",
",",
"Object",
"...",
"arguments",
")",
"throws",
"PickleException",
",",
"PyroException",
",",
"IOException",
"{",
"internal_call",
"(",
"method",
",",
"null",
",",
"Message",
".",
"FLAGS_ONEWAY",
",",
... | Call a method on the remote Pyro object this proxy is for, using Oneway call semantics (return immediately).
@param method the name of the method you want to call
@param arguments zero or more arguments for the remote method | [
"Call",
"a",
"method",
"on",
"the",
"remote",
"Pyro",
"object",
"this",
"proxy",
"is",
"for",
"using",
"Oneway",
"call",
"semantics",
"(",
"return",
"immediately",
")",
"."
] | train | https://github.com/irmen/Pyrolite/blob/060bc3c9069cd31560b6da4f67280736fb2cdf63/java/src/main/java/net/razorvine/pyro/PyroProxy.java#L186-L188 |
ganglia/jmxetric | src/main/java/info/ganglia/jmxetric/MBeanSampler.java | MBeanSampler.addMBeanAttribute | public void addMBeanAttribute(String mbean, MBeanAttribute attr)
throws Exception {
"""
Adds an {@link info.ganglia.jmxetric.MBeanAttribute} to be sampled.
@param mbean
name of the mbean
@param attr
attribute to be sample
@throws Exception
"""
MBeanHolder mbeanHolder = mbeanMap.get(mbean);
if (mb... | java | public void addMBeanAttribute(String mbean, MBeanAttribute attr)
throws Exception {
MBeanHolder mbeanHolder = mbeanMap.get(mbean);
if (mbeanHolder == null) {
mbeanHolder = new MBeanHolder(this, process, mbean);
mbeanMap.put(mbean, mbeanHolder);
}
mbeanHolder.addAttribute(attr);
log.info("Added attrib... | [
"public",
"void",
"addMBeanAttribute",
"(",
"String",
"mbean",
",",
"MBeanAttribute",
"attr",
")",
"throws",
"Exception",
"{",
"MBeanHolder",
"mbeanHolder",
"=",
"mbeanMap",
".",
"get",
"(",
"mbean",
")",
";",
"if",
"(",
"mbeanHolder",
"==",
"null",
")",
"{"... | Adds an {@link info.ganglia.jmxetric.MBeanAttribute} to be sampled.
@param mbean
name of the mbean
@param attr
attribute to be sample
@throws Exception | [
"Adds",
"an",
"{",
"@link",
"info",
".",
"ganglia",
".",
"jmxetric",
".",
"MBeanAttribute",
"}",
"to",
"be",
"sampled",
"."
] | train | https://github.com/ganglia/jmxetric/blob/0b21edb9bd75e0b2df8370ad1c77a1ea47f502ca/src/main/java/info/ganglia/jmxetric/MBeanSampler.java#L108-L117 |
xiancloud/xian | xian-zookeeper/xian-curator/xian-curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java | ZKPaths.getPathAndNode | public static PathAndNode getPathAndNode(String path) {
"""
Given a full path, return the node name and its path. i.e. "/one/two/three" will return {"/one/two", "three"}
@param path the path
@return the node
"""
PathUtils.validatePath(path);
int i = path.lastIndexOf(PATH_SEPARATOR);
... | java | public static PathAndNode getPathAndNode(String path)
{
PathUtils.validatePath(path);
int i = path.lastIndexOf(PATH_SEPARATOR);
if ( i < 0 )
{
return new PathAndNode(path, "");
}
if ( (i + 1) >= path.length() )
{
return new PathAndNode(... | [
"public",
"static",
"PathAndNode",
"getPathAndNode",
"(",
"String",
"path",
")",
"{",
"PathUtils",
".",
"validatePath",
"(",
"path",
")",
";",
"int",
"i",
"=",
"path",
".",
"lastIndexOf",
"(",
"PATH_SEPARATOR",
")",
";",
"if",
"(",
"i",
"<",
"0",
")",
... | Given a full path, return the node name and its path. i.e. "/one/two/three" will return {"/one/two", "three"}
@param path the path
@return the node | [
"Given",
"a",
"full",
"path",
"return",
"the",
"node",
"name",
"and",
"its",
"path",
".",
"i",
".",
"e",
".",
"/",
"one",
"/",
"two",
"/",
"three",
"will",
"return",
"{",
"/",
"one",
"/",
"two",
"three",
"}"
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-client/src/main/java/org/apache/curator/utils/ZKPaths.java#L163-L178 |
alipay/sofa-rpc | core/common/src/main/java/com/alipay/sofa/rpc/common/utils/FileUtils.java | FileUtils.string2File | public static boolean string2File(File file, String data) throws IOException {
"""
字符流写文件 较快
@param file 文件
@param data 数据
@return 操作是否成功
@throws IOException 发送IO异常
"""
if (!file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}
FileWriter writer = null;
... | java | public static boolean string2File(File file, String data) throws IOException {
if (!file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}
FileWriter writer = null;
try {
writer = new FileWriter(file, false);
writer.write(data);
} fi... | [
"public",
"static",
"boolean",
"string2File",
"(",
"File",
"file",
",",
"String",
"data",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"file",
".",
"getParentFile",
"(",
")",
".",
"exists",
"(",
")",
")",
"{",
"file",
".",
"getParentFile",
"(",
"... | 字符流写文件 较快
@param file 文件
@param data 数据
@return 操作是否成功
@throws IOException 发送IO异常 | [
"字符流写文件",
"较快"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/common/src/main/java/com/alipay/sofa/rpc/common/utils/FileUtils.java#L205-L219 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/config/Configuration.java | Configuration.setDefaultStyle | public final void setDefaultStyle(final Map<String, Style> defaultStyle) {
"""
Set the default styles. the case of the keys are not important. The retrieval will be case
insensitive.
@param defaultStyle the mapping from geometry type name (point, polygon, etc...) to the style
to use for that type.
"""
... | java | public final void setDefaultStyle(final Map<String, Style> defaultStyle) {
this.defaultStyle = new HashMap<>(defaultStyle.size());
for (Map.Entry<String, Style> entry: defaultStyle.entrySet()) {
String normalizedName = GEOMETRY_NAME_ALIASES.get(entry.getKey().toLowerCase());
if ... | [
"public",
"final",
"void",
"setDefaultStyle",
"(",
"final",
"Map",
"<",
"String",
",",
"Style",
">",
"defaultStyle",
")",
"{",
"this",
".",
"defaultStyle",
"=",
"new",
"HashMap",
"<>",
"(",
"defaultStyle",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"... | Set the default styles. the case of the keys are not important. The retrieval will be case
insensitive.
@param defaultStyle the mapping from geometry type name (point, polygon, etc...) to the style
to use for that type. | [
"Set",
"the",
"default",
"styles",
".",
"the",
"case",
"of",
"the",
"keys",
"are",
"not",
"important",
".",
"The",
"retrieval",
"will",
"be",
"case",
"insensitive",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/config/Configuration.java#L446-L457 |
FINRAOS/JTAF-ExtWebDriver | src/main/java/org/finra/jtaf/ewd/widget/element/Element.java | Element.getNodeListUsingJavaXPath | private NodeList getNodeListUsingJavaXPath(String xpath) throws Exception {
"""
Get the list of nodes which satisfy the xpath expression passed in
@param xpath
the input xpath expression
@return the nodeset of matching elements
@throws Exception
"""
XPathFactory xpathFac = XPathFactory.newInstance();
... | java | private NodeList getNodeListUsingJavaXPath(String xpath) throws Exception {
XPathFactory xpathFac = XPathFactory.newInstance();
XPath theXpath = xpathFac.newXPath();
String html = getGUIDriver().getHtmlSource();
html = html.replaceAll(">\\s+<", "><");
InputStream input = new ByteArrayInputStream(html.getByte... | [
"private",
"NodeList",
"getNodeListUsingJavaXPath",
"(",
"String",
"xpath",
")",
"throws",
"Exception",
"{",
"XPathFactory",
"xpathFac",
"=",
"XPathFactory",
".",
"newInstance",
"(",
")",
";",
"XPath",
"theXpath",
"=",
"xpathFac",
".",
"newXPath",
"(",
")",
";",... | Get the list of nodes which satisfy the xpath expression passed in
@param xpath
the input xpath expression
@return the nodeset of matching elements
@throws Exception | [
"Get",
"the",
"list",
"of",
"nodes",
"which",
"satisfy",
"the",
"xpath",
"expression",
"passed",
"in"
] | train | https://github.com/FINRAOS/JTAF-ExtWebDriver/blob/78d646def1bf0904f79b19a81df0241e07f2c73a/src/main/java/org/finra/jtaf/ewd/widget/element/Element.java#L892-L912 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/exceptions/MessageUtils.java | MessageUtils.buildMessage | static String buildMessage(BeanResolutionContext resolutionContext, Argument argument, String message, boolean circular) {
"""
Builds an appropriate error message for a constructor argument.
@param resolutionContext The resolution context
@param argument The argument
@param message The mess... | java | static String buildMessage(BeanResolutionContext resolutionContext, Argument argument, String message, boolean circular) {
StringBuilder builder = new StringBuilder("Failed to inject value for parameter [");
String ls = System.getProperty("line.separator");
BeanResolutionContext.Path path = reso... | [
"static",
"String",
"buildMessage",
"(",
"BeanResolutionContext",
"resolutionContext",
",",
"Argument",
"argument",
",",
"String",
"message",
",",
"boolean",
"circular",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"\"Failed to inject value fo... | Builds an appropriate error message for a constructor argument.
@param resolutionContext The resolution context
@param argument The argument
@param message The message
@param circular Is the path circular
@return The message | [
"Builds",
"an",
"appropriate",
"error",
"message",
"for",
"a",
"constructor",
"argument",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/exceptions/MessageUtils.java#L129-L143 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/util/Utils.java | Utils.toLightweightTypeReference | public static LightweightTypeReference toLightweightTypeReference(
JvmType type, CommonTypeComputationServices services) {
"""
Convert a type reference to a lightweight type reference.
@param type - type to convert.
@param services - services used for the conversion
@return the lightweight type reference.
... | java | public static LightweightTypeReference toLightweightTypeReference(
JvmType type, CommonTypeComputationServices services) {
return toLightweightTypeReference(type, services, false);
} | [
"public",
"static",
"LightweightTypeReference",
"toLightweightTypeReference",
"(",
"JvmType",
"type",
",",
"CommonTypeComputationServices",
"services",
")",
"{",
"return",
"toLightweightTypeReference",
"(",
"type",
",",
"services",
",",
"false",
")",
";",
"}"
] | Convert a type reference to a lightweight type reference.
@param type - type to convert.
@param services - services used for the conversion
@return the lightweight type reference. | [
"Convert",
"a",
"type",
"reference",
"to",
"a",
"lightweight",
"type",
"reference",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/util/Utils.java#L627-L630 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/Graphics.java | Graphics.applyMask | public static ImageBuffer applyMask(ImageBuffer imageBuffer, ColorRgba maskColor) {
"""
Apply color mask to the image.
@param imageBuffer The image reference (must not be <code>null</code>).
@param maskColor The color mask (must not be <code>null</code>).
@return The masked image buffer.
@throws LionEngineEx... | java | public static ImageBuffer applyMask(ImageBuffer imageBuffer, ColorRgba maskColor)
{
return factoryGraphic.applyMask(imageBuffer, maskColor);
} | [
"public",
"static",
"ImageBuffer",
"applyMask",
"(",
"ImageBuffer",
"imageBuffer",
",",
"ColorRgba",
"maskColor",
")",
"{",
"return",
"factoryGraphic",
".",
"applyMask",
"(",
"imageBuffer",
",",
"maskColor",
")",
";",
"}"
] | Apply color mask to the image.
@param imageBuffer The image reference (must not be <code>null</code>).
@param maskColor The color mask (must not be <code>null</code>).
@return The masked image buffer.
@throws LionEngineException If invalid arguments. | [
"Apply",
"color",
"mask",
"to",
"the",
"image",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/Graphics.java#L163-L166 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/BundlesHandlerFactory.java | BundlesHandlerFactory.getBundleFromName | private JoinableResourceBundle getBundleFromName(String name, List<JoinableResourceBundle> bundles) {
"""
Returns a bundle from its name
@param name
the bundle name
@param bundles
the list of bundle
@return a bundle from its name
"""
JoinableResourceBundle bundle = null;
for (JoinableResourceBundle... | java | private JoinableResourceBundle getBundleFromName(String name, List<JoinableResourceBundle> bundles) {
JoinableResourceBundle bundle = null;
for (JoinableResourceBundle aBundle : bundles) {
if (aBundle.getName().equals(name)) {
bundle = aBundle;
break;
}
}
return bundle;
} | [
"private",
"JoinableResourceBundle",
"getBundleFromName",
"(",
"String",
"name",
",",
"List",
"<",
"JoinableResourceBundle",
">",
"bundles",
")",
"{",
"JoinableResourceBundle",
"bundle",
"=",
"null",
";",
"for",
"(",
"JoinableResourceBundle",
"aBundle",
":",
"bundles"... | Returns a bundle from its name
@param name
the bundle name
@param bundles
the list of bundle
@return a bundle from its name | [
"Returns",
"a",
"bundle",
"from",
"its",
"name"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/BundlesHandlerFactory.java#L453-L464 |
adyliu/jafka | src/main/java/io/jafka/producer/ZKBrokerPartitionInfo.java | ZKBrokerPartitionInfo.getZKTopicPartitionInfo | private Map<String, SortedSet<Partition>> getZKTopicPartitionInfo(Map<Integer, Broker> allBrokers) {
"""
Generate a sequence of (brokerId, numPartitions) for all topics registered in zookeeper
@param allBrokers all register brokers
@return a mapping from topic to sequence of (brokerId, numPartitions)
"""
... | java | private Map<String, SortedSet<Partition>> getZKTopicPartitionInfo(Map<Integer, Broker> allBrokers) {
final Map<String, SortedSet<Partition>> brokerPartitionsPerTopic = new HashMap<String, SortedSet<Partition>>();
ZkUtils.makeSurePersistentPathExists(zkClient, ZkUtils.BrokerTopicsPath);
List<Stri... | [
"private",
"Map",
"<",
"String",
",",
"SortedSet",
"<",
"Partition",
">",
">",
"getZKTopicPartitionInfo",
"(",
"Map",
"<",
"Integer",
",",
"Broker",
">",
"allBrokers",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"SortedSet",
"<",
"Partition",
">",
">",
... | Generate a sequence of (brokerId, numPartitions) for all topics registered in zookeeper
@param allBrokers all register brokers
@return a mapping from topic to sequence of (brokerId, numPartitions) | [
"Generate",
"a",
"sequence",
"of",
"(",
"brokerId",
"numPartitions",
")",
"for",
"all",
"topics",
"registered",
"in",
"zookeeper"
] | train | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/producer/ZKBrokerPartitionInfo.java#L133-L163 |
jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JScreen.java | JScreen.getGBConstraints | public GridBagConstraints getGBConstraints() {
"""
Get the GridBagConstraints.
@return The gridbag constraints object.
"""
if (m_gbconstraints == null)
{
m_gbconstraints = new GridBagConstraints();
m_gbconstraints.insets = new Insets(2, 2, 2, 2);
m_gbconstra... | java | public GridBagConstraints getGBConstraints()
{
if (m_gbconstraints == null)
{
m_gbconstraints = new GridBagConstraints();
m_gbconstraints.insets = new Insets(2, 2, 2, 2);
m_gbconstraints.ipadx = 2;
m_gbconstraints.ipady = 2;
}
return m_... | [
"public",
"GridBagConstraints",
"getGBConstraints",
"(",
")",
"{",
"if",
"(",
"m_gbconstraints",
"==",
"null",
")",
"{",
"m_gbconstraints",
"=",
"new",
"GridBagConstraints",
"(",
")",
";",
"m_gbconstraints",
".",
"insets",
"=",
"new",
"Insets",
"(",
"2",
",",
... | Get the GridBagConstraints.
@return The gridbag constraints object. | [
"Get",
"the",
"GridBagConstraints",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JScreen.java#L182-L192 |
lucasr/probe | library/src/main/java/org/lucasr/probe/Interceptor.java | Interceptor.invokeDraw | protected final void invokeDraw(View view, Canvas canvas) {
"""
Performs a {@link View#draw(Canvas)} call on the given {@link View}.
"""
final ViewProxy proxy = (ViewProxy) view;
proxy.invokeDraw(canvas);
} | java | protected final void invokeDraw(View view, Canvas canvas) {
final ViewProxy proxy = (ViewProxy) view;
proxy.invokeDraw(canvas);
} | [
"protected",
"final",
"void",
"invokeDraw",
"(",
"View",
"view",
",",
"Canvas",
"canvas",
")",
"{",
"final",
"ViewProxy",
"proxy",
"=",
"(",
"ViewProxy",
")",
"view",
";",
"proxy",
".",
"invokeDraw",
"(",
"canvas",
")",
";",
"}"
] | Performs a {@link View#draw(Canvas)} call on the given {@link View}. | [
"Performs",
"a",
"{"
] | train | https://github.com/lucasr/probe/blob/cd15cc04383a1bf85de2f4c345d2018415b9ddc9/library/src/main/java/org/lucasr/probe/Interceptor.java#L91-L94 |
apache/groovy | src/main/groovy/groovy/transform/stc/ClosureSignatureHint.java | ClosureSignatureHint.pickGenericType | public static ClassNode pickGenericType(MethodNode node, int parameterIndex, int gtIndex) {
"""
A helper method which will extract the n-th generic type from the n-th parameter of a method node.
@param node the method node from which the generic type should be picked
@param parameterIndex the index of the parame... | java | public static ClassNode pickGenericType(MethodNode node, int parameterIndex, int gtIndex) {
final Parameter[] parameters = node.getParameters();
final ClassNode type = parameters[parameterIndex].getOriginType();
return pickGenericType(type, gtIndex);
} | [
"public",
"static",
"ClassNode",
"pickGenericType",
"(",
"MethodNode",
"node",
",",
"int",
"parameterIndex",
",",
"int",
"gtIndex",
")",
"{",
"final",
"Parameter",
"[",
"]",
"parameters",
"=",
"node",
".",
"getParameters",
"(",
")",
";",
"final",
"ClassNode",
... | A helper method which will extract the n-th generic type from the n-th parameter of a method node.
@param node the method node from which the generic type should be picked
@param parameterIndex the index of the parameter in the method parameter list
@param gtIndex the index of the generic type to extract
@return the ge... | [
"A",
"helper",
"method",
"which",
"will",
"extract",
"the",
"n",
"-",
"th",
"generic",
"type",
"from",
"the",
"n",
"-",
"th",
"parameter",
"of",
"a",
"method",
"node",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/transform/stc/ClosureSignatureHint.java#L76-L80 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/graphics/BitmapUtils.java | BitmapUtils.storeOnCacheDir | public static File storeOnCacheDir(Context context, Bitmap bitmap, String path, String filename, Bitmap.CompressFormat format, int quality) {
"""
Store the bitmap on the cache directory path.
@param context the context.
@param bitmap to store.
@param path file path.
@param filename file name.
@param format bi... | java | public static File storeOnCacheDir(Context context, Bitmap bitmap, String path, String filename, Bitmap.CompressFormat format, int quality) {
File dir = new File(context.getCacheDir(), path);
FileUtils.makeDirsIfNeeded(dir);
File file = new File(dir, filename);
if (!storeAsFile(bitmap, f... | [
"public",
"static",
"File",
"storeOnCacheDir",
"(",
"Context",
"context",
",",
"Bitmap",
"bitmap",
",",
"String",
"path",
",",
"String",
"filename",
",",
"Bitmap",
".",
"CompressFormat",
"format",
",",
"int",
"quality",
")",
"{",
"File",
"dir",
"=",
"new",
... | Store the bitmap on the cache directory path.
@param context the context.
@param bitmap to store.
@param path file path.
@param filename file name.
@param format bitmap format.
@param quality the quality of the compressed bitmap.
@return the compressed bitmap file. | [
"Store",
"the",
"bitmap",
"on",
"the",
"cache",
"directory",
"path",
"."
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/graphics/BitmapUtils.java#L250-L258 |
cloudant/java-cloudant | cloudant-client/src/main/java/com/cloudant/client/org/lightcouch/CouchDbClient.java | CouchDbClient.executeToInputStream | public InputStream executeToInputStream(HttpConnection connection) throws CouchDbException {
"""
<p>Execute the HttpConnection request and return the InputStream if there were no errors.</p>
<p>The stream <b>must</b> be closed after use.</p>
@param connection the request HttpConnection
@return InputStream fro... | java | public InputStream executeToInputStream(HttpConnection connection) throws CouchDbException {
try {
return execute(connection).responseAsInputStream();
} catch (IOException ioe) {
throw new CouchDbException("Error retrieving server response", ioe);
}
} | [
"public",
"InputStream",
"executeToInputStream",
"(",
"HttpConnection",
"connection",
")",
"throws",
"CouchDbException",
"{",
"try",
"{",
"return",
"execute",
"(",
"connection",
")",
".",
"responseAsInputStream",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"i... | <p>Execute the HttpConnection request and return the InputStream if there were no errors.</p>
<p>The stream <b>must</b> be closed after use.</p>
@param connection the request HttpConnection
@return InputStream from the HttpConnection response
@throws CouchDbException for HTTP error codes or if there was an IOException | [
"<p",
">",
"Execute",
"the",
"HttpConnection",
"request",
"and",
"return",
"the",
"InputStream",
"if",
"there",
"were",
"no",
"errors",
".",
"<",
"/",
"p",
">",
"<p",
">",
"The",
"stream",
"<b",
">",
"must<",
"/",
"b",
">",
"be",
"closed",
"after",
"... | train | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/org/lightcouch/CouchDbClient.java#L644-L650 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/LatLongUtils.java | LatLongUtils.fromString | public static LatLong fromString(String latLongString) {
"""
Creates a new LatLong from a comma-separated string of coordinates in the order latitude, longitude. All
coordinate values must be in degrees.
@param latLongString the string that describes the LatLong.
@return a new LatLong with the given coordinat... | java | public static LatLong fromString(String latLongString) {
double[] coordinates = parseCoordinateString(latLongString, 2);
return new LatLong(coordinates[0], coordinates[1]);
} | [
"public",
"static",
"LatLong",
"fromString",
"(",
"String",
"latLongString",
")",
"{",
"double",
"[",
"]",
"coordinates",
"=",
"parseCoordinateString",
"(",
"latLongString",
",",
"2",
")",
";",
"return",
"new",
"LatLong",
"(",
"coordinates",
"[",
"0",
"]",
"... | Creates a new LatLong from a comma-separated string of coordinates in the order latitude, longitude. All
coordinate values must be in degrees.
@param latLongString the string that describes the LatLong.
@return a new LatLong with the given coordinates.
@throws IllegalArgumentException if the string cannot be parsed or... | [
"Creates",
"a",
"new",
"LatLong",
"from",
"a",
"comma",
"-",
"separated",
"string",
"of",
"coordinates",
"in",
"the",
"order",
"latitude",
"longitude",
".",
"All",
"coordinate",
"values",
"must",
"be",
"in",
"degrees",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/LatLongUtils.java#L180-L183 |
IBM/ibm-cos-sdk-java | ibm-cos-java-sdk-core/src/main/java/com/ibm/cloud/objectstorage/auth/SignerFactory.java | SignerFactory.lookupAndCreateSigner | private static Signer lookupAndCreateSigner(String serviceName, String regionName) {
"""
Internal implementation for looking up and creating a signer by service
name and region.
"""
String signerType = lookUpSignerTypeByServiceAndRegion(serviceName, regionName);
return createSigner(signerType,... | java | private static Signer lookupAndCreateSigner(String serviceName, String regionName) {
String signerType = lookUpSignerTypeByServiceAndRegion(serviceName, regionName);
return createSigner(signerType, serviceName);
} | [
"private",
"static",
"Signer",
"lookupAndCreateSigner",
"(",
"String",
"serviceName",
",",
"String",
"regionName",
")",
"{",
"String",
"signerType",
"=",
"lookUpSignerTypeByServiceAndRegion",
"(",
"serviceName",
",",
"regionName",
")",
";",
"return",
"createSigner",
"... | Internal implementation for looking up and creating a signer by service
name and region. | [
"Internal",
"implementation",
"for",
"looking",
"up",
"and",
"creating",
"a",
"signer",
"by",
"service",
"name",
"and",
"region",
"."
] | train | https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-core/src/main/java/com/ibm/cloud/objectstorage/auth/SignerFactory.java#L112-L115 |
mabe02/lanterna | src/main/java/com/googlecode/lanterna/graphics/SimpleTheme.java | SimpleTheme.addOverride | public synchronized Definition addOverride(Class<?> clazz, TextColor foreground, TextColor background, SGR... styles) {
"""
Adds an override for a particular class, or overwrites a previously defined override.
@param clazz Class to override the theme for
@param foreground Color to use as the foreground color for... | java | public synchronized Definition addOverride(Class<?> clazz, TextColor foreground, TextColor background, SGR... styles) {
Definition definition = new Definition(new Style(foreground, background, styles));
overrideDefinitions.put(clazz, definition);
return definition;
} | [
"public",
"synchronized",
"Definition",
"addOverride",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"TextColor",
"foreground",
",",
"TextColor",
"background",
",",
"SGR",
"...",
"styles",
")",
"{",
"Definition",
"definition",
"=",
"new",
"Definition",
"(",
"new"... | Adds an override for a particular class, or overwrites a previously defined override.
@param clazz Class to override the theme for
@param foreground Color to use as the foreground color for this override style
@param background Color to use as the background color for this override style
@param styles SGR styles to app... | [
"Adds",
"an",
"override",
"for",
"a",
"particular",
"class",
"or",
"overwrites",
"a",
"previously",
"defined",
"override",
"."
] | train | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/graphics/SimpleTheme.java#L138-L142 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.