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 |
|---|---|---|---|---|---|---|---|---|---|---|
Bernardo-MG/repository-pattern-java | src/main/java/com/wandrell/pattern/repository/jpa/JpaRepository.java | JpaRepository.getEntity | @SuppressWarnings("unchecked")
@Override
public final V getEntity(final NamedParameterQueryData query) {
"""
Queries the entities in the repository and returns a single one.
<p>
The entity is acquired by building a query from the received
{@code QueryData} and executing it.
@param query
the query us... | java | @SuppressWarnings("unchecked")
@Override
public final V getEntity(final NamedParameterQueryData query) {
final Query builtQuery; // Query created from the query data
V entity; // Entity acquired from the query
checkNotNull(query, "Received a null pointer as the query");
// Buil... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"final",
"V",
"getEntity",
"(",
"final",
"NamedParameterQueryData",
"query",
")",
"{",
"final",
"Query",
"builtQuery",
";",
"// Query created from the query data",
"V",
"entity",
";",
"//... | Queries the entities in the repository and returns a single one.
<p>
The entity is acquired by building a query from the received
{@code QueryData} and executing it.
@param query
the query user to acquire the entities
@return the queried entity | [
"Queries",
"the",
"entities",
"in",
"the",
"repository",
"and",
"returns",
"a",
"single",
"one",
".",
"<p",
">",
"The",
"entity",
"is",
"acquired",
"by",
"building",
"a",
"query",
"from",
"the",
"received",
"{",
"@code",
"QueryData",
"}",
"and",
"executing... | train | https://github.com/Bernardo-MG/repository-pattern-java/blob/e94d5bbf9aeeb45acc8485f3686a6e791b082ea8/src/main/java/com/wandrell/pattern/repository/jpa/JpaRepository.java#L248-L267 |
Netflix/zeno | src/main/java/com/netflix/zeno/genericobject/GenericObjectFrameworkSerializer.java | GenericObjectFrameworkSerializer.serializeObject | @Deprecated
@Override
@SuppressWarnings("unchecked")
public void serializeObject(GenericObject rec, String fieldName, String typeName, Object obj) {
"""
/*
@Deprecated instead use serializeObject(GenericObject rec, String fieldName, Object obj)
"""
if( obj == null ){
rec.add(fi... | java | @Deprecated
@Override
@SuppressWarnings("unchecked")
public void serializeObject(GenericObject rec, String fieldName, String typeName, Object obj) {
if( obj == null ){
rec.add(fieldName, null);
} else if (isPrimitive(obj.getClass())){
serializePrimitive(rec, fieldName... | [
"@",
"Deprecated",
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"serializeObject",
"(",
"GenericObject",
"rec",
",",
"String",
"fieldName",
",",
"String",
"typeName",
",",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
... | /*
@Deprecated instead use serializeObject(GenericObject rec, String fieldName, Object obj) | [
"/",
"*",
"@Deprecated",
"instead",
"use",
"serializeObject",
"(",
"GenericObject",
"rec",
"String",
"fieldName",
"Object",
"obj",
")"
] | train | https://github.com/Netflix/zeno/blob/e571a3f1e304942724d454408fe6417fe18c20fd/src/main/java/com/netflix/zeno/genericobject/GenericObjectFrameworkSerializer.java#L80-L94 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/ObjectOutputStream.java | ObjectOutputStream.removeUnsharedReference | private void removeUnsharedReference(Object obj, int previousHandle) {
"""
Remove the unshared object from the table, and restore any previous
handle.
@param obj
Non-null object being dumped.
@param previousHandle
The handle of the previous identical object dumped
"""
if (previousHandle != -1) {... | java | private void removeUnsharedReference(Object obj, int previousHandle) {
if (previousHandle != -1) {
objectsWritten.put(obj, previousHandle);
} else {
objectsWritten.remove(obj);
}
} | [
"private",
"void",
"removeUnsharedReference",
"(",
"Object",
"obj",
",",
"int",
"previousHandle",
")",
"{",
"if",
"(",
"previousHandle",
"!=",
"-",
"1",
")",
"{",
"objectsWritten",
".",
"put",
"(",
"obj",
",",
"previousHandle",
")",
";",
"}",
"else",
"{",
... | Remove the unshared object from the table, and restore any previous
handle.
@param obj
Non-null object being dumped.
@param previousHandle
The handle of the previous identical object dumped | [
"Remove",
"the",
"unshared",
"object",
"from",
"the",
"table",
"and",
"restore",
"any",
"previous",
"handle",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/ObjectOutputStream.java#L506-L512 |
UrielCh/ovh-java-sdk | ovh-java-sdk-vps/src/main/java/net/minidev/ovh/api/ApiOvhVps.java | ApiOvhVps.serviceName_distribution_software_GET | public ArrayList<Long> serviceName_distribution_software_GET(String serviceName) throws IOException {
"""
List available softwares for this template Id
REST: GET /vps/{serviceName}/distribution/software
@param serviceName [required] The internal name of your VPS offer
"""
String qPath = "/vps/{serviceNam... | java | public ArrayList<Long> serviceName_distribution_software_GET(String serviceName) throws IOException {
String qPath = "/vps/{serviceName}/distribution/software";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t4);
} | [
"public",
"ArrayList",
"<",
"Long",
">",
"serviceName_distribution_software_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/vps/{serviceName}/distribution/software\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPat... | List available softwares for this template Id
REST: GET /vps/{serviceName}/distribution/software
@param serviceName [required] The internal name of your VPS offer | [
"List",
"available",
"softwares",
"for",
"this",
"template",
"Id"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-vps/src/main/java/net/minidev/ovh/api/ApiOvhVps.java#L445-L450 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_abbreviatedNumber_abbreviatedNumber_PUT | public void billingAccount_abbreviatedNumber_abbreviatedNumber_PUT(String billingAccount, Long abbreviatedNumber, OvhAbbreviatedNumberGroup body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/{billingAccount}/abbreviatedNumber/{abbreviatedNumber}
@param body [required] New object p... | java | public void billingAccount_abbreviatedNumber_abbreviatedNumber_PUT(String billingAccount, Long abbreviatedNumber, OvhAbbreviatedNumberGroup body) throws IOException {
String qPath = "/telephony/{billingAccount}/abbreviatedNumber/{abbreviatedNumber}";
StringBuilder sb = path(qPath, billingAccount, abbreviatedNumber)... | [
"public",
"void",
"billingAccount_abbreviatedNumber_abbreviatedNumber_PUT",
"(",
"String",
"billingAccount",
",",
"Long",
"abbreviatedNumber",
",",
"OvhAbbreviatedNumberGroup",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/abb... | Alter this object properties
REST: PUT /telephony/{billingAccount}/abbreviatedNumber/{abbreviatedNumber}
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param abbreviatedNumber [required] The abbreviated number which must start with "7" and must have a len... | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L4560-L4564 |
derari/cthul | strings/src/main/java/org/cthul/strings/format/pattern/PatternAlignmentBase.java | PatternAlignmentBase.toRegex | protected int toRegex(PatternAPI regex, Locale locale, String flags, char padding, int width, int precision, String formatString, int position) {
"""
Appends a pattern to {@code pattern} that will be parsed into a value.
If {@code with} is non-negative, it specifies the exact number of
characters the pattern sho... | java | protected int toRegex(PatternAPI regex, Locale locale, String flags, char padding, int width, int precision, String formatString, int position) {
throw new UnsupportedOperationException("Explicit width matching not supported.");
} | [
"protected",
"int",
"toRegex",
"(",
"PatternAPI",
"regex",
",",
"Locale",
"locale",
",",
"String",
"flags",
",",
"char",
"padding",
",",
"int",
"width",
",",
"int",
"precision",
",",
"String",
"formatString",
",",
"int",
"position",
")",
"{",
"throw",
"new... | Appends a pattern to {@code pattern} that will be parsed into a value.
If {@code with} is non-negative, it specifies the exact number of
characters the pattern should consume.
@param regex
@param locale
@param flags
@param padding
@param width
@param precision
@param formatString
@param position
@return | [
"Appends",
"a",
"pattern",
"to",
"{"
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/strings/src/main/java/org/cthul/strings/format/pattern/PatternAlignmentBase.java#L140-L142 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java | IOUtil.setChannelOptions | public static void setChannelOptions(Channel channel, EndpointConfig config) {
"""
Sets configured channel options on given {@link Channel}.
@param channel the {@link Channel} on which options will be set
@param config the endpoint configuration
"""
ChannelOptions options = channel.options();
... | java | public static void setChannelOptions(Channel channel, EndpointConfig config) {
ChannelOptions options = channel.options();
options.setOption(DIRECT_BUF, config.isSocketBufferDirect())
.setOption(TCP_NODELAY, config.isSocketTcpNoDelay())
.setOption(SO_KEEPALIVE, config.isSoc... | [
"public",
"static",
"void",
"setChannelOptions",
"(",
"Channel",
"channel",
",",
"EndpointConfig",
"config",
")",
"{",
"ChannelOptions",
"options",
"=",
"channel",
".",
"options",
"(",
")",
";",
"options",
".",
"setOption",
"(",
"DIRECT_BUF",
",",
"config",
".... | Sets configured channel options on given {@link Channel}.
@param channel the {@link Channel} on which options will be set
@param config the endpoint configuration | [
"Sets",
"configured",
"channel",
"options",
"on",
"given",
"{"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/nio/IOUtil.java#L671-L679 |
westnordost/osmapi | src/main/java/de/westnordost/osmapi/changesets/QueryChangesetsFilters.java | QueryChangesetsFilters.byOpenSomeTimeBetween | public QueryChangesetsFilters byOpenSomeTimeBetween(Date createdBefore, Date closedAfter) {
"""
Filter by changesets that have at one time been open during the given time range
@param closedAfter limit search to changesets that have been closed after this date
@param createdBefore limit search to changesets th... | java | public QueryChangesetsFilters byOpenSomeTimeBetween(Date createdBefore, Date closedAfter)
{
params.put("time", dateFormat.format(closedAfter) + "," + dateFormat.format(createdBefore));
return this;
} | [
"public",
"QueryChangesetsFilters",
"byOpenSomeTimeBetween",
"(",
"Date",
"createdBefore",
",",
"Date",
"closedAfter",
")",
"{",
"params",
".",
"put",
"(",
"\"time\"",
",",
"dateFormat",
".",
"format",
"(",
"closedAfter",
")",
"+",
"\",\"",
"+",
"dateFormat",
".... | Filter by changesets that have at one time been open during the given time range
@param closedAfter limit search to changesets that have been closed after this date
@param createdBefore limit search to changesets that have been created before this date | [
"Filter",
"by",
"changesets",
"that",
"have",
"at",
"one",
"time",
"been",
"open",
"during",
"the",
"given",
"time",
"range"
] | train | https://github.com/westnordost/osmapi/blob/dda6978fd12e117d0cf17812bc22037f61e22c4b/src/main/java/de/westnordost/osmapi/changesets/QueryChangesetsFilters.java#L125-L129 |
aws/aws-sdk-java | aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/UpdateAuthorizerRequest.java | UpdateAuthorizerRequest.withTokenSigningPublicKeys | public UpdateAuthorizerRequest withTokenSigningPublicKeys(java.util.Map<String, String> tokenSigningPublicKeys) {
"""
<p>
The public keys used to verify the token signature.
</p>
@param tokenSigningPublicKeys
The public keys used to verify the token signature.
@return Returns a reference to this object so t... | java | public UpdateAuthorizerRequest withTokenSigningPublicKeys(java.util.Map<String, String> tokenSigningPublicKeys) {
setTokenSigningPublicKeys(tokenSigningPublicKeys);
return this;
} | [
"public",
"UpdateAuthorizerRequest",
"withTokenSigningPublicKeys",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tokenSigningPublicKeys",
")",
"{",
"setTokenSigningPublicKeys",
"(",
"tokenSigningPublicKeys",
")",
";",
"return",
"this",
";",... | <p>
The public keys used to verify the token signature.
</p>
@param tokenSigningPublicKeys
The public keys used to verify the token signature.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"public",
"keys",
"used",
"to",
"verify",
"the",
"token",
"signature",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/UpdateAuthorizerRequest.java#L209-L212 |
js-lib-com/commons | src/main/java/js/util/Classes.java | Classes.getMethod | public static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) {
"""
Get class method with runtime exception. JRE throws checked {@link NoSuchMethodException} if method is missing,
behavior that is not desirable for this library. This method uses runtime, unchecked {@link NoSuchBein... | java | public static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes)
{
try {
Method method = clazz.getDeclaredMethod(methodName, parameterTypes);
method.setAccessible(true);
return method;
}
catch(NoSuchMethodException e) {
throw new NoSuchBeingExce... | [
"public",
"static",
"Method",
"getMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"...",
"parameterTypes",
")",
"{",
"try",
"{",
"Method",
"method",
"=",
"clazz",
".",
"getDeclaredMethod",
"(",
"me... | Get class method with runtime exception. JRE throws checked {@link NoSuchMethodException} if method is missing,
behavior that is not desirable for this library. This method uses runtime, unchecked {@link NoSuchBeingException}
instead. Returned method has accessibility set to true.
@param clazz Java class to return met... | [
"Get",
"class",
"method",
"with",
"runtime",
"exception",
".",
"JRE",
"throws",
"checked",
"{",
"@link",
"NoSuchMethodException",
"}",
"if",
"method",
"is",
"missing",
"behavior",
"that",
"is",
"not",
"desirable",
"for",
"this",
"library",
".",
"This",
"method... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Classes.java#L535-L548 |
google/closure-compiler | src/com/google/javascript/jscomp/Es6ConvertSuperConstructorCalls.java | Es6ConvertSuperConstructorCalls.isDefinedInSources | private boolean isDefinedInSources(NodeTraversal t, String varName) {
"""
Is a variable with the given name defined in the source code being compiled?
<p>Please note that the call to {@code t.getScope()} is expensive, so we should avoid
calling this method when possible.
@param t
@param varName
"""
V... | java | private boolean isDefinedInSources(NodeTraversal t, String varName) {
Var objectVar = t.getScope().getVar(varName);
return objectVar != null && !objectVar.isExtern();
} | [
"private",
"boolean",
"isDefinedInSources",
"(",
"NodeTraversal",
"t",
",",
"String",
"varName",
")",
"{",
"Var",
"objectVar",
"=",
"t",
".",
"getScope",
"(",
")",
".",
"getVar",
"(",
"varName",
")",
";",
"return",
"objectVar",
"!=",
"null",
"&&",
"!",
"... | Is a variable with the given name defined in the source code being compiled?
<p>Please note that the call to {@code t.getScope()} is expensive, so we should avoid
calling this method when possible.
@param t
@param varName | [
"Is",
"a",
"variable",
"with",
"the",
"given",
"name",
"defined",
"in",
"the",
"source",
"code",
"being",
"compiled?"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Es6ConvertSuperConstructorCalls.java#L484-L487 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_phonebook_bookKey_PUT | public void billingAccount_phonebook_bookKey_PUT(String billingAccount, String bookKey, OvhPhonebookMaster body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/{billingAccount}/phonebook/{bookKey}
@param body [required] New object properties
@param billingAccount [required] The nam... | java | public void billingAccount_phonebook_bookKey_PUT(String billingAccount, String bookKey, OvhPhonebookMaster body) throws IOException {
String qPath = "/telephony/{billingAccount}/phonebook/{bookKey}";
StringBuilder sb = path(qPath, billingAccount, bookKey);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"billingAccount_phonebook_bookKey_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"bookKey",
",",
"OvhPhonebookMaster",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/phonebook/{bookKey}\"",
";",
"St... | Alter this object properties
REST: PUT /telephony/{billingAccount}/phonebook/{bookKey}
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param bookKey [required] Identifier of the phonebook | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L5583-L5587 |
jetty-project/jetty-npn | npn-boot/src/main/java/sun/security/ssl/Handshaker.java | Handshaker.calculateKeys | void calculateKeys(SecretKey preMasterSecret, ProtocolVersion version) {
"""
/*
Single access point to key calculation logic. Given the
pre-master secret and the nonces from client and server,
produce all the keying material to be used.
"""
SecretKey master = calculateMasterSecret(preMasterSecret, ... | java | void calculateKeys(SecretKey preMasterSecret, ProtocolVersion version) {
SecretKey master = calculateMasterSecret(preMasterSecret, version);
session.setMasterSecret(master);
calculateConnectionKeys(master);
} | [
"void",
"calculateKeys",
"(",
"SecretKey",
"preMasterSecret",
",",
"ProtocolVersion",
"version",
")",
"{",
"SecretKey",
"master",
"=",
"calculateMasterSecret",
"(",
"preMasterSecret",
",",
"version",
")",
";",
"session",
".",
"setMasterSecret",
"(",
"master",
")",
... | /*
Single access point to key calculation logic. Given the
pre-master secret and the nonces from client and server,
produce all the keying material to be used. | [
"/",
"*",
"Single",
"access",
"point",
"to",
"key",
"calculation",
"logic",
".",
"Given",
"the",
"pre",
"-",
"master",
"secret",
"and",
"the",
"nonces",
"from",
"client",
"and",
"server",
"produce",
"all",
"the",
"keying",
"material",
"to",
"be",
"used",
... | train | https://github.com/jetty-project/jetty-npn/blob/a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d/npn-boot/src/main/java/sun/security/ssl/Handshaker.java#L1055-L1059 |
pravega/pravega | shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java | StreamSegmentNameUtils.computeSegmentId | public static long computeSegmentId(int segmentNumber, int epoch) {
"""
Method to compute 64 bit segment id which takes segment number and epoch and composes it as
`msb = epoch` `lsb = segmentNumber`.
Primary id identifies the segment container mapping and primary + secondary uniquely identifies a segment
withi... | java | public static long computeSegmentId(int segmentNumber, int epoch) {
Preconditions.checkArgument(segmentNumber >= 0);
Preconditions.checkArgument(epoch >= 0);
return (long) epoch << 32 | (segmentNumber & 0xFFFFFFFFL);
} | [
"public",
"static",
"long",
"computeSegmentId",
"(",
"int",
"segmentNumber",
",",
"int",
"epoch",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"segmentNumber",
">=",
"0",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"epoch",
">=",
"0",
")",
... | Method to compute 64 bit segment id which takes segment number and epoch and composes it as
`msb = epoch` `lsb = segmentNumber`.
Primary id identifies the segment container mapping and primary + secondary uniquely identifies a segment
within a stream.
@param segmentNumber segment number.
@param epoch epoch in which se... | [
"Method",
"to",
"compute",
"64",
"bit",
"segment",
"id",
"which",
"takes",
"segment",
"number",
"and",
"epoch",
"and",
"composes",
"it",
"as",
"msb",
"=",
"epoch",
"lsb",
"=",
"segmentNumber",
".",
"Primary",
"id",
"identifies",
"the",
"segment",
"container"... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/shared/protocol/src/main/java/io/pravega/shared/segment/StreamSegmentNameUtils.java#L212-L216 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.getAt | @SuppressWarnings("unchecked")
public static List<Boolean> getAt(boolean[] array, Range range) {
"""
Support the subscript operator with a range for a boolean array
@param array a boolean array
@param range a range indicating the indices for the items to retrieve
@return list of the retrieved booleans
@s... | java | @SuppressWarnings("unchecked")
public static List<Boolean> getAt(boolean[] array, Range range) {
return primitiveArrayGet(array, range);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"List",
"<",
"Boolean",
">",
"getAt",
"(",
"boolean",
"[",
"]",
"array",
",",
"Range",
"range",
")",
"{",
"return",
"primitiveArrayGet",
"(",
"array",
",",
"range",
")",
";",
"}"
] | Support the subscript operator with a range for a boolean array
@param array a boolean array
@param range a range indicating the indices for the items to retrieve
@return list of the retrieved booleans
@since 1.0 | [
"Support",
"the",
"subscript",
"operator",
"with",
"a",
"range",
"for",
"a",
"boolean",
"array"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L13701-L13704 |
buschmais/extended-objects | impl/src/main/java/com/buschmais/xo/impl/AbstractInstanceManager.java | AbstractInstanceManager.readInstance | @Override
public <T> T readInstance(DatastoreType datastoreType) {
"""
Return the proxy instance which corresponds to the given datastore type for
reading.
@param datastoreType
The datastore type.
@param <T>
The instance type.
@return The instance.
"""
return getInstance(datastoreType, Tran... | java | @Override
public <T> T readInstance(DatastoreType datastoreType) {
return getInstance(datastoreType, TransactionalCache.Mode.READ);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"readInstance",
"(",
"DatastoreType",
"datastoreType",
")",
"{",
"return",
"getInstance",
"(",
"datastoreType",
",",
"TransactionalCache",
".",
"Mode",
".",
"READ",
")",
";",
"}"
] | Return the proxy instance which corresponds to the given datastore type for
reading.
@param datastoreType
The datastore type.
@param <T>
The instance type.
@return The instance. | [
"Return",
"the",
"proxy",
"instance",
"which",
"corresponds",
"to",
"the",
"given",
"datastore",
"type",
"for",
"reading",
"."
] | train | https://github.com/buschmais/extended-objects/blob/186431e81f3d8d26c511cfe1143dee59b03c2e7a/impl/src/main/java/com/buschmais/xo/impl/AbstractInstanceManager.java#L54-L57 |
soi-toolkit/soi-toolkit-mule | tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/util/FileUtil.java | FileUtil.getRelativePath | public static String getRelativePath(File file, File srcDir) {
"""
Returns the relative path.
@param file
@param srcDir
@return the relative path
"""
String base = srcDir.getPath();
String filePath = file.getPath();
String relativePath = new File(base).toURI()
.relativize(new File(filePath).to... | java | public static String getRelativePath(File file, File srcDir) {
String base = srcDir.getPath();
String filePath = file.getPath();
String relativePath = new File(base).toURI()
.relativize(new File(filePath).toURI()).getPath();
return relativePath;
} | [
"public",
"static",
"String",
"getRelativePath",
"(",
"File",
"file",
",",
"File",
"srcDir",
")",
"{",
"String",
"base",
"=",
"srcDir",
".",
"getPath",
"(",
")",
";",
"String",
"filePath",
"=",
"file",
".",
"getPath",
"(",
")",
";",
"String",
"relativePa... | Returns the relative path.
@param file
@param srcDir
@return the relative path | [
"Returns",
"the",
"relative",
"path",
"."
] | train | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/util/FileUtil.java#L63-L71 |
VoltDB/voltdb | src/frontend/org/voltdb/iv2/SysProcDuplicateCounter.java | SysProcDuplicateCounter.offer | @Override
int offer(FragmentResponseMessage message) {
"""
It is possible that duplicate counter will get mixed dummy responses and
real responses from replicas, think elastic join and rejoin. The
requirement here is that the duplicate counter should never mix these two
types of responses together in the li... | java | @Override
int offer(FragmentResponseMessage message)
{
long hash = 0;
for (int i = 0; i < message.getTableCount(); i++) {
int depId = message.getTableDependencyIdAtIndex(i);
VoltTable dep = message.getTableAtIndex(i);
List<VoltTable> tables = m_alldeps.get(dep... | [
"@",
"Override",
"int",
"offer",
"(",
"FragmentResponseMessage",
"message",
")",
"{",
"long",
"hash",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"message",
".",
"getTableCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"int",
"depId... | It is possible that duplicate counter will get mixed dummy responses and
real responses from replicas, think elastic join and rejoin. The
requirement here is that the duplicate counter should never mix these two
types of responses together in the list of tables for a given
dependency. Mixing them will cause problems fo... | [
"It",
"is",
"possible",
"that",
"duplicate",
"counter",
"will",
"get",
"mixed",
"dummy",
"responses",
"and",
"real",
"responses",
"from",
"replicas",
"think",
"elastic",
"join",
"and",
"rejoin",
".",
"The",
"requirement",
"here",
"is",
"that",
"the",
"duplicat... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/SysProcDuplicateCounter.java#L63-L108 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.validateHex | public static <T extends CharSequence> T validateHex(T value, String errorMsg) throws ValidateException {
"""
验证是否为Hex(16进制)字符串
@param <T> 字符串类型
@param value 值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常
@since 4.3.3
"""
if (false == isHex(value)) {
throw new ValidateExc... | java | public static <T extends CharSequence> T validateHex(T value, String errorMsg) throws ValidateException {
if (false == isHex(value)) {
throw new ValidateException(errorMsg);
}
return value;
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"validateHex",
"(",
"T",
"value",
",",
"String",
"errorMsg",
")",
"throws",
"ValidateException",
"{",
"if",
"(",
"false",
"==",
"isHex",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"Vali... | 验证是否为Hex(16进制)字符串
@param <T> 字符串类型
@param value 值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常
@since 4.3.3 | [
"验证是否为Hex(16进制)字符串"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L1030-L1035 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/EmailUtils.java | EmailUtils.sendEmail | public static void sendEmail(State state, String subject, String message) throws EmailException {
"""
A general method for sending emails.
@param state a {@link State} object containing configuration properties
@param subject email subject
@param message email message
@throws EmailException if there is anyth... | java | public static void sendEmail(State state, String subject, String message) throws EmailException {
Email email = new SimpleEmail();
email.setHostName(state.getProp(ConfigurationKeys.EMAIL_HOST_KEY, ConfigurationKeys.DEFAULT_EMAIL_HOST));
if (state.contains(ConfigurationKeys.EMAIL_SMTP_PORT_KEY)) {
emai... | [
"public",
"static",
"void",
"sendEmail",
"(",
"State",
"state",
",",
"String",
"subject",
",",
"String",
"message",
")",
"throws",
"EmailException",
"{",
"Email",
"email",
"=",
"new",
"SimpleEmail",
"(",
")",
";",
"email",
".",
"setHostName",
"(",
"state",
... | A general method for sending emails.
@param state a {@link State} object containing configuration properties
@param subject email subject
@param message email message
@throws EmailException if there is anything wrong sending the email | [
"A",
"general",
"method",
"for",
"sending",
"emails",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/EmailUtils.java#L53-L82 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java | TypeUtils.typesSatisfyVariables | public static boolean typesSatisfyVariables(final Map<TypeVariable<?>, Type> typeVarAssigns) {
"""
<p>Determines whether or not specified types satisfy the bounds of their
mapped type variables. When a type parameter extends another (such as
{@code <T, S extends T>}), uses another as a type parameter (such as
{... | java | public static boolean typesSatisfyVariables(final Map<TypeVariable<?>, Type> typeVarAssigns) {
Validate.notNull(typeVarAssigns, "typeVarAssigns is null");
// all types must be assignable to all the bounds of the their mapped
// type variable.
for (final Map.Entry<TypeVariable<?>, Type> e... | [
"public",
"static",
"boolean",
"typesSatisfyVariables",
"(",
"final",
"Map",
"<",
"TypeVariable",
"<",
"?",
">",
",",
"Type",
">",
"typeVarAssigns",
")",
"{",
"Validate",
".",
"notNull",
"(",
"typeVarAssigns",
",",
"\"typeVarAssigns is null\"",
")",
";",
"// all... | <p>Determines whether or not specified types satisfy the bounds of their
mapped type variables. When a type parameter extends another (such as
{@code <T, S extends T>}), uses another as a type parameter (such as
{@code <T, S extends Comparable>>}), or otherwise depends on
another type variable to be specified, the depe... | [
"<p",
">",
"Determines",
"whether",
"or",
"not",
"specified",
"types",
"satisfy",
"the",
"bounds",
"of",
"their",
"mapped",
"type",
"variables",
".",
"When",
"a",
"type",
"parameter",
"extends",
"another",
"(",
"such",
"as",
"{",
"@code",
"<T",
"S",
"exten... | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java#L1220-L1236 |
Azure/azure-sdk-for-java | redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java | RedisInner.exportDataAsync | public Observable<Void> exportDataAsync(String resourceGroupName, String name, ExportRDBParameters parameters) {
"""
Export data from the redis cache to blobs in a container.
@param resourceGroupName The name of the resource group.
@param name The name of the Redis cache.
@param parameters Parameters for Redi... | java | public Observable<Void> exportDataAsync(String resourceGroupName, String name, ExportRDBParameters parameters) {
return exportDataWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> ... | [
"public",
"Observable",
"<",
"Void",
">",
"exportDataAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"ExportRDBParameters",
"parameters",
")",
"{",
"return",
"exportDataWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
",",
"par... | Export data from the redis cache to blobs in a container.
@param resourceGroupName The name of the resource group.
@param name The name of the Redis cache.
@param parameters Parameters for Redis export operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the r... | [
"Export",
"data",
"from",
"the",
"redis",
"cache",
"to",
"blobs",
"in",
"a",
"container",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/redis/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/redis/v2017_10_01/implementation/RedisInner.java#L1535-L1542 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java | Gen.checkStringConstant | private void checkStringConstant(DiagnosticPosition pos, Object constValue) {
"""
Check a constant value and report if it is a string that is
too large.
"""
if (nerrs != 0 || // only complain about a long string once
constValue == null ||
!(constValue instanceof String) ||
... | java | private void checkStringConstant(DiagnosticPosition pos, Object constValue) {
if (nerrs != 0 || // only complain about a long string once
constValue == null ||
!(constValue instanceof String) ||
((String)constValue).length() < Pool.MAX_STRING_LENGTH)
return;
... | [
"private",
"void",
"checkStringConstant",
"(",
"DiagnosticPosition",
"pos",
",",
"Object",
"constValue",
")",
"{",
"if",
"(",
"nerrs",
"!=",
"0",
"||",
"// only complain about a long string once",
"constValue",
"==",
"null",
"||",
"!",
"(",
"constValue",
"instanceof... | Check a constant value and report if it is a string that is
too large. | [
"Check",
"a",
"constant",
"value",
"and",
"report",
"if",
"it",
"is",
"a",
"string",
"that",
"is",
"too",
"large",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java#L513-L521 |
ical4j/ical4j | src/main/java/net/fortuna/ical4j/model/component/VEvent.java | VEvent.getEndDate | public final DtEnd getEndDate(final boolean deriveFromDuration) {
"""
Convenience method to pull the DTEND out of the property list. If DTEND was not specified, use the DTSTART +
DURATION to calculate it.
@param deriveFromDuration specifies whether to derive an end date from the event duration where an end date ... | java | public final DtEnd getEndDate(final boolean deriveFromDuration) {
DtEnd dtEnd = getProperty(Property.DTEND);
// No DTEND? No problem, we'll use the DURATION.
if (dtEnd == null && deriveFromDuration && getStartDate() != null) {
final DtStart dtStart = getStartDate();
final... | [
"public",
"final",
"DtEnd",
"getEndDate",
"(",
"final",
"boolean",
"deriveFromDuration",
")",
"{",
"DtEnd",
"dtEnd",
"=",
"getProperty",
"(",
"Property",
".",
"DTEND",
")",
";",
"// No DTEND? No problem, we'll use the DURATION.",
"if",
"(",
"dtEnd",
"==",
"null",
... | Convenience method to pull the DTEND out of the property list. If DTEND was not specified, use the DTSTART +
DURATION to calculate it.
@param deriveFromDuration specifies whether to derive an end date from the event duration where an end date is
not found
@return The end for this VEVENT. | [
"Convenience",
"method",
"to",
"pull",
"the",
"DTEND",
"out",
"of",
"the",
"property",
"list",
".",
"If",
"DTEND",
"was",
"not",
"specified",
"use",
"the",
"DTSTART",
"+",
"DURATION",
"to",
"calculate",
"it",
"."
] | train | https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/model/component/VEvent.java#L627-L652 |
airbnb/lottie-android | lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java | LottieAnimationView.addValueCallback | public <T> void addValueCallback(KeyPath keyPath, T property, LottieValueCallback<T> callback) {
"""
Add a property callback for the specified {@link KeyPath}. This {@link KeyPath} can resolve
to multiple contents. In that case, the callback's value will apply to all of them.
Internally, this will check if the... | java | public <T> void addValueCallback(KeyPath keyPath, T property, LottieValueCallback<T> callback) {
lottieDrawable.addValueCallback(keyPath, property, callback);
} | [
"public",
"<",
"T",
">",
"void",
"addValueCallback",
"(",
"KeyPath",
"keyPath",
",",
"T",
"property",
",",
"LottieValueCallback",
"<",
"T",
">",
"callback",
")",
"{",
"lottieDrawable",
".",
"addValueCallback",
"(",
"keyPath",
",",
"property",
",",
"callback",
... | Add a property callback for the specified {@link KeyPath}. This {@link KeyPath} can resolve
to multiple contents. In that case, the callback's value will apply to all of them.
Internally, this will check if the {@link KeyPath} has already been resolved with
{@link #resolveKeyPath(KeyPath)} and will resolve it if it ha... | [
"Add",
"a",
"property",
"callback",
"for",
"the",
"specified",
"{",
"@link",
"KeyPath",
"}",
".",
"This",
"{",
"@link",
"KeyPath",
"}",
"can",
"resolve",
"to",
"multiple",
"contents",
".",
"In",
"that",
"case",
"the",
"callback",
"s",
"value",
"will",
"a... | train | https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java#L714-L716 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.filemonitor/src/com/ibm/ws/kernel/filemonitor/internal/FileUpdateMonitor.java | FileUpdateMonitor.scanForUpdates | @Override
public void scanForUpdates(Collection<File> created, Collection<File> modified, Collection<File> deleted) {
"""
{@inheritDoc}
<p>
FileUpdateMonitor:
If the file being monitored is deleted, the File will be added to the
deleted list, and a {@link ResourceUpdateMonitor} will be returned.
If the ... | java | @Override
public void scanForUpdates(Collection<File> created, Collection<File> modified, Collection<File> deleted) {
if (monitoredFile.isFile()) {
if (performScan(monitoredFile)) {
if (exists) { // If file previously existed, it was modified
addToList(modifie... | [
"@",
"Override",
"public",
"void",
"scanForUpdates",
"(",
"Collection",
"<",
"File",
">",
"created",
",",
"Collection",
"<",
"File",
">",
"modified",
",",
"Collection",
"<",
"File",
">",
"deleted",
")",
"{",
"if",
"(",
"monitoredFile",
".",
"isFile",
"(",
... | {@inheritDoc}
<p>
FileUpdateMonitor:
If the file being monitored is deleted, the File will be added to the
deleted list, and a {@link ResourceUpdateMonitor} will be returned.
If the file being monitored is changed, the File will be added to the modified
list. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.filemonitor/src/com/ibm/ws/kernel/filemonitor/internal/FileUpdateMonitor.java#L61-L80 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/Replacer.java | Replacer.by | public MultiPos<String, String, String> by(final Object replacement) {
"""
Returns a MultiPos instance with all occurrences with given replacement
@param replacement
@return
"""
return new MultiPos<String, String, String>(checkNotNull(replacement).toString(), null) {
@Override protected String result... | java | public MultiPos<String, String, String> by(final Object replacement) {
return new MultiPos<String, String, String>(checkNotNull(replacement).toString(), null) {
@Override protected String result() {
return findingReplacing(left, Character.class.isInstance(replacement) ? 'C' : 'S', pos, position);
}
};
} | [
"public",
"MultiPos",
"<",
"String",
",",
"String",
",",
"String",
">",
"by",
"(",
"final",
"Object",
"replacement",
")",
"{",
"return",
"new",
"MultiPos",
"<",
"String",
",",
"String",
",",
"String",
">",
"(",
"checkNotNull",
"(",
"replacement",
")",
".... | Returns a MultiPos instance with all occurrences with given replacement
@param replacement
@return | [
"Returns",
"a",
"MultiPos",
"instance",
"with",
"all",
"occurrences",
"with",
"given",
"replacement"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/Replacer.java#L95-L102 |
tvesalainen/util | util/src/main/java/org/vesalainen/math/Polygon.java | Polygon.isRawHit | public static boolean isRawHit(DenseMatrix64F points, double testx, double testy) {
"""
Returns true if point is inside a polygon.
<p>Doesn't check the bounding rectangle!
@param testx
@param testy
@return
@see <a href="http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html">PNPOLY - Point Inc... | java | public static boolean isRawHit(DenseMatrix64F points, double testx, double testy)
{
return isRawHit(points.data, points.numRows, testx, testy);
} | [
"public",
"static",
"boolean",
"isRawHit",
"(",
"DenseMatrix64F",
"points",
",",
"double",
"testx",
",",
"double",
"testy",
")",
"{",
"return",
"isRawHit",
"(",
"points",
".",
"data",
",",
"points",
".",
"numRows",
",",
"testx",
",",
"testy",
")",
";",
"... | Returns true if point is inside a polygon.
<p>Doesn't check the bounding rectangle!
@param testx
@param testy
@return
@see <a href="http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html">PNPOLY - Point Inclusion in Polygon Test W. Randolph Franklin (WRF)</a> | [
"Returns",
"true",
"if",
"point",
"is",
"inside",
"a",
"polygon",
".",
"<p",
">",
"Doesn",
"t",
"check",
"the",
"bounding",
"rectangle!"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/Polygon.java#L88-L91 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java | Query.endAt | @Nonnull
public Query endAt(@Nonnull DocumentSnapshot snapshot) {
"""
Creates and returns a new Query that ends at the provided document (inclusive). The end
position is relative to the order of the query. The document must contain all of the fields
provided in the orderBy of this query.
@param snapshot The... | java | @Nonnull
public Query endAt(@Nonnull DocumentSnapshot snapshot) {
QueryOptions newOptions = new QueryOptions(options);
newOptions.fieldOrders = createImplicitOrderBy();
newOptions.endCursor = createCursor(newOptions.fieldOrders, snapshot, false);
return new Query(firestore, path, newOptions);
} | [
"@",
"Nonnull",
"public",
"Query",
"endAt",
"(",
"@",
"Nonnull",
"DocumentSnapshot",
"snapshot",
")",
"{",
"QueryOptions",
"newOptions",
"=",
"new",
"QueryOptions",
"(",
"options",
")",
";",
"newOptions",
".",
"fieldOrders",
"=",
"createImplicitOrderBy",
"(",
")... | Creates and returns a new Query that ends at the provided document (inclusive). The end
position is relative to the order of the query. The document must contain all of the fields
provided in the orderBy of this query.
@param snapshot The snapshot of the document to end at.
@return The created Query. | [
"Creates",
"and",
"returns",
"a",
"new",
"Query",
"that",
"ends",
"at",
"the",
"provided",
"document",
"(",
"inclusive",
")",
".",
"The",
"end",
"position",
"is",
"relative",
"to",
"the",
"order",
"of",
"the",
"query",
".",
"The",
"document",
"must",
"co... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java#L857-L863 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmInterfaces.java | XsdAsmInterfaces.allMethod | private InterfaceInfo allMethod(List<XsdElement> directElements, String className, int interfaceIndex, String apiName, String groupName) {
"""
Generates an interface based on a {@link XsdAll} element.
@param directElements The direct elements of the {@link XsdAll} element. Each one will be represented as a method... | java | private InterfaceInfo allMethod(List<XsdElement> directElements, String className, int interfaceIndex, String apiName, String groupName){
String interfaceName = groupName != null ? groupName : className;
String interfaceFullName = firstToUpper(interfaceName + ALL_SUFFIX + interfaceIndex);
if (c... | [
"private",
"InterfaceInfo",
"allMethod",
"(",
"List",
"<",
"XsdElement",
">",
"directElements",
",",
"String",
"className",
",",
"int",
"interfaceIndex",
",",
"String",
"apiName",
",",
"String",
"groupName",
")",
"{",
"String",
"interfaceName",
"=",
"groupName",
... | Generates an interface based on a {@link XsdAll} element.
@param directElements The direct elements of the {@link XsdAll} element. Each one will be represented as a method
in the all interface.
@param className The name of the class that contains the {@link XsdAll}.
@param interfaceIndex The current interface index.
@p... | [
"Generates",
"an",
"interface",
"based",
"on",
"a",
"{"
] | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmInterfaces.java#L617-L626 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_phishing_id_GET | public OvhAntiphishing ip_phishing_id_GET(String ip, Long id) throws IOException {
"""
Get this object properties
REST: GET /ip/{ip}/phishing/{id}
@param ip [required]
@param id [required] Internal ID of the phishing entry
"""
String qPath = "/ip/{ip}/phishing/{id}";
StringBuilder sb = path(qPath, ip,... | java | public OvhAntiphishing ip_phishing_id_GET(String ip, Long id) throws IOException {
String qPath = "/ip/{ip}/phishing/{id}";
StringBuilder sb = path(qPath, ip, id);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhAntiphishing.class);
} | [
"public",
"OvhAntiphishing",
"ip_phishing_id_GET",
"(",
"String",
"ip",
",",
"Long",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/phishing/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"ip",
",",
"id",
")"... | Get this object properties
REST: GET /ip/{ip}/phishing/{id}
@param ip [required]
@param id [required] Internal ID of the phishing entry | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L98-L103 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/couponsets/CouponUrl.java | CouponUrl.deleteCouponUrl | public static MozuUrl deleteCouponUrl(String couponCode, String couponSetCode) {
"""
Get Resource Url for DeleteCoupon
@param couponCode Code associated with the coupon to remove from the cart.
@param couponSetCode The unique identifier of the coupon set that the coupon belongs to.
@return String Resource Url... | java | public static MozuUrl deleteCouponUrl(String couponCode, String couponSetCode)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/couponsets/{couponSetCode}/couponcodes/{couponCode}");
formatter.formatUrl("couponCode", couponCode);
formatter.formatUrl("couponSetCode", couponSetCode);
... | [
"public",
"static",
"MozuUrl",
"deleteCouponUrl",
"(",
"String",
"couponCode",
",",
"String",
"couponSetCode",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/couponsets/{couponSetCode}/couponcodes/{couponCode}\"",
")",
"... | Get Resource Url for DeleteCoupon
@param couponCode Code associated with the coupon to remove from the cart.
@param couponSetCode The unique identifier of the coupon set that the coupon belongs to.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"DeleteCoupon"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/couponsets/CouponUrl.java#L88-L94 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/DashboardResources.java | DashboardResources.deleteDashboard | @DELETE
@Produces(MediaType.APPLICATION_JSON)
@Path("/ {
"""
Deletes the dashboard having the given ID.
@param req The HTTP request.
@param dashboardId The dashboard ID to delete.
@return An empty body if the delete was successful.
@throws WebApplicationException If an error occurs.
... | java | @DELETE
@Produces(MediaType.APPLICATION_JSON)
@Path("/{dashboardId}")
@Description("Deletes the dashboard having the given ID.")
public Response deleteDashboard(@Context HttpServletRequest req,
@PathParam("dashboardId") BigInteger dashboardId) {
if (dashboardId == null || dashboardId.compareTo(BigInteger.ZERO)... | [
"@",
"DELETE",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"@",
"Path",
"(",
"\"/{dashboardId}\"",
")",
"@",
"Description",
"(",
"\"Deletes the dashboard having the given ID.\"",
")",
"public",
"Response",
"deleteDashboard",
"(",
"@",
"Context",
... | Deletes the dashboard having the given ID.
@param req The HTTP request.
@param dashboardId The dashboard ID to delete.
@return An empty body if the delete was successful.
@throws WebApplicationException If an error occurs. | [
"Deletes",
"the",
"dashboard",
"having",
"the",
"given",
"ID",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/DashboardResources.java#L348-L370 |
Netflix/ribbon | ribbon-core/src/main/java/com/netflix/client/ssl/AbstractSslContextFactory.java | AbstractSslContextFactory.createTrustManagers | private TrustManager[] createTrustManagers() throws ClientSslSocketFactoryException {
"""
Creates the trust managers to be used by the factory from the specified trust store file and
password.
@return the newly created array of trust managers
@throws ClientSslSocketFactoryException if an error is detected in ... | java | private TrustManager[] createTrustManagers() throws ClientSslSocketFactoryException {
final TrustManagerFactory factory;
try {
factory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
factory.init(this.trustStore);
} catch (NoSuchAlgorithmException e) {
th... | [
"private",
"TrustManager",
"[",
"]",
"createTrustManagers",
"(",
")",
"throws",
"ClientSslSocketFactoryException",
"{",
"final",
"TrustManagerFactory",
"factory",
";",
"try",
"{",
"factory",
"=",
"TrustManagerFactory",
".",
"getInstance",
"(",
"TrustManagerFactory",
"."... | Creates the trust managers to be used by the factory from the specified trust store file and
password.
@return the newly created array of trust managers
@throws ClientSslSocketFactoryException if an error is detected in loading the trust store | [
"Creates",
"the",
"trust",
"managers",
"to",
"be",
"used",
"by",
"the",
"factory",
"from",
"the",
"specified",
"trust",
"store",
"file",
"and",
"password",
"."
] | train | https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon-core/src/main/java/com/netflix/client/ssl/AbstractSslContextFactory.java#L155-L175 |
trellis-ldp/trellis | core/http/src/main/java/org/trellisldp/http/impl/PatchHandler.java | PatchHandler.updateResource | public CompletionStage<ResponseBuilder> updateResource(final ResponseBuilder builder) {
"""
Update the resource in the persistence layer.
@param builder the Trellis response builder
@return a response builder promise
"""
LOGGER.debug("Updating {} via PATCH", getIdentifier());
// Add the LD... | java | public CompletionStage<ResponseBuilder> updateResource(final ResponseBuilder builder) {
LOGGER.debug("Updating {} via PATCH", getIdentifier());
// Add the LDP link types
if (ACL.equals(getRequest().getExt())) {
getLinkTypes(LDP.RDFSource).forEach(type -> builder.link(type, "type"));... | [
"public",
"CompletionStage",
"<",
"ResponseBuilder",
">",
"updateResource",
"(",
"final",
"ResponseBuilder",
"builder",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Updating {} via PATCH\"",
",",
"getIdentifier",
"(",
")",
")",
";",
"// Add the LDP link types",
"if",
"... | Update the resource in the persistence layer.
@param builder the Trellis response builder
@return a response builder promise | [
"Update",
"the",
"resource",
"in",
"the",
"persistence",
"layer",
"."
] | train | https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/core/http/src/main/java/org/trellisldp/http/impl/PatchHandler.java#L154-L170 |
demidenko05/beigesoft-bcommon | src/main/java/org/beigesoft/service/SrvI18n.java | SrvI18n.getMsg | @Override
public final String getMsg(final String pKey, final String pLang) {
"""
<p>Evaluate message by given key for given language.</p>
@param pKey key of message
@param pLang e.g. "en", "ru", etc.
"""
try {
ResourceBundle mb = messagesMap.get(pLang);
if (mb != null) {
return mb.... | java | @Override
public final String getMsg(final String pKey, final String pLang) {
try {
ResourceBundle mb = messagesMap.get(pLang);
if (mb != null) {
return mb.getString(pKey);
} else {
return getMsg(pKey);
}
} catch (Exception e) {
return "[" + pKey + "]-" + pLang;
... | [
"@",
"Override",
"public",
"final",
"String",
"getMsg",
"(",
"final",
"String",
"pKey",
",",
"final",
"String",
"pLang",
")",
"{",
"try",
"{",
"ResourceBundle",
"mb",
"=",
"messagesMap",
".",
"get",
"(",
"pLang",
")",
";",
"if",
"(",
"mb",
"!=",
"null"... | <p>Evaluate message by given key for given language.</p>
@param pKey key of message
@param pLang e.g. "en", "ru", etc. | [
"<p",
">",
"Evaluate",
"message",
"by",
"given",
"key",
"for",
"given",
"language",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/demidenko05/beigesoft-bcommon/blob/bb446822b4fc9b5a6a8cd3cc98d0b3d83d718daf/src/main/java/org/beigesoft/service/SrvI18n.java#L145-L157 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDatatypeRestrictionImpl_CustomFieldSerializer.java | OWLDatatypeRestrictionImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLDatatypeRestrictionImpl instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLDatatypeRestrictionImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLDatatypeRestrictionImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDatatypeRestrictionImpl_CustomFieldSerializer.java#L74-L77 |
alipay/sofa-rpc | extension-impl/registry-nacos/src/main/java/com/alipay/sofa/rpc/registry/nacos/NacosRegistryProviderObserver.java | NacosRegistryProviderObserver.updateProviders | void updateProviders(ConsumerConfig config, List<Instance> instances) {
"""
Update providers.
@param config the config
@param instances the instances
"""
if (LOGGER.isInfoEnabled(config.getAppName())) {
LOGGER.infoWithApp(config.getAppName(),
"Receive update provider: se... | java | void updateProviders(ConsumerConfig config, List<Instance> instances) {
if (LOGGER.isInfoEnabled(config.getAppName())) {
LOGGER.infoWithApp(config.getAppName(),
"Receive update provider: serviceName={}, size={}, data={}", config.getInterfaceId(), instances.size(),
ins... | [
"void",
"updateProviders",
"(",
"ConsumerConfig",
"config",
",",
"List",
"<",
"Instance",
">",
"instances",
")",
"{",
"if",
"(",
"LOGGER",
".",
"isInfoEnabled",
"(",
"config",
".",
"getAppName",
"(",
")",
")",
")",
"{",
"LOGGER",
".",
"infoWithApp",
"(",
... | Update providers.
@param config the config
@param instances the instances | [
"Update",
"providers",
"."
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/registry-nacos/src/main/java/com/alipay/sofa/rpc/registry/nacos/NacosRegistryProviderObserver.java#L78-L94 |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/context/ContextClientCodeException.java | ContextClientCodeException.getIdentifier | public static String getIdentifier(final Configuration c) {
"""
Extracts a context id from the given configuration.
@param c
@return the context id in the given configuration.
@throws RuntimeException if the configuration can't be parsed.
"""
try {
return Tang.Factory.getTang().newInjector(c).ge... | java | public static String getIdentifier(final Configuration c) {
try {
return Tang.Factory.getTang().newInjector(c).getNamedInstance(
ContextIdentifier.class);
} catch (final InjectionException e) {
throw new RuntimeException("Unable to determine context identifier. Giving up.", e);
}
} | [
"public",
"static",
"String",
"getIdentifier",
"(",
"final",
"Configuration",
"c",
")",
"{",
"try",
"{",
"return",
"Tang",
".",
"Factory",
".",
"getTang",
"(",
")",
".",
"newInjector",
"(",
"c",
")",
".",
"getNamedInstance",
"(",
"ContextIdentifier",
".",
... | Extracts a context id from the given configuration.
@param c
@return the context id in the given configuration.
@throws RuntimeException if the configuration can't be parsed. | [
"Extracts",
"a",
"context",
"id",
"from",
"the",
"given",
"configuration",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/context/ContextClientCodeException.java#L56-L63 |
Swagger2Markup/swagger2markup | src/main/java/io/github/swagger2markup/internal/document/PathsDocument.java | PathsDocument.buildOperationRef | private void buildOperationRef(MarkupDocBuilder markupDocBuilder, PathOperation operation) {
"""
Builds a cross-reference to a separated operation file
@param markupDocBuilder the markupDocBuilder do use for output
@param operation the Swagger Operation
"""
buildOperationTitle(markupDocBuild... | java | private void buildOperationRef(MarkupDocBuilder markupDocBuilder, PathOperation operation) {
buildOperationTitle(markupDocBuilder, crossReference(markupDocBuilder, operationDocumentResolverDefault.apply(operation), operation.getId(), operation.getTitle()), "ref-" + operation.getId());
} | [
"private",
"void",
"buildOperationRef",
"(",
"MarkupDocBuilder",
"markupDocBuilder",
",",
"PathOperation",
"operation",
")",
"{",
"buildOperationTitle",
"(",
"markupDocBuilder",
",",
"crossReference",
"(",
"markupDocBuilder",
",",
"operationDocumentResolverDefault",
".",
"a... | Builds a cross-reference to a separated operation file
@param markupDocBuilder the markupDocBuilder do use for output
@param operation the Swagger Operation | [
"Builds",
"a",
"cross",
"-",
"reference",
"to",
"a",
"separated",
"operation",
"file"
] | train | https://github.com/Swagger2Markup/swagger2markup/blob/da83465f19a2f8a0f1fba873b5762bca8587896b/src/main/java/io/github/swagger2markup/internal/document/PathsDocument.java#L245-L247 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/qe/JoinedQueryExecutor.java | JoinedQueryExecutor.commonOrderingCount | private static <T extends Storable> int
commonOrderingCount(OrderingList<T> orderingA, OrderingList<T> orderingB) {
"""
Returns the count of exactly matching properties from the two
orderings. The match must be consecutive and start at the first
property.
"""
int commonCount = Math.min(orde... | java | private static <T extends Storable> int
commonOrderingCount(OrderingList<T> orderingA, OrderingList<T> orderingB)
{
int commonCount = Math.min(orderingA.size(), orderingB.size());
for (int i=0; i<commonCount; i++) {
if (!orderingA.get(i).equals(orderingB.get(i))) {
... | [
"private",
"static",
"<",
"T",
"extends",
"Storable",
">",
"int",
"commonOrderingCount",
"(",
"OrderingList",
"<",
"T",
">",
"orderingA",
",",
"OrderingList",
"<",
"T",
">",
"orderingB",
")",
"{",
"int",
"commonCount",
"=",
"Math",
".",
"min",
"(",
"orderi... | Returns the count of exactly matching properties from the two
orderings. The match must be consecutive and start at the first
property. | [
"Returns",
"the",
"count",
"of",
"exactly",
"matching",
"properties",
"from",
"the",
"two",
"orderings",
".",
"The",
"match",
"must",
"be",
"consecutive",
"and",
"start",
"at",
"the",
"first",
"property",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/qe/JoinedQueryExecutor.java#L445-L457 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbStatement.java | MariaDbStatement.executeUpdate | public int executeUpdate(final String sql, final int autoGeneratedKeys) throws SQLException {
"""
Executes the given SQL statement and signals the driver with the given flag about whether the
auto-generated keys produced by this <code>Statement</code> object should be made available for
retrieval. The driver wi... | java | public int executeUpdate(final String sql, final int autoGeneratedKeys) throws SQLException {
if (executeInternal(sql, fetchSize, autoGeneratedKeys)) {
return 0;
}
return getUpdateCount();
} | [
"public",
"int",
"executeUpdate",
"(",
"final",
"String",
"sql",
",",
"final",
"int",
"autoGeneratedKeys",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"executeInternal",
"(",
"sql",
",",
"fetchSize",
",",
"autoGeneratedKeys",
")",
")",
"{",
"return",
"0",
... | Executes the given SQL statement and signals the driver with the given flag about whether the
auto-generated keys produced by this <code>Statement</code> object should be made available for
retrieval. The driver will ignore the flag if the SQL statement is not an
<code>INSERT</code> statement, or an SQL statement able... | [
"Executes",
"the",
"given",
"SQL",
"statement",
"and",
"signals",
"the",
"driver",
"with",
"the",
"given",
"flag",
"about",
"whether",
"the",
"auto",
"-",
"generated",
"keys",
"produced",
"by",
"this",
"<code",
">",
"Statement<",
"/",
"code",
">",
"object",
... | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbStatement.java#L545-L550 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/schema/columns/DataColumnsDao.java | DataColumnsDao.queryByConstraintName | public List<DataColumns> queryByConstraintName(String constraintName)
throws SQLException {
"""
Query by the constraint name
@param constraintName
constraint name
@return data columns
@throws SQLException
upon failure
"""
return queryForEq(DataColumns.COLUMN_CONSTRAINT_NAME, constraintName);
} | java | public List<DataColumns> queryByConstraintName(String constraintName)
throws SQLException {
return queryForEq(DataColumns.COLUMN_CONSTRAINT_NAME, constraintName);
} | [
"public",
"List",
"<",
"DataColumns",
">",
"queryByConstraintName",
"(",
"String",
"constraintName",
")",
"throws",
"SQLException",
"{",
"return",
"queryForEq",
"(",
"DataColumns",
".",
"COLUMN_CONSTRAINT_NAME",
",",
"constraintName",
")",
";",
"}"
] | Query by the constraint name
@param constraintName
constraint name
@return data columns
@throws SQLException
upon failure | [
"Query",
"by",
"the",
"constraint",
"name"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/schema/columns/DataColumnsDao.java#L188-L191 |
aoindustries/ao-encoding | src/main/java/com/aoindustries/encoding/XhtmlValidator.java | XhtmlValidator.checkCharacter | public static void checkCharacter(char c) throws IOException {
"""
Checks one character, throws IOException if invalid.
<a href="http://www.w3.org/TR/REC-xml/#charsets">http://www.w3.org/TR/REC-xml/#charsets</a>
"""
if(
(c < 0x20 || c > 0xD7FF) // common case first
&& c != 0x9
&& c != 0xA
&& c... | java | public static void checkCharacter(char c) throws IOException {
if(
(c < 0x20 || c > 0xD7FF) // common case first
&& c != 0x9
&& c != 0xA
&& c != 0xD
&& (c < 0xE000 || c > 0xFFFD)
// high and low surrogates
//&& (c < 0x10000 || c > 0x10FFFF)
&& (c < Character.MIN_HIGH_SURROGATE || c > Character... | [
"public",
"static",
"void",
"checkCharacter",
"(",
"char",
"c",
")",
"throws",
"IOException",
"{",
"if",
"(",
"(",
"c",
"<",
"0x20",
"||",
"c",
">",
"0xD7FF",
")",
"// common case first",
"&&",
"c",
"!=",
"0x9",
"&&",
"c",
"!=",
"0xA",
"&&",
"c",
"!=... | Checks one character, throws IOException if invalid.
<a href="http://www.w3.org/TR/REC-xml/#charsets">http://www.w3.org/TR/REC-xml/#charsets</a> | [
"Checks",
"one",
"character",
"throws",
"IOException",
"if",
"invalid",
"."
] | train | https://github.com/aoindustries/ao-encoding/blob/54eeb8ff58ab7b44bb02549bbe2572625b449e4e/src/main/java/com/aoindustries/encoding/XhtmlValidator.java#L46-L58 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/NearestNeighborAffinityMatrixBuilder.java | NearestNeighborAffinityMatrixBuilder.computeSigma | protected static double computeSigma(int i, DoubleArray pij_row, double perplexity, double log_perp, double[] pij_i) {
"""
Compute row pij[i], using binary search on the kernel bandwidth sigma to
obtain the desired perplexity.
@param i Current point
@param pij_row Distance matrix row pij[i]
@param perplexity... | java | protected static double computeSigma(int i, DoubleArray pij_row, double perplexity, double log_perp, double[] pij_i) {
double max = pij_row.get((int) FastMath.ceil(perplexity)) / Math.E;
double beta = 1 / max; // beta = 1. / (2*sigma*sigma)
double diff = computeH(pij_row, pij_i, -beta) - log_perp;
doubl... | [
"protected",
"static",
"double",
"computeSigma",
"(",
"int",
"i",
",",
"DoubleArray",
"pij_row",
",",
"double",
"perplexity",
",",
"double",
"log_perp",
",",
"double",
"[",
"]",
"pij_i",
")",
"{",
"double",
"max",
"=",
"pij_row",
".",
"get",
"(",
"(",
"i... | Compute row pij[i], using binary search on the kernel bandwidth sigma to
obtain the desired perplexity.
@param i Current point
@param pij_row Distance matrix row pij[i]
@param perplexity Desired perplexity
@param log_perp Log of desired perplexity
@param pij_i Output row
@return beta | [
"Compute",
"row",
"pij",
"[",
"i",
"]",
"using",
"binary",
"search",
"on",
"the",
"kernel",
"bandwidth",
"sigma",
"to",
"obtain",
"the",
"desired",
"perplexity",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/NearestNeighborAffinityMatrixBuilder.java#L230-L248 |
ops4j/org.ops4j.pax.web | pax-web-extender-whiteboard/src/main/java/org/ops4j/pax/web/extender/whiteboard/internal/Activator.java | Activator.trackServletContextHelper | private void trackServletContextHelper(final BundleContext bundleContext, ExtendedHttpServiceRuntime httpServiceRuntime) {
"""
Track servlets.
@param bundleContext the BundleContext associated with this bundle
@param httpServiceRuntime
"""
final ServiceTracker<ServletContextHelper, ServletContextHelperE... | java | private void trackServletContextHelper(final BundleContext bundleContext, ExtendedHttpServiceRuntime httpServiceRuntime) {
final ServiceTracker<ServletContextHelper, ServletContextHelperElement> servletContextHelperTracker =
ServletContextHelperTracker.createTracker(extenderContext, bundleContext, httpServiceRu... | [
"private",
"void",
"trackServletContextHelper",
"(",
"final",
"BundleContext",
"bundleContext",
",",
"ExtendedHttpServiceRuntime",
"httpServiceRuntime",
")",
"{",
"final",
"ServiceTracker",
"<",
"ServletContextHelper",
",",
"ServletContextHelperElement",
">",
"servletContextHel... | Track servlets.
@param bundleContext the BundleContext associated with this bundle
@param httpServiceRuntime | [
"Track",
"servlets",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.web/blob/9ecf3676c1d316be0d43ea7fcfdc8f0defffc2a2/pax-web-extender-whiteboard/src/main/java/org/ops4j/pax/web/extender/whiteboard/internal/Activator.java#L163-L170 |
Erudika/para | para-core/src/main/java/com/erudika/para/core/App.java | App.isAllowedImplicitly | final boolean isAllowedImplicitly(String subjectid, String resourcePath, String httpMethod) {
"""
Check if a request comes from a signed in user who try to read/update themselves.
@param subjectid subject id
@param resourcePath resource path or object type
@param httpMethod HTTP method name
@return true if req... | java | final boolean isAllowedImplicitly(String subjectid, String resourcePath, String httpMethod) {
if (StringUtils.isBlank(subjectid) || StringUtils.isBlank(resourcePath) || StringUtils.isBlank(httpMethod)) {
return false;
}
if (resourcePath.endsWith("/" + subjectid)) {
// implicit permissions: a user can read/u... | [
"final",
"boolean",
"isAllowedImplicitly",
"(",
"String",
"subjectid",
",",
"String",
"resourcePath",
",",
"String",
"httpMethod",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"subjectid",
")",
"||",
"StringUtils",
".",
"isBlank",
"(",
"resourcePath"... | Check if a request comes from a signed in user who try to read/update themselves.
@param subjectid subject id
@param resourcePath resource path or object type
@param httpMethod HTTP method name
@return true if request is GET, PATCH or PUT and the subject id matches the object id | [
"Check",
"if",
"a",
"request",
"comes",
"from",
"a",
"signed",
"in",
"user",
"who",
"try",
"to",
"read",
"/",
"update",
"themselves",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/core/App.java#L823-L832 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.setParentGroup | public void setParentGroup(String groupName, String parentGroupName) throws CmsException {
"""
Sets a new parent-group for an already existing group.<p>
@param groupName the name of the group that should be updated
@param parentGroupName the name of the parent group to set,
or <code>null</code> if the parent
... | java | public void setParentGroup(String groupName, String parentGroupName) throws CmsException {
m_securityManager.setParentGroup(m_context, groupName, parentGroupName);
} | [
"public",
"void",
"setParentGroup",
"(",
"String",
"groupName",
",",
"String",
"parentGroupName",
")",
"throws",
"CmsException",
"{",
"m_securityManager",
".",
"setParentGroup",
"(",
"m_context",
",",
"groupName",
",",
"parentGroupName",
")",
";",
"}"
] | Sets a new parent-group for an already existing group.<p>
@param groupName the name of the group that should be updated
@param parentGroupName the name of the parent group to set,
or <code>null</code> if the parent
group should be deleted.
@throws CmsException if operation was not successful | [
"Sets",
"a",
"new",
"parent",
"-",
"group",
"for",
"an",
"already",
"existing",
"group",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L3827-L3830 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/ContinuousDistributions.java | ContinuousDistributions.uniformCdf | public static double uniformCdf(double x, double a, double b) {
"""
Returns the cumulative probability of Uniform
@param x
@param a
@param b
@return
"""
if(a>=b) {
throw new IllegalArgumentException("The a must be smaller than b.");
}
double probabilitySum;
... | java | public static double uniformCdf(double x, double a, double b) {
if(a>=b) {
throw new IllegalArgumentException("The a must be smaller than b.");
}
double probabilitySum;
if(x<a) {
probabilitySum=0.0;
}
else if(x<b) {
probability... | [
"public",
"static",
"double",
"uniformCdf",
"(",
"double",
"x",
",",
"double",
"a",
",",
"double",
"b",
")",
"{",
"if",
"(",
"a",
">=",
"b",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The a must be smaller than b.\"",
")",
";",
"}",
"dou... | Returns the cumulative probability of Uniform
@param x
@param a
@param b
@return | [
"Returns",
"the",
"cumulative",
"probability",
"of",
"Uniform"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/ContinuousDistributions.java#L374-L391 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsInner.java | VpnConnectionsInner.listByVpnGatewayAsync | public Observable<Page<VpnConnectionInner>> listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName) {
"""
Retrieves all vpn connections for a particular virtual wan vpn gateway.
@param resourceGroupName The resource group name of the VpnGateway.
@param gatewayName The name of the gatewa... | java | public Observable<Page<VpnConnectionInner>> listByVpnGatewayAsync(final String resourceGroupName, final String gatewayName) {
return listByVpnGatewayWithServiceResponseAsync(resourceGroupName, gatewayName)
.map(new Func1<ServiceResponse<Page<VpnConnectionInner>>, Page<VpnConnectionInner>>() {
... | [
"public",
"Observable",
"<",
"Page",
"<",
"VpnConnectionInner",
">",
">",
"listByVpnGatewayAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"gatewayName",
")",
"{",
"return",
"listByVpnGatewayWithServiceResponseAsync",
"(",
"resourceGroupName",... | Retrieves all vpn connections for a particular virtual wan vpn gateway.
@param resourceGroupName The resource group name of the VpnGateway.
@param gatewayName The name of the gateway.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<VpnConnectionInner... | [
"Retrieves",
"all",
"vpn",
"connections",
"for",
"a",
"particular",
"virtual",
"wan",
"vpn",
"gateway",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsInner.java#L581-L589 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java | Aggregations.longAvg | public static <Key, Value> Aggregation<Key, Long, Long> longAvg() {
"""
Returns an aggregation to calculate the long average of all supplied values.<br/>
This aggregation is similar to: <pre>SELECT AVG(value) FROM x</pre>
@param <Key> the input key type
@param <Value> the supplied value type
@return the av... | java | public static <Key, Value> Aggregation<Key, Long, Long> longAvg() {
return new AggregationAdapter(new LongAvgAggregation<Key, Value>());
} | [
"public",
"static",
"<",
"Key",
",",
"Value",
">",
"Aggregation",
"<",
"Key",
",",
"Long",
",",
"Long",
">",
"longAvg",
"(",
")",
"{",
"return",
"new",
"AggregationAdapter",
"(",
"new",
"LongAvgAggregation",
"<",
"Key",
",",
"Value",
">",
"(",
")",
")"... | Returns an aggregation to calculate the long average of all supplied values.<br/>
This aggregation is similar to: <pre>SELECT AVG(value) FROM x</pre>
@param <Key> the input key type
@param <Value> the supplied value type
@return the average over all supplied values | [
"Returns",
"an",
"aggregation",
"to",
"calculate",
"the",
"long",
"average",
"of",
"all",
"supplied",
"values",
".",
"<br",
"/",
">",
"This",
"aggregation",
"is",
"similar",
"to",
":",
"<pre",
">",
"SELECT",
"AVG",
"(",
"value",
")",
"FROM",
"x<",
"/",
... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/mapreduce/aggregation/Aggregations.java#L150-L152 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java | Searcher.addControlsRecursive | private static void addControlsRecursive(Interaction inter, Set<Interaction> set) {
"""
Adds controls of the given interactions recursively to the given set.
@param inter interaction to add its controls
@param set set to add to
"""
for (Control ctrl : inter.getControlledOf())
{
set.add(ctrl);
addCo... | java | private static void addControlsRecursive(Interaction inter, Set<Interaction> set)
{
for (Control ctrl : inter.getControlledOf())
{
set.add(ctrl);
addControlsRecursive(ctrl, set);
}
} | [
"private",
"static",
"void",
"addControlsRecursive",
"(",
"Interaction",
"inter",
",",
"Set",
"<",
"Interaction",
">",
"set",
")",
"{",
"for",
"(",
"Control",
"ctrl",
":",
"inter",
".",
"getControlledOf",
"(",
")",
")",
"{",
"set",
".",
"add",
"(",
"ctrl... | Adds controls of the given interactions recursively to the given set.
@param inter interaction to add its controls
@param set set to add to | [
"Adds",
"controls",
"of",
"the",
"given",
"interactions",
"recursively",
"to",
"the",
"given",
"set",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/Searcher.java#L491-L498 |
zaproxy/zaproxy | src/org/zaproxy/zap/view/panels/AbstractContextSelectToolbarStatusPanel.java | AbstractContextSelectToolbarStatusPanel.setupToolbarElements | protected void setupToolbarElements(JToolBar toolbar) {
"""
Method used to setup the toolbar elements. Should not usually be overriden. Instead, use the
{@link #addToolBarElements(JToolBar, short, int)} method to add elements at various points.
@param toolbar the tool bar of the status panel
"""
int x = 0;... | java | protected void setupToolbarElements(JToolBar toolbar) {
int x = 0;
Insets insets = new Insets(0, 4, 0, 2);
x = this.addToolBarElements(toolbar, TOOLBAR_LOCATION_START, x);
toolbar.add(new JLabel(Constant.messages.getString(panelPrefix + ".toolbar.context.label")),
LayoutHelper.getGBC(x++, 0, 1, 0, insets)... | [
"protected",
"void",
"setupToolbarElements",
"(",
"JToolBar",
"toolbar",
")",
"{",
"int",
"x",
"=",
"0",
";",
"Insets",
"insets",
"=",
"new",
"Insets",
"(",
"0",
",",
"4",
",",
"0",
",",
"2",
")",
";",
"x",
"=",
"this",
".",
"addToolBarElements",
"("... | Method used to setup the toolbar elements. Should not usually be overriden. Instead, use the
{@link #addToolBarElements(JToolBar, short, int)} method to add elements at various points.
@param toolbar the tool bar of the status panel | [
"Method",
"used",
"to",
"setup",
"the",
"toolbar",
"elements",
".",
"Should",
"not",
"usually",
"be",
"overriden",
".",
"Instead",
"use",
"the",
"{"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/view/panels/AbstractContextSelectToolbarStatusPanel.java#L120-L138 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WRadioButtonSelectExample.java | WRadioButtonSelectExample.makeSimpleExample | private void makeSimpleExample() {
"""
Make a simple editable example. The label for this example is used to get the example for use in the unit tests.
"""
add(new WHeading(HeadingLevel.H3, "Simple WRadioButtonSelect"));
WPanel examplePanel = new WPanel();
examplePanel.setLayout(new FlowLayout(FlowLayout... | java | private void makeSimpleExample() {
add(new WHeading(HeadingLevel.H3, "Simple WRadioButtonSelect"));
WPanel examplePanel = new WPanel();
examplePanel.setLayout(new FlowLayout(FlowLayout.VERTICAL, Size.MEDIUM));
add(examplePanel);
/**
* The radio button select.
*/
final WRadioButtonSelect rbSelect = ne... | [
"private",
"void",
"makeSimpleExample",
"(",
")",
"{",
"add",
"(",
"new",
"WHeading",
"(",
"HeadingLevel",
".",
"H3",
",",
"\"Simple WRadioButtonSelect\"",
")",
")",
";",
"WPanel",
"examplePanel",
"=",
"new",
"WPanel",
"(",
")",
";",
"examplePanel",
".",
"se... | Make a simple editable example. The label for this example is used to get the example for use in the unit tests. | [
"Make",
"a",
"simple",
"editable",
"example",
".",
"The",
"label",
"for",
"this",
"example",
"is",
"used",
"to",
"get",
"the",
"example",
"for",
"use",
"in",
"the",
"unit",
"tests",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WRadioButtonSelectExample.java#L71-L102 |
base2Services/kagura | shared/reporting-core/src/main/java/com/base2/kagura/core/report/configmodel/ReportConfig.java | ReportConfig.prepareParameters | public void prepareParameters(Map<String, Object> extra) {
"""
Prepares the parameters for the report. This populates the Combo and ManyCombo box options if there is a groovy
or report backing the data.
@param extra Extra options from the middleware, this is passed down to the report or groovy execution.
"""... | java | public void prepareParameters(Map<String, Object> extra) {
if (paramConfig == null) return;
for (ParamConfig param : paramConfig)
{
param.prepareParameter(extra);
}
} | [
"public",
"void",
"prepareParameters",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"extra",
")",
"{",
"if",
"(",
"paramConfig",
"==",
"null",
")",
"return",
";",
"for",
"(",
"ParamConfig",
"param",
":",
"paramConfig",
")",
"{",
"param",
".",
"prepareP... | Prepares the parameters for the report. This populates the Combo and ManyCombo box options if there is a groovy
or report backing the data.
@param extra Extra options from the middleware, this is passed down to the report or groovy execution. | [
"Prepares",
"the",
"parameters",
"for",
"the",
"report",
".",
"This",
"populates",
"the",
"Combo",
"and",
"ManyCombo",
"box",
"options",
"if",
"there",
"is",
"a",
"groovy",
"or",
"report",
"backing",
"the",
"data",
"."
] | train | https://github.com/base2Services/kagura/blob/5564aa71bfa2cb3baaae2eb098c6c673dd4e82ee/shared/reporting-core/src/main/java/com/base2/kagura/core/report/configmodel/ReportConfig.java#L143-L149 |
fabiomaffioletti/jsondoc | jsondoc-springmvc/src/main/java/org/jsondoc/springmvc/scanner/builder/SpringPathVariableBuilder.java | SpringPathVariableBuilder.mergeApiPathParamDoc | private static void mergeApiPathParamDoc(ApiPathParam apiPathParam, ApiParamDoc apiParamDoc) {
"""
Available properties that can be overridden: name, description,
allowedvalues, format. Name is overridden only if it's empty in the
apiParamDoc argument. Description, format and allowedvalues are copied in
any cas... | java | private static void mergeApiPathParamDoc(ApiPathParam apiPathParam, ApiParamDoc apiParamDoc) {
if (apiPathParam != null) {
if (apiParamDoc.getName().trim().isEmpty()) {
apiParamDoc.setName(apiPathParam.name());
}
apiParamDoc.setDescription(apiPathParam.description());
apiParamDoc.setAllowedvalues(apiP... | [
"private",
"static",
"void",
"mergeApiPathParamDoc",
"(",
"ApiPathParam",
"apiPathParam",
",",
"ApiParamDoc",
"apiParamDoc",
")",
"{",
"if",
"(",
"apiPathParam",
"!=",
"null",
")",
"{",
"if",
"(",
"apiParamDoc",
".",
"getName",
"(",
")",
".",
"trim",
"(",
")... | Available properties that can be overridden: name, description,
allowedvalues, format. Name is overridden only if it's empty in the
apiParamDoc argument. Description, format and allowedvalues are copied in
any case.
@param apiPathParam
@param apiParamDoc | [
"Available",
"properties",
"that",
"can",
"be",
"overridden",
":",
"name",
"description",
"allowedvalues",
"format",
".",
"Name",
"is",
"overridden",
"only",
"if",
"it",
"s",
"empty",
"in",
"the",
"apiParamDoc",
"argument",
".",
"Description",
"format",
"and",
... | train | https://github.com/fabiomaffioletti/jsondoc/blob/26bf413c236e7c3b66f534c2451b157783c1f45e/jsondoc-springmvc/src/main/java/org/jsondoc/springmvc/scanner/builder/SpringPathVariableBuilder.java#L56-L65 |
VoltDB/voltdb | src/frontend/org/voltdb/plannodes/OrderByPlanNode.java | OrderByPlanNode.addSortExpressions | public void addSortExpressions(List<AbstractExpression> sortExprs, List<SortDirectionType> sortDirs) {
"""
Add multiple sort expressions to the order-by
@param sortExprs List of the input expression on which to order the rows
@param sortDirs List of the corresponding sort order for each input expression
"""... | java | public void addSortExpressions(List<AbstractExpression> sortExprs, List<SortDirectionType> sortDirs) {
assert(sortExprs.size() == sortDirs.size());
for (int i = 0; i < sortExprs.size(); ++i) {
addSortExpression(sortExprs.get(i), sortDirs.get(i));
}
} | [
"public",
"void",
"addSortExpressions",
"(",
"List",
"<",
"AbstractExpression",
">",
"sortExprs",
",",
"List",
"<",
"SortDirectionType",
">",
"sortDirs",
")",
"{",
"assert",
"(",
"sortExprs",
".",
"size",
"(",
")",
"==",
"sortDirs",
".",
"size",
"(",
")",
... | Add multiple sort expressions to the order-by
@param sortExprs List of the input expression on which to order the rows
@param sortDirs List of the corresponding sort order for each input expression | [
"Add",
"multiple",
"sort",
"expressions",
"to",
"the",
"order",
"-",
"by"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/OrderByPlanNode.java#L87-L92 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/constraint/Constraints.java | Constraints.lt | public PropertyConstraint lt(String propertyName, Comparable propertyValue) {
"""
Apply a "less than" constraint to a bean property.
@param propertyName The first property
@param propertyValue The constraint value
@return The constraint
"""
return new ParameterizedPropertyConstraint(propertyName, ... | java | public PropertyConstraint lt(String propertyName, Comparable propertyValue) {
return new ParameterizedPropertyConstraint(propertyName, lt(propertyValue));
} | [
"public",
"PropertyConstraint",
"lt",
"(",
"String",
"propertyName",
",",
"Comparable",
"propertyValue",
")",
"{",
"return",
"new",
"ParameterizedPropertyConstraint",
"(",
"propertyName",
",",
"lt",
"(",
"propertyValue",
")",
")",
";",
"}"
] | Apply a "less than" constraint to a bean property.
@param propertyName The first property
@param propertyValue The constraint value
@return The constraint | [
"Apply",
"a",
"less",
"than",
"constraint",
"to",
"a",
"bean",
"property",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/rules/constraint/Constraints.java#L713-L715 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WSuggestionsRenderer.java | WSuggestionsRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
"""
Paints the given WSuggestions.
@param component the WSuggestions to paint.
@param renderContext the RenderContext to paint to.
"""
WSuggestions suggestions = (WSuggestions) component;
XmlStringBui... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WSuggestions suggestions = (WSuggestions) component;
XmlStringBuilder xml = renderContext.getWriter();
// Cache key for a lookup table
String dataKey = suggestions.getListCacheKey();
// Use AJAX if not usin... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WSuggestions",
"suggestions",
"=",
"(",
"WSuggestions",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
... | Paints the given WSuggestions.
@param component the WSuggestions to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WSuggestions",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WSuggestionsRenderer.java#L24-L63 |
Alexey1Gavrilov/ExpectIt | expectit-core/src/main/java/net/sf/expectit/matcher/Matchers.java | Matchers.anyOf | public static Matcher<MultiResult> anyOf(final Matcher<?>... matchers) {
"""
Creates a matcher that matches if the examined input matches <b>any</b> of the specified
matchers.
<p/>
The match result represents a combination of any match operations. If succeeded,
the match result with the
greatest end position ... | java | public static Matcher<MultiResult> anyOf(final Matcher<?>... matchers) {
checkNotEmpty(matchers);
return new MultiMatcher(false, matchers);
} | [
"public",
"static",
"Matcher",
"<",
"MultiResult",
">",
"anyOf",
"(",
"final",
"Matcher",
"<",
"?",
">",
"...",
"matchers",
")",
"{",
"checkNotEmpty",
"(",
"matchers",
")",
";",
"return",
"new",
"MultiMatcher",
"(",
"false",
",",
"matchers",
")",
";",
"}... | Creates a matcher that matches if the examined input matches <b>any</b> of the specified
matchers.
<p/>
The match result represents a combination of any match operations. If succeeded,
the match result with the
greatest end position is selected to implement the result {@link Result} instance returned
by this method.
<p... | [
"Creates",
"a",
"matcher",
"that",
"matches",
"if",
"the",
"examined",
"input",
"matches",
"<b",
">",
"any<",
"/",
"b",
">",
"of",
"the",
"specified",
"matchers",
".",
"<p",
"/",
">",
"The",
"match",
"result",
"represents",
"a",
"combination",
"of",
"any... | train | https://github.com/Alexey1Gavrilov/ExpectIt/blob/5acbe1f8f895fe1dbd63e29bf3ab8e5bbf0873c3/expectit-core/src/main/java/net/sf/expectit/matcher/Matchers.java#L192-L195 |
teatrove/teatrove | trove/src/main/java/org/teatrove/trove/io/LinePositionReader.java | LinePositionReader.createSequence | public static String createSequence(char c, int length) {
"""
Creates and returns a String containing a sequence of the specified
length, repeating the given character.
"""
if (length < 0) length = 1;
StringBuffer buf = new StringBuffer(length);
for (; length > 0; length--) {
... | java | public static String createSequence(char c, int length) {
if (length < 0) length = 1;
StringBuffer buf = new StringBuffer(length);
for (; length > 0; length--) {
buf.append(c);
}
return buf.toString();
} | [
"public",
"static",
"String",
"createSequence",
"(",
"char",
"c",
",",
"int",
"length",
")",
"{",
"if",
"(",
"length",
"<",
"0",
")",
"length",
"=",
"1",
";",
"StringBuffer",
"buf",
"=",
"new",
"StringBuffer",
"(",
"length",
")",
";",
"for",
"(",
";"... | Creates and returns a String containing a sequence of the specified
length, repeating the given character. | [
"Creates",
"and",
"returns",
"a",
"String",
"containing",
"a",
"sequence",
"of",
"the",
"specified",
"length",
"repeating",
"the",
"given",
"character",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/io/LinePositionReader.java#L118-L126 |
foundation-runtime/logging | logging-log4j/src/main/java/com/cisco/oss/foundation/logging/LoggingHelper.java | LoggingHelper.fatal | public static void fatal(final Logger logger, final String format, final Object... params) {
"""
log message using the String.format API.
@param logger
the logger that will be used to log the message
@param format
the format string (the template string)
@param params
the parameters to be formatted into it ... | java | public static void fatal(final Logger logger, final String format, final Object... params) {
fatal(logger, format, null, params);
} | [
"public",
"static",
"void",
"fatal",
"(",
"final",
"Logger",
"logger",
",",
"final",
"String",
"format",
",",
"final",
"Object",
"...",
"params",
")",
"{",
"fatal",
"(",
"logger",
",",
"format",
",",
"null",
",",
"params",
")",
";",
"}"
] | log message using the String.format API.
@param logger
the logger that will be used to log the message
@param format
the format string (the template string)
@param params
the parameters to be formatted into it the string format | [
"log",
"message",
"using",
"the",
"String",
".",
"format",
"API",
"."
] | train | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-log4j/src/main/java/com/cisco/oss/foundation/logging/LoggingHelper.java#L324-L326 |
sd4324530/fastweixin | src/main/java/com/github/sd4324530/fastweixin/api/BaseAPI.java | BaseAPI.executePost | protected BaseResponse executePost(String url, String json, File file) {
"""
通用post请求
@param url 地址,其中token用#代替
@param json 参数,json格式
@param file 上传的文件
@return 请求结果
"""
BaseResponse response;
BeanUtil.requireNonNull(url, "url is null");
List<File> files = null;
if (null !... | java | protected BaseResponse executePost(String url, String json, File file) {
BaseResponse response;
BeanUtil.requireNonNull(url, "url is null");
List<File> files = null;
if (null != file) {
files = CollectionUtil.newArrayList(file);
}
//需要传token
String pos... | [
"protected",
"BaseResponse",
"executePost",
"(",
"String",
"url",
",",
"String",
"json",
",",
"File",
"file",
")",
"{",
"BaseResponse",
"response",
";",
"BeanUtil",
".",
"requireNonNull",
"(",
"url",
",",
"\"url is null\"",
")",
";",
"List",
"<",
"File",
">"... | 通用post请求
@param url 地址,其中token用#代替
@param json 参数,json格式
@param file 上传的文件
@return 请求结果 | [
"通用post请求"
] | train | https://github.com/sd4324530/fastweixin/blob/6bc0a7abfa23aad0dbad4c3123a47a7fb53f3447/src/main/java/com/github/sd4324530/fastweixin/api/BaseAPI.java#L55-L66 |
nmorel/gwt-jackson | gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/rebind/AbstractCreator.java | AbstractCreator.methodCallCodeWithJParameterizedMapperParameters | private CodeBlock methodCallCodeWithJParameterizedMapperParameters( CodeBlock.Builder builder, ImmutableList<? extends
JParameterizedMapper> parameters
) {
"""
Build the code for the parameters of a method call.
@param builder the code builder
@param parameters the parameters
@return the cod... | java | private CodeBlock methodCallCodeWithJParameterizedMapperParameters( CodeBlock.Builder builder, ImmutableList<? extends
JParameterizedMapper> parameters
) {
return methodCallParametersCode( builder, Lists.transform( parameters, new Function<JParameterizedMapper, CodeBlock>() {
@Overr... | [
"private",
"CodeBlock",
"methodCallCodeWithJParameterizedMapperParameters",
"(",
"CodeBlock",
".",
"Builder",
"builder",
",",
"ImmutableList",
"<",
"?",
"extends",
"JParameterizedMapper",
">",
"parameters",
")",
"{",
"return",
"methodCallParametersCode",
"(",
"builder",
"... | Build the code for the parameters of a method call.
@param builder the code builder
@param parameters the parameters
@return the code | [
"Build",
"the",
"code",
"for",
"the",
"parameters",
"of",
"a",
"method",
"call",
"."
] | train | https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/rebind/AbstractCreator.java#L949-L959 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_fax_serviceName_screenLists_PUT | public void billingAccount_fax_serviceName_screenLists_PUT(String billingAccount, String serviceName, OvhFaxScreen body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/{billingAccount}/fax/{serviceName}/screenLists
@param body [required] New object properties
@param billingAccount ... | java | public void billingAccount_fax_serviceName_screenLists_PUT(String billingAccount, String serviceName, OvhFaxScreen body) throws IOException {
String qPath = "/telephony/{billingAccount}/fax/{serviceName}/screenLists";
StringBuilder sb = path(qPath, billingAccount, serviceName);
exec(qPath, "PUT", sb.toString(), b... | [
"public",
"void",
"billingAccount_fax_serviceName_screenLists_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhFaxScreen",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/fax/{serviceName}/screenList... | Alter this object properties
REST: PUT /telephony/{billingAccount}/fax/{serviceName}/screenLists
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L4444-L4448 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/parser/lexparser/MLEDependencyGrammar.java | MLEDependencyGrammar.treeToDependencyHelper | protected static EndHead treeToDependencyHelper(Tree tree, List<IntDependency> depList, int loc, Index<String> wordIndex, Index<String> tagIndex) {
"""
Adds dependencies to list depList. These are in terms of the original
tag set not the reduced (projected) tag set.
"""
// try {
// PrintWrit... | java | protected static EndHead treeToDependencyHelper(Tree tree, List<IntDependency> depList, int loc, Index<String> wordIndex, Index<String> tagIndex) {
// try {
// PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out,"GB18030"),true);
// tree.pennPrint(pw);
// }
// ... | [
"protected",
"static",
"EndHead",
"treeToDependencyHelper",
"(",
"Tree",
"tree",
",",
"List",
"<",
"IntDependency",
">",
"depList",
",",
"int",
"loc",
",",
"Index",
"<",
"String",
">",
"wordIndex",
",",
"Index",
"<",
"String",
">",
"tagIndex",
")",
"{",
"/... | Adds dependencies to list depList. These are in terms of the original
tag set not the reduced (projected) tag set. | [
"Adds",
"dependencies",
"to",
"list",
"depList",
".",
"These",
"are",
"in",
"terms",
"of",
"the",
"original",
"tag",
"set",
"not",
"the",
"reduced",
"(",
"projected",
")",
"tag",
"set",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/parser/lexparser/MLEDependencyGrammar.java#L123-L170 |
elki-project/elki | elki-index-preprocessed/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/knn/NNDescent.java | NNDescent.sampleNew | private int sampleNew(DBIDs ids, WritableDataStore<HashSetModifiableDBIDs> sampleNewNeighbors, WritableDataStore<HashSetModifiableDBIDs> newNeighborHash, int items) {
"""
samples newNeighbors for every object
@param ids All ids
@param sampleNewNeighbors Output of sampled new neighbors
@param newNeighborHash -... | java | private int sampleNew(DBIDs ids, WritableDataStore<HashSetModifiableDBIDs> sampleNewNeighbors, WritableDataStore<HashSetModifiableDBIDs> newNeighborHash, int items) {
int t = 0;
for(DBIDIter iditer = ids.iter(); iditer.valid(); iditer.advance()) {
KNNHeap realNeighbors = store.get(iditer);
HashSetMo... | [
"private",
"int",
"sampleNew",
"(",
"DBIDs",
"ids",
",",
"WritableDataStore",
"<",
"HashSetModifiableDBIDs",
">",
"sampleNewNeighbors",
",",
"WritableDataStore",
"<",
"HashSetModifiableDBIDs",
">",
"newNeighborHash",
",",
"int",
"items",
")",
"{",
"int",
"t",
"=",
... | samples newNeighbors for every object
@param ids All ids
@param sampleNewNeighbors Output of sampled new neighbors
@param newNeighborHash - new neighbors for every object
@param items Number of items to collect
@return Number of new neighbors | [
"samples",
"newNeighbors",
"for",
"every",
"object"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-preprocessed/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/knn/NNDescent.java#L416-L435 |
windup/windup | config/api/src/main/java/org/jboss/windup/config/furnace/FurnaceHolder.java | FurnaceHolder.setFurnace | public void setFurnace(@Observes PostStartup event, Furnace furnace, AddonRegistry registry) {
"""
Called by the {@link Furnace} container. <b>*** Do not use. ***</b>
"""
FurnaceHolder.addonRegistry = registry;
FurnaceHolder.furnace = furnace;
} | java | public void setFurnace(@Observes PostStartup event, Furnace furnace, AddonRegistry registry)
{
FurnaceHolder.addonRegistry = registry;
FurnaceHolder.furnace = furnace;
} | [
"public",
"void",
"setFurnace",
"(",
"@",
"Observes",
"PostStartup",
"event",
",",
"Furnace",
"furnace",
",",
"AddonRegistry",
"registry",
")",
"{",
"FurnaceHolder",
".",
"addonRegistry",
"=",
"registry",
";",
"FurnaceHolder",
".",
"furnace",
"=",
"furnace",
";"... | Called by the {@link Furnace} container. <b>*** Do not use. ***</b> | [
"Called",
"by",
"the",
"{"
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/config/api/src/main/java/org/jboss/windup/config/furnace/FurnaceHolder.java#L31-L35 |
nguillaumin/slick2d-maven | slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/ParticleGame.java | ParticleGame.clearSystem | public void clearSystem(boolean additive) {
"""
Clear the particle system held in this canvas
@param additive
True if the particle system should be set to additive
"""
system = new ParticleSystem("org/newdawn/slick/data/particle.tga", 2000);
if (additive) {
system.setBlendingMode(ParticleSystem.B... | java | public void clearSystem(boolean additive) {
system = new ParticleSystem("org/newdawn/slick/data/particle.tga", 2000);
if (additive) {
system.setBlendingMode(ParticleSystem.BLEND_ADDITIVE);
}
system.setRemoveCompletedEmitters(false);
} | [
"public",
"void",
"clearSystem",
"(",
"boolean",
"additive",
")",
"{",
"system",
"=",
"new",
"ParticleSystem",
"(",
"\"org/newdawn/slick/data/particle.tga\"",
",",
"2000",
")",
";",
"if",
"(",
"additive",
")",
"{",
"system",
".",
"setBlendingMode",
"(",
"Particl... | Clear the particle system held in this canvas
@param additive
True if the particle system should be set to additive | [
"Clear",
"the",
"particle",
"system",
"held",
"in",
"this",
"canvas"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/ParticleGame.java#L184-L190 |
opencypher/openCypher | tools/grammar/src/main/java/org/opencypher/grammar/LiteralNode.java | LiteralNode.textLiteral | private static void textLiteral( Consumer<? super LiteralNode> add, String literal ) {
"""
Creates a text literal, a case insensitive literal.
@param add the adder that adds the literal node to its parent node.
@param literal the literal string.
"""
add.accept( literal( literal, false ) );
... | java | private static void textLiteral( Consumer<? super LiteralNode> add, String literal )
{
add.accept( literal( literal, false ) );
} | [
"private",
"static",
"void",
"textLiteral",
"(",
"Consumer",
"<",
"?",
"super",
"LiteralNode",
">",
"add",
",",
"String",
"literal",
")",
"{",
"add",
".",
"accept",
"(",
"literal",
"(",
"literal",
",",
"false",
")",
")",
";",
"}"
] | Creates a text literal, a case insensitive literal.
@param add the adder that adds the literal node to its parent node.
@param literal the literal string. | [
"Creates",
"a",
"text",
"literal",
"a",
"case",
"insensitive",
"literal",
"."
] | train | https://github.com/opencypher/openCypher/blob/eb780caea625900ddbedd28a1eac9a5dbe09c5f0/tools/grammar/src/main/java/org/opencypher/grammar/LiteralNode.java#L151-L154 |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/UserFieldCounters.java | UserFieldCounters.nextField | public <E extends Enum<E> & FieldType> E nextField(Class<E> clazz, UserFieldDataType type) {
"""
Generate the next available field for a user defined field.
@param <E> field type class
@param clazz class of the desired field enum
@param type user defined field type.
@return field of specified type
"""
... | java | public <E extends Enum<E> & FieldType> E nextField(Class<E> clazz, UserFieldDataType type)
{
for (String name : m_names[type.ordinal()])
{
int i = NumberHelper.getInt(m_counters.get(name)) + 1;
try
{
E e = Enum.valueOf(clazz, name + i);
m_counters.put(na... | [
"public",
"<",
"E",
"extends",
"Enum",
"<",
"E",
">",
"&",
"FieldType",
">",
"E",
"nextField",
"(",
"Class",
"<",
"E",
">",
"clazz",
",",
"UserFieldDataType",
"type",
")",
"{",
"for",
"(",
"String",
"name",
":",
"m_names",
"[",
"type",
".",
"ordinal"... | Generate the next available field for a user defined field.
@param <E> field type class
@param clazz class of the desired field enum
@param type user defined field type.
@return field of specified type | [
"Generate",
"the",
"next",
"available",
"field",
"for",
"a",
"user",
"defined",
"field",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/UserFieldCounters.java#L70-L89 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.dedicatedCloud_serviceName_ip_GET | public ArrayList<String> dedicatedCloud_serviceName_ip_GET(String serviceName, OvhIpCountriesEnum country, String description, Long estimatedClientsNumber, String networkName, OvhOrderableIpBlockRangeEnum size, String usage) throws IOException {
"""
Get allowed durations for 'ip' option
REST: GET /order/dedicat... | java | public ArrayList<String> dedicatedCloud_serviceName_ip_GET(String serviceName, OvhIpCountriesEnum country, String description, Long estimatedClientsNumber, String networkName, OvhOrderableIpBlockRangeEnum size, String usage) throws IOException {
String qPath = "/order/dedicatedCloud/{serviceName}/ip";
StringBuilder... | [
"public",
"ArrayList",
"<",
"String",
">",
"dedicatedCloud_serviceName_ip_GET",
"(",
"String",
"serviceName",
",",
"OvhIpCountriesEnum",
"country",
",",
"String",
"description",
",",
"Long",
"estimatedClientsNumber",
",",
"String",
"networkName",
",",
"OvhOrderableIpBlock... | Get allowed durations for 'ip' option
REST: GET /order/dedicatedCloud/{serviceName}/ip
@param size [required] The network ranges orderable
@param usage [required] Basic information of how will this bloc be used (as "web","ssl","cloud" or other things)
@param description [required] Information visible on whois (minimum... | [
"Get",
"allowed",
"durations",
"for",
"ip",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L5798-L5809 |
openengsb/openengsb | api/edb/src/main/java/org/openengsb/core/edb/api/EDBObject.java | EDBObject.appendEntry | private void appendEntry(Map.Entry<String, EDBObjectEntry> entry, StringBuilder builder) {
"""
Analyzes the entry and write the specific information into the StringBuilder.
"""
if (builder.length() > 2) {
builder.append(",");
}
builder.append(" \"").append(entry.getKey()).ap... | java | private void appendEntry(Map.Entry<String, EDBObjectEntry> entry, StringBuilder builder) {
if (builder.length() > 2) {
builder.append(",");
}
builder.append(" \"").append(entry.getKey()).append("\"");
builder.append(" : ").append(entry.getValue());
} | [
"private",
"void",
"appendEntry",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"EDBObjectEntry",
">",
"entry",
",",
"StringBuilder",
"builder",
")",
"{",
"if",
"(",
"builder",
".",
"length",
"(",
")",
">",
"2",
")",
"{",
"builder",
".",
"append",
"(",... | Analyzes the entry and write the specific information into the StringBuilder. | [
"Analyzes",
"the",
"entry",
"and",
"write",
"the",
"specific",
"information",
"into",
"the",
"StringBuilder",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/api/edb/src/main/java/org/openengsb/core/edb/api/EDBObject.java#L210-L216 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/Pair.java | Pair.internedStringPair | public static Pair<String, String> internedStringPair(String first, String second) {
"""
Returns an MutableInternedPair where the Strings have been interned.
This is a factory method for creating an
MutableInternedPair. It requires the arguments to be Strings.
If this Pair is serialized
and then deserialized,... | java | public static Pair<String, String> internedStringPair(String first, String second) {
return new MutableInternedPair(first, second);
} | [
"public",
"static",
"Pair",
"<",
"String",
",",
"String",
">",
"internedStringPair",
"(",
"String",
"first",
",",
"String",
"second",
")",
"{",
"return",
"new",
"MutableInternedPair",
"(",
"first",
",",
"second",
")",
";",
"}"
] | Returns an MutableInternedPair where the Strings have been interned.
This is a factory method for creating an
MutableInternedPair. It requires the arguments to be Strings.
If this Pair is serialized
and then deserialized, first and second are interned upon
deserialization.
<p><i>Note:</i> I put this in thinking that i... | [
"Returns",
"an",
"MutableInternedPair",
"where",
"the",
"Strings",
"have",
"been",
"interned",
".",
"This",
"is",
"a",
"factory",
"method",
"for",
"creating",
"an",
"MutableInternedPair",
".",
"It",
"requires",
"the",
"arguments",
"to",
"be",
"Strings",
".",
"... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/Pair.java#L196-L198 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java | Symbol.isMemberOf | public boolean isMemberOf(TypeSymbol clazz, Types types) {
"""
Fully check membership: hierarchy, protection, and hiding.
Does not exclude methods not inherited due to overriding.
"""
return
owner == clazz ||
clazz.isSubClass(owner, types) &&
isInheritedIn(clazz, ty... | java | public boolean isMemberOf(TypeSymbol clazz, Types types) {
return
owner == clazz ||
clazz.isSubClass(owner, types) &&
isInheritedIn(clazz, types) &&
!hiddenIn((ClassSymbol)clazz, types);
} | [
"public",
"boolean",
"isMemberOf",
"(",
"TypeSymbol",
"clazz",
",",
"Types",
"types",
")",
"{",
"return",
"owner",
"==",
"clazz",
"||",
"clazz",
".",
"isSubClass",
"(",
"owner",
",",
"types",
")",
"&&",
"isInheritedIn",
"(",
"clazz",
",",
"types",
")",
"... | Fully check membership: hierarchy, protection, and hiding.
Does not exclude methods not inherited due to overriding. | [
"Fully",
"check",
"membership",
":",
"hierarchy",
"protection",
"and",
"hiding",
".",
"Does",
"not",
"exclude",
"methods",
"not",
"inherited",
"due",
"to",
"overriding",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java#L514-L520 |
census-instrumentation/opencensus-java | benchmarks/src/jmh/java/io/opencensus/benchmarks/tags/TagsBenchmarksUtil.java | TagsBenchmarksUtil.createTagContext | @VisibleForTesting
public static TagContext createTagContext(TagContextBuilder tagsBuilder, int numTags) {
"""
Adds 'numTags' tags to 'tagsBuilder' and returns the associated tag context.
"""
for (int i = 0; i < numTags; i++) {
tagsBuilder.put(TAG_KEYS.get(i), TAG_VALUES.get(i), UNLIMITED_PROPAGATI... | java | @VisibleForTesting
public static TagContext createTagContext(TagContextBuilder tagsBuilder, int numTags) {
for (int i = 0; i < numTags; i++) {
tagsBuilder.put(TAG_KEYS.get(i), TAG_VALUES.get(i), UNLIMITED_PROPAGATION);
}
return tagsBuilder.build();
} | [
"@",
"VisibleForTesting",
"public",
"static",
"TagContext",
"createTagContext",
"(",
"TagContextBuilder",
"tagsBuilder",
",",
"int",
"numTags",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numTags",
";",
"i",
"++",
")",
"{",
"tagsBuilder",
"... | Adds 'numTags' tags to 'tagsBuilder' and returns the associated tag context. | [
"Adds",
"numTags",
"tags",
"to",
"tagsBuilder",
"and",
"returns",
"the",
"associated",
"tag",
"context",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/benchmarks/src/jmh/java/io/opencensus/benchmarks/tags/TagsBenchmarksUtil.java#L98-L104 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/util/Debugger.java | Debugger.printWarn | public static void printWarn(Object caller, Object message) {
"""
Print a warning level message.
The stack trace will be printed if
the given message is an exception.
@param caller the calling object
@param message the message to print
"""
StringBuilder text = new StringBuilder();
Class<?> c = ca... | java | public static void printWarn(Object caller, Object message)
{
StringBuilder text = new StringBuilder();
Class<?> c = callerBuilder(caller, text);
if(message instanceof Throwable)
getLog(c).warn(text.append(stackTrace((Throwable)message)));
else
getLog(c).warn(text.append(message));
} | [
"public",
"static",
"void",
"printWarn",
"(",
"Object",
"caller",
",",
"Object",
"message",
")",
"{",
"StringBuilder",
"text",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Class",
"<",
"?",
">",
"c",
"=",
"callerBuilder",
"(",
"caller",
",",
"text",
")",... | Print a warning level message.
The stack trace will be printed if
the given message is an exception.
@param caller the calling object
@param message the message to print | [
"Print",
"a",
"warning",
"level",
"message",
".",
"The",
"stack",
"trace",
"will",
"be",
"printed",
"if",
"the",
"given",
"message",
"is",
"an",
"exception",
"."
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/util/Debugger.java#L531-L543 |
apache/groovy | subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java | NioGroovyMethods.setText | public static void setText(Path self, String text, String charset) throws IOException {
"""
Synonym for write(text, charset) allowing:
<pre>
myFile.setText('some text', charset)
</pre>
or with some help from <code>ExpandoMetaClass</code>, you could do something like:
<pre>
myFile.metaClass.setText = { String... | java | public static void setText(Path self, String text, String charset) throws IOException {
write(self, text, charset);
} | [
"public",
"static",
"void",
"setText",
"(",
"Path",
"self",
",",
"String",
"text",
",",
"String",
"charset",
")",
"throws",
"IOException",
"{",
"write",
"(",
"self",
",",
"text",
",",
"charset",
")",
";",
"}"
] | Synonym for write(text, charset) allowing:
<pre>
myFile.setText('some text', charset)
</pre>
or with some help from <code>ExpandoMetaClass</code>, you could do something like:
<pre>
myFile.metaClass.setText = { String s {@code ->} delegate.setText(s, 'UTF-8') }
myfile.text = 'some text'
</pre>
@param self A Path
@p... | [
"Synonym",
"for",
"write",
"(",
"text",
"charset",
")",
"allowing",
":",
"<pre",
">",
"myFile",
".",
"setText",
"(",
"some",
"text",
"charset",
")",
"<",
"/",
"pre",
">",
"or",
"with",
"some",
"help",
"from",
"<code",
">",
"ExpandoMetaClass<",
"/",
"co... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java#L479-L481 |
EdwardRaff/JSAT | JSAT/src/jsat/clustering/hierarchical/NNChainHAC.java | NNChainHAC.getClusterDesignations | public List<List<DataPoint>> getClusterDesignations(int clusters, DataSet data) {
"""
Returns the assignment array for that would have been computed for the
previous data set with the desired number of clusters.
@param clusters the number of clusters desired
@param data
@return the list of data points in eac... | java | public List<List<DataPoint>> getClusterDesignations(int clusters, DataSet data)
{
if(merges == null || (merges.length+2)/2 != data.size())
return null;
int[] assignments = new int[data.size()];
assignments = getClusterDesignations(assignments, clusters);
return createClus... | [
"public",
"List",
"<",
"List",
"<",
"DataPoint",
">",
">",
"getClusterDesignations",
"(",
"int",
"clusters",
",",
"DataSet",
"data",
")",
"{",
"if",
"(",
"merges",
"==",
"null",
"||",
"(",
"merges",
".",
"length",
"+",
"2",
")",
"/",
"2",
"!=",
"data... | Returns the assignment array for that would have been computed for the
previous data set with the desired number of clusters.
@param clusters the number of clusters desired
@param data
@return the list of data points in each cluster, or <tt>null</tt> if no
data set has been clustered.
@see #hasStoredClustering() | [
"Returns",
"the",
"assignment",
"array",
"for",
"that",
"would",
"have",
"been",
"computed",
"for",
"the",
"previous",
"data",
"set",
"with",
"the",
"desired",
"number",
"of",
"clusters",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/clustering/hierarchical/NNChainHAC.java#L184-L191 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/TagAttributeImpl.java | TagAttributeImpl.getObject | public Object getObject(FaceletContext ctx, Class type) {
"""
If literal, simply coerce our String literal value using an ExpressionFactory, otherwise create a ValueExpression
and evaluate it.
@see ExpressionFactory#coerceToType(java.lang.Object, java.lang.Class)
@see ExpressionFactory#createValueExpression(j... | java | public Object getObject(FaceletContext ctx, Class type)
{
if ((this.capabilities & EL_LITERAL) != 0)
{
if (String.class.equals(type))
{
return this.value;
}
else
{
try
{
re... | [
"public",
"Object",
"getObject",
"(",
"FaceletContext",
"ctx",
",",
"Class",
"type",
")",
"{",
"if",
"(",
"(",
"this",
".",
"capabilities",
"&",
"EL_LITERAL",
")",
"!=",
"0",
")",
"{",
"if",
"(",
"String",
".",
"class",
".",
"equals",
"(",
"type",
")... | If literal, simply coerce our String literal value using an ExpressionFactory, otherwise create a ValueExpression
and evaluate it.
@see ExpressionFactory#coerceToType(java.lang.Object, java.lang.Class)
@see ExpressionFactory#createValueExpression(javax.el.ELContext, java.lang.String, java.lang.Class)
@see ValueExpress... | [
"If",
"literal",
"simply",
"coerce",
"our",
"String",
"literal",
"value",
"using",
"an",
"ExpressionFactory",
"otherwise",
"create",
"a",
"ValueExpression",
"and",
"evaluate",
"it",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/TagAttributeImpl.java#L406-L438 |
molgenis/molgenis | molgenis-data-import/src/main/java/org/molgenis/data/importer/emx/EmxMetadataParser.java | EmxMetadataParser.parseAttributesSheet | private void parseAttributesSheet(
Repository<Entity> attributesRepo, IntermediateParseResults intermediateResults) {
"""
Load all attributes from the source repository and add it to the {@link
IntermediateParseResults}.
@param attributesRepo Repository for the attributes
@param intermediateResults {@li... | java | private void parseAttributesSheet(
Repository<Entity> attributesRepo, IntermediateParseResults intermediateResults) {
for (Attribute attr : attributesRepo.getEntityType().getAtomicAttributes()) {
checkAttrSheetHeaders(attr);
}
Map<String, Map<String, EmxAttribute>> attributesMap = newLinkedHash... | [
"private",
"void",
"parseAttributesSheet",
"(",
"Repository",
"<",
"Entity",
">",
"attributesRepo",
",",
"IntermediateParseResults",
"intermediateResults",
")",
"{",
"for",
"(",
"Attribute",
"attr",
":",
"attributesRepo",
".",
"getEntityType",
"(",
")",
".",
"getAto... | Load all attributes from the source repository and add it to the {@link
IntermediateParseResults}.
@param attributesRepo Repository for the attributes
@param intermediateResults {@link IntermediateParseResults} with the tags already parsed | [
"Load",
"all",
"attributes",
"from",
"the",
"source",
"repository",
"and",
"add",
"it",
"to",
"the",
"{",
"@link",
"IntermediateParseResults",
"}",
"."
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-data-import/src/main/java/org/molgenis/data/importer/emx/EmxMetadataParser.java#L718-L743 |
ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/clientlibs/processor/RendererContext.java | RendererContext.registerClientlibLink | public void registerClientlibLink(ClientlibLink link, ClientlibResourceFolder parent) {
"""
Registers rendered resources / client libraries that have already been rendered for the current request, that is,
over all clientlib tag calls of a request
@param link the element to be registered
@param parent the e... | java | public void registerClientlibLink(ClientlibLink link, ClientlibResourceFolder parent) {
if (renderedClientlibs.contains(link)) {
LOG.error("Bug: duplicate clientlib link {} being included from {} ", link, parent);
} else {
renderedClientlibs.add(link);
LOG.debug("regi... | [
"public",
"void",
"registerClientlibLink",
"(",
"ClientlibLink",
"link",
",",
"ClientlibResourceFolder",
"parent",
")",
"{",
"if",
"(",
"renderedClientlibs",
".",
"contains",
"(",
"link",
")",
")",
"{",
"LOG",
".",
"error",
"(",
"\"Bug: duplicate clientlib link {} b... | Registers rendered resources / client libraries that have already been rendered for the current request, that is,
over all clientlib tag calls of a request
@param link the element to be registered
@param parent the element referencing it, for logging purposes | [
"Registers",
"rendered",
"resources",
"/",
"client",
"libraries",
"that",
"have",
"already",
"been",
"rendered",
"for",
"the",
"current",
"request",
"that",
"is",
"over",
"all",
"clientlib",
"tag",
"calls",
"of",
"a",
"request"
] | train | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/clientlibs/processor/RendererContext.java#L66-L73 |
mgormley/prim | src/main/java/edu/jhu/prim/util/math/FastMath.java | FastMath.logSubtract | public static double logSubtract(double x, double y) {
"""
Subtracts two probabilities that are stored as log probabilities.
Note that x >= y.
@param x log(p)
@param y log(q)
@return log(p - q) = log(exp(x) - exp(y))
@throws IllegalStateException if x < y
"""
if (FastMath.useLogAddTable) {
... | java | public static double logSubtract(double x, double y) {
if (FastMath.useLogAddTable) {
return SmoothedLogAddTable.logSubtract(x,y);
} else {
return FastMath.logSubtractExact(x,y);
}
} | [
"public",
"static",
"double",
"logSubtract",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"if",
"(",
"FastMath",
".",
"useLogAddTable",
")",
"{",
"return",
"SmoothedLogAddTable",
".",
"logSubtract",
"(",
"x",
",",
"y",
")",
";",
"}",
"else",
"{",
... | Subtracts two probabilities that are stored as log probabilities.
Note that x >= y.
@param x log(p)
@param y log(q)
@return log(p - q) = log(exp(x) - exp(y))
@throws IllegalStateException if x < y | [
"Subtracts",
"two",
"probabilities",
"that",
"are",
"stored",
"as",
"log",
"probabilities",
".",
"Note",
"that",
"x",
">",
"=",
"y",
"."
] | train | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java/edu/jhu/prim/util/math/FastMath.java#L44-L50 |
metafacture/metafacture-core | metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/Iso646ByteBuffer.java | Iso646ByteBuffer.parseIntAt | int parseIntAt(final int fromIndex, final int length) {
"""
Parses characters in the specified part of the byte buffer into an integer
This is a simplified version of {@link Integer#parseInt(String)}. It
operates directly on the byte data and works only for positive numbers and
a radix of 10.
@param fromInde... | java | int parseIntAt(final int fromIndex, final int length) {
assert length >= 0;
assert 0 <= fromIndex && (fromIndex + length) <= byteArray.length;
final int multiplyMax = Integer.MAX_VALUE / RADIX;
int result = 0;
for (int i = 0; i < length; ++i) {
if (result > multiplyMa... | [
"int",
"parseIntAt",
"(",
"final",
"int",
"fromIndex",
",",
"final",
"int",
"length",
")",
"{",
"assert",
"length",
">=",
"0",
";",
"assert",
"0",
"<=",
"fromIndex",
"&&",
"(",
"fromIndex",
"+",
"length",
")",
"<=",
"byteArray",
".",
"length",
";",
"fi... | Parses characters in the specified part of the byte buffer into an integer
This is a simplified version of {@link Integer#parseInt(String)}. It
operates directly on the byte data and works only for positive numbers and
a radix of 10.
@param fromIndex position fo the byte range to convert into an integer
@param length ... | [
"Parses",
"characters",
"in",
"the",
"specified",
"part",
"of",
"the",
"byte",
"buffer",
"into",
"an",
"integer",
"This",
"is",
"a",
"simplified",
"version",
"of",
"{",
"@link",
"Integer#parseInt",
"(",
"String",
")",
"}",
".",
"It",
"operates",
"directly",
... | train | https://github.com/metafacture/metafacture-core/blob/cb43933ec8eb01a4ddce4019c14b2415cc441918/metafacture-biblio/src/main/java/org/metafacture/biblio/iso2709/Iso646ByteBuffer.java#L201-L218 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionRendererModel.java | MapTileCollisionRendererModel.renderCollision | private static void renderCollision(Graphic g, CollisionFormula formula, int th, int x, int y) {
"""
Render collision from current vector.
@param g The graphic buffer.
@param formula The collision formula.
@param th The tile height.
@param x The current horizontal location.
@param y The current vertical loc... | java | private static void renderCollision(Graphic g, CollisionFormula formula, int th, int x, int y)
{
final CollisionFunction function = formula.getFunction();
final CollisionRange range = formula.getRange();
switch (range.getOutput())
{
case X:
renderX(... | [
"private",
"static",
"void",
"renderCollision",
"(",
"Graphic",
"g",
",",
"CollisionFormula",
"formula",
",",
"int",
"th",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"final",
"CollisionFunction",
"function",
"=",
"formula",
".",
"getFunction",
"(",
")",
"... | Render collision from current vector.
@param g The graphic buffer.
@param formula The collision formula.
@param th The tile height.
@param x The current horizontal location.
@param y The current vertical location. | [
"Render",
"collision",
"from",
"current",
"vector",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionRendererModel.java#L88-L103 |
fflewddur/hola | src/main/java/net/straylightlabs/hola/sd/Query.java | Query.createFor | @SuppressWarnings("unused")
public static Query createFor(Service service, Domain domain) {
"""
Create a Query for the given Service and Domain.
@param service service to search for
@param domain domain to search on
@return a new Query object
"""
return new Query(service, domain, BROWSING_TIM... | java | @SuppressWarnings("unused")
public static Query createFor(Service service, Domain domain) {
return new Query(service, domain, BROWSING_TIMEOUT);
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"public",
"static",
"Query",
"createFor",
"(",
"Service",
"service",
",",
"Domain",
"domain",
")",
"{",
"return",
"new",
"Query",
"(",
"service",
",",
"domain",
",",
"BROWSING_TIMEOUT",
")",
";",
"}"
] | Create a Query for the given Service and Domain.
@param service service to search for
@param domain domain to search on
@return a new Query object | [
"Create",
"a",
"Query",
"for",
"the",
"given",
"Service",
"and",
"Domain",
"."
] | train | https://github.com/fflewddur/hola/blob/08d9b9f3b807fd447181a5c1122f117a950db848/src/main/java/net/straylightlabs/hola/sd/Query.java#L82-L85 |
beanshell/beanshell | src/main/java/bsh/NameSpace.java | NameSpace.getPropertyValue | Object getPropertyValue(final String propName, final Interpreter interp)
throws UtilEvalError {
"""
Get a property from a scripted object or Primitive.VOID if no such
property exists.
@param propName the prop name
@param interp the interp
@return the property value
@throws UtilEvalError the util e... | java | Object getPropertyValue(final String propName, final Interpreter interp)
throws UtilEvalError {
String accessorName = Reflect.accessorName(Reflect.GET_PREFIX, propName);
final Class<?>[] classArray = Reflect.ZERO_TYPES;
BshMethod m = this.getMethod(accessorName, classArray);
... | [
"Object",
"getPropertyValue",
"(",
"final",
"String",
"propName",
",",
"final",
"Interpreter",
"interp",
")",
"throws",
"UtilEvalError",
"{",
"String",
"accessorName",
"=",
"Reflect",
".",
"accessorName",
"(",
"Reflect",
".",
"GET_PREFIX",
",",
"propName",
")",
... | Get a property from a scripted object or Primitive.VOID if no such
property exists.
@param propName the prop name
@param interp the interp
@return the property value
@throws UtilEvalError the util eval error | [
"Get",
"a",
"property",
"from",
"a",
"scripted",
"object",
"or",
"Primitive",
".",
"VOID",
"if",
"no",
"such",
"property",
"exists",
"."
] | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/NameSpace.java#L1401-L1418 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/constraint/HasAnID.java | HasAnID.satisfies | @Override
public boolean satisfies(Match match, int... ind) {
"""
Checks if the element has one of the desired IDs.
@param match current pattern match
@param ind mapped indices
@return true if the ID is in the list
"""
BioPAXElement ele = match.get(ind[0]);
if (!idMap.containsKey(ele))
idMap.put(el... | java | @Override
public boolean satisfies(Match match, int... ind)
{
BioPAXElement ele = match.get(ind[0]);
if (!idMap.containsKey(ele))
idMap.put(ele, idFetcher.fetchID(ele));
return idMap.get(ele) != null && !idMap.get(ele).isEmpty();
} | [
"@",
"Override",
"public",
"boolean",
"satisfies",
"(",
"Match",
"match",
",",
"int",
"...",
"ind",
")",
"{",
"BioPAXElement",
"ele",
"=",
"match",
".",
"get",
"(",
"ind",
"[",
"0",
"]",
")",
";",
"if",
"(",
"!",
"idMap",
".",
"containsKey",
"(",
"... | Checks if the element has one of the desired IDs.
@param match current pattern match
@param ind mapped indices
@return true if the ID is in the list | [
"Checks",
"if",
"the",
"element",
"has",
"one",
"of",
"the",
"desired",
"IDs",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/HasAnID.java#L51-L60 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/reflect/ReflectionUtils.java | ReflectionUtils.setField | public static void setField(Object obj, String fieldName, Object value) {
"""
Sets the field with the specified name on the given object to the given value. This method assumes the field
is an instance (object) member field.
@param obj the Object on which the field is defined.
@param fieldName a String indica... | java | public static void setField(Object obj, String fieldName, Object value) {
try {
setField(obj, getField(obj.getClass(), fieldName), value);
}
catch (FieldNotFoundException e) {
throw new IllegalArgumentException(String.format("Field with name (%1$s) does not exist on object of type (%2$s)!",
... | [
"public",
"static",
"void",
"setField",
"(",
"Object",
"obj",
",",
"String",
"fieldName",
",",
"Object",
"value",
")",
"{",
"try",
"{",
"setField",
"(",
"obj",
",",
"getField",
"(",
"obj",
".",
"getClass",
"(",
")",
",",
"fieldName",
")",
",",
"value",... | Sets the field with the specified name on the given object to the given value. This method assumes the field
is an instance (object) member field.
@param obj the Object on which the field is defined.
@param fieldName a String indicating the name of the field on which to set the value.
@param value the Object value to ... | [
"Sets",
"the",
"field",
"with",
"the",
"specified",
"name",
"on",
"the",
"given",
"object",
"to",
"the",
"given",
"value",
".",
"This",
"method",
"assumes",
"the",
"field",
"is",
"an",
"instance",
"(",
"object",
")",
"member",
"field",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/reflect/ReflectionUtils.java#L204-L212 |
lightblueseas/vintage-time | src/main/java/de/alpharogroup/date/CalculateDateExtensions.java | CalculateDateExtensions.addMilliseconds | public static Date addMilliseconds(final Date date, final int addMilliseconds) {
"""
Adds milliseconds to the given Date object and returns it. Note: you can add negative values
too for get date in past.
@param date
The Date object to add the milliseconds.
@param addMilliseconds
The milliseconds to add.
@r... | java | public static Date addMilliseconds(final Date date, final int addMilliseconds)
{
final Calendar dateOnCalendar = Calendar.getInstance();
dateOnCalendar.setTime(date);
dateOnCalendar.add(Calendar.MILLISECOND, addMilliseconds);
return dateOnCalendar.getTime();
} | [
"public",
"static",
"Date",
"addMilliseconds",
"(",
"final",
"Date",
"date",
",",
"final",
"int",
"addMilliseconds",
")",
"{",
"final",
"Calendar",
"dateOnCalendar",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"dateOnCalendar",
".",
"setTime",
"(",
"da... | Adds milliseconds to the given Date object and returns it. Note: you can add negative values
too for get date in past.
@param date
The Date object to add the milliseconds.
@param addMilliseconds
The milliseconds to add.
@return The resulted Date object. | [
"Adds",
"milliseconds",
"to",
"the",
"given",
"Date",
"object",
"and",
"returns",
"it",
".",
"Note",
":",
"you",
"can",
"add",
"negative",
"values",
"too",
"for",
"get",
"date",
"in",
"past",
"."
] | train | https://github.com/lightblueseas/vintage-time/blob/fbf201e679d9f9b92e7b5771f3eea1413cc2e113/src/main/java/de/alpharogroup/date/CalculateDateExtensions.java#L92-L98 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/MoveOnChangeHandler.java | MoveOnChangeHandler.init | public void init(BaseField field, Converter fldDest, Converter fldSource, boolean bClearIfThisNull, boolean bOnlyIfDestNull, boolean bDontMoveNull) {
"""
Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param fldDest The destination field.
@param fldSource Th... | java | public void init(BaseField field, Converter fldDest, Converter fldSource, boolean bClearIfThisNull, boolean bOnlyIfDestNull, boolean bDontMoveNull)
{
super.init(field);
this.setRespondsToMode(DBConstants.INIT_MOVE, false);
this.setRespondsToMode(DBConstants.READ_MOVE, false); // By default, ... | [
"public",
"void",
"init",
"(",
"BaseField",
"field",
",",
"Converter",
"fldDest",
",",
"Converter",
"fldSource",
",",
"boolean",
"bClearIfThisNull",
",",
"boolean",
"bOnlyIfDestNull",
",",
"boolean",
"bDontMoveNull",
")",
"{",
"super",
".",
"init",
"(",
"field",... | Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param fldDest The destination field.
@param fldSource The source field.
@param bClearIfThisNull If this listener's owner is set to null, set the destination field to null.
@param bOnlyIfDestNull Move only if the destin... | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/MoveOnChangeHandler.java#L109-L119 |
fozziethebeat/S-Space | src/main/java/org/tartarus/snowball/SnowballProgram.java | SnowballProgram.replace_s | protected int replace_s(int c_bra, int c_ket, String s) {
"""
/* to replace chars between c_bra and c_ket in current by the
chars in s.
"""
int adjustment = s.length() - (c_ket - c_bra);
current.replace(c_bra, c_ket, s);
limit += adjustment;
if (cursor >= c_ket) cursor += adjustment;
else if (cursor > c_... | java | protected int replace_s(int c_bra, int c_ket, String s)
{
int adjustment = s.length() - (c_ket - c_bra);
current.replace(c_bra, c_ket, s);
limit += adjustment;
if (cursor >= c_ket) cursor += adjustment;
else if (cursor > c_bra) cursor = c_bra;
return adjustment;
} | [
"protected",
"int",
"replace_s",
"(",
"int",
"c_bra",
",",
"int",
"c_ket",
",",
"String",
"s",
")",
"{",
"int",
"adjustment",
"=",
"s",
".",
"length",
"(",
")",
"-",
"(",
"c_ket",
"-",
"c_bra",
")",
";",
"current",
".",
"replace",
"(",
"c_bra",
","... | /* to replace chars between c_bra and c_ket in current by the
chars in s. | [
"/",
"*",
"to",
"replace",
"chars",
"between",
"c_bra",
"and",
"c_ket",
"in",
"current",
"by",
"the",
"chars",
"in",
"s",
"."
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/org/tartarus/snowball/SnowballProgram.java#L325-L333 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/optimize/listeners/CheckpointListener.java | CheckpointListener.availableCheckpoints | public static List<Checkpoint> availableCheckpoints(File directory) {
"""
List all available checkpoints. A checkpoint is 'available' if the file can be loaded. Any checkpoint files that
have been automatically deleted (given the configuration) will not be returned here.
Note that the checkpointInfo.txt file mus... | java | public static List<Checkpoint> availableCheckpoints(File directory){
File checkpointRecordFile = new File(directory, "checkpointInfo.txt");
Preconditions.checkState(checkpointRecordFile.exists(), "Could not find checkpoint record file at expected path %s", checkpointRecordFile.getAbsolutePath());
... | [
"public",
"static",
"List",
"<",
"Checkpoint",
">",
"availableCheckpoints",
"(",
"File",
"directory",
")",
"{",
"File",
"checkpointRecordFile",
"=",
"new",
"File",
"(",
"directory",
",",
"\"checkpointInfo.txt\"",
")",
";",
"Preconditions",
".",
"checkState",
"(",
... | List all available checkpoints. A checkpoint is 'available' if the file can be loaded. Any checkpoint files that
have been automatically deleted (given the configuration) will not be returned here.
Note that the checkpointInfo.txt file must exist, as this stores checkpoint information
@return List of checkpoint files ... | [
"List",
"all",
"available",
"checkpoints",
".",
"A",
"checkpoint",
"is",
"available",
"if",
"the",
"file",
"can",
"be",
"loaded",
".",
"Any",
"checkpoint",
"files",
"that",
"have",
"been",
"automatically",
"deleted",
"(",
"given",
"the",
"configuration",
")",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/optimize/listeners/CheckpointListener.java#L348-L367 |
elki-project/elki | elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/APRIORI.java | APRIORI.nextSearchItemset | private boolean nextSearchItemset(BitVector bv, int[] scratchi, int[] iters) {
"""
Advance scratch itemset to the next.
@param bv Bit vector data source
@param scratchi Scratch itemset
@param iters Iterator array
@return {@code true} if the itemset had minimum length
"""
final int last = scratchi.len... | java | private boolean nextSearchItemset(BitVector bv, int[] scratchi, int[] iters) {
final int last = scratchi.length - 1;
for(int j = last; j >= 0; j--) {
int n = bv.iterAdvance(iters[j]);
if(n >= 0 && (j == last || n != iters[j + 1])) {
iters[j] = n;
scratchi[j] = bv.iterDim(n);
... | [
"private",
"boolean",
"nextSearchItemset",
"(",
"BitVector",
"bv",
",",
"int",
"[",
"]",
"scratchi",
",",
"int",
"[",
"]",
"iters",
")",
"{",
"final",
"int",
"last",
"=",
"scratchi",
".",
"length",
"-",
"1",
";",
"for",
"(",
"int",
"j",
"=",
"last",
... | Advance scratch itemset to the next.
@param bv Bit vector data source
@param scratchi Scratch itemset
@param iters Iterator array
@return {@code true} if the itemset had minimum length | [
"Advance",
"scratch",
"itemset",
"to",
"the",
"next",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/APRIORI.java#L519-L530 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java | TypeAnnotationPosition.classExtends | public static TypeAnnotationPosition
classExtends(final List<TypePathEntry> location,
final int type_index) {
"""
Create a {@code TypeAnnotationPosition} for a class extension.
@param location The type path.
@param type_index The index of the interface.
"""
return class... | java | public static TypeAnnotationPosition
classExtends(final List<TypePathEntry> location,
final int type_index) {
return classExtends(location, null, type_index, -1);
} | [
"public",
"static",
"TypeAnnotationPosition",
"classExtends",
"(",
"final",
"List",
"<",
"TypePathEntry",
">",
"location",
",",
"final",
"int",
"type_index",
")",
"{",
"return",
"classExtends",
"(",
"location",
",",
"null",
",",
"type_index",
",",
"-",
"1",
")... | Create a {@code TypeAnnotationPosition} for a class extension.
@param location The type path.
@param type_index The index of the interface. | [
"Create",
"a",
"{",
"@code",
"TypeAnnotationPosition",
"}",
"for",
"a",
"class",
"extension",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java#L801-L805 |
nemerosa/ontrack | ontrack-model/src/main/java/net/nemerosa/ontrack/model/structure/ValidationStampRunView.java | ValidationStampRunView.hasValidationStamp | public boolean hasValidationStamp(String name, String status) {
"""
Checks if the validation run view has the given validation stamp with the given status.
"""
return (StringUtils.equals(name, getValidationStamp().getName()))
&& isRun()
&& (
StringUtils.i... | java | public boolean hasValidationStamp(String name, String status) {
return (StringUtils.equals(name, getValidationStamp().getName()))
&& isRun()
&& (
StringUtils.isBlank(status)
|| StringUtils.equals(status, getLastStatus().getStatusID().getId(... | [
"public",
"boolean",
"hasValidationStamp",
"(",
"String",
"name",
",",
"String",
"status",
")",
"{",
"return",
"(",
"StringUtils",
".",
"equals",
"(",
"name",
",",
"getValidationStamp",
"(",
")",
".",
"getName",
"(",
")",
")",
")",
"&&",
"isRun",
"(",
")... | Checks if the validation run view has the given validation stamp with the given status. | [
"Checks",
"if",
"the",
"validation",
"run",
"view",
"has",
"the",
"given",
"validation",
"stamp",
"with",
"the",
"given",
"status",
"."
] | train | https://github.com/nemerosa/ontrack/blob/37b0874cbf387b58aba95cd3c1bc3b15e11bc913/ontrack-model/src/main/java/net/nemerosa/ontrack/model/structure/ValidationStampRunView.java#L52-L59 |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/Cartographer.java | Cartographer.toJson | public String toJson(Map<?, ?> map) {
"""
Serializes the map into it's json representation and returns it as a String. If you want to
write the json to {@link Writer} instead of retrieving it as a String, use {@link #toJson(Map,
Writer)} instead.
"""
StringWriter stringWriter = new StringWriter();
tr... | java | public String toJson(Map<?, ?> map) {
StringWriter stringWriter = new StringWriter();
try {
toJson(map, stringWriter);
} catch (IOException e) {
throw new AssertionError(e); // No I/O writing to a Buffer.
}
return stringWriter.toString();
} | [
"public",
"String",
"toJson",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
")",
"{",
"StringWriter",
"stringWriter",
"=",
"new",
"StringWriter",
"(",
")",
";",
"try",
"{",
"toJson",
"(",
"map",
",",
"stringWriter",
")",
";",
"}",
"catch",
"(",
"IOExce... | Serializes the map into it's json representation and returns it as a String. If you want to
write the json to {@link Writer} instead of retrieving it as a String, use {@link #toJson(Map,
Writer)} instead. | [
"Serializes",
"the",
"map",
"into",
"it",
"s",
"json",
"representation",
"and",
"returns",
"it",
"as",
"a",
"String",
".",
"If",
"you",
"want",
"to",
"write",
"the",
"json",
"to",
"{"
] | train | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/Cartographer.java#L91-L99 |
jeremylong/DependencyCheck | utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java | Settings.setString | public void setString(@NotNull final String key, @NotNull final String value) {
"""
Sets a property value.
@param key the key for the property
@param value the value for the property
"""
props.setProperty(key, value);
LOGGER.debug("Setting: {}='{}'", key, value);
} | java | public void setString(@NotNull final String key, @NotNull final String value) {
props.setProperty(key, value);
LOGGER.debug("Setting: {}='{}'", key, value);
} | [
"public",
"void",
"setString",
"(",
"@",
"NotNull",
"final",
"String",
"key",
",",
"@",
"NotNull",
"final",
"String",
"value",
")",
"{",
"props",
".",
"setProperty",
"(",
"key",
",",
"value",
")",
";",
"LOGGER",
".",
"debug",
"(",
"\"Setting: {}='{}'\"",
... | Sets a property value.
@param key the key for the property
@param value the value for the property | [
"Sets",
"a",
"property",
"value",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java#L665-L668 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/spider/SpiderAPI.java | SpiderAPI.getSpiderScan | private GenericScanner2 getSpiderScan(JSONObject params) throws ApiException {
"""
Returns the specified GenericScanner2 or the last scan available.
@param params the parameters of the API call
@return the GenericScanner2 with the given scan ID or, if not present, the last scan available
@throws ApiException ... | java | private GenericScanner2 getSpiderScan(JSONObject params) throws ApiException {
GenericScanner2 spiderScan;
int id = getParam(params, PARAM_SCAN_ID, -1);
if (id == -1) {
spiderScan = extension.getLastScan();
} else {
spiderScan = extension.getScan(id);
}
if (spiderScan == null) {
throw new ApiExcep... | [
"private",
"GenericScanner2",
"getSpiderScan",
"(",
"JSONObject",
"params",
")",
"throws",
"ApiException",
"{",
"GenericScanner2",
"spiderScan",
";",
"int",
"id",
"=",
"getParam",
"(",
"params",
",",
"PARAM_SCAN_ID",
",",
"-",
"1",
")",
";",
"if",
"(",
"id",
... | Returns the specified GenericScanner2 or the last scan available.
@param params the parameters of the API call
@return the GenericScanner2 with the given scan ID or, if not present, the last scan available
@throws ApiException if there's no scan with the given scan ID
@see #PARAM_SCAN_ID | [
"Returns",
"the",
"specified",
"GenericScanner2",
"or",
"the",
"last",
"scan",
"available",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/spider/SpiderAPI.java#L417-L431 |
skyscreamer/JSONassert | src/main/java/org/skyscreamer/jsonassert/JSONCompare.java | JSONCompare.compareJson | public static JSONCompareResult compareJson(final JSONString expected, final JSONString actual) {
"""
Compares {@link JSONString} provided to the expected {@code JSONString}, checking that the
{@link org.json.JSONString#toJSONString()} are equal.
@param expected Expected {@code JSONstring}
@param actual {@c... | java | public static JSONCompareResult compareJson(final JSONString expected, final JSONString actual) {
final JSONCompareResult result = new JSONCompareResult();
final String expectedJson = expected.toJSONString();
final String actualJson = actual.toJSONString();
if (!expectedJson.equals(actua... | [
"public",
"static",
"JSONCompareResult",
"compareJson",
"(",
"final",
"JSONString",
"expected",
",",
"final",
"JSONString",
"actual",
")",
"{",
"final",
"JSONCompareResult",
"result",
"=",
"new",
"JSONCompareResult",
"(",
")",
";",
"final",
"String",
"expectedJson",... | Compares {@link JSONString} provided to the expected {@code JSONString}, checking that the
{@link org.json.JSONString#toJSONString()} are equal.
@param expected Expected {@code JSONstring}
@param actual {@code JSONstring} to compare
@return result of the comparison | [
"Compares",
"{",
"@link",
"JSONString",
"}",
"provided",
"to",
"the",
"expected",
"{",
"@code",
"JSONString",
"}",
"checking",
"that",
"the",
"{",
"@link",
"org",
".",
"json",
".",
"JSONString#toJSONString",
"()",
"}",
"are",
"equal",
"."
] | train | https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/JSONCompare.java#L104-L112 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.