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 |
|---|---|---|---|---|---|---|---|---|---|---|
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnszone_binding.java | dnszone_binding.get | public static dnszone_binding get(nitro_service service, String zonename) throws Exception {
"""
Use this API to fetch dnszone_binding resource of given name .
"""
dnszone_binding obj = new dnszone_binding();
obj.set_zonename(zonename);
dnszone_binding response = (dnszone_binding) obj.get_resource(servic... | java | public static dnszone_binding get(nitro_service service, String zonename) throws Exception{
dnszone_binding obj = new dnszone_binding();
obj.set_zonename(zonename);
dnszone_binding response = (dnszone_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"dnszone_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"zonename",
")",
"throws",
"Exception",
"{",
"dnszone_binding",
"obj",
"=",
"new",
"dnszone_binding",
"(",
")",
";",
"obj",
".",
"set_zonename",
"(",
"zonename",
")",
... | Use this API to fetch dnszone_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"dnszone_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnszone_binding.java#L103-L108 |
twilio/twilio-java | src/main/java/com/twilio/rest/trunking/v1/trunk/PhoneNumberReader.java | PhoneNumberReader.nextPage | @Override
public Page<PhoneNumber> nextPage(final Page<PhoneNumber> page,
final TwilioRestClient client) {
"""
Retrieve the next page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Next Page
"""... | java | @Override
public Page<PhoneNumber> nextPage(final Page<PhoneNumber> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getNextPageUrl(
Domains.TRUNKING.toString(),
client.ge... | [
"@",
"Override",
"public",
"Page",
"<",
"PhoneNumber",
">",
"nextPage",
"(",
"final",
"Page",
"<",
"PhoneNumber",
">",
"page",
",",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET",
... | Retrieve the next page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Next Page | [
"Retrieve",
"the",
"next",
"page",
"from",
"the",
"Twilio",
"API",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/trunking/v1/trunk/PhoneNumberReader.java#L91-L102 |
zutnop/telekom-workflow-engine | telekom-workflow-engine/src/main/java/ee/telekom/workflow/graph/el/ElUtil.java | ElUtil.initNewELProcessor | public static ELProcessor initNewELProcessor( Environment environment, Long externalInstanceId ) {
"""
Creates and prepares a new ELProcessor instance with workflow engine configuration to evaluate expressions on
workflow instance environment together with some additional features (NOW variable, WORKFLOW_INSTANCE... | java | public static ELProcessor initNewELProcessor( Environment environment, Long externalInstanceId ){
ELProcessor processor = new ELProcessor();
processor.getELManager().addBeanNameResolver( new EnvironmentBeanNameResolver( environment ) );
processor.setValue( ReservedVariables.NOW, new Date() );
... | [
"public",
"static",
"ELProcessor",
"initNewELProcessor",
"(",
"Environment",
"environment",
",",
"Long",
"externalInstanceId",
")",
"{",
"ELProcessor",
"processor",
"=",
"new",
"ELProcessor",
"(",
")",
";",
"processor",
".",
"getELManager",
"(",
")",
".",
"addBean... | Creates and prepares a new ELProcessor instance with workflow engine configuration to evaluate expressions on
workflow instance environment together with some additional features (NOW variable, WORKFLOW_INSTANCE_ID variable).
The ELProcessor instance is meant to be used "quickly" only for current task execution/evalua... | [
"Creates",
"and",
"prepares",
"a",
"new",
"ELProcessor",
"instance",
"with",
"workflow",
"engine",
"configuration",
"to",
"evaluate",
"expressions",
"on",
"workflow",
"instance",
"environment",
"together",
"with",
"some",
"additional",
"features",
"(",
"NOW",
"varia... | train | https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/graph/el/ElUtil.java#L43-L49 |
apache/flink | flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/table/descriptors/Kafka.java | Kafka.startFromSpecificOffset | public Kafka startFromSpecificOffset(int partition, long specificOffset) {
"""
Configures to start reading partitions from specific offsets and specifies the given offset for
the given partition.
@param partition partition index
@param specificOffset partition offset to start reading from
@see FlinkKafkaCons... | java | public Kafka startFromSpecificOffset(int partition, long specificOffset) {
this.startupMode = StartupMode.SPECIFIC_OFFSETS;
if (this.specificOffsets == null) {
this.specificOffsets = new HashMap<>();
}
this.specificOffsets.put(partition, specificOffset);
return this;
} | [
"public",
"Kafka",
"startFromSpecificOffset",
"(",
"int",
"partition",
",",
"long",
"specificOffset",
")",
"{",
"this",
".",
"startupMode",
"=",
"StartupMode",
".",
"SPECIFIC_OFFSETS",
";",
"if",
"(",
"this",
".",
"specificOffsets",
"==",
"null",
")",
"{",
"th... | Configures to start reading partitions from specific offsets and specifies the given offset for
the given partition.
@param partition partition index
@param specificOffset partition offset to start reading from
@see FlinkKafkaConsumerBase#setStartFromSpecificOffsets(Map) | [
"Configures",
"to",
"start",
"reading",
"partitions",
"from",
"specific",
"offsets",
"and",
"specifies",
"the",
"given",
"offset",
"for",
"the",
"given",
"partition",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/table/descriptors/Kafka.java#L177-L184 |
datacleaner/DataCleaner | engine/core/src/main/java/org/datacleaner/job/runner/ConsumeRowHandler.java | ConsumeRowHandler.consumeRow | public ConsumeRowResult consumeRow(final InputRow row) {
"""
Consumes a {@link InputRow} by applying all transformations etc. to it,
returning a result of transformed rows and their {@link FilterOutcomes}s.
@param row
@return
"""
final FilterOutcomes outcomes = new FilterOutcomesImpl(_alwaysSatisf... | java | public ConsumeRowResult consumeRow(final InputRow row) {
final FilterOutcomes outcomes = new FilterOutcomesImpl(_alwaysSatisfiedOutcomes);
final ConsumeRowHandlerDelegate delegate = new ConsumeRowHandlerDelegate(_consumers, row, 0, outcomes);
return delegate.consume();
} | [
"public",
"ConsumeRowResult",
"consumeRow",
"(",
"final",
"InputRow",
"row",
")",
"{",
"final",
"FilterOutcomes",
"outcomes",
"=",
"new",
"FilterOutcomesImpl",
"(",
"_alwaysSatisfiedOutcomes",
")",
";",
"final",
"ConsumeRowHandlerDelegate",
"delegate",
"=",
"new",
"Co... | Consumes a {@link InputRow} by applying all transformations etc. to it,
returning a result of transformed rows and their {@link FilterOutcomes}s.
@param row
@return | [
"Consumes",
"a",
"{",
"@link",
"InputRow",
"}",
"by",
"applying",
"all",
"transformations",
"etc",
".",
"to",
"it",
"returning",
"a",
"result",
"of",
"transformed",
"rows",
"and",
"their",
"{",
"@link",
"FilterOutcomes",
"}",
"s",
"."
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/engine/core/src/main/java/org/datacleaner/job/runner/ConsumeRowHandler.java#L142-L146 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.injectBeanMethod | @Internal
@SuppressWarnings("WeakerAccess")
protected void injectBeanMethod(BeanResolutionContext resolutionContext, DefaultBeanContext context, int methodIndex, Object bean) {
"""
Inject a bean method that requires reflection.
@param resolutionContext The resolution context
@param context Th... | java | @Internal
@SuppressWarnings("WeakerAccess")
protected void injectBeanMethod(BeanResolutionContext resolutionContext, DefaultBeanContext context, int methodIndex, Object bean) {
MethodInjectionPoint methodInjectionPoint = methodInjectionPoints.get(methodIndex);
Argument[] methodArgumentTypes = me... | [
"@",
"Internal",
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"protected",
"void",
"injectBeanMethod",
"(",
"BeanResolutionContext",
"resolutionContext",
",",
"DefaultBeanContext",
"context",
",",
"int",
"methodIndex",
",",
"Object",
"bean",
")",
"{",
"Metho... | Inject a bean method that requires reflection.
@param resolutionContext The resolution context
@param context The bean context
@param methodIndex The method index
@param bean The bean | [
"Inject",
"a",
"bean",
"method",
"that",
"requires",
"reflection",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L682-L696 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/core/bind/BindUploader.java | BindUploader.isArrayBind | public static boolean isArrayBind(Map<String, ParameterBindingDTO> bindValues) {
"""
Return whether the bind map uses array binds
@param bindValues the bind map
@return whether the bind map uses array binds
"""
if (bindValues == null || bindValues.size() == 0)
{
return false;
}
Parame... | java | public static boolean isArrayBind(Map<String, ParameterBindingDTO> bindValues)
{
if (bindValues == null || bindValues.size() == 0)
{
return false;
}
ParameterBindingDTO bindSample = bindValues.values().iterator().next();
return bindSample.getValue() instanceof List;
} | [
"public",
"static",
"boolean",
"isArrayBind",
"(",
"Map",
"<",
"String",
",",
"ParameterBindingDTO",
">",
"bindValues",
")",
"{",
"if",
"(",
"bindValues",
"==",
"null",
"||",
"bindValues",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return",
"false",
";... | Return whether the bind map uses array binds
@param bindValues the bind map
@return whether the bind map uses array binds | [
"Return",
"whether",
"the",
"bind",
"map",
"uses",
"array",
"binds"
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/bind/BindUploader.java#L588-L596 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.virtualNetworkInterface_uuid_GET | public OvhVirtualNetworkInterface virtualNetworkInterface_uuid_GET(String uuid) throws IOException {
"""
Get VirtualNetworkInterface details
REST: GET /dedicated/server/virtualNetworkInterface/{uuid}
@param uuid [required] VirtualNetworkInterface uuid
"""
String qPath = "/dedicated/server/virtualNetworkI... | java | public OvhVirtualNetworkInterface virtualNetworkInterface_uuid_GET(String uuid) throws IOException {
String qPath = "/dedicated/server/virtualNetworkInterface/{uuid}";
StringBuilder sb = path(qPath, uuid);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhVirtualNetworkInterface.c... | [
"public",
"OvhVirtualNetworkInterface",
"virtualNetworkInterface_uuid_GET",
"(",
"String",
"uuid",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/virtualNetworkInterface/{uuid}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
... | Get VirtualNetworkInterface details
REST: GET /dedicated/server/virtualNetworkInterface/{uuid}
@param uuid [required] VirtualNetworkInterface uuid | [
"Get",
"VirtualNetworkInterface",
"details"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L151-L156 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/wsspi/http/channel/compression/GzipOutputHandler.java | GzipOutputHandler.writeInt | private void writeInt(int value, byte[] data, int offset) {
"""
Write an integer into the output space, starting at the input offset.
@param value
@param data
@param offset
"""
int index = offset;
data[index++] = (byte) (value & 0xff);
data[index++] = (byte) ((value >> 8) & 0xff);
... | java | private void writeInt(int value, byte[] data, int offset) {
int index = offset;
data[index++] = (byte) (value & 0xff);
data[index++] = (byte) ((value >> 8) & 0xff);
data[index++] = (byte) ((value >> 16) & 0xff);
data[index++] = (byte) ((value >> 24) & 0xff);
} | [
"private",
"void",
"writeInt",
"(",
"int",
"value",
",",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"{",
"int",
"index",
"=",
"offset",
";",
"data",
"[",
"index",
"++",
"]",
"=",
"(",
"byte",
")",
"(",
"value",
"&",
"0xff",
")",
";",
... | Write an integer into the output space, starting at the input offset.
@param value
@param data
@param offset | [
"Write",
"an",
"integer",
"into",
"the",
"output",
"space",
"starting",
"at",
"the",
"input",
"offset",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/wsspi/http/channel/compression/GzipOutputHandler.java#L287-L293 |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/CommonOps_ZDRM.java | CommonOps_ZDRM.multAddTransB | public static void multAddTransB(ZMatrixRMaj a , ZMatrixRMaj b , ZMatrixRMaj c ) {
"""
<p>
Performs the following operation:<br>
<br>
c = c + a * b<sup>H</sup> <br>
c<sub>ij</sub> = c<sub>ij</sub> + ∑<sub>k=1:n</sub> { a<sub>ik</sub> * b<sub>jk</sub>}
</p>
@param a The left matrix in the multiplication... | java | public static void multAddTransB(ZMatrixRMaj a , ZMatrixRMaj b , ZMatrixRMaj c )
{
MatrixMatrixMult_ZDRM.multAddTransB(a,b,c);
} | [
"public",
"static",
"void",
"multAddTransB",
"(",
"ZMatrixRMaj",
"a",
",",
"ZMatrixRMaj",
"b",
",",
"ZMatrixRMaj",
"c",
")",
"{",
"MatrixMatrixMult_ZDRM",
".",
"multAddTransB",
"(",
"a",
",",
"b",
",",
"c",
")",
";",
"}"
] | <p>
Performs the following operation:<br>
<br>
c = c + a * b<sup>H</sup> <br>
c<sub>ij</sub> = c<sub>ij</sub> + ∑<sub>k=1:n</sub> { a<sub>ik</sub> * b<sub>jk</sub>}
</p>
@param a The left matrix in the multiplication operation. Not modified.
@param b The right matrix in the multiplication operation. Not modified.
... | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"c",
"=",
"c",
"+",
"a",
"*",
"b<sup",
">",
"H<",
"/",
"sup",
">",
"<br",
">",
"c<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"c<sub",
">",
"ij<",
"/",
"sub",
">... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/CommonOps_ZDRM.java#L631-L634 |
FaritorKang/unmz-common-util | src/main/java/net/unmz/java/util/security/MD5Utils.java | MD5Utils.sign | public static String sign(String text, String key, String input_charset) {
"""
签名字符串
@param text 需要签名的字符串
@param key 密钥
@param input_charset 编码格式
@return 签名结果
"""
text = text + key;
return DigestUtils.md5Hex(getContentBytes(text, input_charset));
} | java | public static String sign(String text, String key, String input_charset) {
text = text + key;
return DigestUtils.md5Hex(getContentBytes(text, input_charset));
} | [
"public",
"static",
"String",
"sign",
"(",
"String",
"text",
",",
"String",
"key",
",",
"String",
"input_charset",
")",
"{",
"text",
"=",
"text",
"+",
"key",
";",
"return",
"DigestUtils",
".",
"md5Hex",
"(",
"getContentBytes",
"(",
"text",
",",
"input_char... | 签名字符串
@param text 需要签名的字符串
@param key 密钥
@param input_charset 编码格式
@return 签名结果 | [
"签名字符串"
] | train | https://github.com/FaritorKang/unmz-common-util/blob/2912b8889b85ed910d536f85b24b6fa68035814a/src/main/java/net/unmz/java/util/security/MD5Utils.java#L135-L138 |
google/identity-toolkit-java-client | src/main/java/com/google/identitytoolkit/GitkitClient.java | GitkitClient.uploadUsers | public void uploadUsers(String hashAlgorithm, byte[] hashKey, List<GitkitUser> users)
throws GitkitServerException, GitkitClientException {
"""
Uploads multiple user accounts to Gitkit server.
@param hashAlgorithm hash algorithm. Supported values are HMAC_SHA256, HMAC_SHA1, HMAC_MD5,
PBKDF_SHA1, MD5 and ... | java | public void uploadUsers(String hashAlgorithm, byte[] hashKey, List<GitkitUser> users)
throws GitkitServerException, GitkitClientException {
uploadUsers(hashAlgorithm, hashKey, users, null, null, null);
} | [
"public",
"void",
"uploadUsers",
"(",
"String",
"hashAlgorithm",
",",
"byte",
"[",
"]",
"hashKey",
",",
"List",
"<",
"GitkitUser",
">",
"users",
")",
"throws",
"GitkitServerException",
",",
"GitkitClientException",
"{",
"uploadUsers",
"(",
"hashAlgorithm",
",",
... | Uploads multiple user accounts to Gitkit server.
@param hashAlgorithm hash algorithm. Supported values are HMAC_SHA256, HMAC_SHA1, HMAC_MD5,
PBKDF_SHA1, MD5 and SCRYPT.
@param hashKey key of hash algorithm
@param users list of user accounts to be uploaded
@throws GitkitClientException for invalid request
@throws Gitki... | [
"Uploads",
"multiple",
"user",
"accounts",
"to",
"Gitkit",
"server",
"."
] | train | https://github.com/google/identity-toolkit-java-client/blob/61dda1aabbd541ad5e431e840fd266bfca5f8a4a/src/main/java/com/google/identitytoolkit/GitkitClient.java#L389-L392 |
couchbase/CouchbaseMock | src/main/java/com/couchbase/mock/JsonUtils.java | JsonUtils.decodeAsMap | @SuppressWarnings("unchecked")
public static Map<String,Object> decodeAsMap(String json) {
"""
Decode a JSON string as Java map. The string must represent a JSON Object
@param json The JSON to decode
@return a map representing the JSON Object
"""
return decode(json, HashMap.class);
} | java | @SuppressWarnings("unchecked")
public static Map<String,Object> decodeAsMap(String json) {
return decode(json, HashMap.class);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"decodeAsMap",
"(",
"String",
"json",
")",
"{",
"return",
"decode",
"(",
"json",
",",
"HashMap",
".",
"class",
")",
";",
"}"
] | Decode a JSON string as Java map. The string must represent a JSON Object
@param json The JSON to decode
@return a map representing the JSON Object | [
"Decode",
"a",
"JSON",
"string",
"as",
"Java",
"map",
".",
"The",
"string",
"must",
"represent",
"a",
"JSON",
"Object"
] | train | https://github.com/couchbase/CouchbaseMock/blob/2085bbebade1d5b6356480e7bf335139d08383da/src/main/java/com/couchbase/mock/JsonUtils.java#L64-L67 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getImploded | @Nonnull
public static <KEYTYPE, VALUETYPE> String getImploded (final char cSepOuter,
final char cSepInner,
@Nullable final Map <KEYTYPE, VALUETYPE> aElements) {
"""
Get a concatenated String from al... | java | @Nonnull
public static <KEYTYPE, VALUETYPE> String getImploded (final char cSepOuter,
final char cSepInner,
@Nullable final Map <KEYTYPE, VALUETYPE> aElements)
{
return getImplodedMapped (cSepOuter,... | [
"@",
"Nonnull",
"public",
"static",
"<",
"KEYTYPE",
",",
"VALUETYPE",
">",
"String",
"getImploded",
"(",
"final",
"char",
"cSepOuter",
",",
"final",
"char",
"cSepInner",
",",
"@",
"Nullable",
"final",
"Map",
"<",
"KEYTYPE",
",",
"VALUETYPE",
">",
"aElements"... | Get a concatenated String from all elements of the passed map, separated by
the specified separator chars.
@param cSepOuter
The separator to use for separating the map entries.
@param cSepInner
The separator to use for separating the key from the value.
@param aElements
The map to convert. May be <code>null</code> or ... | [
"Get",
"a",
"concatenated",
"String",
"from",
"all",
"elements",
"of",
"the",
"passed",
"map",
"separated",
"by",
"the",
"specified",
"separator",
"chars",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L1059-L1065 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF5.java | CommonOps_DDF5.addEquals | public static void addEquals( DMatrix5 a , DMatrix5 b ) {
"""
<p>Performs the following operation:<br>
<br>
a = a + b <br>
a<sub>i</sub> = a<sub>i</sub> + b<sub>i</sub> <br>
</p>
@param a A Vector. Modified.
@param b A Vector. Not modified.
"""
a.a1 += b.a1;
a.a2 += b.a2;
a.a3 +... | java | public static void addEquals( DMatrix5 a , DMatrix5 b ) {
a.a1 += b.a1;
a.a2 += b.a2;
a.a3 += b.a3;
a.a4 += b.a4;
a.a5 += b.a5;
} | [
"public",
"static",
"void",
"addEquals",
"(",
"DMatrix5",
"a",
",",
"DMatrix5",
"b",
")",
"{",
"a",
".",
"a1",
"+=",
"b",
".",
"a1",
";",
"a",
".",
"a2",
"+=",
"b",
".",
"a2",
";",
"a",
".",
"a3",
"+=",
"b",
".",
"a3",
";",
"a",
".",
"a4",
... | <p>Performs the following operation:<br>
<br>
a = a + b <br>
a<sub>i</sub> = a<sub>i</sub> + b<sub>i</sub> <br>
</p>
@param a A Vector. Modified.
@param b A Vector. Not modified. | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"a",
"=",
"a",
"+",
"b",
"<br",
">",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"+",
"b<sub",
">",
"i<",
"/",
"sub",
">",... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF5.java#L146-L152 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/internal/DefaultReentrantTypeResolver.java | DefaultReentrantTypeResolver.getInvalidWritableVariableAccessMessage | protected String getInvalidWritableVariableAccessMessage(XVariableDeclaration variable, XAbstractFeatureCall featureCall, IResolvedTypes resolvedTypes) {
"""
Provide the error message for mutable variables that may not be captured in lambdas.
@param variable the writable variable declaration
@param featureCall... | java | protected String getInvalidWritableVariableAccessMessage(XVariableDeclaration variable, XAbstractFeatureCall featureCall, IResolvedTypes resolvedTypes) {
// TODO this should be part of a separate validation service
XClosure containingClosure = EcoreUtil2.getContainerOfType(featureCall, XClosure.class);
if (contai... | [
"protected",
"String",
"getInvalidWritableVariableAccessMessage",
"(",
"XVariableDeclaration",
"variable",
",",
"XAbstractFeatureCall",
"featureCall",
",",
"IResolvedTypes",
"resolvedTypes",
")",
"{",
"// TODO this should be part of a separate validation service",
"XClosure",
"contai... | Provide the error message for mutable variables that may not be captured in lambdas.
@param variable the writable variable declaration
@param featureCall the reference to the variable
@param resolvedTypes type information | [
"Provide",
"the",
"error",
"message",
"for",
"mutable",
"variables",
"that",
"may",
"not",
"be",
"captured",
"in",
"lambdas",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/internal/DefaultReentrantTypeResolver.java#L208-L215 |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/resolution/UnresolvedBindingValidator.java | UnresolvedBindingValidator.pruneInvalidOptional | public void pruneInvalidOptional(DependencyExplorerOutput output, InvalidKeys invalidKeys) {
"""
Prune all of the invalid optional keys from the graph. After this method, all of the keys
remaining in the graph are resolvable.
"""
DependencyGraph.GraphPruner prunedGraph = new DependencyGraph.GraphPrune... | java | public void pruneInvalidOptional(DependencyExplorerOutput output, InvalidKeys invalidKeys) {
DependencyGraph.GraphPruner prunedGraph = new DependencyGraph.GraphPruner(output.getGraph());
for (Key<?> key : invalidKeys.getInvalidOptionalKeys()) {
prunedGraph.remove(key);
output.removeBinding(key);
... | [
"public",
"void",
"pruneInvalidOptional",
"(",
"DependencyExplorerOutput",
"output",
",",
"InvalidKeys",
"invalidKeys",
")",
"{",
"DependencyGraph",
".",
"GraphPruner",
"prunedGraph",
"=",
"new",
"DependencyGraph",
".",
"GraphPruner",
"(",
"output",
".",
"getGraph",
"... | Prune all of the invalid optional keys from the graph. After this method, all of the keys
remaining in the graph are resolvable. | [
"Prune",
"all",
"of",
"the",
"invalid",
"optional",
"keys",
"from",
"the",
"graph",
".",
"After",
"this",
"method",
"all",
"of",
"the",
"keys",
"remaining",
"in",
"the",
"graph",
"are",
"resolvable",
"."
] | train | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/resolution/UnresolvedBindingValidator.java#L110-L117 |
looly/hutool | hutool-json/src/main/java/cn/hutool/json/JSONUtil.java | JSONUtil.parseObj | public static JSONObject parseObj(Object obj, boolean ignoreNullValue, boolean isOrder) {
"""
JSON字符串转JSONObject对象
@param obj Bean对象或者Map
@param ignoreNullValue 是否忽略空值,如果source为JSON字符串,不忽略空值
@param isOrder 是否有序
@return JSONObject
@since 4.2.2
"""
return new JSONObject(obj, ignoreNullValue, isOrder);
... | java | public static JSONObject parseObj(Object obj, boolean ignoreNullValue, boolean isOrder) {
return new JSONObject(obj, ignoreNullValue, isOrder);
} | [
"public",
"static",
"JSONObject",
"parseObj",
"(",
"Object",
"obj",
",",
"boolean",
"ignoreNullValue",
",",
"boolean",
"isOrder",
")",
"{",
"return",
"new",
"JSONObject",
"(",
"obj",
",",
"ignoreNullValue",
",",
"isOrder",
")",
";",
"}"
] | JSON字符串转JSONObject对象
@param obj Bean对象或者Map
@param ignoreNullValue 是否忽略空值,如果source为JSON字符串,不忽略空值
@param isOrder 是否有序
@return JSONObject
@since 4.2.2 | [
"JSON字符串转JSONObject对象"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONUtil.java#L93-L95 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataOneOfImpl_CustomFieldSerializer.java | OWLDataOneOfImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataOneOfImpl instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.us... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataOneOfImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLDataOneOfImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"
] | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataOneOfImpl_CustomFieldSerializer.java#L89-L92 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Model.java | Model.addValidator | public void addValidator(Validator validator, String errorKey) {
"""
Binds a validator to an attribute if validation fails.
@param errorKey key of error in errors map. Usually this is a name of attribute,
but not limited to that, can be anything.
@param validator -validator that failed validation.
"""
... | java | public void addValidator(Validator validator, String errorKey) {
if(!errors.containsKey(errorKey))
errors.addValidator(errorKey, validator);
} | [
"public",
"void",
"addValidator",
"(",
"Validator",
"validator",
",",
"String",
"errorKey",
")",
"{",
"if",
"(",
"!",
"errors",
".",
"containsKey",
"(",
"errorKey",
")",
")",
"errors",
".",
"addValidator",
"(",
"errorKey",
",",
"validator",
")",
";",
"}"
] | Binds a validator to an attribute if validation fails.
@param errorKey key of error in errors map. Usually this is a name of attribute,
but not limited to that, can be anything.
@param validator -validator that failed validation. | [
"Binds",
"a",
"validator",
"to",
"an",
"attribute",
"if",
"validation",
"fails",
"."
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Model.java#L2265-L2268 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/ReflectionHelper.java | ReflectionHelper.getAnnotation | public <A extends Annotation> A getAnnotation(Class<A> annotationClass, AnnotatedElement element) {
"""
Finds the supplied annotation if present on the element, or on its parents.
The parents in this sense are the super types and interfaces if the element is a class.
Or, in case of a Method, the (overridden) met... | java | public <A extends Annotation> A getAnnotation(Class<A> annotationClass, AnnotatedElement element) {
A annotation;
Map<AnnotatedElement, Annotation> cacheMap = cache.get(annotationClass);
if (cacheMap == null) {
cacheMap = new HashMap<AnnotatedElement, Annotation>();
cache... | [
"public",
"<",
"A",
"extends",
"Annotation",
">",
"A",
"getAnnotation",
"(",
"Class",
"<",
"A",
">",
"annotationClass",
",",
"AnnotatedElement",
"element",
")",
"{",
"A",
"annotation",
";",
"Map",
"<",
"AnnotatedElement",
",",
"Annotation",
">",
"cacheMap",
... | Finds the supplied annotation if present on the element, or on its parents.
The parents in this sense are the super types and interfaces if the element is a class.
Or, in case of a Method, the (overridden) method declaration by its super types or interfaces.
@param annotationClass class of annotation looked for.
@param... | [
"Finds",
"the",
"supplied",
"annotation",
"if",
"present",
"on",
"the",
"element",
"or",
"on",
"its",
"parents",
".",
"The",
"parents",
"in",
"this",
"sense",
"are",
"the",
"super",
"types",
"and",
"interfaces",
"if",
"the",
"element",
"is",
"a",
"class",
... | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/ReflectionHelper.java#L25-L43 |
tango-controls/JTango | server/src/main/java/org/tango/server/events/EventManager.java | EventManager.pushAttributeValueEvent | public void pushAttributeValueEvent(final String deviceName, final String attributeName) throws DevFailed {
"""
Check if the event must be sent and fire it if must be done
@param attributeName specified event attribute
@throws DevFailed
"""
xlogger.entry();
for (final EventType eventType : ... | java | public void pushAttributeValueEvent(final String deviceName, final String attributeName) throws DevFailed {
xlogger.entry();
for (final EventType eventType : EventType.getEventAttrValueTypeList()) {
pushAttributeValueEventIdlLoop(deviceName, attributeName, eventType);
}
xlogg... | [
"public",
"void",
"pushAttributeValueEvent",
"(",
"final",
"String",
"deviceName",
",",
"final",
"String",
"attributeName",
")",
"throws",
"DevFailed",
"{",
"xlogger",
".",
"entry",
"(",
")",
";",
"for",
"(",
"final",
"EventType",
"eventType",
":",
"EventType",
... | Check if the event must be sent and fire it if must be done
@param attributeName specified event attribute
@throws DevFailed | [
"Check",
"if",
"the",
"event",
"must",
"be",
"sent",
"and",
"fire",
"it",
"if",
"must",
"be",
"done"
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/server/src/main/java/org/tango/server/events/EventManager.java#L499-L505 |
google/closure-compiler | src/com/google/javascript/rhino/jstype/JSTypeRegistry.java | JSTypeRegistry.createOptionalType | public JSType createOptionalType(JSType type) {
"""
Creates a type representing optional values of the given type.
@return the union of the type and the void type
"""
if (type instanceof UnknownType || type.isAllType()) {
return type;
} else {
return createUnionType(type, getNativeType(JST... | java | public JSType createOptionalType(JSType type) {
if (type instanceof UnknownType || type.isAllType()) {
return type;
} else {
return createUnionType(type, getNativeType(JSTypeNative.VOID_TYPE));
}
} | [
"public",
"JSType",
"createOptionalType",
"(",
"JSType",
"type",
")",
"{",
"if",
"(",
"type",
"instanceof",
"UnknownType",
"||",
"type",
".",
"isAllType",
"(",
")",
")",
"{",
"return",
"type",
";",
"}",
"else",
"{",
"return",
"createUnionType",
"(",
"type"... | Creates a type representing optional values of the given type.
@return the union of the type and the void type | [
"Creates",
"a",
"type",
"representing",
"optional",
"values",
"of",
"the",
"given",
"type",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/JSTypeRegistry.java#L1476-L1482 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java | TypeUtils.getTypeArguments | private static Map<TypeVariable<?>, Type> getTypeArguments(Class<?> cls, final Class<?> toClass,
final Map<TypeVariable<?>, Type> subtypeVarAssigns) {
"""
<p>Return a map of the type arguments of a class in the context of {@code toClass}.</p>
@param cls the class in question
@param toClass the cont... | java | private static Map<TypeVariable<?>, Type> getTypeArguments(Class<?> cls, final Class<?> toClass,
final Map<TypeVariable<?>, Type> subtypeVarAssigns) {
// make sure they're assignable
if (!isAssignable(cls, toClass)) {
return null;
}
// can't work with primitives
... | [
"private",
"static",
"Map",
"<",
"TypeVariable",
"<",
"?",
">",
",",
"Type",
">",
"getTypeArguments",
"(",
"Class",
"<",
"?",
">",
"cls",
",",
"final",
"Class",
"<",
"?",
">",
"toClass",
",",
"final",
"Map",
"<",
"TypeVariable",
"<",
"?",
">",
",",
... | <p>Return a map of the type arguments of a class in the context of {@code toClass}.</p>
@param cls the class in question
@param toClass the context class
@param subtypeVarAssigns a map with type variables
@return the {@code Map} with type arguments | [
"<p",
">",
"Return",
"a",
"map",
"of",
"the",
"type",
"arguments",
"of",
"a",
"class",
"in",
"the",
"context",
"of",
"{",
"@code",
"toClass",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java#L903-L934 |
apache/incubator-gobblin | gobblin-core-base/src/main/java/org/apache/gobblin/instrumented/Instrumented.java | Instrumented.updateTimer | public static void updateTimer(Optional<Timer> timer, final long duration, final TimeUnit unit) {
"""
Updates a timer only if it is defined.
@param timer an Optional<{@link com.codahale.metrics.Timer}>
@param duration
@param unit
"""
timer.transform(new Function<Timer, Timer>() {
@Override
... | java | public static void updateTimer(Optional<Timer> timer, final long duration, final TimeUnit unit) {
timer.transform(new Function<Timer, Timer>() {
@Override
public Timer apply(@Nonnull Timer input) {
input.update(duration, unit);
return input;
}
});
} | [
"public",
"static",
"void",
"updateTimer",
"(",
"Optional",
"<",
"Timer",
">",
"timer",
",",
"final",
"long",
"duration",
",",
"final",
"TimeUnit",
"unit",
")",
"{",
"timer",
".",
"transform",
"(",
"new",
"Function",
"<",
"Timer",
",",
"Timer",
">",
"(",... | Updates a timer only if it is defined.
@param timer an Optional<{@link com.codahale.metrics.Timer}>
@param duration
@param unit | [
"Updates",
"a",
"timer",
"only",
"if",
"it",
"is",
"defined",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core-base/src/main/java/org/apache/gobblin/instrumented/Instrumented.java#L240-L248 |
apiman/apiman | gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/ESRegistry.java | ESRegistry.lookupClient | @SuppressWarnings("nls") // Do beans need escaping or will that be done 'automatically'. Test it. Strings do, but probably only quotes?
private Client lookupClient(String orgId, String clientId, String version) {
"""
Searches for a client by its orgid:clientId:version and returns it.
@param orgId
@param clie... | java | @SuppressWarnings("nls") // Do beans need escaping or will that be done 'automatically'. Test it. Strings do, but probably only quotes?
private Client lookupClient(String orgId, String clientId, String version) {
String query = "{" +
" \"query\": {" +
" \"bool\": {" +... | [
"@",
"SuppressWarnings",
"(",
"\"nls\"",
")",
"// Do beans need escaping or will that be done 'automatically'. Test it. Strings do, but probably only quotes?",
"private",
"Client",
"lookupClient",
"(",
"String",
"orgId",
",",
"String",
"clientId",
",",
"String",
"version",
")",
... | Searches for a client by its orgid:clientId:version and returns it.
@param orgId
@param clientId
@param version | [
"Searches",
"for",
"a",
"client",
"by",
"its",
"orgid",
":",
"clientId",
":",
"version",
"and",
"returns",
"it",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/ESRegistry.java#L207-L250 |
ocelotds/ocelot | ocelot-web/src/main/java/org/ocelotds/configuration/OcelotRequestConfigurator.java | OcelotRequestConfigurator.modifyHandshake | @Override
public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
"""
Set user information from open websocket
@param sec
@param request
@param response
"""
sec.getUserProperties().put(Constants.HANDSHAKEREQUEST, request);
super.modifyHandshake... | java | @Override
public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
sec.getUserProperties().put(Constants.HANDSHAKEREQUEST, request);
super.modifyHandshake(sec, request, response);
} | [
"@",
"Override",
"public",
"void",
"modifyHandshake",
"(",
"ServerEndpointConfig",
"sec",
",",
"HandshakeRequest",
"request",
",",
"HandshakeResponse",
"response",
")",
"{",
"sec",
".",
"getUserProperties",
"(",
")",
".",
"put",
"(",
"Constants",
".",
"HANDSHAKERE... | Set user information from open websocket
@param sec
@param request
@param response | [
"Set",
"user",
"information",
"from",
"open",
"websocket"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-web/src/main/java/org/ocelotds/configuration/OcelotRequestConfigurator.java#L29-L33 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/types/buildInfo/Env.java | Env.addAllWithFilter | private void addAllWithFilter(Map<String, String> toMap, Map<String, String> fromMap, IncludeExcludePatterns pattern) {
"""
Adds all pairs from 'fromMap' to 'toMap' excluding once that matching the pattern
"""
for (Object o : fromMap.entrySet()) {
Map.Entry entry = (Map.Entry) o;
... | java | private void addAllWithFilter(Map<String, String> toMap, Map<String, String> fromMap, IncludeExcludePatterns pattern) {
for (Object o : fromMap.entrySet()) {
Map.Entry entry = (Map.Entry) o;
String key = (String) entry.getKey();
if (PatternMatcher.pathConflicts(key, pattern))... | [
"private",
"void",
"addAllWithFilter",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"toMap",
",",
"Map",
"<",
"String",
",",
"String",
">",
"fromMap",
",",
"IncludeExcludePatterns",
"pattern",
")",
"{",
"for",
"(",
"Object",
"o",
":",
"fromMap",
".",
"... | Adds all pairs from 'fromMap' to 'toMap' excluding once that matching the pattern | [
"Adds",
"all",
"pairs",
"from",
"fromMap",
"to",
"toMap",
"excluding",
"once",
"that",
"matching",
"the",
"pattern"
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/types/buildInfo/Env.java#L63-L72 |
jbundle/jbundle | thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/mem/memory/MKeyArea.java | MKeyArea.doWrite | public void doWrite(FieldTable vectorTable, KeyAreaInfo keyArea, BaseBuffer bufferNew) throws DBException {
"""
Add this record (Always called from the record class).
@param table The basetable.
@param keyArea The key area.
@param bufferNew The buffer to add.
@exception DBException File exception.
"""
... | java | public void doWrite(FieldTable vectorTable, KeyAreaInfo keyArea, BaseBuffer bufferNew) throws DBException
{
super.doWrite(vectorTable, keyArea, bufferNew);
} | [
"public",
"void",
"doWrite",
"(",
"FieldTable",
"vectorTable",
",",
"KeyAreaInfo",
"keyArea",
",",
"BaseBuffer",
"bufferNew",
")",
"throws",
"DBException",
"{",
"super",
".",
"doWrite",
"(",
"vectorTable",
",",
"keyArea",
",",
"bufferNew",
")",
";",
"}"
] | Add this record (Always called from the record class).
@param table The basetable.
@param keyArea The key area.
@param bufferNew The buffer to add.
@exception DBException File exception. | [
"Add",
"this",
"record",
"(",
"Always",
"called",
"from",
"the",
"record",
"class",
")",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/db/misc/src/main/java/org/jbundle/thin/base/db/mem/memory/MKeyArea.java#L326-L329 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/OptimalCECPMain.java | OptimalCECPMain.assignOptAln | private static void assignOptAln(AFPChain afpChain, List<List<List<Integer>>> blocks) {
"""
Sometimes it's convenient to store an alignment using java collections,
where <tt>blocks.get(blockNum).get(0).get(pos)</tt> specifies the aligned
residue at position <i>pos</i> of block <i>blockNum</i> of the first
prote... | java | private static void assignOptAln(AFPChain afpChain, List<List<List<Integer>>> blocks)
{
int[][][] optAln = new int[blocks.size()][][];
int[] optLen = new int[blocks.size()];
int optLength = 0;
int numBlocks = blocks.size();
for(int block = 0; block < numBlocks; block++) {
// block should be 2xN rectangu... | [
"private",
"static",
"void",
"assignOptAln",
"(",
"AFPChain",
"afpChain",
",",
"List",
"<",
"List",
"<",
"List",
"<",
"Integer",
">",
">",
">",
"blocks",
")",
"{",
"int",
"[",
"]",
"[",
"]",
"[",
"]",
"optAln",
"=",
"new",
"int",
"[",
"blocks",
"."... | Sometimes it's convenient to store an alignment using java collections,
where <tt>blocks.get(blockNum).get(0).get(pos)</tt> specifies the aligned
residue at position <i>pos</i> of block <i>blockNum</i> of the first
protein.
This method takes such a collection and stores it into the afpChain's
{@link AFPChain#setOptAln... | [
"Sometimes",
"it",
"s",
"convenient",
"to",
"store",
"an",
"alignment",
"using",
"java",
"collections",
"where",
"<tt",
">",
"blocks",
".",
"get",
"(",
"blockNum",
")",
".",
"get",
"(",
"0",
")",
".",
"get",
"(",
"pos",
")",
"<",
"/",
"tt",
">",
"s... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/OptimalCECPMain.java#L386-L423 |
michel-kraemer/citeproc-java | citeproc-java/src/main/java/de/undercouch/citeproc/BibliographyFileReader.java | BibliographyFileReader.readBibliographyFile | public ItemDataProvider readBibliographyFile(InputStream bibstream,
String filename) throws IOException {
"""
Reads all items from an input stream and returns a provider
serving these items. Note that you can supply an additional file
name to help the method to determine the exact bibliography file format.
I... | java | public ItemDataProvider readBibliographyFile(InputStream bibstream,
String filename) throws IOException {
BufferedInputStream bis;
if (bibstream instanceof BufferedInputStream) {
bis = (BufferedInputStream)bibstream;
} else {
bis = new BufferedInputStream(bibstream);
}
//determine file format
Fi... | [
"public",
"ItemDataProvider",
"readBibliographyFile",
"(",
"InputStream",
"bibstream",
",",
"String",
"filename",
")",
"throws",
"IOException",
"{",
"BufferedInputStream",
"bis",
";",
"if",
"(",
"bibstream",
"instanceof",
"BufferedInputStream",
")",
"{",
"bis",
"=",
... | Reads all items from an input stream and returns a provider
serving these items. Note that you can supply an additional file
name to help the method to determine the exact bibliography file format.
If you don't know the file name you can pass null, but in this case the
method's result might try to read the input stream... | [
"Reads",
"all",
"items",
"from",
"an",
"input",
"stream",
"and",
"returns",
"a",
"provider",
"serving",
"these",
"items",
".",
"Note",
"that",
"you",
"can",
"supply",
"an",
"additional",
"file",
"name",
"to",
"help",
"the",
"method",
"to",
"determine",
"th... | train | https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java/src/main/java/de/undercouch/citeproc/BibliographyFileReader.java#L130-L144 |
statefulj/statefulj | statefulj-persistence/statefulj-persistence-mongo/src/main/java/org/statefulj/persistence/mongo/MongoPersister.java | MongoPersister.setCurrent | @Override
public void setCurrent(T stateful, State<T> current, State<T> next) throws StaleStateException {
"""
Set the current State. This method will ensure that the state in the db matches the expected current state.
If not, it will throw a StateStateException
@param stateful Stateful Entity
@param curren... | java | @Override
public void setCurrent(T stateful, State<T> current, State<T> next) throws StaleStateException {
try {
// Has this Entity been persisted to Mongo?
//
StateDocumentImpl stateDoc = this.getStateDocument(stateful);
if (stateDoc != null && stateDoc.isPersisted()) {
// Update state in the DB
... | [
"@",
"Override",
"public",
"void",
"setCurrent",
"(",
"T",
"stateful",
",",
"State",
"<",
"T",
">",
"current",
",",
"State",
"<",
"T",
">",
"next",
")",
"throws",
"StaleStateException",
"{",
"try",
"{",
"// Has this Entity been persisted to Mongo?",
"//",
"Sta... | Set the current State. This method will ensure that the state in the db matches the expected current state.
If not, it will throw a StateStateException
@param stateful Stateful Entity
@param current Expected current State
@param next The value of the next State
@throws StaleStateException thrown if the value of the S... | [
"Set",
"the",
"current",
"State",
".",
"This",
"method",
"will",
"ensure",
"that",
"the",
"state",
"in",
"the",
"db",
"matches",
"the",
"expected",
"current",
"state",
".",
"If",
"not",
"it",
"will",
"throw",
"a",
"StateStateException"
] | train | https://github.com/statefulj/statefulj/blob/d3459b3cb12bd508643027743401484a231e5fa1/statefulj-persistence/statefulj-persistence-mongo/src/main/java/org/statefulj/persistence/mongo/MongoPersister.java#L163-L192 |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/UrlChain.java | UrlChain.assertArgumentNotNull | protected void assertArgumentNotNull(String argumentName, Object value) {
"""
Assert that the argument is not null.
@param argumentName The name of assert-target argument. (NotNull)
@param value The value of argument. (NotNull)
@throws IllegalArgumentException When the value is null.
"""
if (argumen... | java | protected void assertArgumentNotNull(String argumentName, Object value) {
if (argumentName == null) {
String msg = "The argument name should not be null: argName=null value=" + value;
throw new IllegalArgumentException(msg);
}
if (value == null) {
String msg =... | [
"protected",
"void",
"assertArgumentNotNull",
"(",
"String",
"argumentName",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"argumentName",
"==",
"null",
")",
"{",
"String",
"msg",
"=",
"\"The argument name should not be null: argName=null value=\"",
"+",
"value",
";",
... | Assert that the argument is not null.
@param argumentName The name of assert-target argument. (NotNull)
@param value The value of argument. (NotNull)
@throws IllegalArgumentException When the value is null. | [
"Assert",
"that",
"the",
"argument",
"is",
"not",
"null",
"."
] | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/UrlChain.java#L134-L143 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/disparity/FactoryStereoDisparity.java | FactoryStereoDisparity.regionSparseWta | public static <T extends ImageGray<T>> StereoDisparitySparse<T>
regionSparseWta( int minDisparity , int maxDisparity,
int regionRadiusX, int regionRadiusY ,
double maxPerPixelError ,
double texture ,
boolean subpixelInterpolation ,
Class<T> imageType ) {
"""
WTA algorithms that compu... | java | public static <T extends ImageGray<T>> StereoDisparitySparse<T>
regionSparseWta( int minDisparity , int maxDisparity,
int regionRadiusX, int regionRadiusY ,
double maxPerPixelError ,
double texture ,
boolean subpixelInterpolation ,
Class<T> imageType ) {
double maxError = (regionRadius... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"StereoDisparitySparse",
"<",
"T",
">",
"regionSparseWta",
"(",
"int",
"minDisparity",
",",
"int",
"maxDisparity",
",",
"int",
"regionRadiusX",
",",
"int",
"regionRadiusY",
",",
"double"... | WTA algorithms that computes disparity on a sparse per-pixel basis as requested..
@param minDisparity Minimum disparity that it will check. Must be ≥ 0 and < maxDisparity
@param maxDisparity Maximum disparity that it will calculate. Must be > 0
@param regionRadiusX Radius of the rectangular region along x-axi... | [
"WTA",
"algorithms",
"that",
"computes",
"disparity",
"on",
"a",
"sparse",
"per",
"-",
"pixel",
"basis",
"as",
"requested",
".."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/disparity/FactoryStereoDisparity.java#L241-L275 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncAgentsInner.java | SyncAgentsInner.beginCreateOrUpdateAsync | public Observable<SyncAgentInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String syncAgentName, String syncDatabaseId) {
"""
Creates or updates a sync agent.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure... | java | public Observable<SyncAgentInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String syncAgentName, String syncDatabaseId) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, syncAgentName, syncDatabaseId).map(new Func1<ServiceResponse<SyncAgentInner>, S... | [
"public",
"Observable",
"<",
"SyncAgentInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"syncAgentName",
",",
"String",
"syncDatabaseId",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync... | Creates or updates a sync agent.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server on which the sync agent is hosted.
@param syncAgentName The name of the sync agent.
... | [
"Creates",
"or",
"updates",
"a",
"sync",
"agent",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncAgentsInner.java#L489-L496 |
SonarSource/sonarqube | server/sonar-server/src/main/java/org/sonar/server/permission/PermissionTemplateService.java | PermissionTemplateService.applyDefault | public void applyDefault(DbSession dbSession, ComponentDto component, @Nullable Integer projectCreatorUserId) {
"""
Apply the default permission template to project. The project can already exist (so it has permissions) or
can be provisioned (so has no permissions yet).
@param projectCreatorUserId id of the user... | java | public void applyDefault(DbSession dbSession, ComponentDto component, @Nullable Integer projectCreatorUserId) {
PermissionTemplateDto template = findTemplate(dbSession, component);
checkArgument(template != null, "Cannot retrieve default permission template");
copyPermissions(dbSession, template, component,... | [
"public",
"void",
"applyDefault",
"(",
"DbSession",
"dbSession",
",",
"ComponentDto",
"component",
",",
"@",
"Nullable",
"Integer",
"projectCreatorUserId",
")",
"{",
"PermissionTemplateDto",
"template",
"=",
"findTemplate",
"(",
"dbSession",
",",
"component",
")",
"... | Apply the default permission template to project. The project can already exist (so it has permissions) or
can be provisioned (so has no permissions yet).
@param projectCreatorUserId id of the user who creates the project, only if project is provisioned. He will | [
"Apply",
"the",
"default",
"permission",
"template",
"to",
"project",
".",
"The",
"project",
"can",
"already",
"exist",
"(",
"so",
"it",
"has",
"permissions",
")",
"or",
"can",
"be",
"provisioned",
"(",
"so",
"has",
"no",
"permissions",
"yet",
")",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/permission/PermissionTemplateService.java#L108-L112 |
ebean-orm/querybean-generator | src/main/java/io/ebean/querybean/generator/ProcessingContext.java | ProcessingContext.gatherProperties | private void gatherProperties(List<VariableElement> fields, Element element) {
"""
Recursively gather all the fields (properties) for the given bean element.
"""
TypeElement typeElement = (TypeElement) element;
TypeMirror superclass = typeElement.getSuperclass();
Element mappedSuper = typeUtils.as... | java | private void gatherProperties(List<VariableElement> fields, Element element) {
TypeElement typeElement = (TypeElement) element;
TypeMirror superclass = typeElement.getSuperclass();
Element mappedSuper = typeUtils.asElement(superclass);
if (isMappedSuperOrInheritance(mappedSuper)) {
gatherProperti... | [
"private",
"void",
"gatherProperties",
"(",
"List",
"<",
"VariableElement",
">",
"fields",
",",
"Element",
"element",
")",
"{",
"TypeElement",
"typeElement",
"=",
"(",
"TypeElement",
")",
"element",
";",
"TypeMirror",
"superclass",
"=",
"typeElement",
".",
"getS... | Recursively gather all the fields (properties) for the given bean element. | [
"Recursively",
"gather",
"all",
"the",
"fields",
"(",
"properties",
")",
"for",
"the",
"given",
"bean",
"element",
"."
] | train | https://github.com/ebean-orm/querybean-generator/blob/ef28793c6bf4d51ce9017f251606917a3bd52266/src/main/java/io/ebean/querybean/generator/ProcessingContext.java#L77-L92 |
buschmais/jqa-maven3-plugin | src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java | MavenModelScannerPlugin.addManagedDependencies | private List<MavenDependencyDescriptor> addManagedDependencies(MavenDependentDescriptor pomDescriptor, DependencyManagement dependencyManagement,
ScannerContext scannerContext, Class<? extends AbstractDependencyDescriptor> relationClass) {
"""
Adds dependency management information.
@param pomDescri... | java | private List<MavenDependencyDescriptor> addManagedDependencies(MavenDependentDescriptor pomDescriptor, DependencyManagement dependencyManagement,
ScannerContext scannerContext, Class<? extends AbstractDependencyDescriptor> relationClass) {
if (dependencyManagement == null) {
return Colle... | [
"private",
"List",
"<",
"MavenDependencyDescriptor",
">",
"addManagedDependencies",
"(",
"MavenDependentDescriptor",
"pomDescriptor",
",",
"DependencyManagement",
"dependencyManagement",
",",
"ScannerContext",
"scannerContext",
",",
"Class",
"<",
"?",
"extends",
"AbstractDepe... | Adds dependency management information.
@param pomDescriptor
The descriptor for the current POM.
@param dependencyManagement
The dependency management information.
@param scannerContext | [
"Adds",
"dependency",
"management",
"information",
"."
] | train | https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java#L382-L389 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Table.java | Table.checkColumnInFKConstraint | void checkColumnInFKConstraint(int colIndex, int actionType) {
"""
Used for column defaults and nullability. Checks whether column is in an
FK with a given referential action type.
@param colIndex index of column
@param actionType referential action of the FK
"""
for (int i = 0, size = constraint... | java | void checkColumnInFKConstraint(int colIndex, int actionType) {
for (int i = 0, size = constraintList.length; i < size; i++) {
Constraint c = constraintList[i];
if (c.getConstraintType() == Constraint.FOREIGN_KEY
&& c.hasColumn(colIndex)
&& (actio... | [
"void",
"checkColumnInFKConstraint",
"(",
"int",
"colIndex",
",",
"int",
"actionType",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"size",
"=",
"constraintList",
".",
"length",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"{",
"Constraint",
"c",
... | Used for column defaults and nullability. Checks whether column is in an
FK with a given referential action type.
@param colIndex index of column
@param actionType referential action of the FK | [
"Used",
"for",
"column",
"defaults",
"and",
"nullability",
".",
"Checks",
"whether",
"column",
"is",
"in",
"an",
"FK",
"with",
"a",
"given",
"referential",
"action",
"type",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Table.java#L1253-L1268 |
BlueBrain/bluima | modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/annotationviewer/BlueAnnotationViewGenerator.java | BlueAnnotationViewGenerator.processStyleMap | public void processStyleMap(File aStyleMap) throws TransformerException {
"""
Processes a user-specified file map and produces three outputs:
<UL>
<LI>annotations.css - A CSS stylesheet for the annotation viewer</LI>
<LI>legend.html - HTML document for legend (bottom pane of viewer)</LI>
<LI>docFrame.xsl - An ... | java | public void processStyleMap(File aStyleMap) throws TransformerException {
// Copy static files annotations.xsl, annotationViewer.js, and
// index.html to
// the output dir as well, where they will be used later
writeToFile("annotations.xsl", mOutputDir);
writeToFile("annotationViewer.js", mOutputDir);
writeToFile... | [
"public",
"void",
"processStyleMap",
"(",
"File",
"aStyleMap",
")",
"throws",
"TransformerException",
"{",
"// Copy static files annotations.xsl, annotationViewer.js, and",
"// index.html to",
"// the output dir as well, where they will be used later",
"writeToFile",
"(",
"\"annotation... | Processes a user-specified file map and produces three outputs:
<UL>
<LI>annotations.css - A CSS stylesheet for the annotation viewer</LI>
<LI>legend.html - HTML document for legend (bottom pane of viewer)</LI>
<LI>docFrame.xsl - An XSL stylesheet to be applied to annotated documents
during calls to {@link processDocum... | [
"Processes",
"a",
"user",
"-",
"specified",
"file",
"map",
"and",
"produces",
"three",
"outputs",
":",
"<UL",
">",
"<LI",
">",
"annotations",
".",
"css",
"-",
"A",
"CSS",
"stylesheet",
"for",
"the",
"annotation",
"viewer<",
"/",
"LI",
">",
"<LI",
">",
... | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/annotationviewer/BlueAnnotationViewGenerator.java#L178-L208 |
SUSE/salt-netapi-client | src/main/java/com/suse/salt/netapi/parser/XorTypeAdapterFactory.java | XorTypeAdapterFactory.xorAdapter | private <L, R> TypeAdapter<Xor<L, R>> xorAdapter(TypeAdapter<L> leftAdapter,
TypeAdapter<R> rightAdapter) {
"""
Creates a generic Xor adapter by combining two other adapters - one for each side of
the Xor type. It will first try to parse incoming JSON data as the right type and, if
that does not succ... | java | private <L, R> TypeAdapter<Xor<L, R>> xorAdapter(TypeAdapter<L> leftAdapter,
TypeAdapter<R> rightAdapter) {
return new TypeAdapter<Xor<L, R>>() {
@Override
public Xor<L, R> read(JsonReader in) throws IOException {
JsonElement json = TypeAdapters.JSON_ELEMENT.r... | [
"private",
"<",
"L",
",",
"R",
">",
"TypeAdapter",
"<",
"Xor",
"<",
"L",
",",
"R",
">",
">",
"xorAdapter",
"(",
"TypeAdapter",
"<",
"L",
">",
"leftAdapter",
",",
"TypeAdapter",
"<",
"R",
">",
"rightAdapter",
")",
"{",
"return",
"new",
"TypeAdapter",
... | Creates a generic Xor adapter by combining two other adapters - one for each side of
the Xor type. It will first try to parse incoming JSON data as the right type and, if
that does not succeed, it will try again with the left type.
All exceptions besides the possible parsing Exception of the left type are not
caught.
... | [
"Creates",
"a",
"generic",
"Xor",
"adapter",
"by",
"combining",
"two",
"other",
"adapters",
"-",
"one",
"for",
"each",
"side",
"of",
"the",
"Xor",
"type",
".",
"It",
"will",
"first",
"try",
"to",
"parse",
"incoming",
"JSON",
"data",
"as",
"the",
"right",... | train | https://github.com/SUSE/salt-netapi-client/blob/a0bdf643c8e34fa4def4b915366594c1491fdad5/src/main/java/com/suse/salt/netapi/parser/XorTypeAdapterFactory.java#L70-L90 |
alkacon/opencms-core | src/org/opencms/db/CmsSubscriptionManager.java | CmsSubscriptionManager.unsubscribeAllDeletedResources | public void unsubscribeAllDeletedResources(CmsObject cms, long deletedTo) throws CmsException {
"""
Unsubscribes all deleted resources that were deleted before the specified time stamp.<p>
@param cms the current users context
@param deletedTo the time stamp to which the resources have been deleted
@throws C... | java | public void unsubscribeAllDeletedResources(CmsObject cms, long deletedTo) throws CmsException {
if (!isEnabled()) {
throw new CmsRuntimeException(Messages.get().container(Messages.ERR_SUBSCRIPTION_MANAGER_DISABLED_0));
}
m_securityManager.unsubscribeAllDeletedResources(cms.getReques... | [
"public",
"void",
"unsubscribeAllDeletedResources",
"(",
"CmsObject",
"cms",
",",
"long",
"deletedTo",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"!",
"isEnabled",
"(",
")",
")",
"{",
"throw",
"new",
"CmsRuntimeException",
"(",
"Messages",
".",
"get",
"(",... | Unsubscribes all deleted resources that were deleted before the specified time stamp.<p>
@param cms the current users context
@param deletedTo the time stamp to which the resources have been deleted
@throws CmsException if something goes wrong | [
"Unsubscribes",
"all",
"deleted",
"resources",
"that",
"were",
"deleted",
"before",
"the",
"specified",
"time",
"stamp",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSubscriptionManager.java#L410-L416 |
finmath/finmath-lib | src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/LocalRiskMinimizingHedgePortfolio.java | LocalRiskMinimizingHedgePortfolio.getBasisFunctions | private RandomVariable[] getBasisFunctions(RandomVariable underlying) {
"""
Create basis functions for a binning.
@param underlying
@return
"""
double min = underlying.getMin();
double max = underlying.getMax();
ArrayList<RandomVariable> basisFunctionList = new ArrayList<>();
double[] discretizati... | java | private RandomVariable[] getBasisFunctions(RandomVariable underlying) {
double min = underlying.getMin();
double max = underlying.getMax();
ArrayList<RandomVariable> basisFunctionList = new ArrayList<>();
double[] discretization = (new TimeDiscretizationFromArray(min, numberOfBins, (max-min)/numberOfBins)).get... | [
"private",
"RandomVariable",
"[",
"]",
"getBasisFunctions",
"(",
"RandomVariable",
"underlying",
")",
"{",
"double",
"min",
"=",
"underlying",
".",
"getMin",
"(",
")",
";",
"double",
"max",
"=",
"underlying",
".",
"getMax",
"(",
")",
";",
"ArrayList",
"<",
... | Create basis functions for a binning.
@param underlying
@return | [
"Create",
"basis",
"functions",
"for",
"a",
"binning",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/LocalRiskMinimizingHedgePortfolio.java#L155-L167 |
apache/flink | flink-core/src/main/java/org/apache/flink/types/StringValue.java | StringValue.setValue | public void setValue(StringValue value, int offset, int len) {
"""
Sets the value of the StringValue to a substring of the given string.
@param value The new string value.
@param offset The position to start the substring.
@param len The length of the substring.
"""
checkNotNull(value);
setValue(value... | java | public void setValue(StringValue value, int offset, int len) {
checkNotNull(value);
setValue(value.value, offset, len);
} | [
"public",
"void",
"setValue",
"(",
"StringValue",
"value",
",",
"int",
"offset",
",",
"int",
"len",
")",
"{",
"checkNotNull",
"(",
"value",
")",
";",
"setValue",
"(",
"value",
".",
"value",
",",
"offset",
",",
"len",
")",
";",
"}"
] | Sets the value of the StringValue to a substring of the given string.
@param value The new string value.
@param offset The position to start the substring.
@param len The length of the substring. | [
"Sets",
"the",
"value",
"of",
"the",
"StringValue",
"to",
"a",
"substring",
"of",
"the",
"given",
"string",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/StringValue.java#L172-L175 |
mikepenz/MaterialDrawer | library/src/main/java/com/mikepenz/materialdrawer/util/DrawerUIUtils.java | DrawerUIUtils.getIconStateList | public static StateListDrawable getIconStateList(Drawable icon, Drawable selectedIcon) {
"""
helper to create a stateListDrawable for the icon
@param icon
@param selectedIcon
@return
"""
StateListDrawable iconStateListDrawable = new StateListDrawable();
iconStateListDrawable.addState(new i... | java | public static StateListDrawable getIconStateList(Drawable icon, Drawable selectedIcon) {
StateListDrawable iconStateListDrawable = new StateListDrawable();
iconStateListDrawable.addState(new int[]{android.R.attr.state_selected}, selectedIcon);
iconStateListDrawable.addState(new int[]{}, icon);
... | [
"public",
"static",
"StateListDrawable",
"getIconStateList",
"(",
"Drawable",
"icon",
",",
"Drawable",
"selectedIcon",
")",
"{",
"StateListDrawable",
"iconStateListDrawable",
"=",
"new",
"StateListDrawable",
"(",
")",
";",
"iconStateListDrawable",
".",
"addState",
"(",
... | helper to create a stateListDrawable for the icon
@param icon
@param selectedIcon
@return | [
"helper",
"to",
"create",
"a",
"stateListDrawable",
"for",
"the",
"icon"
] | train | https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/util/DrawerUIUtils.java#L155-L160 |
Stratio/stratio-cassandra | src/java/com/stratio/cassandra/util/JsonSerializer.java | JsonSerializer.fromString | public static <T> T fromString(String value, Class<T> valueType) throws IOException {
"""
Returns the object of the specified class represented by the specified JSON {@code String}.
@param value A JSON {@code String} to be parsed.
@param valueType The class of the object to be parsed.
@param <T> The... | java | public static <T> T fromString(String value, Class<T> valueType) throws IOException {
return jsonMapper.readValue(value, valueType);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"fromString",
"(",
"String",
"value",
",",
"Class",
"<",
"T",
">",
"valueType",
")",
"throws",
"IOException",
"{",
"return",
"jsonMapper",
".",
"readValue",
"(",
"value",
",",
"valueType",
")",
";",
"}"
] | Returns the object of the specified class represented by the specified JSON {@code String}.
@param value A JSON {@code String} to be parsed.
@param valueType The class of the object to be parsed.
@param <T> The type of the object to be parsed.
@return The object of the specified class represented by the spec... | [
"Returns",
"the",
"object",
"of",
"the",
"specified",
"class",
"represented",
"by",
"the",
"specified",
"JSON",
"{",
"@code",
"String",
"}",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/util/JsonSerializer.java#L69-L71 |
OpenLiberty/open-liberty | dev/com.ibm.websphere.javaee.el.3.0/src/javax/el/ELProcessor.java | ELProcessor.defineFunction | public void defineFunction(String prefix, String function, Method method)
throws java.lang.NoSuchMethodException {
"""
Map a method to a function name.
@param prefix Function prefix
@param function Function name
@param method Method
@throws NullPointerException
If any of the arguments a... | java | public void defineFunction(String prefix, String function, Method method)
throws java.lang.NoSuchMethodException {
if (prefix == null || function == null || method == null) {
throw new NullPointerException(Util.message(
context, "elProcessor.defineFunctionNullParams"... | [
"public",
"void",
"defineFunction",
"(",
"String",
"prefix",
",",
"String",
"function",
",",
"Method",
"method",
")",
"throws",
"java",
".",
"lang",
".",
"NoSuchMethodException",
"{",
"if",
"(",
"prefix",
"==",
"null",
"||",
"function",
"==",
"null",
"||",
... | Map a method to a function name.
@param prefix Function prefix
@param function Function name
@param method Method
@throws NullPointerException
If any of the arguments are null
@throws NoSuchMethodException
If the method is not static | [
"Map",
"a",
"method",
"to",
"a",
"function",
"name",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.el.3.0/src/javax/el/ELProcessor.java#L178-L196 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/util/StreamUtil.java | StreamUtil.copy | public static void copy(Reader in, Writer out) throws IOException {
"""
Copies the content of a reader to a writer.
@param in the reader to read
@param out the writer to write
@throws java.io.IOException if an I/O error occurs
"""
char[] buf = new char[1024];
while (true) {
int count = in.read... | java | public static void copy(Reader in, Writer out) throws IOException {
char[] buf = new char[1024];
while (true) {
int count = in.read(buf);
if (count < 0) {
break;
}
out.write(buf, 0, count);
}
out.flush();
} | [
"public",
"static",
"void",
"copy",
"(",
"Reader",
"in",
",",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"char",
"[",
"]",
"buf",
"=",
"new",
"char",
"[",
"1024",
"]",
";",
"while",
"(",
"true",
")",
"{",
"int",
"count",
"=",
"in",
".",
... | Copies the content of a reader to a writer.
@param in the reader to read
@param out the writer to write
@throws java.io.IOException if an I/O error occurs | [
"Copies",
"the",
"content",
"of",
"a",
"reader",
"to",
"a",
"writer",
"."
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/StreamUtil.java#L231-L241 |
gallandarakhneorg/afc | advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/ifx/Segment3ifx.java | Segment3ifx.y2Property | @Pure
public IntegerProperty y2Property() {
"""
Replies the property that is the y coordinate of the second segment point.
@return the y2 property.
"""
if (this.p2.y == null) {
this.p2.y = new SimpleIntegerProperty(this, MathFXAttributeNames.Y2);
}
return this.p2.y;
} | java | @Pure
public IntegerProperty y2Property() {
if (this.p2.y == null) {
this.p2.y = new SimpleIntegerProperty(this, MathFXAttributeNames.Y2);
}
return this.p2.y;
} | [
"@",
"Pure",
"public",
"IntegerProperty",
"y2Property",
"(",
")",
"{",
"if",
"(",
"this",
".",
"p2",
".",
"y",
"==",
"null",
")",
"{",
"this",
".",
"p2",
".",
"y",
"=",
"new",
"SimpleIntegerProperty",
"(",
"this",
",",
"MathFXAttributeNames",
".",
"Y2"... | Replies the property that is the y coordinate of the second segment point.
@return the y2 property. | [
"Replies",
"the",
"property",
"that",
"is",
"the",
"y",
"coordinate",
"of",
"the",
"second",
"segment",
"point",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/mathfx/src/main/java/org/arakhne/afc/math/geometry/d3/ifx/Segment3ifx.java#L276-L282 |
ACRA/acra | acra-core/src/main/java/org/acra/builder/ReportBuilder.java | ReportBuilder.customData | @NonNull
@SuppressWarnings("unused")
public ReportBuilder customData(@NonNull Map<String, String> customData) {
"""
Sets additional values to be added to {@link org.acra.ReportField#CUSTOM_DATA}. Values
specified here take precedence over globally specified custom data.
@param customData a map of custo... | java | @NonNull
@SuppressWarnings("unused")
public ReportBuilder customData(@NonNull Map<String, String> customData) {
this.customData.putAll(customData);
return this;
} | [
"@",
"NonNull",
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"public",
"ReportBuilder",
"customData",
"(",
"@",
"NonNull",
"Map",
"<",
"String",
",",
"String",
">",
"customData",
")",
"{",
"this",
".",
"customData",
".",
"putAll",
"(",
"customData",
")",... | Sets additional values to be added to {@link org.acra.ReportField#CUSTOM_DATA}. Values
specified here take precedence over globally specified custom data.
@param customData a map of custom key-values to be attached to the report
@return the updated {@code ReportBuilder} | [
"Sets",
"additional",
"values",
"to",
"be",
"added",
"to",
"{",
"@link",
"org",
".",
"acra",
".",
"ReportField#CUSTOM_DATA",
"}",
".",
"Values",
"specified",
"here",
"take",
"precedence",
"over",
"globally",
"specified",
"custom",
"data",
"."
] | train | https://github.com/ACRA/acra/blob/bfa3235ab110328c5ab2f792ddf8ee87be4a32d1/acra-core/src/main/java/org/acra/builder/ReportBuilder.java#L107-L112 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/AbstractTriangle3F.java | AbstractTriangle3F.containsProjectionOf | @Pure
public boolean containsProjectionOf(double x, double y, double z) {
"""
Checks if the projection of a point on the triangle's plane is inside the triangle.
@param x
@param y
@param z
@return <code>true</code> if the projection of the point is in the triangle, otherwise <code>false</code>.
"""
Po... | java | @Pure
public boolean containsProjectionOf(double x, double y, double z) {
Point3f proj = (Point3f) getPlane().getProjection(x, y, z);
if (proj == null) {
return false;
}
return contains(proj);
} | [
"@",
"Pure",
"public",
"boolean",
"containsProjectionOf",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"Point3f",
"proj",
"=",
"(",
"Point3f",
")",
"getPlane",
"(",
")",
".",
"getProjection",
"(",
"x",
",",
"y",
",",
"z",
")"... | Checks if the projection of a point on the triangle's plane is inside the triangle.
@param x
@param y
@param z
@return <code>true</code> if the projection of the point is in the triangle, otherwise <code>false</code>. | [
"Checks",
"if",
"the",
"projection",
"of",
"a",
"point",
"on",
"the",
"triangle",
"s",
"plane",
"is",
"inside",
"the",
"triangle",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/AbstractTriangle3F.java#L2066-L2073 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/HistoryDTO.java | HistoryDTO.transformToDto | public static HistoryDTO transformToDto(History history) {
"""
Converts a history object to DTO.
@param history The history object.
@return The history DTO.
@throws WebApplicationException If an error occurs.
"""
if (history == null) {
throw new WebApplicationException("Null ... | java | public static HistoryDTO transformToDto(History history) {
if (history == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
HistoryDTO historyDto = new HistoryDTO();
try {
BeanUtil... | [
"public",
"static",
"HistoryDTO",
"transformToDto",
"(",
"History",
"history",
")",
"{",
"if",
"(",
"history",
"==",
"null",
")",
"{",
"throw",
"new",
"WebApplicationException",
"(",
"\"Null entity object cannot be converted to Dto object.\"",
",",
"Status",
".",
"INT... | Converts a history object to DTO.
@param history The history object.
@return The history DTO.
@throws WebApplicationException If an error occurs. | [
"Converts",
"a",
"history",
"object",
"to",
"DTO",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/HistoryDTO.java#L77-L90 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/externallink/CmsEditExternalLinkDialog.java | CmsEditExternalLinkDialog.showNewLinkDialog | public static CmsEditExternalLinkDialog showNewLinkDialog(CmsListInfoBean typeInfo, String parentFolderPath) {
"""
Shows the create new link dialog.<p>
@param typeInfo the 'pointer' type info
@param parentFolderPath the parent folder site path
@return the dialog object
"""
CmsEditExternalLinkDi... | java | public static CmsEditExternalLinkDialog showNewLinkDialog(CmsListInfoBean typeInfo, String parentFolderPath) {
CmsEditExternalLinkDialog dialog = new CmsEditExternalLinkDialog(typeInfo, parentFolderPath);
dialog.center();
return dialog;
} | [
"public",
"static",
"CmsEditExternalLinkDialog",
"showNewLinkDialog",
"(",
"CmsListInfoBean",
"typeInfo",
",",
"String",
"parentFolderPath",
")",
"{",
"CmsEditExternalLinkDialog",
"dialog",
"=",
"new",
"CmsEditExternalLinkDialog",
"(",
"typeInfo",
",",
"parentFolderPath",
"... | Shows the create new link dialog.<p>
@param typeInfo the 'pointer' type info
@param parentFolderPath the parent folder site path
@return the dialog object | [
"Shows",
"the",
"create",
"new",
"link",
"dialog",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/externallink/CmsEditExternalLinkDialog.java#L185-L190 |
Azure/azure-sdk-for-java | keyvault/resource-manager/v2016_10_01/src/main/java/com/microsoft/azure/management/keyvault/v2016_10_01/implementation/VaultsInner.java | VaultsInner.updateAccessPolicyAsync | public Observable<VaultAccessPolicyParametersInner> updateAccessPolicyAsync(String resourceGroupName, String vaultName, AccessPolicyUpdateKind operationKind, VaultAccessPolicyProperties properties) {
"""
Update access policies in a key vault in the specified subscription.
@param resourceGroupName The name of th... | java | public Observable<VaultAccessPolicyParametersInner> updateAccessPolicyAsync(String resourceGroupName, String vaultName, AccessPolicyUpdateKind operationKind, VaultAccessPolicyProperties properties) {
return updateAccessPolicyWithServiceResponseAsync(resourceGroupName, vaultName, operationKind, properties).map(n... | [
"public",
"Observable",
"<",
"VaultAccessPolicyParametersInner",
">",
"updateAccessPolicyAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vaultName",
",",
"AccessPolicyUpdateKind",
"operationKind",
",",
"VaultAccessPolicyProperties",
"properties",
")",
"{",
"return... | Update access policies in a key vault in the specified subscription.
@param resourceGroupName The name of the Resource Group to which the vault belongs.
@param vaultName Name of the vault
@param operationKind Name of the operation. Possible values include: 'add', 'replace', 'remove'
@param properties Properties of the... | [
"Update",
"access",
"policies",
"in",
"a",
"key",
"vault",
"in",
"the",
"specified",
"subscription",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/resource-manager/v2016_10_01/src/main/java/com/microsoft/azure/management/keyvault/v2016_10_01/implementation/VaultsInner.java#L546-L553 |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageManager.java | ImageManager.getImageKey | public ImageKey getImageKey (String rset, String path) {
"""
Returns an image key that can be used to fetch the image identified by the specified
resource set and image path.
"""
return getImageKey(getDataProvider(rset), path);
} | java | public ImageKey getImageKey (String rset, String path)
{
return getImageKey(getDataProvider(rset), path);
} | [
"public",
"ImageKey",
"getImageKey",
"(",
"String",
"rset",
",",
"String",
"path",
")",
"{",
"return",
"getImageKey",
"(",
"getDataProvider",
"(",
"rset",
")",
",",
"path",
")",
";",
"}"
] | Returns an image key that can be used to fetch the image identified by the specified
resource set and image path. | [
"Returns",
"an",
"image",
"key",
"that",
"can",
"be",
"used",
"to",
"fetch",
"the",
"image",
"identified",
"by",
"the",
"specified",
"resource",
"set",
"and",
"image",
"path",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageManager.java#L262-L265 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getCharacterSkills | public void getCharacterSkills(String API, String name, Callback<CharacterSkills> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on Character Skills API go <a href="https://wiki.guildwars2.com/wiki/API:2/characters#Skills">here</a><br/>
Give user the access to {@link Callback#onRes... | java | public void getCharacterSkills(String API, String name, Callback<CharacterSkills> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name));
gw2API.getCharacterSkills(name, API).enqueue(callback);
} | [
"public",
"void",
"getCharacterSkills",
"(",
"String",
"API",
",",
"String",
"name",
",",
"Callback",
"<",
"CharacterSkills",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
... | For more info on Character Skills API go <a href="https://wiki.guildwars2.com/wiki/API:2/characters#Skills">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param API API key
@param name character... | [
"For",
"more",
"info",
"on",
"Character",
"Skills",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"characters#Skills",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">"... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L829-L832 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java | LambdaToMethod.makeNewClass | JCNewClass makeNewClass(Type ctype, List<JCExpression> args) {
"""
Make an attributed class instance creation expression.
@param ctype The class type.
@param args The constructor arguments.
"""
return makeNewClass(ctype, args,
rs.resolveConstructor(null, attrEnv, ctype, TreeInf... | java | JCNewClass makeNewClass(Type ctype, List<JCExpression> args) {
return makeNewClass(ctype, args,
rs.resolveConstructor(null, attrEnv, ctype, TreeInfo.types(args), List.nil()));
} | [
"JCNewClass",
"makeNewClass",
"(",
"Type",
"ctype",
",",
"List",
"<",
"JCExpression",
">",
"args",
")",
"{",
"return",
"makeNewClass",
"(",
"ctype",
",",
"args",
",",
"rs",
".",
"resolveConstructor",
"(",
"null",
",",
"attrEnv",
",",
"ctype",
",",
"TreeInf... | Make an attributed class instance creation expression.
@param ctype The class type.
@param args The constructor arguments. | [
"Make",
"an",
"attributed",
"class",
"instance",
"creation",
"expression",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java#L676-L679 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.bitGet | public static boolean bitGet(MemorySegment[] segments, int baseOffset, int index) {
"""
read bit from segments.
@param segments target segments.
@param baseOffset bits base offset.
@param index bit index from base offset.
"""
int offset = baseOffset + ((index & BIT_BYTE_POSITION_MASK) >>> 3);
byte cur... | java | public static boolean bitGet(MemorySegment[] segments, int baseOffset, int index) {
int offset = baseOffset + ((index & BIT_BYTE_POSITION_MASK) >>> 3);
byte current = getByte(segments, offset);
return (current & (1 << (index & BIT_BYTE_INDEX_MASK))) != 0;
} | [
"public",
"static",
"boolean",
"bitGet",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"baseOffset",
",",
"int",
"index",
")",
"{",
"int",
"offset",
"=",
"baseOffset",
"+",
"(",
"(",
"index",
"&",
"BIT_BYTE_POSITION_MASK",
")",
">>>",
"3",
")",
... | read bit from segments.
@param segments target segments.
@param baseOffset bits base offset.
@param index bit index from base offset. | [
"read",
"bit",
"from",
"segments",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L522-L526 |
susom/database | src/main/java/com/github/susom/database/DatabaseProvider.java | DatabaseProvider.fromJndi | @CheckReturnValue
public static Builder fromJndi(final Context context, final String lookupKey, Flavor flavor) {
"""
Builder method to create and initialize an instance of this class using
a JNDI resource. To use this method you must explicitly indicate what
Flavor of database we are dealing with.
"""
... | java | @CheckReturnValue
public static Builder fromJndi(final Context context, final String lookupKey, Flavor flavor) {
Options options = new OptionsDefault(flavor);
return new BuilderImpl(null, () -> {
DataSource ds;
try {
ds = (DataSource) context.lookup(lookupKey);
} catch (Exception e)... | [
"@",
"CheckReturnValue",
"public",
"static",
"Builder",
"fromJndi",
"(",
"final",
"Context",
"context",
",",
"final",
"String",
"lookupKey",
",",
"Flavor",
"flavor",
")",
"{",
"Options",
"options",
"=",
"new",
"OptionsDefault",
"(",
"flavor",
")",
";",
"return... | Builder method to create and initialize an instance of this class using
a JNDI resource. To use this method you must explicitly indicate what
Flavor of database we are dealing with. | [
"Builder",
"method",
"to",
"create",
"and",
"initialize",
"an",
"instance",
"of",
"this",
"class",
"using",
"a",
"JNDI",
"resource",
".",
"To",
"use",
"this",
"method",
"you",
"must",
"explicitly",
"indicate",
"what",
"Flavor",
"of",
"database",
"we",
"are",... | train | https://github.com/susom/database/blob/25add9e08ad863712f9b5e319b6cb826f6f97640/src/main/java/com/github/susom/database/DatabaseProvider.java#L221-L238 |
crnk-project/crnk-framework | crnk-core/src/main/java/io/crnk/core/module/internal/ResourceFilterDirectoryImpl.java | ResourceFilterDirectoryImpl.canAccess | @Override
public boolean canAccess(ResourceField field, HttpMethod method, QueryContext queryContext, boolean allowIgnore) {
"""
Allows to check whether the given field can be written.
@param field from the information model or null if is a dynamic field (like JsonAny).
"""
if (field == null) {
... | java | @Override
public boolean canAccess(ResourceField field, HttpMethod method, QueryContext queryContext, boolean allowIgnore) {
if (field == null) {
return true;
}
FilterBehavior filterBehavior = get(field, method, queryContext);
if (filterBehavior == FilterBehavior.NONE) {
... | [
"@",
"Override",
"public",
"boolean",
"canAccess",
"(",
"ResourceField",
"field",
",",
"HttpMethod",
"method",
",",
"QueryContext",
"queryContext",
",",
"boolean",
"allowIgnore",
")",
"{",
"if",
"(",
"field",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}... | Allows to check whether the given field can be written.
@param field from the information model or null if is a dynamic field (like JsonAny). | [
"Allows",
"to",
"check",
"whether",
"the",
"given",
"field",
"can",
"be",
"written",
"."
] | train | https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-core/src/main/java/io/crnk/core/module/internal/ResourceFilterDirectoryImpl.java#L126-L143 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/WorkbinsApi.java | WorkbinsApi.unsubscribeToWorkbinNotifications | public ApiSuccessResponse unsubscribeToWorkbinNotifications(String workbinId, UnsubscribeToWorkbinNotificationsData unsubscribeToWorkbinNotificationsData) throws ApiException {
"""
Unsubscribe to the notifications of changes of the content of a Workbin.
@param workbinId Id of the Workbin (required)
@param unsu... | java | public ApiSuccessResponse unsubscribeToWorkbinNotifications(String workbinId, UnsubscribeToWorkbinNotificationsData unsubscribeToWorkbinNotificationsData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = unsubscribeToWorkbinNotificationsWithHttpInfo(workbinId, unsubscribeToWorkbinNotificationsData);... | [
"public",
"ApiSuccessResponse",
"unsubscribeToWorkbinNotifications",
"(",
"String",
"workbinId",
",",
"UnsubscribeToWorkbinNotificationsData",
"unsubscribeToWorkbinNotificationsData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
... | Unsubscribe to the notifications of changes of the content of a Workbin.
@param workbinId Id of the Workbin (required)
@param unsubscribeToWorkbinNotificationsData (required)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Unsubscribe",
"to",
"the",
"notifications",
"of",
"changes",
"of",
"the",
"content",
"of",
"a",
"Workbin",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/WorkbinsApi.java#L1029-L1032 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.putAt | public static <K,V> V putAt(Map<K,V> self, K key, V value) {
"""
A helper method to allow maps to work with subscript operators
@param self a Map
@param key an Object as a key for the map
@param value the value to put into the map
@return the value corresponding to the given key
@since 1.0
"""
... | java | public static <K,V> V putAt(Map<K,V> self, K key, V value) {
self.put(key, value);
return value;
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"V",
"putAt",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"self",
",",
"K",
"key",
",",
"V",
"value",
")",
"{",
"self",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"value",
";",
"}"
] | A helper method to allow maps to work with subscript operators
@param self a Map
@param key an Object as a key for the map
@param value the value to put into the map
@return the value corresponding to the given key
@since 1.0 | [
"A",
"helper",
"method",
"to",
"allow",
"maps",
"to",
"work",
"with",
"subscript",
"operators"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L8206-L8209 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsEmbeddedDialogHandler.java | CmsEmbeddedDialogHandler.openDialog | public void openDialog(
String dialogId,
String contextType,
List<CmsUUID> resources,
Map<String, String> rawParams) {
"""
Opens the dialog with the given id.<p>
@param dialogId the dialog id
@param contextType the context type, used to check the action visibility
@param resour... | java | public void openDialog(
String dialogId,
String contextType,
List<CmsUUID> resources,
Map<String, String> rawParams) {
String resourceIds = "";
if (resources != null) {
for (CmsUUID id : resources) {
resourceIds += id.toString() + ";";
... | [
"public",
"void",
"openDialog",
"(",
"String",
"dialogId",
",",
"String",
"contextType",
",",
"List",
"<",
"CmsUUID",
">",
"resources",
",",
"Map",
"<",
"String",
",",
"String",
">",
"rawParams",
")",
"{",
"String",
"resourceIds",
"=",
"\"\"",
";",
"if",
... | Opens the dialog with the given id.<p>
@param dialogId the dialog id
@param contextType the context type, used to check the action visibility
@param resources the resource to handle
@param rawParams additional set of parameters to append to the query string (will not be escaped, therefore 'raw') | [
"Opens",
"the",
"dialog",
"with",
"the",
"given",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsEmbeddedDialogHandler.java#L172-L202 |
Azure/azure-sdk-for-java | mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/implementation/ODataAtomMarshaller.java | ODataAtomMarshaller.marshalEntry | public void marshalEntry(Object content, OutputStream stream)
throws JAXBException {
"""
Convert the given content into an ATOM entry and write it to the given
stream.
@param content
Content object to send
@param stream
Stream to write to
@throws JAXBException
if content is malformed/not marsh... | java | public void marshalEntry(Object content, OutputStream stream)
throws JAXBException {
marshaller.marshal(createEntry(content), stream);
} | [
"public",
"void",
"marshalEntry",
"(",
"Object",
"content",
",",
"OutputStream",
"stream",
")",
"throws",
"JAXBException",
"{",
"marshaller",
".",
"marshal",
"(",
"createEntry",
"(",
"content",
")",
",",
"stream",
")",
";",
"}"
] | Convert the given content into an ATOM entry and write it to the given
stream.
@param content
Content object to send
@param stream
Stream to write to
@throws JAXBException
if content is malformed/not marshallable | [
"Convert",
"the",
"given",
"content",
"into",
"an",
"ATOM",
"entry",
"and",
"write",
"it",
"to",
"the",
"given",
"stream",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/implementation/ODataAtomMarshaller.java#L109-L112 |
ravendb/ravendb-jvm-client | src/main/java/net/ravendb/client/documents/subscriptions/DocumentSubscriptions.java | DocumentSubscriptions.getSubscriptionWorker | public SubscriptionWorker<ObjectNode> getSubscriptionWorker(SubscriptionWorkerOptions options, String database) {
"""
It opens a subscription and starts pulling documents since a last processed document for that subscription.
The connection options determine client and server cooperation rules like document batch... | java | public SubscriptionWorker<ObjectNode> getSubscriptionWorker(SubscriptionWorkerOptions options, String database) {
return getSubscriptionWorker(ObjectNode.class, options, database);
} | [
"public",
"SubscriptionWorker",
"<",
"ObjectNode",
">",
"getSubscriptionWorker",
"(",
"SubscriptionWorkerOptions",
"options",
",",
"String",
"database",
")",
"{",
"return",
"getSubscriptionWorker",
"(",
"ObjectNode",
".",
"class",
",",
"options",
",",
"database",
")",... | It opens a subscription and starts pulling documents since a last processed document for that subscription.
The connection options determine client and server cooperation rules like document batch sizes or a timeout in a matter of which a client
needs to acknowledge that batch has been processed. The acknowledgment is ... | [
"It",
"opens",
"a",
"subscription",
"and",
"starts",
"pulling",
"documents",
"since",
"a",
"last",
"processed",
"document",
"for",
"that",
"subscription",
".",
"The",
"connection",
"options",
"determine",
"client",
"and",
"server",
"cooperation",
"rules",
"like",
... | train | https://github.com/ravendb/ravendb-jvm-client/blob/5a45727de507b541d1571e79ddd97c7d88bee787/src/main/java/net/ravendb/client/documents/subscriptions/DocumentSubscriptions.java#L167-L169 |
zeromq/jeromq | src/main/java/org/zeromq/ZMsg.java | ZMsg.recvMsg | @Draft
public static void recvMsg(ZMQ.Socket socket, int flags, Consumer<ZMsg> handler) {
"""
This API is in DRAFT state and is subject to change at ANY time until declared stable
handle incoming message with a handler
@param socket
@param flags see ZMQ constants
@param handler handler to handle incoming... | java | @Draft
public static void recvMsg(ZMQ.Socket socket, int flags, Consumer<ZMsg> handler)
{
handler.accept(ZMsg.recvMsg(socket, flags));
} | [
"@",
"Draft",
"public",
"static",
"void",
"recvMsg",
"(",
"ZMQ",
".",
"Socket",
"socket",
",",
"int",
"flags",
",",
"Consumer",
"<",
"ZMsg",
">",
"handler",
")",
"{",
"handler",
".",
"accept",
"(",
"ZMsg",
".",
"recvMsg",
"(",
"socket",
",",
"flags",
... | This API is in DRAFT state and is subject to change at ANY time until declared stable
handle incoming message with a handler
@param socket
@param flags see ZMQ constants
@param handler handler to handle incoming message | [
"This",
"API",
"is",
"in",
"DRAFT",
"state",
"and",
"is",
"subject",
"to",
"change",
"at",
"ANY",
"time",
"until",
"declared",
"stable",
"handle",
"incoming",
"message",
"with",
"a",
"handler"
] | train | https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZMsg.java#L286-L290 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/io/DefaultInputResolver.java | DefaultInputResolver.resolveEntity | public static WstxInputSource resolveEntity
(WstxInputSource parent, URL pathCtxt, String entityName,
String publicId, String systemId,
XMLResolver customResolver, ReaderConfig cfg, int xmlVersion)
throws IOException, XMLStreamException {
"""
Basic external resource resolver imple... | java | public static WstxInputSource resolveEntity
(WstxInputSource parent, URL pathCtxt, String entityName,
String publicId, String systemId,
XMLResolver customResolver, ReaderConfig cfg, int xmlVersion)
throws IOException, XMLStreamException
{
if (pathCtxt == null) {
... | [
"public",
"static",
"WstxInputSource",
"resolveEntity",
"(",
"WstxInputSource",
"parent",
",",
"URL",
"pathCtxt",
",",
"String",
"entityName",
",",
"String",
"publicId",
",",
"String",
"systemId",
",",
"XMLResolver",
"customResolver",
",",
"ReaderConfig",
"cfg",
","... | Basic external resource resolver implementation; usable both with
DTD and entity resolution.
@param parent Input source that contains reference to be expanded.
@param pathCtxt Reference context to use for resolving path, if
known. If null, reference context of the parent will
be used; and if that is null (which is pos... | [
"Basic",
"external",
"resource",
"resolver",
"implementation",
";",
"usable",
"both",
"with",
"DTD",
"and",
"entity",
"resolution",
"."
] | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/io/DefaultInputResolver.java#L64-L93 |
pravega/pravega | common/src/main/java/io/pravega/common/concurrent/ExecutorServiceHelpers.java | ExecutorServiceHelpers.newScheduledThreadPool | public static ScheduledExecutorService newScheduledThreadPool(int size, String poolName) {
"""
Creates a new ScheduledExecutorService that will use daemon threads with appropriate names the threads.
@param size The number of threads in the threadpool
@param poolName The name of the pool (this will be printed in ... | java | public static ScheduledExecutorService newScheduledThreadPool(int size, String poolName) {
// Caller runs only occurs after shutdown, as queue size is unbounded.
ScheduledThreadPoolExecutor result = new ScheduledThreadPoolExecutor(size, getThreadFactory(poolName), new CallerRuns());
// Do not e... | [
"public",
"static",
"ScheduledExecutorService",
"newScheduledThreadPool",
"(",
"int",
"size",
",",
"String",
"poolName",
")",
"{",
"// Caller runs only occurs after shutdown, as queue size is unbounded.",
"ScheduledThreadPoolExecutor",
"result",
"=",
"new",
"ScheduledThreadPoolExec... | Creates a new ScheduledExecutorService that will use daemon threads with appropriate names the threads.
@param size The number of threads in the threadpool
@param poolName The name of the pool (this will be printed in logs)
@return A new executor service. | [
"Creates",
"a",
"new",
"ScheduledExecutorService",
"that",
"will",
"use",
"daemon",
"threads",
"with",
"appropriate",
"names",
"the",
"threads",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/concurrent/ExecutorServiceHelpers.java#L71-L85 |
jbundle/jbundle | base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/report/HBaseParserScreen.java | HBaseParserScreen.printHtmlLogo | public void printHtmlLogo(PrintWriter out, ResourceBundle reg)
throws DBException {
"""
Print the top nav menu.
@exception DBException File exception.
"""
String strXml = this.getProperty("xml"); // Html page
if ((strXml != null) && (strXml.length() > 0))
((B... | java | public void printHtmlLogo(PrintWriter out, ResourceBundle reg)
throws DBException
{
String strXml = this.getProperty("xml"); // Html page
if ((strXml != null) && (strXml.length() > 0))
((BaseParserScreen)this.getScreenField()).setURL(((BaseParserScreen)this.getScre... | [
"public",
"void",
"printHtmlLogo",
"(",
"PrintWriter",
"out",
",",
"ResourceBundle",
"reg",
")",
"throws",
"DBException",
"{",
"String",
"strXml",
"=",
"this",
".",
"getProperty",
"(",
"\"xml\"",
")",
";",
"// Html page",
"if",
"(",
"(",
"strXml",
"!=",
"nul... | Print the top nav menu.
@exception DBException File exception. | [
"Print",
"the",
"top",
"nav",
"menu",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/report/HBaseParserScreen.java#L127-L134 |
E7du/jfinal-ext3 | src/main/java/com/jfinal/ext/kit/Reflect.java | Reflect.exactMethod | private Method exactMethod(String name, Class<?>[] types) throws NoSuchMethodException {
"""
Searches a method with the exact same signature as desired.
<p>
If a public method is found in the class hierarchy, this method is returned. Otherwise a private method with the
exact same signature is returned. If no ex... | java | private Method exactMethod(String name, Class<?>[] types) throws NoSuchMethodException {
final Class<?> type = type();
// first priority: find a public method with exact signature match in class hierarchy
try {
return type.getMethod(name, types);
}
// second priorit... | [
"private",
"Method",
"exactMethod",
"(",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"types",
")",
"throws",
"NoSuchMethodException",
"{",
"final",
"Class",
"<",
"?",
">",
"type",
"=",
"type",
"(",
")",
";",
"// first priority: find a public met... | Searches a method with the exact same signature as desired.
<p>
If a public method is found in the class hierarchy, this method is returned. Otherwise a private method with the
exact same signature is returned. If no exact match could be found, we let the {@code NoSuchMethodException} pass
through. | [
"Searches",
"a",
"method",
"with",
"the",
"exact",
"same",
"signature",
"as",
"desired",
".",
"<p",
">",
"If",
"a",
"public",
"method",
"is",
"found",
"in",
"the",
"class",
"hierarchy",
"this",
"method",
"is",
"returned",
".",
"Otherwise",
"a",
"private",
... | train | https://github.com/E7du/jfinal-ext3/blob/8ffcbd150fd50c72852bb778bd427b5eb19254dc/src/main/java/com/jfinal/ext/kit/Reflect.java#L377-L389 |
Samsung/GearVRf | GVRf/Extensions/MixedReality/src/main/java/org/gearvrf/mixedreality/arcore/ARCoreSession.java | ARCoreSession.onResolveCloudAnchor | synchronized protected void onResolveCloudAnchor(String anchorId, CloudAnchorCallback cb) {
"""
This method resolves an anchor. The {@link IAnchorEvents} will be invoked when the results are
available.
"""
Anchor newAnchor = mSession.resolveCloudAnchor(anchorId);
pendingAnchors.put(newAnchor, ... | java | synchronized protected void onResolveCloudAnchor(String anchorId, CloudAnchorCallback cb) {
Anchor newAnchor = mSession.resolveCloudAnchor(anchorId);
pendingAnchors.put(newAnchor, cb);
} | [
"synchronized",
"protected",
"void",
"onResolveCloudAnchor",
"(",
"String",
"anchorId",
",",
"CloudAnchorCallback",
"cb",
")",
"{",
"Anchor",
"newAnchor",
"=",
"mSession",
".",
"resolveCloudAnchor",
"(",
"anchorId",
")",
";",
"pendingAnchors",
".",
"put",
"(",
"ne... | This method resolves an anchor. The {@link IAnchorEvents} will be invoked when the results are
available. | [
"This",
"method",
"resolves",
"an",
"anchor",
".",
"The",
"{"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/MixedReality/src/main/java/org/gearvrf/mixedreality/arcore/ARCoreSession.java#L453-L456 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.getDeletedCertificate | public DeletedCertificateBundle getDeletedCertificate(String vaultBaseUrl, String certificateName) {
"""
Retrieves information about the specified deleted certificate.
The GetDeletedCertificate operation retrieves the deleted certificate information plus its attributes, such as retention interval, scheduled perma... | java | public DeletedCertificateBundle getDeletedCertificate(String vaultBaseUrl, String certificateName) {
return getDeletedCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking().single().body();
} | [
"public",
"DeletedCertificateBundle",
"getDeletedCertificate",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
")",
"{",
"return",
"getDeletedCertificateWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"certificateName",
")",
".",
"toBlocking",
"(",
")"... | Retrieves information about the specified deleted certificate.
The GetDeletedCertificate operation retrieves the deleted certificate information plus its attributes, such as retention interval, scheduled permanent deletion and the current deletion recovery level. This operation requires the certificates/get permission.... | [
"Retrieves",
"information",
"about",
"the",
"specified",
"deleted",
"certificate",
".",
"The",
"GetDeletedCertificate",
"operation",
"retrieves",
"the",
"deleted",
"certificate",
"information",
"plus",
"its",
"attributes",
"such",
"as",
"retention",
"interval",
"schedul... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L8534-L8536 |
RoaringBitmap/RoaringBitmap | roaringbitmap/src/main/java/org/roaringbitmap/buffer/ImmutableRoaringBitmap.java | ImmutableRoaringBitmap.andNot | public static MutableRoaringBitmap andNot(final ImmutableRoaringBitmap x1,
final ImmutableRoaringBitmap x2, long rangeStart, long rangeEnd) {
"""
Bitwise ANDNOT (difference) operation for the given range, rangeStart (inclusive) and rangeEnd
(exclusive). The provided bitmaps are *not* modified. This operatio... | java | public static MutableRoaringBitmap andNot(final ImmutableRoaringBitmap x1,
final ImmutableRoaringBitmap x2, long rangeStart, long rangeEnd) {
MutableRoaringBitmap.rangeSanityCheck(rangeStart,rangeEnd);
MutableRoaringBitmap rb1 = selectRangeWithoutCopy(x1, rangeStart, rangeEnd);
MutableRoaringBitmap rb... | [
"public",
"static",
"MutableRoaringBitmap",
"andNot",
"(",
"final",
"ImmutableRoaringBitmap",
"x1",
",",
"final",
"ImmutableRoaringBitmap",
"x2",
",",
"long",
"rangeStart",
",",
"long",
"rangeEnd",
")",
"{",
"MutableRoaringBitmap",
".",
"rangeSanityCheck",
"(",
"range... | Bitwise ANDNOT (difference) operation for the given range, rangeStart (inclusive) and rangeEnd
(exclusive). The provided bitmaps are *not* modified. This operation is thread-safe as long as
the provided bitmaps remain unchanged.
@param x1 first bitmap
@param x2 other bitmap
@param rangeStart beginning of the range (in... | [
"Bitwise",
"ANDNOT",
"(",
"difference",
")",
"operation",
"for",
"the",
"given",
"range",
"rangeStart",
"(",
"inclusive",
")",
"and",
"rangeEnd",
"(",
"exclusive",
")",
".",
"The",
"provided",
"bitmaps",
"are",
"*",
"not",
"*",
"modified",
".",
"This",
"op... | train | https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/buffer/ImmutableRoaringBitmap.java#L360-L366 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/nio/PathFileObject.java | PathFileObject.createDirectoryPathFileObject | static PathFileObject createDirectoryPathFileObject(JavacPathFileManager fileManager,
final Path path, final Path dir) {
"""
Create a PathFileObject within a directory, such that the binary name
can be inferred from the relationship to the parent directory.
"""
return new PathFileObject(fi... | java | static PathFileObject createDirectoryPathFileObject(JavacPathFileManager fileManager,
final Path path, final Path dir) {
return new PathFileObject(fileManager, path) {
@Override
String inferBinaryName(Iterable<? extends Path> paths) {
return toBinaryName(dir.r... | [
"static",
"PathFileObject",
"createDirectoryPathFileObject",
"(",
"JavacPathFileManager",
"fileManager",
",",
"final",
"Path",
"path",
",",
"final",
"Path",
"dir",
")",
"{",
"return",
"new",
"PathFileObject",
"(",
"fileManager",
",",
"path",
")",
"{",
"@",
"Overri... | Create a PathFileObject within a directory, such that the binary name
can be inferred from the relationship to the parent directory. | [
"Create",
"a",
"PathFileObject",
"within",
"a",
"directory",
"such",
"that",
"the",
"binary",
"name",
"can",
"be",
"inferred",
"from",
"the",
"relationship",
"to",
"the",
"parent",
"directory",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/nio/PathFileObject.java#L71-L79 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/protocols/payments/PaymentProtocol.java | PaymentProtocol.createPayToAddressOutput | public static Protos.Output createPayToAddressOutput(@Nullable Coin amount, Address address) {
"""
Create a standard pay to address output for usage in {@link #createPaymentRequest} and
{@link #createPaymentMessage}.
@param amount amount to pay, or null
@param address address to pay to
@return output
"""... | java | public static Protos.Output createPayToAddressOutput(@Nullable Coin amount, Address address) {
Protos.Output.Builder output = Protos.Output.newBuilder();
if (amount != null) {
final NetworkParameters params = address.getParameters();
if (params.hasMaxMoney() && amount.compareTo(p... | [
"public",
"static",
"Protos",
".",
"Output",
"createPayToAddressOutput",
"(",
"@",
"Nullable",
"Coin",
"amount",
",",
"Address",
"address",
")",
"{",
"Protos",
".",
"Output",
".",
"Builder",
"output",
"=",
"Protos",
".",
"Output",
".",
"newBuilder",
"(",
")"... | Create a standard pay to address output for usage in {@link #createPaymentRequest} and
{@link #createPaymentMessage}.
@param amount amount to pay, or null
@param address address to pay to
@return output | [
"Create",
"a",
"standard",
"pay",
"to",
"address",
"output",
"for",
"usage",
"in",
"{",
"@link",
"#createPaymentRequest",
"}",
"and",
"{",
"@link",
"#createPaymentMessage",
"}",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/protocols/payments/PaymentProtocol.java#L400-L412 |
MKLab-ITI/multimedia-indexing | src/main/java/gr/iti/mklab/visual/dimreduction/PCA.java | PCA.sampleToEigenSpace | public double[] sampleToEigenSpace(double[] sampleData) throws Exception {
"""
Converts a vector from sample space into eigen space. If {@link #doWhitening} is true, then the vector
is also L2 normalized after projection.
@param sampleData
Sample space vector
@return Eigen space projected vector
@throws Exc... | java | public double[] sampleToEigenSpace(double[] sampleData) throws Exception {
if (!isPcaInitialized) {
// initiallize PCA correctly!
throw new Exception("PCA is not correctly initiallized!");
}
if (sampleData.length != sampleSize) {
throw new IllegalArgumentException("Unexpected vector length!");
}... | [
"public",
"double",
"[",
"]",
"sampleToEigenSpace",
"(",
"double",
"[",
"]",
"sampleData",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"isPcaInitialized",
")",
"{",
"// initiallize PCA correctly!\r",
"throw",
"new",
"Exception",
"(",
"\"PCA is not correctly ini... | Converts a vector from sample space into eigen space. If {@link #doWhitening} is true, then the vector
is also L2 normalized after projection.
@param sampleData
Sample space vector
@return Eigen space projected vector
@throws Exception | [
"Converts",
"a",
"vector",
"from",
"sample",
"space",
"into",
"eigen",
"space",
".",
"If",
"{",
"@link",
"#doWhitening",
"}",
"is",
"true",
"then",
"the",
"vector",
"is",
"also",
"L2",
"normalized",
"after",
"projection",
"."
] | train | https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/dimreduction/PCA.java#L188-L208 |
Azure/azure-sdk-for-java | iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificatesInner.java | CertificatesInner.createOrUpdate | public CertificateDescriptionInner createOrUpdate(String resourceGroupName, String resourceName, String certificateName) {
"""
Upload the certificate to the IoT hub.
Adds new or replaces existing certificate.
@param resourceGroupName The name of the resource group that contains the IoT hub.
@param resourceNam... | java | public CertificateDescriptionInner createOrUpdate(String resourceGroupName, String resourceName, String certificateName) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, certificateName).toBlocking().single().body();
} | [
"public",
"CertificateDescriptionInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"String",
"certificateName",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
",",
... | Upload the certificate to the IoT hub.
Adds new or replaces existing certificate.
@param resourceGroupName The name of the resource group that contains the IoT hub.
@param resourceName The name of the IoT hub.
@param certificateName The name of the certificate
@throws IllegalArgumentException thrown if parameters fail... | [
"Upload",
"the",
"certificate",
"to",
"the",
"IoT",
"hub",
".",
"Adds",
"new",
"or",
"replaces",
"existing",
"certificate",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/CertificatesInner.java#L285-L287 |
dbracewell/mango | src/main/java/com/davidbracewell/json/JsonReader.java | JsonReader.endObject | public JsonReader endObject() throws IOException {
"""
Ends the document
@return the structured reader
@throws IOException Something went wrong reading
"""
if (currentValue.getKey() != END_OBJECT) {
throw new IOException("Expecting END_OBJECT, but found " + jsonTokenToStructuredElement(null)... | java | public JsonReader endObject() throws IOException {
if (currentValue.getKey() != END_OBJECT) {
throw new IOException("Expecting END_OBJECT, but found " + jsonTokenToStructuredElement(null));
}
consume();
return this;
} | [
"public",
"JsonReader",
"endObject",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"currentValue",
".",
"getKey",
"(",
")",
"!=",
"END_OBJECT",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Expecting END_OBJECT, but found \"",
"+",
"jsonTokenToStructuredElem... | Ends the document
@return the structured reader
@throws IOException Something went wrong reading | [
"Ends",
"the",
"document"
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L272-L278 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ManagedClustersInner.java | ManagedClustersInner.beginResetAADProfile | public void beginResetAADProfile(String resourceGroupName, String resourceName, ManagedClusterAADProfile parameters) {
"""
Reset AAD Profile of a managed cluster.
Update the AAD Profile for a managed cluster.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the managed ... | java | public void beginResetAADProfile(String resourceGroupName, String resourceName, ManagedClusterAADProfile parameters) {
beginResetAADProfileWithServiceResponseAsync(resourceGroupName, resourceName, parameters).toBlocking().single().body();
} | [
"public",
"void",
"beginResetAADProfile",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ManagedClusterAADProfile",
"parameters",
")",
"{",
"beginResetAADProfileWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
",",
"parameter... | Reset AAD Profile of a managed cluster.
Update the AAD Profile for a managed cluster.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the managed cluster resource.
@param parameters Parameters supplied to the Reset AAD Profile operation for a Managed Cluster.
@throws IllegalArg... | [
"Reset",
"AAD",
"Profile",
"of",
"a",
"managed",
"cluster",
".",
"Update",
"the",
"AAD",
"Profile",
"for",
"a",
"managed",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ManagedClustersInner.java#L1753-L1755 |
sebastiangraf/jSCSI | bundles/target/src/main/java/org/jscsi/target/connection/stage/fullfeature/TargetFullFeatureStage.java | TargetFullFeatureStage.createFixedFormatErrorPdu | protected static final ProtocolDataUnit createFixedFormatErrorPdu(
final FieldPointerSenseKeySpecificData[] senseKeySpecificData,
final AdditionalSenseCodeAndQualifier additionalSenseCodeAndQualifier, final int initiatorTaskTag,
final int expectedDataTransferLength) {
"""
Creates a PDU w... | java | protected static final ProtocolDataUnit createFixedFormatErrorPdu(
final FieldPointerSenseKeySpecificData[] senseKeySpecificData,
final AdditionalSenseCodeAndQualifier additionalSenseCodeAndQualifier, final int initiatorTaskTag,
final int expectedDataTransferLength) {
// create the... | [
"protected",
"static",
"final",
"ProtocolDataUnit",
"createFixedFormatErrorPdu",
"(",
"final",
"FieldPointerSenseKeySpecificData",
"[",
"]",
"senseKeySpecificData",
",",
"final",
"AdditionalSenseCodeAndQualifier",
"additionalSenseCodeAndQualifier",
",",
"final",
"int",
"initiator... | Creates a PDU with {@link FixedFormatSenseData} that must be sent to the initiator after receiving a
Command
Descriptor Block with an illegal field.
@param senseKeySpecificData
contains a list of all illegal fields
@param additionalSenseCodeAndQualifier
provides more specific information about the cause of the check c... | [
"Creates",
"a",
"PDU",
"with",
"{",
"@link",
"FixedFormatSenseData",
"}",
"that",
"must",
"be",
"sent",
"to",
"the",
"initiator",
"after",
"receiving",
"a",
"Command",
"Descriptor",
"Block",
"with",
"an",
"illegal",
"field",
"."
] | train | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/connection/stage/fullfeature/TargetFullFeatureStage.java#L57-L101 |
Alluxio/alluxio | core/common/src/main/java/alluxio/AbstractClient.java | AbstractClient.retryRPC | protected synchronized <V> V retryRPC(RpcCallable<V> rpc, String rpcName)
throws AlluxioStatusException {
"""
Tries to execute an RPC defined as a {@link RpcCallable}. Metrics will be recorded based on
the provided rpc name.
If a {@link UnavailableException} occurs, a reconnection will be tried through
... | java | protected synchronized <V> V retryRPC(RpcCallable<V> rpc, String rpcName)
throws AlluxioStatusException {
try (Timer.Context ctx = MetricsSystem.timer(getQualifiedMetricName(rpcName)).time()) {
return retryRPCInternal(rpc, () -> {
MetricsSystem.counter(getQualifiedRetryMetricName(rpcName)).inc()... | [
"protected",
"synchronized",
"<",
"V",
">",
"V",
"retryRPC",
"(",
"RpcCallable",
"<",
"V",
">",
"rpc",
",",
"String",
"rpcName",
")",
"throws",
"AlluxioStatusException",
"{",
"try",
"(",
"Timer",
".",
"Context",
"ctx",
"=",
"MetricsSystem",
".",
"timer",
"... | Tries to execute an RPC defined as a {@link RpcCallable}. Metrics will be recorded based on
the provided rpc name.
If a {@link UnavailableException} occurs, a reconnection will be tried through
{@link #connect()} and the action will be re-executed.
@param rpc the RPC call to be executed
@param rpcName the human reada... | [
"Tries",
"to",
"execute",
"an",
"RPC",
"defined",
"as",
"a",
"{",
"@link",
"RpcCallable",
"}",
".",
"Metrics",
"will",
"be",
"recorded",
"based",
"on",
"the",
"provided",
"rpc",
"name",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/AbstractClient.java#L349-L360 |
NoraUi/NoraUi | src/main/java/com/github/noraui/data/db/DBDataProvider.java | DBDataProvider.readValue | @Override
public String readValue(String column, int line) throws TechnicalException {
"""
{@inheritDoc}
@throws TechnicalException
is thrown if you have a technical error (IOException on .sql file) in NoraUi.
"""
logger.debug("readValue: column:[{}] and line:[{}] ", column, line);
Stri... | java | @Override
public String readValue(String column, int line) throws TechnicalException {
logger.debug("readValue: column:[{}] and line:[{}] ", column, line);
String sqlRequest;
try {
final Path file = Paths.get(dataInPath + scenarioName + ".sql");
sqlRequest = new Strin... | [
"@",
"Override",
"public",
"String",
"readValue",
"(",
"String",
"column",
",",
"int",
"line",
")",
"throws",
"TechnicalException",
"{",
"logger",
".",
"debug",
"(",
"\"readValue: column:[{}] and line:[{}] \"",
",",
"column",
",",
"line",
")",
";",
"String",
"sq... | {@inheritDoc}
@throws TechnicalException
is thrown if you have a technical error (IOException on .sql file) in NoraUi. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/data/db/DBDataProvider.java#L122-L145 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/classify/GeneralDataset.java | GeneralDataset.addAll | public void addAll(Iterable<? extends Datum<L,F>> data) {
"""
Adds all Datums in the given collection of data to this dataset
@param data collection of datums you would like to add to the dataset
"""
for (Datum<L, F> d : data) {
add(d);
}
} | java | public void addAll(Iterable<? extends Datum<L,F>> data) {
for (Datum<L, F> d : data) {
add(d);
}
} | [
"public",
"void",
"addAll",
"(",
"Iterable",
"<",
"?",
"extends",
"Datum",
"<",
"L",
",",
"F",
">",
">",
"data",
")",
"{",
"for",
"(",
"Datum",
"<",
"L",
",",
"F",
">",
"d",
":",
"data",
")",
"{",
"add",
"(",
"d",
")",
";",
"}",
"}"
] | Adds all Datums in the given collection of data to this dataset
@param data collection of datums you would like to add to the dataset | [
"Adds",
"all",
"Datums",
"in",
"the",
"given",
"collection",
"of",
"data",
"to",
"this",
"dataset"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/classify/GeneralDataset.java#L214-L218 |
loldevs/riotapi | rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java | ThrottledApiHandler.getLeagueEntries | public Future<Map<Long, List<LeagueItem>>> getLeagueEntries(long... summoners) {
"""
Get a listing of all league entries in the summoners' leagues
@param summoners The ids of the summoners
@return A map, mapping summoner ids to lists of league entries for that summoner
@see <a href=https://developer.riotgames.c... | java | public Future<Map<Long, List<LeagueItem>>> getLeagueEntries(long... summoners) {
return new ApiFuture<>(() -> handler.getLeagueEntries(summoners));
} | [
"public",
"Future",
"<",
"Map",
"<",
"Long",
",",
"List",
"<",
"LeagueItem",
">",
">",
">",
"getLeagueEntries",
"(",
"long",
"...",
"summoners",
")",
"{",
"return",
"new",
"ApiFuture",
"<>",
"(",
"(",
")",
"->",
"handler",
".",
"getLeagueEntries",
"(",
... | Get a listing of all league entries in the summoners' leagues
@param summoners The ids of the summoners
@return A map, mapping summoner ids to lists of league entries for that summoner
@see <a href=https://developer.riotgames.com/api/methods#!/593/1863>Official API documentation</a> | [
"Get",
"a",
"listing",
"of",
"all",
"league",
"entries",
"in",
"the",
"summoners",
"leagues"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L255-L257 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/YearMonth.java | YearMonth.plusYears | public YearMonth plusYears(long yearsToAdd) {
"""
Returns a copy of this {@code YearMonth} with the specified number of years added.
<p>
This instance is immutable and unaffected by this method call.
@param yearsToAdd the years to add, may be negative
@return a {@code YearMonth} based on this year-month wit... | java | public YearMonth plusYears(long yearsToAdd) {
if (yearsToAdd == 0) {
return this;
}
int newYear = YEAR.checkValidIntValue(year + yearsToAdd); // safe overflow
return with(newYear, month);
} | [
"public",
"YearMonth",
"plusYears",
"(",
"long",
"yearsToAdd",
")",
"{",
"if",
"(",
"yearsToAdd",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"int",
"newYear",
"=",
"YEAR",
".",
"checkValidIntValue",
"(",
"year",
"+",
"yearsToAdd",
")",
";",
"// saf... | Returns a copy of this {@code YearMonth} with the specified number of years added.
<p>
This instance is immutable and unaffected by this method call.
@param yearsToAdd the years to add, may be negative
@return a {@code YearMonth} based on this year-month with the years added, not null
@throws DateTimeException if the... | [
"Returns",
"a",
"copy",
"of",
"this",
"{",
"@code",
"YearMonth",
"}",
"with",
"the",
"specified",
"number",
"of",
"years",
"added",
".",
"<p",
">",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/YearMonth.java#L823-L829 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/conf/Configuration.java | Configuration.getLocalPath | public Path getLocalPath(String dirsProp, String path)
throws IOException {
"""
Get a local file under a directory named by <i>dirsProp</i> with
the given <i>path</i>. If <i>dirsProp</i> contains multiple directories,
then one is chosen based on <i>path</i>'s hash code. If the selected
directory does not ... | java | public Path getLocalPath(String dirsProp, String path)
throws IOException {
String[] dirs = getStrings(dirsProp);
int hashCode = path.hashCode();
FileSystem fs = FileSystem.getLocal(this);
for (int i = 0; i < dirs.length; i++) { // try each local dir
int index = (hashCode+i & Integer.MAX_VALU... | [
"public",
"Path",
"getLocalPath",
"(",
"String",
"dirsProp",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"String",
"[",
"]",
"dirs",
"=",
"getStrings",
"(",
"dirsProp",
")",
";",
"int",
"hashCode",
"=",
"path",
".",
"hashCode",
"(",
")",
";... | Get a local file under a directory named by <i>dirsProp</i> with
the given <i>path</i>. If <i>dirsProp</i> contains multiple directories,
then one is chosen based on <i>path</i>'s hash code. If the selected
directory does not exist, an attempt is made to create it.
@param dirsProp directory in which to locate the fi... | [
"Get",
"a",
"local",
"file",
"under",
"a",
"directory",
"named",
"by",
"<i",
">",
"dirsProp<",
"/",
"i",
">",
"with",
"the",
"given",
"<i",
">",
"path<",
"/",
"i",
">",
".",
"If",
"<i",
">",
"dirsProp<",
"/",
"i",
">",
"contains",
"multiple",
"dire... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/conf/Configuration.java#L961-L981 |
jkrasnay/sqlbuilder | src/main/java/ca/krasnay/sqlbuilder/AbstractSqlBuilder.java | AbstractSqlBuilder.appendList | protected void appendList(StringBuilder sql, List<?> list, String init, String sep) {
"""
Constructs a list of items with given separators.
@param sql
StringBuilder to which the constructed string will be
appended.
@param list
List of objects (usually strings) to join.
@param init
String to be added to th... | java | protected void appendList(StringBuilder sql, List<?> list, String init, String sep) {
boolean first = true;
for (Object s : list) {
if (first) {
sql.append(init);
} else {
sql.append(sep);
}
sql.append(s);
firs... | [
"protected",
"void",
"appendList",
"(",
"StringBuilder",
"sql",
",",
"List",
"<",
"?",
">",
"list",
",",
"String",
"init",
",",
"String",
"sep",
")",
"{",
"boolean",
"first",
"=",
"true",
";",
"for",
"(",
"Object",
"s",
":",
"list",
")",
"{",
"if",
... | Constructs a list of items with given separators.
@param sql
StringBuilder to which the constructed string will be
appended.
@param list
List of objects (usually strings) to join.
@param init
String to be added to the start of the list, before any of the
items.
@param sep
Separator string to be added between items in ... | [
"Constructs",
"a",
"list",
"of",
"items",
"with",
"given",
"separators",
"."
] | train | https://github.com/jkrasnay/sqlbuilder/blob/8e6acedc51cfad0527263376af51e1ef052f7147/src/main/java/ca/krasnay/sqlbuilder/AbstractSqlBuilder.java#L26-L39 |
protegeproject/jpaul | src/main/java/jpaul/DataStructs/DSUtil.java | DSUtil.checkEq | public static <E> boolean checkEq(E obj1, E obj2) {
"""
Checks equality of two objects; deals with the case when
<code>obj1</code> is null, and next invokes
<code>equals</code>.
"""
if(obj1 == null) return obj2 == null;
// make sure we do this short-circuit, just in case it's not done by equals
if(obj1 ==... | java | public static <E> boolean checkEq(E obj1, E obj2) {
if(obj1 == null) return obj2 == null;
// make sure we do this short-circuit, just in case it's not done by equals
if(obj1 == obj2) return true;
return obj1.equals(obj2);
} | [
"public",
"static",
"<",
"E",
">",
"boolean",
"checkEq",
"(",
"E",
"obj1",
",",
"E",
"obj2",
")",
"{",
"if",
"(",
"obj1",
"==",
"null",
")",
"return",
"obj2",
"==",
"null",
";",
"// make sure we do this short-circuit, just in case it's not done by equals",
"if",... | Checks equality of two objects; deals with the case when
<code>obj1</code> is null, and next invokes
<code>equals</code>. | [
"Checks",
"equality",
"of",
"two",
"objects",
";",
"deals",
"with",
"the",
"case",
"when",
"<code",
">",
"obj1<",
"/",
"code",
">",
"is",
"null",
"and",
"next",
"invokes",
"<code",
">",
"equals<",
"/",
"code",
">",
"."
] | train | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/DSUtil.java#L37-L42 |
GoogleCloudPlatform/appengine-plugins-core | src/main/java/com/google/cloud/tools/io/FileUtil.java | FileUtil.copyDirectory | public static void copyDirectory(final Path source, final Path destination) throws IOException {
"""
Implementation of recursive directory copy, does NOT overwrite.
@param source an existing source directory to copy from
@param destination an existing destination directory to copy to
@throws IllegalArgumentEx... | java | public static void copyDirectory(final Path source, final Path destination) throws IOException {
copyDirectory(source, destination, Collections.emptyList());
} | [
"public",
"static",
"void",
"copyDirectory",
"(",
"final",
"Path",
"source",
",",
"final",
"Path",
"destination",
")",
"throws",
"IOException",
"{",
"copyDirectory",
"(",
"source",
",",
"destination",
",",
"Collections",
".",
"emptyList",
"(",
")",
")",
";",
... | Implementation of recursive directory copy, does NOT overwrite.
@param source an existing source directory to copy from
@param destination an existing destination directory to copy to
@throws IllegalArgumentException if source directory is same destination directory, either
source or destination is not a directory, or... | [
"Implementation",
"of",
"recursive",
"directory",
"copy",
"does",
"NOT",
"overwrite",
"."
] | train | https://github.com/GoogleCloudPlatform/appengine-plugins-core/blob/d22e9fa1103522409ab6fdfbf68c4a5a0bc5b97d/src/main/java/com/google/cloud/tools/io/FileUtil.java#L44-L46 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/util/NLS.java | NLS.initializeMessages | public static void initializeMessages(final String bundleName, final Class clazz) {
"""
Initialize the given class with the values from the specified message bundle.
@param bundleName fully qualified path of the class name
@param clazz the class where the constants will exist
"""
if (System.getSecurityMa... | java | public static void initializeMessages(final String bundleName, final Class clazz) {
if (System.getSecurityManager() == null) {
load(bundleName, clazz);
return;
}
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
load(bundleName, clazz);
return null;
}
});
} | [
"public",
"static",
"void",
"initializeMessages",
"(",
"final",
"String",
"bundleName",
",",
"final",
"Class",
"clazz",
")",
"{",
"if",
"(",
"System",
".",
"getSecurityManager",
"(",
")",
"==",
"null",
")",
"{",
"load",
"(",
"bundleName",
",",
"clazz",
")"... | Initialize the given class with the values from the specified message bundle.
@param bundleName fully qualified path of the class name
@param clazz the class where the constants will exist | [
"Initialize",
"the",
"given",
"class",
"with",
"the",
"values",
"from",
"the",
"specified",
"message",
"bundle",
"."
] | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/util/NLS.java#L128-L139 |
morimekta/providence | providence-core/src/main/java/net/morimekta/providence/util/BaseTypeRegistry.java | BaseTypeRegistry.finalTypename | protected String finalTypename(String typeName, String programContext) {
"""
Get the final typename of the given identifier within the context.
@param typeName The identifier name.
@param programContext The program context.
@return The final typename.
"""
String qualifiedName = qualifiedTypenameIn... | java | protected String finalTypename(String typeName, String programContext) {
String qualifiedName = qualifiedTypenameInternal(typeName, programContext);
if (typedefs.containsKey(qualifiedName)) {
String resolved = typedefs.get(qualifiedName);
return finalTypename(resolved, programCo... | [
"protected",
"String",
"finalTypename",
"(",
"String",
"typeName",
",",
"String",
"programContext",
")",
"{",
"String",
"qualifiedName",
"=",
"qualifiedTypenameInternal",
"(",
"typeName",
",",
"programContext",
")",
";",
"if",
"(",
"typedefs",
".",
"containsKey",
... | Get the final typename of the given identifier within the context.
@param typeName The identifier name.
@param programContext The program context.
@return The final typename. | [
"Get",
"the",
"final",
"typename",
"of",
"the",
"given",
"identifier",
"within",
"the",
"context",
"."
] | train | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java/net/morimekta/providence/util/BaseTypeRegistry.java#L166-L175 |
VoltDB/voltdb | src/frontend/org/voltdb/ElasticHashinator.java | ElasticHashinator.getConfigureBytes | public static byte[] getConfigureBytes(int partitionCount, int tokenCount) {
"""
Convenience method for generating a deterministic token distribution for the ring based
on a given partition count and tokens per partition. Each partition will have N tokens
placed randomly on the ring.
"""
Precondition... | java | public static byte[] getConfigureBytes(int partitionCount, int tokenCount) {
Preconditions.checkArgument(partitionCount > 0);
Preconditions.checkArgument(tokenCount > partitionCount);
Buckets buckets = new Buckets(partitionCount, tokenCount);
ElasticHashinator hashinator = new ElasticHas... | [
"public",
"static",
"byte",
"[",
"]",
"getConfigureBytes",
"(",
"int",
"partitionCount",
",",
"int",
"tokenCount",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"partitionCount",
">",
"0",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"tokenCount... | Convenience method for generating a deterministic token distribution for the ring based
on a given partition count and tokens per partition. Each partition will have N tokens
placed randomly on the ring. | [
"Convenience",
"method",
"for",
"generating",
"a",
"deterministic",
"token",
"distribution",
"for",
"the",
"ring",
"based",
"on",
"a",
"given",
"partition",
"count",
"and",
"tokens",
"per",
"partition",
".",
"Each",
"partition",
"will",
"have",
"N",
"tokens",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/ElasticHashinator.java#L200-L206 |
kubernetes-client/java | util/src/main/java/io/kubernetes/client/informer/cache/Cache.java | Cache.indexKeys | @Override
public List<String> indexKeys(String indexName, String indexKey) {
"""
Index keys list.
@param indexName the index name
@param indexKey the index key
@return the list
"""
lock.lock();
try {
if (!this.indexers.containsKey(indexName)) {
throw new IllegalArgumentException(St... | java | @Override
public List<String> indexKeys(String indexName, String indexKey) {
lock.lock();
try {
if (!this.indexers.containsKey(indexName)) {
throw new IllegalArgumentException(String.format("index %s doesn't exist!", indexName));
}
Map<String, Set<String>> index = this.indices.get(in... | [
"@",
"Override",
"public",
"List",
"<",
"String",
">",
"indexKeys",
"(",
"String",
"indexName",
",",
"String",
"indexKey",
")",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"!",
"this",
".",
"indexers",
".",
"containsKey",
"(",
"in... | Index keys list.
@param indexName the index name
@param indexKey the index key
@return the list | [
"Index",
"keys",
"list",
"."
] | train | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/Cache.java#L268-L285 |
synchronoss/cpo-api | cpo-jdbc/src/main/java/org/synchronoss/cpo/transform/jdbc/TransformCharArray.java | TransformCharArray.transformOut | @Override
public String transformOut(JdbcPreparedStatementFactory jpsf, char[] attributeObject) throws CpoException {
"""
Transforms the data from the class attribute to the object required by the datasource
@param cpoAdapter The CpoAdapter for the datasource where the attribute is being persisted
@param par... | java | @Override
public String transformOut(JdbcPreparedStatementFactory jpsf, char[] attributeObject) throws CpoException {
String retStr = null;
if (attributeObject != null) {
retStr = new String(attributeObject);
}
return retStr;
} | [
"@",
"Override",
"public",
"String",
"transformOut",
"(",
"JdbcPreparedStatementFactory",
"jpsf",
",",
"char",
"[",
"]",
"attributeObject",
")",
"throws",
"CpoException",
"{",
"String",
"retStr",
"=",
"null",
";",
"if",
"(",
"attributeObject",
"!=",
"null",
")",... | Transforms the data from the class attribute to the object required by the datasource
@param cpoAdapter The CpoAdapter for the datasource where the attribute is being persisted
@param parentObject The object that contains the attribute being persisted.
@param attributeObject The object that represents the attribute be... | [
"Transforms",
"the",
"data",
"from",
"the",
"class",
"attribute",
"to",
"the",
"object",
"required",
"by",
"the",
"datasource"
] | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/transform/jdbc/TransformCharArray.java#L66-L75 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/jdbc/SnowflakeFileTransferAgent.java | SnowflakeFileTransferAgent.extractLocationAndPath | static public remoteLocation extractLocationAndPath(String stageLocationPath) {
"""
A small helper for extracting location name and path from full location path
@param stageLocationPath stage location
@return remoteLocation object
"""
String location = stageLocationPath;
String path = "";
// s... | java | static public remoteLocation extractLocationAndPath(String stageLocationPath)
{
String location = stageLocationPath;
String path = "";
// split stage location as location name and path
if (stageLocationPath.contains("/"))
{
location = stageLocationPath.substring(0, stageLocationPath.indexOf... | [
"static",
"public",
"remoteLocation",
"extractLocationAndPath",
"(",
"String",
"stageLocationPath",
")",
"{",
"String",
"location",
"=",
"stageLocationPath",
";",
"String",
"path",
"=",
"\"\"",
";",
"// split stage location as location name and path",
"if",
"(",
"stageLoc... | A small helper for extracting location name and path from full location path
@param stageLocationPath stage location
@return remoteLocation object | [
"A",
"small",
"helper",
"for",
"extracting",
"location",
"name",
"and",
"path",
"from",
"full",
"location",
"path"
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/jdbc/SnowflakeFileTransferAgent.java#L2775-L2788 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_scheduler_serviceName_PUT | public void billingAccount_scheduler_serviceName_PUT(String billingAccount, String serviceName, OvhScheduler body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/{billingAccount}/scheduler/{serviceName}
@param body [required] New object properties
@param billingAccount [required] T... | java | public void billingAccount_scheduler_serviceName_PUT(String billingAccount, String serviceName, OvhScheduler body) throws IOException {
String qPath = "/telephony/{billingAccount}/scheduler/{serviceName}";
StringBuilder sb = path(qPath, billingAccount, serviceName);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"billingAccount_scheduler_serviceName_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhScheduler",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/scheduler/{serviceName}\"",
";",... | Alter this object properties
REST: PUT /telephony/{billingAccount}/scheduler/{serviceName}
@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#L546-L550 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java | TheMovieDbApi.createList | public String createList(String sessionId, String name, String description) throws MovieDbException {
"""
This method lets users create a new list. A valid session id is required.
@param sessionId sessionId
@param name name
@param description description
@return The list id
@throws MovieDbException exceptio... | java | public String createList(String sessionId, String name, String description) throws MovieDbException {
return tmdbList.createList(sessionId, name, description);
} | [
"public",
"String",
"createList",
"(",
"String",
"sessionId",
",",
"String",
"name",
",",
"String",
"description",
")",
"throws",
"MovieDbException",
"{",
"return",
"tmdbList",
".",
"createList",
"(",
"sessionId",
",",
"name",
",",
"description",
")",
";",
"}"... | This method lets users create a new list. A valid session id is required.
@param sessionId sessionId
@param name name
@param description description
@return The list id
@throws MovieDbException exception | [
"This",
"method",
"lets",
"users",
"create",
"a",
"new",
"list",
".",
"A",
"valid",
"session",
"id",
"is",
"required",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java#L775-L777 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/mining/word2vec/AbstractVectorModel.java | AbstractVectorModel.nearest | public List<Map.Entry<K, Float>> nearest(K key, int size) {
"""
查询与key最相似的元素
@param key 键
@param size topN个
@return 键值对列表, 键是相似词语, 值是相似度, 按相似度降序排列
"""
Vector vector = storage.get(key);
if (vector == null)
{
return Collections.emptyList();
}
return neare... | java | public List<Map.Entry<K, Float>> nearest(K key, int size)
{
Vector vector = storage.get(key);
if (vector == null)
{
return Collections.emptyList();
}
return nearest(key, vector, size);
} | [
"public",
"List",
"<",
"Map",
".",
"Entry",
"<",
"K",
",",
"Float",
">",
">",
"nearest",
"(",
"K",
"key",
",",
"int",
"size",
")",
"{",
"Vector",
"vector",
"=",
"storage",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"vector",
"==",
"null",
")"... | 查询与key最相似的元素
@param key 键
@param size topN个
@return 键值对列表, 键是相似词语, 值是相似度, 按相似度降序排列 | [
"查询与key最相似的元素"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/word2vec/AbstractVectorModel.java#L78-L86 |
Activiti/Activiti | activiti-engine/src/main/java/org/activiti/engine/impl/util/json/CDL.java | CDL.rowToJSONObject | public static JSONObject rowToJSONObject(JSONArray names, JSONTokener x) throws JSONException {
"""
Produce a JSONObject from a row of comma delimited text, using a parallel JSONArray of strings to provides the names of the elements.
@param names
A JSONArray of names. This is commonly obtained from the first r... | java | public static JSONObject rowToJSONObject(JSONArray names, JSONTokener x) throws JSONException {
JSONArray ja = rowToJSONArray(x);
return ja != null ? ja.toJSONObject(names) : null;
} | [
"public",
"static",
"JSONObject",
"rowToJSONObject",
"(",
"JSONArray",
"names",
",",
"JSONTokener",
"x",
")",
"throws",
"JSONException",
"{",
"JSONArray",
"ja",
"=",
"rowToJSONArray",
"(",
"x",
")",
";",
"return",
"ja",
"!=",
"null",
"?",
"ja",
".",
"toJSONO... | Produce a JSONObject from a row of comma delimited text, using a parallel JSONArray of strings to provides the names of the elements.
@param names
A JSONArray of names. This is commonly obtained from the first row of a comma delimited text file using the rowToJSONArray method.
@param x
A JSONTokener of the source text... | [
"Produce",
"a",
"JSONObject",
"from",
"a",
"row",
"of",
"comma",
"delimited",
"text",
"using",
"a",
"parallel",
"JSONArray",
"of",
"strings",
"to",
"provides",
"the",
"names",
"of",
"the",
"elements",
"."
] | train | https://github.com/Activiti/Activiti/blob/82e2b2cd2083b2f734ca0efc7815389c0f2517d9/activiti-engine/src/main/java/org/activiti/engine/impl/util/json/CDL.java#L128-L131 |
spotify/async-google-pubsub-client | src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java | Pubsub.listSubscriptions | public PubsubFuture<SubscriptionList> listSubscriptions(final String project) {
"""
List the Pub/Sub subscriptions in a project. This will get the first page of subscriptions. To enumerate all
subscriptions you might have to make further calls to {@link #listTopics(String, String)} with the page token in
order t... | java | public PubsubFuture<SubscriptionList> listSubscriptions(final String project) {
final String path = "projects/" + project + "/subscriptions";
return get("list subscriptions", path, readJson(SubscriptionList.class));
} | [
"public",
"PubsubFuture",
"<",
"SubscriptionList",
">",
"listSubscriptions",
"(",
"final",
"String",
"project",
")",
"{",
"final",
"String",
"path",
"=",
"\"projects/\"",
"+",
"project",
"+",
"\"/subscriptions\"",
";",
"return",
"get",
"(",
"\"list subscriptions\"",... | List the Pub/Sub subscriptions in a project. This will get the first page of subscriptions. To enumerate all
subscriptions you might have to make further calls to {@link #listTopics(String, String)} with the page token in
order to get further pages.
@param project The Google Cloud project.
@return A future that is com... | [
"List",
"the",
"Pub",
"/",
"Sub",
"subscriptions",
"in",
"a",
"project",
".",
"This",
"will",
"get",
"the",
"first",
"page",
"of",
"subscriptions",
".",
"To",
"enumerate",
"all",
"subscriptions",
"you",
"might",
"have",
"to",
"make",
"further",
"calls",
"t... | train | https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L369-L372 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.