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 |
|---|---|---|---|---|---|---|---|---|---|---|
OpenBEL/openbel-framework | org.openbel.framework.common/src/main/java/org/openbel/framework/common/lang/Signature.java | Signature.matches | public SemanticStatus matches(final Signature other) {
"""
Returns the {@link SemanticStatus semantic status} of the supplied
signature against this one.
@param other {@link Signature}
@return SemanticStatus, which may be null
"""
if (other == null) return null;
// Check simple function/r... | java | public SemanticStatus matches(final Signature other) {
if (other == null) return null;
// Check simple function/return types first
if (getFunction() != other.getFunction()) return INVALID_FUNCTION;
if (getReturnType() != other.getReturnType())
return INVALID_RETURN_TYPE;
... | [
"public",
"SemanticStatus",
"matches",
"(",
"final",
"Signature",
"other",
")",
"{",
"if",
"(",
"other",
"==",
"null",
")",
"return",
"null",
";",
"// Check simple function/return types first",
"if",
"(",
"getFunction",
"(",
")",
"!=",
"other",
".",
"getFunction... | Returns the {@link SemanticStatus semantic status} of the supplied
signature against this one.
@param other {@link Signature}
@return SemanticStatus, which may be null | [
"Returns",
"the",
"{",
"@link",
"SemanticStatus",
"semantic",
"status",
"}",
"of",
"the",
"supplied",
"signature",
"against",
"this",
"one",
"."
] | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.common/src/main/java/org/openbel/framework/common/lang/Signature.java#L289-L301 |
likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java | AbstractParser.getBoolean | protected Boolean getBoolean(final String key, final JSONObject jsonObject) {
"""
Check to make sure the JSONObject has the specified key and if so return
the value as a boolean. If no key is found null is returned.
If the value is not JSON boolean (true/false) then {@link #getNonStandardBoolean(String, JSONOb... | java | protected Boolean getBoolean(final String key, final JSONObject jsonObject) {
Boolean value = null;
if(hasKey(key, jsonObject)) {
try {
value = jsonObject.getBoolean(key);
}
catch(JSONException e) {
LOGGER.debug("Could not get boolean from JSONObject for key: " + key, e);
... | [
"protected",
"Boolean",
"getBoolean",
"(",
"final",
"String",
"key",
",",
"final",
"JSONObject",
"jsonObject",
")",
"{",
"Boolean",
"value",
"=",
"null",
";",
"if",
"(",
"hasKey",
"(",
"key",
",",
"jsonObject",
")",
")",
"{",
"try",
"{",
"value",
"=",
... | Check to make sure the JSONObject has the specified key and if so return
the value as a boolean. If no key is found null is returned.
If the value is not JSON boolean (true/false) then {@link #getNonStandardBoolean(String, JSONObject)}
is called.
@param key name of the field to fetch from the json object
@param jsonO... | [
"Check",
"to",
"make",
"sure",
"the",
"JSONObject",
"has",
"the",
"specified",
"key",
"and",
"if",
"so",
"return",
"the",
"value",
"as",
"a",
"boolean",
".",
"If",
"no",
"key",
"is",
"found",
"null",
"is",
"returned",
"."
] | train | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java#L80-L93 |
carewebframework/carewebframework-vista | org.carewebframework.vista.api-parent/org.carewebframework.vista.api.esig/src/main/java/org/carewebframework/vista/esig/ESigList.java | ESigList.indexOf | public int indexOf(IESigType eSigType, String id) {
"""
Returns the index of a sig item identified by type and id.
@param eSigType The esignature type.
@param id The item id.
@return Index of item.
"""
return items.indexOf(new ESigItem(eSigType, id));
} | java | public int indexOf(IESigType eSigType, String id) {
return items.indexOf(new ESigItem(eSigType, id));
} | [
"public",
"int",
"indexOf",
"(",
"IESigType",
"eSigType",
",",
"String",
"id",
")",
"{",
"return",
"items",
".",
"indexOf",
"(",
"new",
"ESigItem",
"(",
"eSigType",
",",
"id",
")",
")",
";",
"}"
] | Returns the index of a sig item identified by type and id.
@param eSigType The esignature type.
@param id The item id.
@return Index of item. | [
"Returns",
"the",
"index",
"of",
"a",
"sig",
"item",
"identified",
"by",
"type",
"and",
"id",
"."
] | train | https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.api-parent/org.carewebframework.vista.api.esig/src/main/java/org/carewebframework/vista/esig/ESigList.java#L94-L96 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.beginGenerateVpnProfile | public String beginGenerateVpnProfile(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) {
"""
Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication.
@param resourceGroupName Th... | java | public String beginGenerateVpnProfile(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) {
return beginGenerateVpnProfileWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body();
} | [
"public",
"String",
"beginGenerateVpnProfile",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
",",
"VpnClientParameters",
"parameters",
")",
"{",
"return",
"beginGenerateVpnProfileWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtua... | Generates VPN profile for P2S client of the virtual network gateway in the specified resource group. Used for IKEV2 and radius based authentication.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@param parameters Parameters supplied t... | [
"Generates",
"VPN",
"profile",
"for",
"P2S",
"client",
"of",
"the",
"virtual",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
".",
"Used",
"for",
"IKEV2",
"and",
"radius",
"based",
"authentication",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L1707-L1709 |
xebia/Xebium | src/main/java/com/xebia/incubator/xebium/SeleniumDriverFixture.java | SeleniumDriverFixture.doOnWith | public boolean doOnWith(final String command, final String target, final String value) {
"""
<p><code>
| ensure | do | <i>type</i> | on | <i>searchString</i> | with | <i>some text</i> |
</code></p>
@param command
@param target
@param value
@return
"""
LOG.info("Performing | " + command + " | " + targ... | java | public boolean doOnWith(final String command, final String target, final String value) {
LOG.info("Performing | " + command + " | " + target + " | " + value + " |");
return executeDoCommand(command, new String[] { unalias(target), unalias(value) });
} | [
"public",
"boolean",
"doOnWith",
"(",
"final",
"String",
"command",
",",
"final",
"String",
"target",
",",
"final",
"String",
"value",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Performing | \"",
"+",
"command",
"+",
"\" | \"",
"+",
"target",
"+",
"\" | \"",
"+... | <p><code>
| ensure | do | <i>type</i> | on | <i>searchString</i> | with | <i>some text</i> |
</code></p>
@param command
@param target
@param value
@return | [
"<p",
">",
"<code",
">",
"|",
"ensure",
"|",
"do",
"|",
"<i",
">",
"type<",
"/",
"i",
">",
"|",
"on",
"|",
"<i",
">",
"searchString<",
"/",
"i",
">",
"|",
"with",
"|",
"<i",
">",
"some",
"text<",
"/",
"i",
">",
"|",
"<",
"/",
"code",
">",
... | train | https://github.com/xebia/Xebium/blob/594f6d9e65622acdbd03dba0700b17645981da1f/src/main/java/com/xebia/incubator/xebium/SeleniumDriverFixture.java#L370-L373 |
carewebframework/carewebframework-core | org.carewebframework.messaging-parent/org.carewebframework.messaging.amqp-parent/org.carewebframework.messaging.amqp.rabbitmq/src/main/java/org/carewebframework/messaging/amqp/rabbitmq/Broker.java | Broker.sendMessage | public void sendMessage(String channel, Message message) {
"""
Sends an event to the default exchange.
@param channel Name of the channel.
@param message Message to send.
"""
ensureChannel(channel);
admin.getRabbitTemplate().convertAndSend(exchange.getName(), channel, message);
} | java | public void sendMessage(String channel, Message message) {
ensureChannel(channel);
admin.getRabbitTemplate().convertAndSend(exchange.getName(), channel, message);
} | [
"public",
"void",
"sendMessage",
"(",
"String",
"channel",
",",
"Message",
"message",
")",
"{",
"ensureChannel",
"(",
"channel",
")",
";",
"admin",
".",
"getRabbitTemplate",
"(",
")",
".",
"convertAndSend",
"(",
"exchange",
".",
"getName",
"(",
")",
",",
"... | Sends an event to the default exchange.
@param channel Name of the channel.
@param message Message to send. | [
"Sends",
"an",
"event",
"to",
"the",
"default",
"exchange",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.messaging-parent/org.carewebframework.messaging.amqp-parent/org.carewebframework.messaging.amqp.rabbitmq/src/main/java/org/carewebframework/messaging/amqp/rabbitmq/Broker.java#L104-L107 |
icode/ameba | src/main/java/ameba/db/ebean/filter/CommonExprTransformer.java | CommonExprTransformer.fillArgs | public static void fillArgs(String operator, Val<Expression>[] args, ExpressionList<?> et) {
"""
<p>fillArgs.</p>
@param operator a {@link java.lang.String} object.
@param args an array of {@link ameba.db.dsl.QueryExprMeta.Val} objects.
@param et a {@link io.ebean.ExpressionList} object.
"""
... | java | public static void fillArgs(String operator, Val<Expression>[] args, ExpressionList<?> et) {
for (Val<Expression> val : args) {
if (val.object() instanceof Expression) {
et.add(val.expr());
} else {
throw new QuerySyntaxException(Messages.get("dsl.argument... | [
"public",
"static",
"void",
"fillArgs",
"(",
"String",
"operator",
",",
"Val",
"<",
"Expression",
">",
"[",
"]",
"args",
",",
"ExpressionList",
"<",
"?",
">",
"et",
")",
"{",
"for",
"(",
"Val",
"<",
"Expression",
">",
"val",
":",
"args",
")",
"{",
... | <p>fillArgs.</p>
@param operator a {@link java.lang.String} object.
@param args an array of {@link ameba.db.dsl.QueryExprMeta.Val} objects.
@param et a {@link io.ebean.ExpressionList} object. | [
"<p",
">",
"fillArgs",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/filter/CommonExprTransformer.java#L47-L55 |
sdl/odata | odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java | EntityDataModelUtil.getAndCheckType | public static Type getAndCheckType(EntityDataModel entityDataModel, Class<?> javaType) {
"""
Gets the OData type for a Java type and throws an exception if there is no OData type for the Java type.
@param entityDataModel The entity data model.
@param javaType The Java type.
@return The OData type for t... | java | public static Type getAndCheckType(EntityDataModel entityDataModel, Class<?> javaType) {
Type type = entityDataModel.getType(javaType);
if (type == null) {
throw new ODataSystemException("No type found in the entity data model for Java type: "
+ javaType.getName());
... | [
"public",
"static",
"Type",
"getAndCheckType",
"(",
"EntityDataModel",
"entityDataModel",
",",
"Class",
"<",
"?",
">",
"javaType",
")",
"{",
"Type",
"type",
"=",
"entityDataModel",
".",
"getType",
"(",
"javaType",
")",
";",
"if",
"(",
"type",
"==",
"null",
... | Gets the OData type for a Java type and throws an exception if there is no OData type for the Java type.
@param entityDataModel The entity data model.
@param javaType The Java type.
@return The OData type for the Java type.
@throws ODataSystemException If there is no OData type for the specified Java type. | [
"Gets",
"the",
"OData",
"type",
"for",
"a",
"Java",
"type",
"and",
"throws",
"an",
"exception",
"if",
"there",
"is",
"no",
"OData",
"type",
"for",
"the",
"Java",
"type",
"."
] | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_api/src/main/java/com/sdl/odata/util/edm/EntityDataModelUtil.java#L85-L92 |
camunda/camunda-bpm-platform | distro/wildfly/subsystem/src/main/java/org/camunda/bpm/container/impl/jboss/util/CustomMarshaller.java | CustomMarshaller.getValueTypes | public static AttributeDefinition[] getValueTypes(Object instance, Class clazz) {
"""
Obtain the 'valueTypes' of the ObjectTypeAttributeDefinition through reflection because they are private in Wildfly 8.
"""
try {
if (ObjectTypeAttributeDefinition.class.isAssignableFrom(clazz)) {
Field value... | java | public static AttributeDefinition[] getValueTypes(Object instance, Class clazz) {
try {
if (ObjectTypeAttributeDefinition.class.isAssignableFrom(clazz)) {
Field valueTypesField = clazz.getDeclaredField("valueTypes");
valueTypesField.setAccessible(true);
Object value = valueTypesField.g... | [
"public",
"static",
"AttributeDefinition",
"[",
"]",
"getValueTypes",
"(",
"Object",
"instance",
",",
"Class",
"clazz",
")",
"{",
"try",
"{",
"if",
"(",
"ObjectTypeAttributeDefinition",
".",
"class",
".",
"isAssignableFrom",
"(",
"clazz",
")",
")",
"{",
"Field... | Obtain the 'valueTypes' of the ObjectTypeAttributeDefinition through reflection because they are private in Wildfly 8. | [
"Obtain",
"the",
"valueTypes",
"of",
"the",
"ObjectTypeAttributeDefinition",
"through",
"reflection",
"because",
"they",
"are",
"private",
"in",
"Wildfly",
"8",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/distro/wildfly/subsystem/src/main/java/org/camunda/bpm/container/impl/jboss/util/CustomMarshaller.java#L36-L54 |
Azure/azure-sdk-for-java | dns/resource-manager/v2016_04_01/src/main/java/com/microsoft/azure/management/dns/v2016_04_01/implementation/ZonesInner.java | ZonesInner.beginDelete | public ZoneDeleteResultInner beginDelete(String resourceGroupName, String zoneName, String ifMatch) {
"""
Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone.
@param resourceGroupName The name of the resource group.
@param zoneName The name of the DNS ... | java | public ZoneDeleteResultInner beginDelete(String resourceGroupName, String zoneName, String ifMatch) {
return beginDeleteWithServiceResponseAsync(resourceGroupName, zoneName, ifMatch).toBlocking().single().body();
} | [
"public",
"ZoneDeleteResultInner",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"zoneName",
",",
"String",
"ifMatch",
")",
"{",
"return",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"zoneName",
",",
"ifMatch",
")",
".",
"... | Deletes a DNS zone. WARNING: All DNS records in the zone will also be deleted. This operation cannot be undone.
@param resourceGroupName The name of the resource group.
@param zoneName The name of the DNS zone (without a terminating dot).
@param ifMatch The etag of the DNS zone. Omit this value to always delete the cu... | [
"Deletes",
"a",
"DNS",
"zone",
".",
"WARNING",
":",
"All",
"DNS",
"records",
"in",
"the",
"zone",
"will",
"also",
"be",
"deleted",
".",
"This",
"operation",
"cannot",
"be",
"undone",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/dns/resource-manager/v2016_04_01/src/main/java/com/microsoft/azure/management/dns/v2016_04_01/implementation/ZonesInner.java#L526-L528 |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java | DevicesInner.createOrUpdate | public DataBoxEdgeDeviceInner createOrUpdate(String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice) {
"""
Creates or updates a Data Box Edge/Gateway resource.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@param dataBoxEdgeDevice The resou... | java | public DataBoxEdgeDeviceInner createOrUpdate(String deviceName, String resourceGroupName, DataBoxEdgeDeviceInner dataBoxEdgeDevice) {
return createOrUpdateWithServiceResponseAsync(deviceName, resourceGroupName, dataBoxEdgeDevice).toBlocking().last().body();
} | [
"public",
"DataBoxEdgeDeviceInner",
"createOrUpdate",
"(",
"String",
"deviceName",
",",
"String",
"resourceGroupName",
",",
"DataBoxEdgeDeviceInner",
"dataBoxEdgeDevice",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"deviceName",
",",
"resourceGroupName",
... | Creates or updates a Data Box Edge/Gateway resource.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@param dataBoxEdgeDevice The resource object.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by s... | [
"Creates",
"or",
"updates",
"a",
"Data",
"Box",
"Edge",
"/",
"Gateway",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java#L703-L705 |
LearnLib/automatalib | commons/smartcollections/src/main/java/net/automatalib/commons/smartcollections/AbstractLinkedList.java | AbstractLinkedList.replaceEntry | protected void replaceEntry(T oldEntry, T newEntry) {
"""
Replaces an entry in the list.
@param oldEntry
the entry to be replaced.
@param newEntry
the replacement entry.
"""
T prev = oldEntry.getPrev();
T next = newEntry.getNext();
if (prev != null) {
prev.setNext(newE... | java | protected void replaceEntry(T oldEntry, T newEntry) {
T prev = oldEntry.getPrev();
T next = newEntry.getNext();
if (prev != null) {
prev.setNext(newEntry);
} else {
head = newEntry;
}
if (next != null) {
next.setPrev(newEntry);
... | [
"protected",
"void",
"replaceEntry",
"(",
"T",
"oldEntry",
",",
"T",
"newEntry",
")",
"{",
"T",
"prev",
"=",
"oldEntry",
".",
"getPrev",
"(",
")",
";",
"T",
"next",
"=",
"newEntry",
".",
"getNext",
"(",
")",
";",
"if",
"(",
"prev",
"!=",
"null",
")... | Replaces an entry in the list.
@param oldEntry
the entry to be replaced.
@param newEntry
the replacement entry. | [
"Replaces",
"an",
"entry",
"in",
"the",
"list",
"."
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/commons/smartcollections/src/main/java/net/automatalib/commons/smartcollections/AbstractLinkedList.java#L179-L192 |
lordcodes/SnackbarBuilder | snackbarbuilder/src/main/java/com/github/andrewlord1990/snackbarbuilder/SnackbarBuilder.java | SnackbarBuilder.dismissCallback | @SuppressWarnings("WeakerAccess")
public SnackbarBuilder dismissCallback(final SnackbarDismissCallback callback) {
"""
Set the callback to be informed of the Snackbar being dismissed through some means.
@param callback The callback.
@return This instance.
"""
callbacks.add(new SnackbarCallback() {
... | java | @SuppressWarnings("WeakerAccess")
public SnackbarBuilder dismissCallback(final SnackbarDismissCallback callback) {
callbacks.add(new SnackbarCallback() {
public void onSnackbarDismissed(Snackbar snackbar, int dismissEvent) {
callback.onSnackbarDismissed(snackbar, dismissEvent);
}
});
r... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"SnackbarBuilder",
"dismissCallback",
"(",
"final",
"SnackbarDismissCallback",
"callback",
")",
"{",
"callbacks",
".",
"add",
"(",
"new",
"SnackbarCallback",
"(",
")",
"{",
"public",
"void",
"onSnackba... | Set the callback to be informed of the Snackbar being dismissed through some means.
@param callback The callback.
@return This instance. | [
"Set",
"the",
"callback",
"to",
"be",
"informed",
"of",
"the",
"Snackbar",
"being",
"dismissed",
"through",
"some",
"means",
"."
] | train | https://github.com/lordcodes/SnackbarBuilder/blob/a104a753c78ed66940c19d295e141a521cf81d73/snackbarbuilder/src/main/java/com/github/andrewlord1990/snackbarbuilder/SnackbarBuilder.java#L357-L365 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FileUtil.java | FileUtil.unZip | public static void unZip(File inFile, File unzipDir) throws IOException {
"""
Given a File input it will unzip the file in a the unzip directory
passed as the second parameter
@param inFile The zip file as input
@param unzipDir The unzip directory where to unzip the zip file.
@throws IOException
"""
En... | java | public static void unZip(File inFile, File unzipDir) throws IOException {
Enumeration<? extends ZipEntry> entries;
ZipFile zipFile = new ZipFile(inFile);
try {
entries = zipFile.entries();
while (entries.hasMoreElements()) {
ZipEntry entry = entries.nextElement();
if (!entry.isD... | [
"public",
"static",
"void",
"unZip",
"(",
"File",
"inFile",
",",
"File",
"unzipDir",
")",
"throws",
"IOException",
"{",
"Enumeration",
"<",
"?",
"extends",
"ZipEntry",
">",
"entries",
";",
"ZipFile",
"zipFile",
"=",
"new",
"ZipFile",
"(",
"inFile",
")",
";... | Given a File input it will unzip the file in a the unzip directory
passed as the second parameter
@param inFile The zip file as input
@param unzipDir The unzip directory where to unzip the zip file.
@throws IOException | [
"Given",
"a",
"File",
"input",
"it",
"will",
"unzip",
"the",
"file",
"in",
"a",
"the",
"unzip",
"directory",
"passed",
"as",
"the",
"second",
"parameter"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileUtil.java#L632-L668 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistriesInner.java | RegistriesInner.beginUpdate | public RegistryInner beginUpdate(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) {
"""
Updates a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryNa... | java | public RegistryInner beginUpdate(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).toBlocking().single().body();
} | [
"public",
"RegistryInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"RegistryUpdateParameters",
"registryUpdateParameters",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
... | Updates a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param registryUpdateParameters The parameters for updating a container registry.
@throws IllegalArgumentE... | [
"Updates",
"a",
"container",
"registry",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistriesInner.java#L717-L719 |
h2oai/h2o-3 | h2o-automl/src/main/java/ai/h2o/automl/AutoML.java | AutoML.pollAndUpdateProgress | private void pollAndUpdateProgress(Stage stage, String name, WorkAllocations.Work work, Job parentJob, Job subJob) {
"""
***************** Jobs Build / Configure / Run / Poll section (model agnostic, kind of...) *****************//
"""
pollAndUpdateProgress(stage, name, work, parentJob, subJob, false);
... | java | private void pollAndUpdateProgress(Stage stage, String name, WorkAllocations.Work work, Job parentJob, Job subJob) {
pollAndUpdateProgress(stage, name, work, parentJob, subJob, false);
} | [
"private",
"void",
"pollAndUpdateProgress",
"(",
"Stage",
"stage",
",",
"String",
"name",
",",
"WorkAllocations",
".",
"Work",
"work",
",",
"Job",
"parentJob",
",",
"Job",
"subJob",
")",
"{",
"pollAndUpdateProgress",
"(",
"stage",
",",
"name",
",",
"work",
"... | ***************** Jobs Build / Configure / Run / Poll section (model agnostic, kind of...) *****************// | [
"*****************",
"Jobs",
"Build",
"/",
"Configure",
"/",
"Run",
"/",
"Poll",
"section",
"(",
"model",
"agnostic",
"kind",
"of",
"...",
")",
"*****************",
"//"
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-automl/src/main/java/ai/h2o/automl/AutoML.java#L555-L557 |
alkacon/opencms-core | src/org/opencms/search/CmsSearchIndex.java | CmsSearchIndex.getMultiTermQueryFilter | protected Query getMultiTermQueryFilter(String field, List<String> terms) {
"""
Returns a cached Lucene term query filter for the given field and terms.<p>
@param field the field to use
@param terms the term to use
@return a cached Lucene term query filter for the given field and terms
"""
retu... | java | protected Query getMultiTermQueryFilter(String field, List<String> terms) {
return getMultiTermQueryFilter(field, null, terms);
} | [
"protected",
"Query",
"getMultiTermQueryFilter",
"(",
"String",
"field",
",",
"List",
"<",
"String",
">",
"terms",
")",
"{",
"return",
"getMultiTermQueryFilter",
"(",
"field",
",",
"null",
",",
"terms",
")",
";",
"}"
] | Returns a cached Lucene term query filter for the given field and terms.<p>
@param field the field to use
@param terms the term to use
@return a cached Lucene term query filter for the given field and terms | [
"Returns",
"a",
"cached",
"Lucene",
"term",
"query",
"filter",
"for",
"the",
"given",
"field",
"and",
"terms",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/search/CmsSearchIndex.java#L1620-L1623 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverter.java | TypeConverter.convertToLong | public static long convertToLong (@Nullable final Object aSrcValue, final long nDefault) {
"""
Convert the passed source value to long
@param aSrcValue
The source value. May be <code>null</code>.
@param nDefault
The default value to be returned if an error occurs during type
conversion.
@return The convert... | java | public static long convertToLong (@Nullable final Object aSrcValue, final long nDefault)
{
final Long aValue = convert (aSrcValue, Long.class, null);
return aValue == null ? nDefault : aValue.longValue ();
} | [
"public",
"static",
"long",
"convertToLong",
"(",
"@",
"Nullable",
"final",
"Object",
"aSrcValue",
",",
"final",
"long",
"nDefault",
")",
"{",
"final",
"Long",
"aValue",
"=",
"convert",
"(",
"aSrcValue",
",",
"Long",
".",
"class",
",",
"null",
")",
";",
... | Convert the passed source value to long
@param aSrcValue
The source value. May be <code>null</code>.
@param nDefault
The default value to be returned if an error occurs during type
conversion.
@return The converted value.
@throws RuntimeException
If the converter itself throws an exception
@see TypeConverterProviderBe... | [
"Convert",
"the",
"passed",
"source",
"value",
"to",
"long"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/typeconvert/TypeConverter.java#L375-L379 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java | DiagnosticsInner.executeSiteDetector | public DiagnosticDetectorResponseInner executeSiteDetector(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory) {
"""
Execute Detector.
Execute Detector.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param d... | java | public DiagnosticDetectorResponseInner executeSiteDetector(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory) {
return executeSiteDetectorWithServiceResponseAsync(resourceGroupName, siteName, detectorName, diagnosticCategory).toBlocking().single().body();
} | [
"public",
"DiagnosticDetectorResponseInner",
"executeSiteDetector",
"(",
"String",
"resourceGroupName",
",",
"String",
"siteName",
",",
"String",
"detectorName",
",",
"String",
"diagnosticCategory",
")",
"{",
"return",
"executeSiteDetectorWithServiceResponseAsync",
"(",
"reso... | Execute Detector.
Execute Detector.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param detectorName Detector Resource Name
@param diagnosticCategory Category Name
@throws IllegalArgumentException thrown if parameters fail the validation
@throws DefaultEr... | [
"Execute",
"Detector",
".",
"Execute",
"Detector",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L1134-L1136 |
threerings/narya | core/src/main/java/com/threerings/presents/util/ClassUtil.java | ClassUtil.findMethod | public static Method findMethod (Class<?> clazz, String name) {
"""
Locates and returns the first method in the supplied class whose name is equal to the
specified name.
@return the method with the specified name or null if no method with that name could be
found.
"""
Method[] methods = clazz.getM... | java | public static Method findMethod (Class<?> clazz, String name)
{
Method[] methods = clazz.getMethods();
for (Method method : methods) {
if (method.getName().equals(name)) {
return method;
}
}
return null;
} | [
"public",
"static",
"Method",
"findMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"name",
")",
"{",
"Method",
"[",
"]",
"methods",
"=",
"clazz",
".",
"getMethods",
"(",
")",
";",
"for",
"(",
"Method",
"method",
":",
"methods",
")",
"{"... | Locates and returns the first method in the supplied class whose name is equal to the
specified name.
@return the method with the specified name or null if no method with that name could be
found. | [
"Locates",
"and",
"returns",
"the",
"first",
"method",
"in",
"the",
"supplied",
"class",
"whose",
"name",
"is",
"equal",
"to",
"the",
"specified",
"name",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/util/ClassUtil.java#L100-L109 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/transform/pyramid/PyramidOps.java | PyramidOps.scaleDown2 | public static <T extends ImageGray<T>>
void scaleDown2(T input , T output ) {
"""
Scales down the input by a factor of 2. Every other pixel along both axises is skipped.
"""
if( input instanceof GrayF32) {
ImplPyramidOps.scaleDown2((GrayF32)input,(GrayF32)output);
} else if( input instanceof GrayU8) {... | java | public static <T extends ImageGray<T>>
void scaleDown2(T input , T output ) {
if( input instanceof GrayF32) {
ImplPyramidOps.scaleDown2((GrayF32)input,(GrayF32)output);
} else if( input instanceof GrayU8) {
ImplPyramidOps.scaleDown2((GrayU8)input,(GrayU8)output);
} else {
throw new IllegalArgumentExcept... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"void",
"scaleDown2",
"(",
"T",
"input",
",",
"T",
"output",
")",
"{",
"if",
"(",
"input",
"instanceof",
"GrayF32",
")",
"{",
"ImplPyramidOps",
".",
"scaleDown2",
"(",
"(",
"Gray... | Scales down the input by a factor of 2. Every other pixel along both axises is skipped. | [
"Scales",
"down",
"the",
"input",
"by",
"a",
"factor",
"of",
"2",
".",
"Every",
"other",
"pixel",
"along",
"both",
"axises",
"is",
"skipped",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/pyramid/PyramidOps.java#L152-L161 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/DefaultQueryParser.java | DefaultQueryParser.appendSort | protected void appendSort(SolrQuery solrQuery, @Nullable Sort sort, @Nullable Class<?> domainType) {
"""
Append sorting parameters to {@link SolrQuery}
@param solrQuery
@param sort
"""
if (sort == null) {
return;
}
for (Order order : sort) {
solrQuery.addSort(getMappedFieldName(order.getPrope... | java | protected void appendSort(SolrQuery solrQuery, @Nullable Sort sort, @Nullable Class<?> domainType) {
if (sort == null) {
return;
}
for (Order order : sort) {
solrQuery.addSort(getMappedFieldName(order.getProperty(), domainType),
order.isAscending() ? ORDER.asc : ORDER.desc);
}
} | [
"protected",
"void",
"appendSort",
"(",
"SolrQuery",
"solrQuery",
",",
"@",
"Nullable",
"Sort",
"sort",
",",
"@",
"Nullable",
"Class",
"<",
"?",
">",
"domainType",
")",
"{",
"if",
"(",
"sort",
"==",
"null",
")",
"{",
"return",
";",
"}",
"for",
"(",
"... | Append sorting parameters to {@link SolrQuery}
@param solrQuery
@param sort | [
"Append",
"sorting",
"parameters",
"to",
"{",
"@link",
"SolrQuery",
"}"
] | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/DefaultQueryParser.java#L505-L515 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/JMessageClient.java | JMessageClient.addOrRemoveCrossGroupMember | public ResponseWrapper addOrRemoveCrossGroupMember(long gid, CrossGroup[] groups)
throws APIConnectionException, APIRequestException {
"""
Add or remove group members from a given group id.
@param gid Necessary, target group id.
@param groups Necessary
@return No content
@throws APIConnectionExcept... | java | public ResponseWrapper addOrRemoveCrossGroupMember(long gid, CrossGroup[] groups)
throws APIConnectionException, APIRequestException {
return _crossAppClient.addOrRemoveCrossGroupMembers(gid, groups);
} | [
"public",
"ResponseWrapper",
"addOrRemoveCrossGroupMember",
"(",
"long",
"gid",
",",
"CrossGroup",
"[",
"]",
"groups",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"return",
"_crossAppClient",
".",
"addOrRemoveCrossGroupMembers",
"(",
"gid",
... | Add or remove group members from a given group id.
@param gid Necessary, target group id.
@param groups Necessary
@return No content
@throws APIConnectionException connect exception
@throws APIRequestException request exception | [
"Add",
"or",
"remove",
"group",
"members",
"from",
"a",
"given",
"group",
"id",
"."
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L594-L597 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_responder_account_PUT | public void domain_responder_account_PUT(String domain, String account, OvhResponder body) throws IOException {
"""
Alter this object properties
REST: PUT /email/domain/{domain}/responder/{account}
@param body [required] New object properties
@param domain [required] Name of your domain name
@param account [... | java | public void domain_responder_account_PUT(String domain, String account, OvhResponder body) throws IOException {
String qPath = "/email/domain/{domain}/responder/{account}";
StringBuilder sb = path(qPath, domain, account);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"domain_responder_account_PUT",
"(",
"String",
"domain",
",",
"String",
"account",
",",
"OvhResponder",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{domain}/responder/{account}\"",
";",
"StringBuilder",
"sb",
"="... | Alter this object properties
REST: PUT /email/domain/{domain}/responder/{account}
@param body [required] New object properties
@param domain [required] Name of your domain name
@param account [required] Name of account | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L965-L969 |
Netflix/spectator | spectator-web-spring/src/main/java/com/netflix/spectator/controllers/MetricsController.java | MetricsController.encodeRegistry | Map<String, MetricValues> encodeRegistry(
Registry sourceRegistry, Predicate<Measurement> filter) {
"""
Internal API for encoding a registry that can be encoded as JSON.
This is a helper function for the REST endpoint and to test against.
"""
Map<String, MetricValues> metricMap = new HashMap<>();
... | java | Map<String, MetricValues> encodeRegistry(
Registry sourceRegistry, Predicate<Measurement> filter) {
Map<String, MetricValues> metricMap = new HashMap<>();
/*
* Flatten the meter measurements into a map of measurements keyed by
* the name and mapped to the different tag variants.
*/
f... | [
"Map",
"<",
"String",
",",
"MetricValues",
">",
"encodeRegistry",
"(",
"Registry",
"sourceRegistry",
",",
"Predicate",
"<",
"Measurement",
">",
"filter",
")",
"{",
"Map",
"<",
"String",
",",
"MetricValues",
">",
"metricMap",
"=",
"new",
"HashMap",
"<>",
"(",... | Internal API for encoding a registry that can be encoded as JSON.
This is a helper function for the REST endpoint and to test against. | [
"Internal",
"API",
"for",
"encoding",
"a",
"registry",
"that",
"can",
"be",
"encoded",
"as",
"JSON",
".",
"This",
"is",
"a",
"helper",
"function",
"for",
"the",
"REST",
"endpoint",
"and",
"to",
"test",
"against",
"."
] | train | https://github.com/Netflix/spectator/blob/259318252770de3bad581b85adff187d8f2c6537/spectator-web-spring/src/main/java/com/netflix/spectator/controllers/MetricsController.java#L126-L156 |
undertow-io/undertow | core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/NodePingUtil.java | NodePingUtil.pingHttpClient | static void pingHttpClient(URI connection, PingCallback callback, HttpServerExchange exchange, UndertowClient client, XnioSsl xnioSsl, OptionMap options) {
"""
Try to ping a server using the undertow client.
@param connection the connection URI
@param callback the ping callback
@param exchange th... | java | static void pingHttpClient(URI connection, PingCallback callback, HttpServerExchange exchange, UndertowClient client, XnioSsl xnioSsl, OptionMap options) {
final XnioIoThread thread = exchange.getIoThread();
final RequestExchangeListener exchangeListener = new RequestExchangeListener(callback, NodeHeal... | [
"static",
"void",
"pingHttpClient",
"(",
"URI",
"connection",
",",
"PingCallback",
"callback",
",",
"HttpServerExchange",
"exchange",
",",
"UndertowClient",
"client",
",",
"XnioSsl",
"xnioSsl",
",",
"OptionMap",
"options",
")",
"{",
"final",
"XnioIoThread",
"thread"... | Try to ping a server using the undertow client.
@param connection the connection URI
@param callback the ping callback
@param exchange the http servers exchange
@param client the undertow client
@param xnioSsl the ssl setup
@param options the options | [
"Try",
"to",
"ping",
"a",
"server",
"using",
"the",
"undertow",
"client",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/NodePingUtil.java#L103-L111 |
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/ExtendedProperties.java | ExtendedProperties.get | public String get(final Object key, final boolean process) {
"""
Looks up a property. Recursively checks the defaults if necessary. If the property is found
as a system property, this value will be used.
@param key
The property key
@param process
If {@code true}, the looked-up value is passed to
{@link #pr... | java | public String get(final Object key, final boolean process) {
String value = propsMap.get(key);
if (process) {
value = processPropertyValue(value);
}
return value == null && defaults != null ? defaults.get(key) : value;
} | [
"public",
"String",
"get",
"(",
"final",
"Object",
"key",
",",
"final",
"boolean",
"process",
")",
"{",
"String",
"value",
"=",
"propsMap",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"process",
")",
"{",
"value",
"=",
"processPropertyValue",
"(",
"va... | Looks up a property. Recursively checks the defaults if necessary. If the property is found
as a system property, this value will be used.
@param key
The property key
@param process
If {@code true}, the looked-up value is passed to
{@link #processPropertyValue(String)}, and the processed result is returned.
@return Th... | [
"Looks",
"up",
"a",
"property",
".",
"Recursively",
"checks",
"the",
"defaults",
"if",
"necessary",
".",
"If",
"the",
"property",
"is",
"found",
"as",
"a",
"system",
"property",
"this",
"value",
"will",
"be",
"used",
"."
] | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/ExtendedProperties.java#L167-L173 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/snmp_trap.java | snmp_trap.update | public static snmp_trap update(nitro_service client, snmp_trap resource) throws Exception {
"""
<pre>
Use this operation to modify snmp trap destination.
</pre>
"""
resource.validate("modify");
return ((snmp_trap[]) resource.update_resource(client))[0];
} | java | public static snmp_trap update(nitro_service client, snmp_trap resource) throws Exception
{
resource.validate("modify");
return ((snmp_trap[]) resource.update_resource(client))[0];
} | [
"public",
"static",
"snmp_trap",
"update",
"(",
"nitro_service",
"client",
",",
"snmp_trap",
"resource",
")",
"throws",
"Exception",
"{",
"resource",
".",
"validate",
"(",
"\"modify\"",
")",
";",
"return",
"(",
"(",
"snmp_trap",
"[",
"]",
")",
"resource",
".... | <pre>
Use this operation to modify snmp trap destination.
</pre> | [
"<pre",
">",
"Use",
"this",
"operation",
"to",
"modify",
"snmp",
"trap",
"destination",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/snmp_trap.java#L218-L222 |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/utils/Utility.java | Utility.verifyFeatureKey | private static void verifyFeatureKey( String key, String searchedField, IHMProgressMonitor pm ) {
"""
Verify if there is a key of a FeatureCollections.
@param key
@throws IllegalArgumentException
if the key is null.
"""
if (key == null) {
if (pm != null) {
pm.errorMessa... | java | private static void verifyFeatureKey( String key, String searchedField, IHMProgressMonitor pm ) {
if (key == null) {
if (pm != null) {
pm.errorMessage(msg.message("trentoP.error.featureKey") + searchedField);
}
throw new IllegalArgumentException(msg.message("t... | [
"private",
"static",
"void",
"verifyFeatureKey",
"(",
"String",
"key",
",",
"String",
"searchedField",
",",
"IHMProgressMonitor",
"pm",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"if",
"(",
"pm",
"!=",
"null",
")",
"{",
"pm",
".",
"errorMessage"... | Verify if there is a key of a FeatureCollections.
@param key
@throws IllegalArgumentException
if the key is null. | [
"Verify",
"if",
"there",
"is",
"a",
"key",
"of",
"a",
"FeatureCollections",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/utils/Utility.java#L395-L403 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java | WikipediaTemplateInfo.revisionContainsTemplateNames | public boolean revisionContainsTemplateNames(int revId, List<String> templateNames) throws WikiApiException {
"""
Determines whether a given revision contains a given template name
@param revId
@param templateNames a list of template names
@return
@throws WikiApiException
"""
List<String> tplList = ... | java | public boolean revisionContainsTemplateNames(int revId, List<String> templateNames) throws WikiApiException{
List<String> tplList = getTemplateNamesFromRevision(revId);
for(String tpl:tplList){
for(String templateName:templateNames){
if(tpl.equalsIgnoreCase(templateName)){
return tr... | [
"public",
"boolean",
"revisionContainsTemplateNames",
"(",
"int",
"revId",
",",
"List",
"<",
"String",
">",
"templateNames",
")",
"throws",
"WikiApiException",
"{",
"List",
"<",
"String",
">",
"tplList",
"=",
"getTemplateNamesFromRevision",
"(",
"revId",
")",
";",... | Determines whether a given revision contains a given template name
@param revId
@param templateNames a list of template names
@return
@throws WikiApiException | [
"Determines",
"whether",
"a",
"given",
"revision",
"contains",
"a",
"given",
"template",
"name"
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L1265-L1275 |
mozilla/rhino | src/org/mozilla/javascript/RhinoException.java | RhinoException.getScriptStackTrace | public String getScriptStackTrace(int limit, String functionName) {
"""
Get a string representing the script stack of this exception.
If optimization is enabled, this includes java stack elements
whose source and method names suggest they have been generated
by the Rhino script compiler.
The optional "limit" p... | java | public String getScriptStackTrace(int limit, String functionName)
{
ScriptStackElement[] stack = getScriptStack(limit, functionName);
return formatStackTrace(stack, details());
} | [
"public",
"String",
"getScriptStackTrace",
"(",
"int",
"limit",
",",
"String",
"functionName",
")",
"{",
"ScriptStackElement",
"[",
"]",
"stack",
"=",
"getScriptStack",
"(",
"limit",
",",
"functionName",
")",
";",
"return",
"formatStackTrace",
"(",
"stack",
",",... | Get a string representing the script stack of this exception.
If optimization is enabled, this includes java stack elements
whose source and method names suggest they have been generated
by the Rhino script compiler.
The optional "limit" parameter limits the number of stack frames returned.
The "functionName" parameter... | [
"Get",
"a",
"string",
"representing",
"the",
"script",
"stack",
"of",
"this",
"exception",
".",
"If",
"optimization",
"is",
"enabled",
"this",
"includes",
"java",
"stack",
"elements",
"whose",
"source",
"and",
"method",
"names",
"suggest",
"they",
"have",
"bee... | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/RhinoException.java#L221-L225 |
landawn/AbacusUtil | src/com/landawn/abacus/util/JdbcUtil.java | JdbcUtil.prepareQuery | public static PreparedQuery prepareQuery(final Connection conn, final String sql, final boolean autoGeneratedKeys) throws SQLException {
"""
Never write below code because it will definitely cause {@code Connection} leak:
<pre>
<code>
JdbcUtil.prepareQuery(dataSource.getConnection(), sql, autoGeneratedKeys);
<... | java | public static PreparedQuery prepareQuery(final Connection conn, final String sql, final boolean autoGeneratedKeys) throws SQLException {
return new PreparedQuery(conn.prepareStatement(sql, autoGeneratedKeys ? Statement.RETURN_GENERATED_KEYS : Statement.NO_GENERATED_KEYS));
} | [
"public",
"static",
"PreparedQuery",
"prepareQuery",
"(",
"final",
"Connection",
"conn",
",",
"final",
"String",
"sql",
",",
"final",
"boolean",
"autoGeneratedKeys",
")",
"throws",
"SQLException",
"{",
"return",
"new",
"PreparedQuery",
"(",
"conn",
".",
"prepareSt... | Never write below code because it will definitely cause {@code Connection} leak:
<pre>
<code>
JdbcUtil.prepareQuery(dataSource.getConnection(), sql, autoGeneratedKeys);
</code>
</pre>
@param conn the specified {@code conn} won't be close after this query is executed.
@param sql
@param autoGeneratedKeys
@return
@throws... | [
"Never",
"write",
"below",
"code",
"because",
"it",
"will",
"definitely",
"cause",
"{",
"@code",
"Connection",
"}",
"leak",
":",
"<pre",
">",
"<code",
">",
"JdbcUtil",
".",
"prepareQuery",
"(",
"dataSource",
".",
"getConnection",
"()",
"sql",
"autoGeneratedKey... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/JdbcUtil.java#L1291-L1293 |
drewnoakes/metadata-extractor | Source/com/drew/lang/Rational.java | Rational.getSimplifiedInstance | @NotNull
public Rational getSimplifiedInstance() {
"""
<p>
Simplifies the representation of this {@link Rational} number.</p>
<p>
For example, 5/10 simplifies to 1/2 because both Numerator
and Denominator share a common factor of 5.</p>
<p>
Uses the Euclidean Algorithm to find the greatest common divisor... | java | @NotNull
public Rational getSimplifiedInstance()
{
long gcd = GCD(_numerator, _denominator);
return new Rational(_numerator / gcd, _denominator / gcd);
} | [
"@",
"NotNull",
"public",
"Rational",
"getSimplifiedInstance",
"(",
")",
"{",
"long",
"gcd",
"=",
"GCD",
"(",
"_numerator",
",",
"_denominator",
")",
";",
"return",
"new",
"Rational",
"(",
"_numerator",
"/",
"gcd",
",",
"_denominator",
"/",
"gcd",
")",
";"... | <p>
Simplifies the representation of this {@link Rational} number.</p>
<p>
For example, 5/10 simplifies to 1/2 because both Numerator
and Denominator share a common factor of 5.</p>
<p>
Uses the Euclidean Algorithm to find the greatest common divisor.</p>
@return A simplified instance if one exists, otherwise a copy o... | [
"<p",
">",
"Simplifies",
"the",
"representation",
"of",
"this",
"{",
"@link",
"Rational",
"}",
"number",
".",
"<",
"/",
"p",
">",
"<p",
">",
"For",
"example",
"5",
"/",
"10",
"simplifies",
"to",
"1",
"/",
"2",
"because",
"both",
"Numerator",
"and",
"... | train | https://github.com/drewnoakes/metadata-extractor/blob/a958e0b61b50e590731b3be1dca8df8e21ebd43c/Source/com/drew/lang/Rational.java#L298-L304 |
dropbox/dropbox-sdk-java | examples/upload-file/src/main/java/com/dropbox/core/examples/upload_file/Main.java | Main.uploadFile | private static void uploadFile(DbxClientV2 dbxClient, File localFile, String dropboxPath) {
"""
Uploads a file in a single request. This approach is preferred for small files since it
eliminates unnecessary round-trips to the servers.
@param dbxClient Dropbox user authenticated client
@param localFIle local f... | java | private static void uploadFile(DbxClientV2 dbxClient, File localFile, String dropboxPath) {
try (InputStream in = new FileInputStream(localFile)) {
ProgressListener progressListener = l -> printProgress(l, localFile.length());
FileMetadata metadata = dbxClient.files().uploadBuilder(drop... | [
"private",
"static",
"void",
"uploadFile",
"(",
"DbxClientV2",
"dbxClient",
",",
"File",
"localFile",
",",
"String",
"dropboxPath",
")",
"{",
"try",
"(",
"InputStream",
"in",
"=",
"new",
"FileInputStream",
"(",
"localFile",
")",
")",
"{",
"ProgressListener",
"... | Uploads a file in a single request. This approach is preferred for small files since it
eliminates unnecessary round-trips to the servers.
@param dbxClient Dropbox user authenticated client
@param localFIle local file to upload
@param dropboxPath Where to upload the file to within Dropbox | [
"Uploads",
"a",
"file",
"in",
"a",
"single",
"request",
".",
"This",
"approach",
"is",
"preferred",
"for",
"small",
"files",
"since",
"it",
"eliminates",
"unnecessary",
"round",
"-",
"trips",
"to",
"the",
"servers",
"."
] | train | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/examples/upload-file/src/main/java/com/dropbox/core/examples/upload_file/Main.java#L48-L68 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/format/DateTimeFormatterBuilder.java | DateTimeFormatterBuilder.appendInternal | private int appendInternal(DateTimePrinterParser pp) {
"""
Appends a printer and/or parser to the internal list handling padding.
@param pp the printer-parser to add, not null
@return the index into the active parsers list
"""
Jdk8Methods.requireNonNull(pp, "pp");
if (active.padNextWidth >... | java | private int appendInternal(DateTimePrinterParser pp) {
Jdk8Methods.requireNonNull(pp, "pp");
if (active.padNextWidth > 0) {
if (pp != null) {
pp = new PadPrinterParserDecorator(pp, active.padNextWidth, active.padNextChar);
}
active.padNextWidth = 0;
... | [
"private",
"int",
"appendInternal",
"(",
"DateTimePrinterParser",
"pp",
")",
"{",
"Jdk8Methods",
".",
"requireNonNull",
"(",
"pp",
",",
"\"pp\"",
")",
";",
"if",
"(",
"active",
".",
"padNextWidth",
">",
"0",
")",
"{",
"if",
"(",
"pp",
"!=",
"null",
")",
... | Appends a printer and/or parser to the internal list handling padding.
@param pp the printer-parser to add, not null
@return the index into the active parsers list | [
"Appends",
"a",
"printer",
"and",
"/",
"or",
"parser",
"to",
"the",
"internal",
"list",
"handling",
"padding",
"."
] | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/format/DateTimeFormatterBuilder.java#L1834-L1846 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/util/UrlUtilities.java | UrlUtilities.createBuddyIconUrl | @Deprecated
public static String createBuddyIconUrl(int iconFarm, int iconServer, String id) {
"""
Construct the BuddyIconUrl with {@code http} scheme.
<p>
If none available, return the <a href="http://www.flickr.com/images/buddyicon.jpg">default</a>, or an URL assembled from farm, iconserver and nsid.
@... | java | @Deprecated
public static String createBuddyIconUrl(int iconFarm, int iconServer, String id) {
return createBuddyIconUrl("http", iconFarm, iconServer, id);
} | [
"@",
"Deprecated",
"public",
"static",
"String",
"createBuddyIconUrl",
"(",
"int",
"iconFarm",
",",
"int",
"iconServer",
",",
"String",
"id",
")",
"{",
"return",
"createBuddyIconUrl",
"(",
"\"http\"",
",",
"iconFarm",
",",
"iconServer",
",",
"id",
")",
";",
... | Construct the BuddyIconUrl with {@code http} scheme.
<p>
If none available, return the <a href="http://www.flickr.com/images/buddyicon.jpg">default</a>, or an URL assembled from farm, iconserver and nsid.
@see <a href="http://flickr.com/services/api/misc.buddyicons.html">Flickr Documentation</a>
@param iconFarm
@param... | [
"Construct",
"the",
"BuddyIconUrl",
"with",
"{",
"@code",
"http",
"}",
"scheme",
".",
"<p",
">",
"If",
"none",
"available",
"return",
"the",
"<a",
"href",
"=",
"http",
":",
"//",
"www",
".",
"flickr",
".",
"com",
"/",
"images",
"/",
"buddyicon",
".",
... | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/util/UrlUtilities.java#L182-L185 |
hazelcast/hazelcast-kubernetes | src/main/java/com/hazelcast/kubernetes/RestClient.java | RestClient.buildSslSocketFactory | private SSLSocketFactory buildSslSocketFactory() {
"""
Builds SSL Socket Factory with the public CA Certificate from Kubernetes Master.
"""
try {
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
keyStore.load(null, null);
keyStore.setCertificateEn... | java | private SSLSocketFactory buildSslSocketFactory() {
try {
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
keyStore.load(null, null);
keyStore.setCertificateEntry("ca", generateCertificate());
TrustManagerFactory tmf = TrustManagerFactory.getIn... | [
"private",
"SSLSocketFactory",
"buildSslSocketFactory",
"(",
")",
"{",
"try",
"{",
"KeyStore",
"keyStore",
"=",
"KeyStore",
".",
"getInstance",
"(",
"KeyStore",
".",
"getDefaultType",
"(",
")",
")",
";",
"keyStore",
".",
"load",
"(",
"null",
",",
"null",
")"... | Builds SSL Socket Factory with the public CA Certificate from Kubernetes Master. | [
"Builds",
"SSL",
"Socket",
"Factory",
"with",
"the",
"public",
"CA",
"Certificate",
"from",
"Kubernetes",
"Master",
"."
] | train | https://github.com/hazelcast/hazelcast-kubernetes/blob/b1144067addf56d1446a9e1007f5cb3290b86815/src/main/java/com/hazelcast/kubernetes/RestClient.java#L174-L190 |
OpenTSDB/opentsdb | src/tools/TreeSync.java | TreeSync.purgeTree | public int purgeTree(final int tree_id, final boolean delete_definition)
throws Exception {
"""
Attempts to delete all data generated by the given tree, and optionally,
the tree definition itself.
@param tree_id The tree with data to delete
@param delete_definition Whether or not the tree definition itself... | java | public int purgeTree(final int tree_id, final boolean delete_definition)
throws Exception {
if (delete_definition) {
LOG.info("Deleting tree branches and definition for: " + tree_id);
} else {
LOG.info("Deleting tree branches for: " + tree_id);
}
Tree.deleteTree(tsdb, tree_id, delete_de... | [
"public",
"int",
"purgeTree",
"(",
"final",
"int",
"tree_id",
",",
"final",
"boolean",
"delete_definition",
")",
"throws",
"Exception",
"{",
"if",
"(",
"delete_definition",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Deleting tree branches and definition for: \"",
"+",
... | Attempts to delete all data generated by the given tree, and optionally,
the tree definition itself.
@param tree_id The tree with data to delete
@param delete_definition Whether or not the tree definition itself should
be removed from the system
@return 0 if completed successfully, something else if an error occurred | [
"Attempts",
"to",
"delete",
"all",
"data",
"generated",
"by",
"the",
"given",
"tree",
"and",
"optionally",
"the",
"tree",
"definition",
"itself",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/TreeSync.java#L324-L334 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric_ca/sdk/HFCAClient.java | HFCAClient.getHFCAAffiliations | public HFCAAffiliation getHFCAAffiliations(User registrar) throws AffiliationException, InvalidArgumentException {
"""
gets all affiliations that the registrar is allowed to see
@param registrar The identity of the registrar (i.e. who is performing the registration).
@return The affiliations that were requeste... | java | public HFCAAffiliation getHFCAAffiliations(User registrar) throws AffiliationException, InvalidArgumentException {
if (cryptoSuite == null) {
throw new InvalidArgumentException("Crypto primitives not set.");
}
if (registrar == null) {
throw new InvalidArgumentException("... | [
"public",
"HFCAAffiliation",
"getHFCAAffiliations",
"(",
"User",
"registrar",
")",
"throws",
"AffiliationException",
",",
"InvalidArgumentException",
"{",
"if",
"(",
"cryptoSuite",
"==",
"null",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Crypto primit... | gets all affiliations that the registrar is allowed to see
@param registrar The identity of the registrar (i.e. who is performing the registration).
@return The affiliations that were requested
@throws AffiliationException if getting all affiliations fails
@throws InvalidArgumentException | [
"gets",
"all",
"affiliations",
"that",
"the",
"registrar",
"is",
"allowed",
"to",
"see"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric_ca/sdk/HFCAClient.java#L1055-L1084 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/cors/CorsConfigBuilder.java | CorsConfigBuilder.preflightResponseHeader | public <T> CorsConfigBuilder preflightResponseHeader(final CharSequence name, final Iterable<T> value) {
"""
Returns HTTP response headers that should be added to a CORS preflight response.
An intermediary like a load balancer might require that a CORS preflight request
have certain headers set. This enables s... | java | public <T> CorsConfigBuilder preflightResponseHeader(final CharSequence name, final Iterable<T> value) {
preflightHeaders.put(name, new ConstantValueGenerator(value));
return this;
} | [
"public",
"<",
"T",
">",
"CorsConfigBuilder",
"preflightResponseHeader",
"(",
"final",
"CharSequence",
"name",
",",
"final",
"Iterable",
"<",
"T",
">",
"value",
")",
"{",
"preflightHeaders",
".",
"put",
"(",
"name",
",",
"new",
"ConstantValueGenerator",
"(",
"... | Returns HTTP response headers that should be added to a CORS preflight response.
An intermediary like a load balancer might require that a CORS preflight request
have certain headers set. This enables such headers to be added.
@param name the name of the HTTP header.
@param value the values for the HTTP header.
@para... | [
"Returns",
"HTTP",
"response",
"headers",
"that",
"should",
"be",
"added",
"to",
"a",
"CORS",
"preflight",
"response",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/cors/CorsConfigBuilder.java#L303-L306 |
phax/ph-oton | ph-oton-core/src/main/java/com/helger/photon/core/menu/ui/MenuRendererCallback.java | MenuRendererCallback.createRenderedMenu | @Nonnull
public static <T extends IHCList <T, HCLI>> T createRenderedMenu (@Nonnull final ILayoutExecutionContext aLEC,
@Nonnull final ISupplier <T> aFactory,
@Nonnull final IMenuIte... | java | @Nonnull
public static <T extends IHCList <T, HCLI>> T createRenderedMenu (@Nonnull final ILayoutExecutionContext aLEC,
@Nonnull final ISupplier <T> aFactory,
@Nonnull final IMenuIte... | [
"@",
"Nonnull",
"public",
"static",
"<",
"T",
"extends",
"IHCList",
"<",
"T",
",",
"HCLI",
">",
">",
"T",
"createRenderedMenu",
"(",
"@",
"Nonnull",
"final",
"ILayoutExecutionContext",
"aLEC",
",",
"@",
"Nonnull",
"final",
"ISupplier",
"<",
"T",
">",
"aFac... | Render the whole menu
@param aLEC
The current layout execution context. Required for cookie-less
handling. May not be <code>null</code>.
@param aFactory
The factory to be used to create nodes of type T. May not be
<code>null</code>.
@param aRenderer
The renderer to use
@param aDisplayMenuItemIDs
The menu items to disp... | [
"Render",
"the",
"whole",
"menu"
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/menu/ui/MenuRendererCallback.java#L290-L297 |
Waikato/moa | moa/src/main/java/moa/classifiers/lazy/SAMkNN.java | SAMkNN.clean | private void clean(Instances cleanAgainst, Instances toClean, boolean onlyLast) {
"""
Removes distance-based all instances from the input samples that contradict those in the STM.
"""
if (cleanAgainst.numInstances() > this.kOption.getValue() && toClean.numInstances() > 0){
if (onlyLast){
cleanSingle(c... | java | private void clean(Instances cleanAgainst, Instances toClean, boolean onlyLast) {
if (cleanAgainst.numInstances() > this.kOption.getValue() && toClean.numInstances() > 0){
if (onlyLast){
cleanSingle(cleanAgainst, (cleanAgainst.numInstances()-1), toClean);
}else{
for (int i=0; i < cleanAgainst.numInstanc... | [
"private",
"void",
"clean",
"(",
"Instances",
"cleanAgainst",
",",
"Instances",
"toClean",
",",
"boolean",
"onlyLast",
")",
"{",
"if",
"(",
"cleanAgainst",
".",
"numInstances",
"(",
")",
">",
"this",
".",
"kOption",
".",
"getValue",
"(",
")",
"&&",
"toClea... | Removes distance-based all instances from the input samples that contradict those in the STM. | [
"Removes",
"distance",
"-",
"based",
"all",
"instances",
"from",
"the",
"input",
"samples",
"that",
"contradict",
"those",
"in",
"the",
"STM",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/lazy/SAMkNN.java#L359-L369 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/ReComputeTimeOffsetHandler.java | ReComputeTimeOffsetHandler.init | public void init(BaseField field, String targetFieldName, DateTimeField fldOtherDate) {
"""
Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param iTargetFieldSeq The date field sequence in this owner to use to calc the difference.
@param fldOtherDate The oth... | java | public void init(BaseField field, String targetFieldName, DateTimeField fldOtherDate)
{
m_fldOtherDate = fldOtherDate;
super.init(field, targetFieldName, null);
} | [
"public",
"void",
"init",
"(",
"BaseField",
"field",
",",
"String",
"targetFieldName",
",",
"DateTimeField",
"fldOtherDate",
")",
"{",
"m_fldOtherDate",
"=",
"fldOtherDate",
";",
"super",
".",
"init",
"(",
"field",
",",
"targetFieldName",
",",
"null",
")",
";"... | Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param iTargetFieldSeq The date field sequence in this owner to use to calc the difference.
@param fldOtherDate The other date field to use in calculating the date difference. If null, uses the current time. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/ReComputeTimeOffsetHandler.java#L65-L69 |
cdk/cdk | base/core/src/main/java/org/openscience/cdk/graph/EssentialCycles.java | EssentialCycles.isEssential | private boolean isEssential(final Cycle candidate, final Collection<Cycle> relevant) {
"""
Determines whether the <i>cycle</i> is essential.
@param candidate a cycle which is a member of the MCB
@param relevant relevant cycles of the same length as <i>cycle</i>
@return whether the candidate is essential
... | java | private boolean isEssential(final Cycle candidate, final Collection<Cycle> relevant) {
// construct an alternative basis with all equal weight relevant cycles
final List<Cycle> alternate = new ArrayList<Cycle>(relevant.size() + basis.size());
final int weight = candidate.length();
for ... | [
"private",
"boolean",
"isEssential",
"(",
"final",
"Cycle",
"candidate",
",",
"final",
"Collection",
"<",
"Cycle",
">",
"relevant",
")",
"{",
"// construct an alternative basis with all equal weight relevant cycles",
"final",
"List",
"<",
"Cycle",
">",
"alternate",
"=",... | Determines whether the <i>cycle</i> is essential.
@param candidate a cycle which is a member of the MCB
@param relevant relevant cycles of the same length as <i>cycle</i>
@return whether the candidate is essential | [
"Determines",
"whether",
"the",
"<i",
">",
"cycle<",
"/",
"i",
">",
"is",
"essential",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/graph/EssentialCycles.java#L171-L186 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java | AppServiceCertificateOrdersInner.resendEmailAsync | public Observable<Void> resendEmailAsync(String resourceGroupName, String certificateOrderName) {
"""
Resend certificate email.
Resend certificate email.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param certificateOrderName Name of the certificate order.
@throws Illeg... | java | public Observable<Void> resendEmailAsync(String resourceGroupName, String certificateOrderName) {
return resendEmailWithServiceResponseAsync(resourceGroupName, certificateOrderName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) ... | [
"public",
"Observable",
"<",
"Void",
">",
"resendEmailAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"certificateOrderName",
")",
"{",
"return",
"resendEmailWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"certificateOrderName",
")",
".",
"map",
"(... | Resend certificate email.
Resend certificate email.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param certificateOrderName Name of the certificate order.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponse} object if succe... | [
"Resend",
"certificate",
"email",
".",
"Resend",
"certificate",
"email",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java#L1804-L1811 |
apache/groovy | src/main/java/org/codehaus/groovy/transform/trait/Traits.java | Traits.getAsType | @SuppressWarnings("unchecked")
public static <T> T getAsType(Object self, Class<T> clazz) {
"""
Converts a class implementing some trait into a target class. If the trait is a dynamic proxy and
that the target class is assignable to the target object of the proxy, then the target object is
returned. Otherwis... | java | @SuppressWarnings("unchecked")
public static <T> T getAsType(Object self, Class<T> clazz) {
if (self instanceof GeneratedGroovyProxy) {
Object proxyTarget = ((GeneratedGroovyProxy)self).getProxyTarget();
if (clazz.isAssignableFrom(proxyTarget.getClass())) {
return (T)... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"getAsType",
"(",
"Object",
"self",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"if",
"(",
"self",
"instanceof",
"GeneratedGroovyProxy",
")",
"{",
"Object",
"... | Converts a class implementing some trait into a target class. If the trait is a dynamic proxy and
that the target class is assignable to the target object of the proxy, then the target object is
returned. Otherwise, falls back to {@link org.codehaus.groovy.runtime.DefaultGroovyMethods#asType(java.lang.Object, Class)}
@... | [
"Converts",
"a",
"class",
"implementing",
"some",
"trait",
"into",
"a",
"target",
"class",
".",
"If",
"the",
"trait",
"is",
"a",
"dynamic",
"proxy",
"and",
"that",
"the",
"target",
"class",
"is",
"assignable",
"to",
"the",
"target",
"object",
"of",
"the",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/transform/trait/Traits.java#L253-L262 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WPanelTypeExample.java | WPanelTypeExample.buildSubordinates | private void buildSubordinates() {
"""
The subordinate controls used to show/hide parts of the configuration options based on the selected WPanel Type.
"""
WSubordinateControl control = new WSubordinateControl();
Rule rule = new Rule();
rule.setCondition(new Equal(panelType, WPanel.Type.HEADER));
rule.... | java | private void buildSubordinates() {
WSubordinateControl control = new WSubordinateControl();
Rule rule = new Rule();
rule.setCondition(new Equal(panelType, WPanel.Type.HEADER));
rule.addActionOnTrue(new Show(showUtilBarField));
rule.addActionOnTrue(new Show(showMenuField));
rule.addActionOnTrue(new Hide(cont... | [
"private",
"void",
"buildSubordinates",
"(",
")",
"{",
"WSubordinateControl",
"control",
"=",
"new",
"WSubordinateControl",
"(",
")",
";",
"Rule",
"rule",
"=",
"new",
"Rule",
"(",
")",
";",
"rule",
".",
"setCondition",
"(",
"new",
"Equal",
"(",
"panelType",
... | The subordinate controls used to show/hide parts of the configuration options based on the selected WPanel Type. | [
"The",
"subordinate",
"controls",
"used",
"to",
"show",
"/",
"hide",
"parts",
"of",
"the",
"configuration",
"options",
"based",
"on",
"the",
"selected",
"WPanel",
"Type",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WPanelTypeExample.java#L263-L285 |
di2e/Argo | ArgoWirelineFormat/src/main/java/ws/argo/wireline/response/ServiceWrapper.java | ServiceWrapper.addAccessPoint | public void addAccessPoint(String label, String ip, String port, String url, String dataType, String data) {
"""
Add a new access point for the service record. This structure exists to
help deal with network access issues and not multiple contracts. For
example, a service could have an access point that is diffe... | java | public void addAccessPoint(String label, String ip, String port, String url, String dataType, String data) {
AccessPoint ap = new AccessPoint();
ap.label = label;
ap.ipAddress = ip;
ap.port = port;
ap.url = url;
ap.dataType = dataType;
ap.data = data;
accessPoints.add(ap);
} | [
"public",
"void",
"addAccessPoint",
"(",
"String",
"label",
",",
"String",
"ip",
",",
"String",
"port",
",",
"String",
"url",
",",
"String",
"dataType",
",",
"String",
"data",
")",
"{",
"AccessPoint",
"ap",
"=",
"new",
"AccessPoint",
"(",
")",
";",
"ap",... | Add a new access point for the service record. This structure exists to
help deal with network access issues and not multiple contracts. For
example, a service could have an access point that is different because of
multiple NICs that host is accessible on. It's not to have a service
accessible by HTTP and HTTPS - thos... | [
"Add",
"a",
"new",
"access",
"point",
"for",
"the",
"service",
"record",
".",
"This",
"structure",
"exists",
"to",
"help",
"deal",
"with",
"network",
"access",
"issues",
"and",
"not",
"multiple",
"contracts",
".",
"For",
"example",
"a",
"service",
"could",
... | train | https://github.com/di2e/Argo/blob/f537a03d2d25fdfecda7999ec10e1da67dc3b8f3/ArgoWirelineFormat/src/main/java/ws/argo/wireline/response/ServiceWrapper.java#L225-L237 |
looly/hutool | hutool-json/src/main/java/cn/hutool/json/JSONGetter.java | JSONGetter.get | public <T> T get(K key, Class<T> type, boolean ignoreError) throws ConvertException {
"""
获取指定类型的对象
@param <T> 获取的对象类型
@param key 键
@param type 获取对象类型
@param ignoreError 是否跳过转换失败的对象或值
@return 对象
@throws ConvertException 转换异常
@since 3.0.8
"""
final Object value = this.getObj(key);
if(null == valu... | java | public <T> T get(K key, Class<T> type, boolean ignoreError) throws ConvertException{
final Object value = this.getObj(key);
if(null == value){
return null;
}
return JSONConverter.jsonConvert(type, value, ignoreError);
} | [
"public",
"<",
"T",
">",
"T",
"get",
"(",
"K",
"key",
",",
"Class",
"<",
"T",
">",
"type",
",",
"boolean",
"ignoreError",
")",
"throws",
"ConvertException",
"{",
"final",
"Object",
"value",
"=",
"this",
".",
"getObj",
"(",
"key",
")",
";",
"if",
"(... | 获取指定类型的对象
@param <T> 获取的对象类型
@param key 键
@param type 获取对象类型
@param ignoreError 是否跳过转换失败的对象或值
@return 对象
@throws ConvertException 转换异常
@since 3.0.8 | [
"获取指定类型的对象"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONGetter.java#L126-L132 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/HttpMessageSecurity.java | HttpMessageSecurity.unprotectPayload | private String unprotectPayload(String payload) throws IOException {
"""
Unencrypt encrypted payload.
@param payload
base64url serialized JWEObject.
@return Unencrypted message.
"""
try {
JWEObject jweObject = JWEObject.deserialize(MessageSecurityHelper.base64UrltoString(payload));
... | java | private String unprotectPayload(String payload) throws IOException {
try {
JWEObject jweObject = JWEObject.deserialize(MessageSecurityHelper.base64UrltoString(payload));
JWEHeader jweHeader = jweObject.jweHeader();
if (!clientEncryptionKey.kid().equals(jweHeader.kid()) || !j... | [
"private",
"String",
"unprotectPayload",
"(",
"String",
"payload",
")",
"throws",
"IOException",
"{",
"try",
"{",
"JWEObject",
"jweObject",
"=",
"JWEObject",
".",
"deserialize",
"(",
"MessageSecurityHelper",
".",
"base64UrltoString",
"(",
"payload",
")",
")",
";",... | Unencrypt encrypted payload.
@param payload
base64url serialized JWEObject.
@return Unencrypted message. | [
"Unencrypt",
"encrypted",
"payload",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/messagesecurity/HttpMessageSecurity.java#L339-L371 |
inferred/FreeBuilder | src/main/java/org/inferred/freebuilder/processor/source/ScopeHandler.java | ScopeHandler.visibilityIn | ScopeState visibilityIn(QualifiedName scope, QualifiedName type) {
"""
Returns whether {@code type} is visible in, or can be imported into, the body of {@code type}.
"""
Set<QualifiedName> possibleConflicts = typesInScope(scope).get(type.getSimpleName());
if (possibleConflicts.equals(ImmutableSet.of(ty... | java | ScopeState visibilityIn(QualifiedName scope, QualifiedName type) {
Set<QualifiedName> possibleConflicts = typesInScope(scope).get(type.getSimpleName());
if (possibleConflicts.equals(ImmutableSet.of(type))) {
return ScopeState.IN_SCOPE;
} else if (!possibleConflicts.isEmpty()) {
return ScopeState... | [
"ScopeState",
"visibilityIn",
"(",
"QualifiedName",
"scope",
",",
"QualifiedName",
"type",
")",
"{",
"Set",
"<",
"QualifiedName",
">",
"possibleConflicts",
"=",
"typesInScope",
"(",
"scope",
")",
".",
"get",
"(",
"type",
".",
"getSimpleName",
"(",
")",
")",
... | Returns whether {@code type} is visible in, or can be imported into, the body of {@code type}. | [
"Returns",
"whether",
"{"
] | train | https://github.com/inferred/FreeBuilder/blob/d5a222f90648aece135da4b971c55a60afe8649c/src/main/java/org/inferred/freebuilder/processor/source/ScopeHandler.java#L77-L88 |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/util/GlobusPathMatchingResourcePatternResolver.java | GlobusPathMatchingResourcePatternResolver.parseFilesInDirectory | private void parseFilesInDirectory(File currentDirectory, Vector<GlobusResource> pathsMatchingLocationPattern) {
"""
Compares every file's Absolute Path against the locationPattern, if they match
a GlobusResource is created with the file's Absolute Path and added to pathsMatchingLocationPattern.
@param currentDi... | java | private void parseFilesInDirectory(File currentDirectory, Vector<GlobusResource> pathsMatchingLocationPattern) {
File[] directoryContents = null;
if (currentDirectory.isDirectory()) {
directoryContents = currentDirectory.listFiles(); //Get a list of the files and directories
} els... | [
"private",
"void",
"parseFilesInDirectory",
"(",
"File",
"currentDirectory",
",",
"Vector",
"<",
"GlobusResource",
">",
"pathsMatchingLocationPattern",
")",
"{",
"File",
"[",
"]",
"directoryContents",
"=",
"null",
";",
"if",
"(",
"currentDirectory",
".",
"isDirector... | Compares every file's Absolute Path against the locationPattern, if they match
a GlobusResource is created with the file's Absolute Path and added to pathsMatchingLocationPattern.
@param currentDirectory The directory whose files to parse.
@param pathsMatchingLocationPattern Holds GlobusResource instances of all the p... | [
"Compares",
"every",
"file",
"s",
"Absolute",
"Path",
"against",
"the",
"locationPattern",
"if",
"they",
"match",
"a",
"GlobusResource",
"is",
"created",
"with",
"the",
"file",
"s",
"Absolute",
"Path",
"and",
"added",
"to",
"pathsMatchingLocationPattern",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/GlobusPathMatchingResourcePatternResolver.java#L171-L192 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CProductPersistenceImpl.java | CProductPersistenceImpl.findByGroupId | @Override
public List<CProduct> findByGroupId(long groupId) {
"""
Returns all the c products where groupId = ?.
@param groupId the group ID
@return the matching c products
"""
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CProduct> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CProduct",
">",
"findByGroupId",
"(",
"long",
"groupId",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the c products where groupId = ?.
@param groupId the group ID
@return the matching c products | [
"Returns",
"all",
"the",
"c",
"products",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CProductPersistenceImpl.java#L1499-L1502 |
banq/jdonframework | src/main/java/com/jdon/util/jdom/DataFormatFilter.java | DataFormatFilter.endElement | public void endElement (String uri, String localName, String qName)
throws SAXException {
"""
Add newline and indentation prior to end tag.
<p>If the element has contained other elements, the tag
will appear indented on a new line; otherwise, it will
appear immediately following whatever came before.</p>... | java | public void endElement (String uri, String localName, String qName)
throws SAXException
{
boolean seenElement = (state == SEEN_ELEMENT);
state = stateStack.pop();
if (seenElement) {
doNewline();
doIndent();
}
super.endElement(uri, localNam... | [
"public",
"void",
"endElement",
"(",
"String",
"uri",
",",
"String",
"localName",
",",
"String",
"qName",
")",
"throws",
"SAXException",
"{",
"boolean",
"seenElement",
"=",
"(",
"state",
"==",
"SEEN_ELEMENT",
")",
";",
"state",
"=",
"stateStack",
".",
"pop",... | Add newline and indentation prior to end tag.
<p>If the element has contained other elements, the tag
will appear indented on a new line; otherwise, it will
appear immediately following whatever came before.</p>
<p>The newline and indentation will be passed on down
the filter chain through regular characters events.<... | [
"Add",
"newline",
"and",
"indentation",
"prior",
"to",
"end",
"tag",
"."
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/jdom/DataFormatFilter.java#L276-L286 |
zxing/zxing | android/src/com/google/zxing/client/android/camera/CameraManager.java | CameraManager.setTorch | public synchronized void setTorch(boolean newSetting) {
"""
Convenience method for {@link com.google.zxing.client.android.CaptureActivity}
@param newSetting if {@code true}, light should be turned on if currently off. And vice versa.
"""
OpenCamera theCamera = camera;
if (theCamera != null && newSet... | java | public synchronized void setTorch(boolean newSetting) {
OpenCamera theCamera = camera;
if (theCamera != null && newSetting != configManager.getTorchState(theCamera.getCamera())) {
boolean wasAutoFocusManager = autoFocusManager != null;
if (wasAutoFocusManager) {
autoFocusManager.stop();
... | [
"public",
"synchronized",
"void",
"setTorch",
"(",
"boolean",
"newSetting",
")",
"{",
"OpenCamera",
"theCamera",
"=",
"camera",
";",
"if",
"(",
"theCamera",
"!=",
"null",
"&&",
"newSetting",
"!=",
"configManager",
".",
"getTorchState",
"(",
"theCamera",
".",
"... | Convenience method for {@link com.google.zxing.client.android.CaptureActivity}
@param newSetting if {@code true}, light should be turned on if currently off. And vice versa. | [
"Convenience",
"method",
"for",
"{",
"@link",
"com",
".",
"google",
".",
"zxing",
".",
"client",
".",
"android",
".",
"CaptureActivity",
"}"
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/android/src/com/google/zxing/client/android/camera/CameraManager.java#L174-L188 |
apache/incubator-heron | heron/packing/src/java/org/apache/heron/packing/binpacking/FirstFitDecreasingPacking.java | FirstFitDecreasingPacking.removeInstancesFromContainers | private void removeInstancesFromContainers(PackingPlanBuilder packingPlanBuilder,
Map<String, Integer> componentsToScaleDown) {
"""
Removes instances from containers during scaling down
@param packingPlanBuilder existing packing plan
@param componentsToScaleDown sca... | java | private void removeInstancesFromContainers(PackingPlanBuilder packingPlanBuilder,
Map<String, Integer> componentsToScaleDown) {
List<ResourceRequirement> resourceRequirements =
getSortedInstances(componentsToScaleDown.keySet());
InstanceCountScorer instance... | [
"private",
"void",
"removeInstancesFromContainers",
"(",
"PackingPlanBuilder",
"packingPlanBuilder",
",",
"Map",
"<",
"String",
",",
"Integer",
">",
"componentsToScaleDown",
")",
"{",
"List",
"<",
"ResourceRequirement",
">",
"resourceRequirements",
"=",
"getSortedInstance... | Removes instances from containers during scaling down
@param packingPlanBuilder existing packing plan
@param componentsToScaleDown scale down factor for the components. | [
"Removes",
"instances",
"from",
"containers",
"during",
"scaling",
"down"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/packing/src/java/org/apache/heron/packing/binpacking/FirstFitDecreasingPacking.java#L257-L280 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/SerializationUtils.java | SerializationUtils.serializeState | public static <T extends State> void serializeState(FileSystem fs, Path jobStateFilePath, T state)
throws IOException {
"""
Serialize a {@link State} instance to a file.
@param fs the {@link FileSystem} instance for creating the file
@param jobStateFilePath the path to the file
@param state the {@link S... | java | public static <T extends State> void serializeState(FileSystem fs, Path jobStateFilePath, T state)
throws IOException {
serializeState(fs, jobStateFilePath, state, fs.getDefaultReplication(jobStateFilePath));
} | [
"public",
"static",
"<",
"T",
"extends",
"State",
">",
"void",
"serializeState",
"(",
"FileSystem",
"fs",
",",
"Path",
"jobStateFilePath",
",",
"T",
"state",
")",
"throws",
"IOException",
"{",
"serializeState",
"(",
"fs",
",",
"jobStateFilePath",
",",
"state",... | Serialize a {@link State} instance to a file.
@param fs the {@link FileSystem} instance for creating the file
@param jobStateFilePath the path to the file
@param state the {@link State} to serialize
@param <T> the {@link State} object type
@throws IOException if it fails to serialize the {@link State} instance | [
"Serialize",
"a",
"{",
"@link",
"State",
"}",
"instance",
"to",
"a",
"file",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/SerializationUtils.java#L141-L144 |
JadiraOrg/jadira | bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java | BasicBinder.registerExtendedBinder | protected <I, T extends I> void registerExtendedBinder(Class<I> iface, T provider) {
"""
Register a custom, typesafe binder implementation which can be retrieved later
@param iface The interface for the provider to be registered.
@param provider The implementation.
@param <I> The class to be registered
@param ... | java | protected <I, T extends I> void registerExtendedBinder(Class<I> iface, T provider) {
extendedBinders.put(iface, provider);
} | [
"protected",
"<",
"I",
",",
"T",
"extends",
"I",
">",
"void",
"registerExtendedBinder",
"(",
"Class",
"<",
"I",
">",
"iface",
",",
"T",
"provider",
")",
"{",
"extendedBinders",
".",
"put",
"(",
"iface",
",",
"provider",
")",
";",
"}"
] | Register a custom, typesafe binder implementation which can be retrieved later
@param iface The interface for the provider to be registered.
@param provider The implementation.
@param <I> The class to be registered
@param <T> Implementation of the binder type, I. | [
"Register",
"a",
"custom",
"typesafe",
"binder",
"implementation",
"which",
"can",
"be",
"retrieved",
"later"
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/bindings/src/main/java/org/jadira/bindings/core/binder/BasicBinder.java#L513-L515 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service/src/com/ibm/ws/kernel/service/util/SecureAction.java | SecureAction.getService | public <S> S getService(final ServiceReference<S> reference, final BundleContext context) {
"""
Gets a service object. Same as calling
context.getService(reference)
@param reference the ServiceReference
@param context the BundleContext
@return a service object
"""
if (System.getSecurityManager() ... | java | public <S> S getService(final ServiceReference<S> reference, final BundleContext context) {
if (System.getSecurityManager() == null)
return context.getService(reference);
return AccessController.doPrivileged(new PrivilegedAction<S>() {
@Override
public S run() {
... | [
"public",
"<",
"S",
">",
"S",
"getService",
"(",
"final",
"ServiceReference",
"<",
"S",
">",
"reference",
",",
"final",
"BundleContext",
"context",
")",
"{",
"if",
"(",
"System",
".",
"getSecurityManager",
"(",
")",
"==",
"null",
")",
"return",
"context",
... | Gets a service object. Same as calling
context.getService(reference)
@param reference the ServiceReference
@param context the BundleContext
@return a service object | [
"Gets",
"a",
"service",
"object",
".",
"Same",
"as",
"calling",
"context",
".",
"getService",
"(",
"reference",
")"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service/src/com/ibm/ws/kernel/service/util/SecureAction.java#L453-L462 |
aws/aws-sdk-java | aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/Utils.java | Utils.getRequiredResourceAsStream | public static InputStream getRequiredResourceAsStream(Class<?> clzz, String location) {
"""
Return an InputStream of the specified resource, failing if it can't be found.
@param clzz
@param location
Location of resource
"""
InputStream resourceStream = clzz.getResourceAsStream(location);
... | java | public static InputStream getRequiredResourceAsStream(Class<?> clzz, String location) {
InputStream resourceStream = clzz.getResourceAsStream(location);
if (resourceStream == null) {
// Try with a leading "/"
if (!location.startsWith("/")) {
resourceStream = clzz... | [
"public",
"static",
"InputStream",
"getRequiredResourceAsStream",
"(",
"Class",
"<",
"?",
">",
"clzz",
",",
"String",
"location",
")",
"{",
"InputStream",
"resourceStream",
"=",
"clzz",
".",
"getResourceAsStream",
"(",
"location",
")",
";",
"if",
"(",
"resourceS... | Return an InputStream of the specified resource, failing if it can't be found.
@param clzz
@param location
Location of resource | [
"Return",
"an",
"InputStream",
"of",
"the",
"specified",
"resource",
"failing",
"if",
"it",
"can",
"t",
"be",
"found",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/Utils.java#L208-L222 |
devnewton/jnuit | pngdecoder/src/main/java/de/matthiasmann/twl/utils/PNGDecoder.java | PNGDecoder.overwriteTRNS | public void overwriteTRNS(byte r, byte g, byte b) {
"""
Overwrites the tRNS chunk entry to make a selected color transparent.
<p>This can only be invoked when the image has no alpha channel.</p>
<p>Calling this method causes {@link #hasAlpha()} to return true.</p>
@param r the red component of the color to ma... | java | public void overwriteTRNS(byte r, byte g, byte b) {
if(hasAlphaChannel()) {
throw new UnsupportedOperationException("image has an alpha channel");
}
byte[] pal = this.palette;
if(pal == null) {
transPixel = new byte[] { 0, r, 0, g, 0, b };
} else {
... | [
"public",
"void",
"overwriteTRNS",
"(",
"byte",
"r",
",",
"byte",
"g",
",",
"byte",
"b",
")",
"{",
"if",
"(",
"hasAlphaChannel",
"(",
")",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"image has an alpha channel\"",
")",
";",
"}",
"byte"... | Overwrites the tRNS chunk entry to make a selected color transparent.
<p>This can only be invoked when the image has no alpha channel.</p>
<p>Calling this method causes {@link #hasAlpha()} to return true.</p>
@param r the red component of the color to make transparent
@param g the green component of the color to make ... | [
"Overwrites",
"the",
"tRNS",
"chunk",
"entry",
"to",
"make",
"a",
"selected",
"color",
"transparent",
".",
"<p",
">",
"This",
"can",
"only",
"be",
"invoked",
"when",
"the",
"image",
"has",
"no",
"alpha",
"channel",
".",
"<",
"/",
"p",
">",
"<p",
">",
... | train | https://github.com/devnewton/jnuit/blob/191f19b55a17451d0f277c151c7e9b4427a12415/pngdecoder/src/main/java/de/matthiasmann/twl/utils/PNGDecoder.java#L190-L205 |
fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/BinaryServiceImpl.java | BinaryServiceImpl.find | @Override
public FedoraBinary find(final FedoraSession session, final String path) {
"""
Retrieve a Datastream instance by pid and dsid
@param path jcr path to the datastream
@return datastream
"""
return cast(findNode(session, path));
} | java | @Override
public FedoraBinary find(final FedoraSession session, final String path) {
return cast(findNode(session, path));
} | [
"@",
"Override",
"public",
"FedoraBinary",
"find",
"(",
"final",
"FedoraSession",
"session",
",",
"final",
"String",
"path",
")",
"{",
"return",
"cast",
"(",
"findNode",
"(",
"session",
",",
"path",
")",
")",
";",
"}"
] | Retrieve a Datastream instance by pid and dsid
@param path jcr path to the datastream
@return datastream | [
"Retrieve",
"a",
"Datastream",
"instance",
"by",
"pid",
"and",
"dsid"
] | train | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/services/BinaryServiceImpl.java#L127-L130 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmInterfaces.java | XsdAsmInterfaces.generateInnerSequenceClass | private ClassWriter generateInnerSequenceClass(String typeName, String className, String apiName) {
"""
Creates the inner classes that are used to support the sequence behaviour.
@param typeName The name of the next type to return.
@param className The name of the class which contains the sequence.
@param apiNa... | java | private ClassWriter generateInnerSequenceClass(String typeName, String className, String apiName) {
ClassWriter classWriter = generateClass(typeName, JAVA_OBJECT, new String[] {CUSTOM_ATTRIBUTE_GROUP}, getClassSignature(new String[]{CUSTOM_ATTRIBUTE_GROUP}, typeName, apiName), ACC_PUBLIC + ACC_SUPER, apiName);
... | [
"private",
"ClassWriter",
"generateInnerSequenceClass",
"(",
"String",
"typeName",
",",
"String",
"className",
",",
"String",
"apiName",
")",
"{",
"ClassWriter",
"classWriter",
"=",
"generateClass",
"(",
"typeName",
",",
"JAVA_OBJECT",
",",
"new",
"String",
"[",
"... | Creates the inner classes that are used to support the sequence behaviour.
@param typeName The name of the next type to return.
@param className The name of the class which contains the sequence.
@param apiName The name of the generated fluent interface.
@return The {@link ClassWriter} object which represents the inner... | [
"Creates",
"the",
"inner",
"classes",
"that",
"are",
"used",
"to",
"support",
"the",
"sequence",
"behaviour",
"."
] | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/XsdAsmInterfaces.java#L501-L507 |
rollbar/rollbar-java | rollbar-android/src/main/java/com/rollbar/android/Rollbar.java | Rollbar.log | public void log(Throwable error, Map<String, Object> custom, String description) {
"""
Record an error with custom parameters and human readable description at the default level
returned by {@link com.rollbar.notifier.Rollbar#level}.
@param error the error.
@param custom the custom data.
@param de... | java | public void log(Throwable error, Map<String, Object> custom, String description) {
log(error, custom, description, null);
} | [
"public",
"void",
"log",
"(",
"Throwable",
"error",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"custom",
",",
"String",
"description",
")",
"{",
"log",
"(",
"error",
",",
"custom",
",",
"description",
",",
"null",
")",
";",
"}"
] | Record an error with custom parameters and human readable description at the default level
returned by {@link com.rollbar.notifier.Rollbar#level}.
@param error the error.
@param custom the custom data.
@param description the human readable description of error. | [
"Record",
"an",
"error",
"with",
"custom",
"parameters",
"and",
"human",
"readable",
"description",
"at",
"the",
"default",
"level",
"returned",
"by",
"{",
"@link",
"com",
".",
"rollbar",
".",
"notifier",
".",
"Rollbar#level",
"}",
"."
] | train | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L734-L736 |
jlinn/quartz-redis-jobstore | src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java | AbstractRedisStorage.applyMisfire | protected boolean applyMisfire(OperableTrigger trigger, T jedis) throws JobPersistenceException {
"""
Determine whether or not the given trigger has misfired.
If so, notify the {@link org.quartz.spi.SchedulerSignaler} and update the trigger.
@param trigger the trigger to check for misfire
@param jedis a thread-... | java | protected boolean applyMisfire(OperableTrigger trigger, T jedis) throws JobPersistenceException {
long misfireTime = System.currentTimeMillis();
if(misfireThreshold > 0){
misfireTime -= misfireThreshold;
}
final Date nextFireTime = trigger.getNextFireTime();
if(nextFi... | [
"protected",
"boolean",
"applyMisfire",
"(",
"OperableTrigger",
"trigger",
",",
"T",
"jedis",
")",
"throws",
"JobPersistenceException",
"{",
"long",
"misfireTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"if",
"(",
"misfireThreshold",
">",
"0",
"... | Determine whether or not the given trigger has misfired.
If so, notify the {@link org.quartz.spi.SchedulerSignaler} and update the trigger.
@param trigger the trigger to check for misfire
@param jedis a thread-safe Redis connection
@return false if the trigger has misfired; true otherwise
@throws JobPersistenceExceptio... | [
"Determine",
"whether",
"or",
"not",
"the",
"given",
"trigger",
"has",
"misfired",
".",
"If",
"so",
"notify",
"the",
"{"
] | train | https://github.com/jlinn/quartz-redis-jobstore/blob/be9a52ee776d8a09866fe99fd9718bc13a0cb992/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java#L560-L588 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java | SDBaseOps.scalarSet | public SDVariable scalarSet(String name, SDVariable in, Number set) {
"""
Return a variable with equal shape to the input, but all elements set to value 'set'
@param name Name of the output variable
@param in Input variable
@param set Value to set
@return Output variable
"""
SDVariable ret = f... | java | public SDVariable scalarSet(String name, SDVariable in, Number set) {
SDVariable ret = f().scalarSet(in, set);
return updateVariableNameAndReference(ret, name);
} | [
"public",
"SDVariable",
"scalarSet",
"(",
"String",
"name",
",",
"SDVariable",
"in",
",",
"Number",
"set",
")",
"{",
"SDVariable",
"ret",
"=",
"f",
"(",
")",
".",
"scalarSet",
"(",
"in",
",",
"set",
")",
";",
"return",
"updateVariableNameAndReference",
"("... | Return a variable with equal shape to the input, but all elements set to value 'set'
@param name Name of the output variable
@param in Input variable
@param set Value to set
@return Output variable | [
"Return",
"a",
"variable",
"with",
"equal",
"shape",
"to",
"the",
"input",
"but",
"all",
"elements",
"set",
"to",
"value",
"set"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L2005-L2008 |
alkacon/opencms-core | src/org/opencms/ui/apps/logfile/CmsLogChannelTable.java | CmsLogChannelTable.changeLoggerLevel | void changeLoggerLevel(LoggerLevel clickedLevel, Set<Logger> clickedLogger) {
"""
Sets a given Level to a Set of Loggers.<p>
@param clickedLevel to be set
@param clickedLogger to get level changed
"""
for (Logger logger : clickedLogger) {
@SuppressWarnings("resource")
Logge... | java | void changeLoggerLevel(LoggerLevel clickedLevel, Set<Logger> clickedLogger) {
for (Logger logger : clickedLogger) {
@SuppressWarnings("resource")
LoggerContext context = logger.getContext();
Configuration config = context.getConfiguration();
LoggerConfig loggerCo... | [
"void",
"changeLoggerLevel",
"(",
"LoggerLevel",
"clickedLevel",
",",
"Set",
"<",
"Logger",
">",
"clickedLogger",
")",
"{",
"for",
"(",
"Logger",
"logger",
":",
"clickedLogger",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"resource\"",
")",
"LoggerContext",
"conte... | Sets a given Level to a Set of Loggers.<p>
@param clickedLevel to be set
@param clickedLogger to get level changed | [
"Sets",
"a",
"given",
"Level",
"to",
"a",
"Set",
"of",
"Loggers",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/logfile/CmsLogChannelTable.java#L504-L521 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/aggregate/CrossTab.java | CrossTab.rowPercents | public static Table rowPercents(Table table, CategoricalColumn<?> column1, CategoricalColumn<?> column2) {
"""
Returns a table containing the row percents made from a source table, after first calculating the counts
cross-tabulated from the given columns
"""
Table xTabs = counts(table, column1, column... | java | public static Table rowPercents(Table table, CategoricalColumn<?> column1, CategoricalColumn<?> column2) {
Table xTabs = counts(table, column1, column2);
return rowPercents(xTabs);
} | [
"public",
"static",
"Table",
"rowPercents",
"(",
"Table",
"table",
",",
"CategoricalColumn",
"<",
"?",
">",
"column1",
",",
"CategoricalColumn",
"<",
"?",
">",
"column2",
")",
"{",
"Table",
"xTabs",
"=",
"counts",
"(",
"table",
",",
"column1",
",",
"column... | Returns a table containing the row percents made from a source table, after first calculating the counts
cross-tabulated from the given columns | [
"Returns",
"a",
"table",
"containing",
"the",
"row",
"percents",
"made",
"from",
"a",
"source",
"table",
"after",
"first",
"calculating",
"the",
"counts",
"cross",
"-",
"tabulated",
"from",
"the",
"given",
"columns"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/aggregate/CrossTab.java#L261-L264 |
jruby/jcodings | src/org/jcodings/AbstractEncoding.java | AbstractEncoding.isNewLine | @Override
public boolean isNewLine(byte[]bytes, int p, int end) {
"""
onigenc_is_mbc_newline_0x0a / used also by multibyte encodings
"""
return p < end ? bytes[p] == Encoding.NEW_LINE : false;
} | java | @Override
public boolean isNewLine(byte[]bytes, int p, int end) {
return p < end ? bytes[p] == Encoding.NEW_LINE : false;
} | [
"@",
"Override",
"public",
"boolean",
"isNewLine",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"p",
",",
"int",
"end",
")",
"{",
"return",
"p",
"<",
"end",
"?",
"bytes",
"[",
"p",
"]",
"==",
"Encoding",
".",
"NEW_LINE",
":",
"false",
";",
"}"
] | onigenc_is_mbc_newline_0x0a / used also by multibyte encodings | [
"onigenc_is_mbc_newline_0x0a",
"/",
"used",
"also",
"by",
"multibyte",
"encodings"
] | train | https://github.com/jruby/jcodings/blob/8e09c6caab59f9a0b9760e57d2708eea185c2de1/src/org/jcodings/AbstractEncoding.java#L51-L54 |
Netflix/astyanax | astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeEntityMapper.java | CompositeEntityMapper.constructEntity | T constructEntity(K id, com.netflix.astyanax.model.Column<ByteBuffer> column) {
"""
Construct an entity object from a row key and column list.
@param id
@param cl
@return
"""
try {
// First, construct the parent class and give it an id
T entity = clazz.newInstance();
... | java | T constructEntity(K id, com.netflix.astyanax.model.Column<ByteBuffer> column) {
try {
// First, construct the parent class and give it an id
T entity = clazz.newInstance();
idMapper.setValue(entity, id);
setEntityFieldsFromColumnName(entity, column.getRawName().du... | [
"T",
"constructEntity",
"(",
"K",
"id",
",",
"com",
".",
"netflix",
".",
"astyanax",
".",
"model",
".",
"Column",
"<",
"ByteBuffer",
">",
"column",
")",
"{",
"try",
"{",
"// First, construct the parent class and give it an id",
"T",
"entity",
"=",
"clazz",
"."... | Construct an entity object from a row key and column list.
@param id
@param cl
@return | [
"Construct",
"an",
"entity",
"object",
"from",
"a",
"row",
"key",
"and",
"column",
"list",
"."
] | train | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeEntityMapper.java#L248-L259 |
xiancloud/xian | xian-zookeeper/xian-curator/xian-curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java | ServiceDiscoveryImpl.queryForInstances | @Override
public Collection<ServiceInstance<T>> queryForInstances(String name) throws Exception {
"""
Return all known instances for the given group
@param name name of the group
@return list of instances (or an empty list)
@throws Exception errors
"""
return queryForInstances(name, null);
... | java | @Override
public Collection<ServiceInstance<T>> queryForInstances(String name) throws Exception
{
return queryForInstances(name, null);
} | [
"@",
"Override",
"public",
"Collection",
"<",
"ServiceInstance",
"<",
"T",
">",
">",
"queryForInstances",
"(",
"String",
"name",
")",
"throws",
"Exception",
"{",
"return",
"queryForInstances",
"(",
"name",
",",
"null",
")",
";",
"}"
] | Return all known instances for the given group
@param name name of the group
@return list of instances (or an empty list)
@throws Exception errors | [
"Return",
"all",
"known",
"instances",
"for",
"the",
"given",
"group"
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceDiscoveryImpl.java#L307-L311 |
zandero/settings | src/main/java/com/zandero/settings/Settings.java | Settings.getList | public <T> List<T> getList(String name, Class<T> type) {
"""
Returns setting a list of objects
@param name setting name
@param type type of object
@param <T> type
@return list of found setting
@throws IllegalArgumentException in case settings could not be converted to given type
"""
Object value = supe... | java | public <T> List<T> getList(String name, Class<T> type) {
Object value = super.get(name);
// make sure correct objects are returned
if (value instanceof List) {
ArrayList<T> output = new ArrayList<>();
List list = (List) value;
for (Object item : list) {
output.add(type.cast(item));
}
retur... | [
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"getList",
"(",
"String",
"name",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"Object",
"value",
"=",
"super",
".",
"get",
"(",
"name",
")",
";",
"// make sure correct objects are returned",
"if",
"(",... | Returns setting a list of objects
@param name setting name
@param type type of object
@param <T> type
@return list of found setting
@throws IllegalArgumentException in case settings could not be converted to given type | [
"Returns",
"setting",
"a",
"list",
"of",
"objects"
] | train | https://github.com/zandero/settings/blob/802b44f41bc75e7eb2761028db8c73b7e59620c7/src/main/java/com/zandero/settings/Settings.java#L201-L219 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/CareWebUtil.java | CareWebUtil.associateCSH | public static void associateCSH(BaseUIComponent component, String module, String topic, String label) {
"""
Associates help context with a component.
@param component The component.
@param module The help module identifier.
@param topic The topic id.
@param label The topic label.
"""
HelpContext ... | java | public static void associateCSH(BaseUIComponent component, String module, String topic, String label) {
HelpContext context = new HelpContext(module, topic, label);
HelpUtil.associateCSH(component, context, getShell());
} | [
"public",
"static",
"void",
"associateCSH",
"(",
"BaseUIComponent",
"component",
",",
"String",
"module",
",",
"String",
"topic",
",",
"String",
"label",
")",
"{",
"HelpContext",
"context",
"=",
"new",
"HelpContext",
"(",
"module",
",",
"topic",
",",
"label",
... | Associates help context with a component.
@param component The component.
@param module The help module identifier.
@param topic The topic id.
@param label The topic label. | [
"Associates",
"help",
"context",
"with",
"a",
"component",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/CareWebUtil.java#L124-L127 |
zeroturnaround/zt-exec | src/main/java/org/zeroturnaround/exec/ProcessInitException.java | ProcessInitException.newInstance | public static ProcessInitException newInstance(String prefix, IOException e) {
"""
Try to wrap a given {@link IOException} into a {@link ProcessInitException}.
@param prefix prefix to be added in the message.
@param e existing exception possibly containing an error code in its message.
@return new exception c... | java | public static ProcessInitException newInstance(String prefix, IOException e) {
String m = e.getMessage();
if (m == null) {
return null;
}
int i = m.lastIndexOf(BEFORE_CODE);
if (i == -1) {
return null;
}
int j = m.indexOf(AFTER_CODE, i);
if (j == -1) {
return null;
... | [
"public",
"static",
"ProcessInitException",
"newInstance",
"(",
"String",
"prefix",
",",
"IOException",
"e",
")",
"{",
"String",
"m",
"=",
"e",
".",
"getMessage",
"(",
")",
";",
"if",
"(",
"m",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"int",... | Try to wrap a given {@link IOException} into a {@link ProcessInitException}.
@param prefix prefix to be added in the message.
@param e existing exception possibly containing an error code in its message.
@return new exception containing the prefix, error code and its description in the message plus the error code valu... | [
"Try",
"to",
"wrap",
"a",
"given",
"{",
"@link",
"IOException",
"}",
"into",
"a",
"{",
"@link",
"ProcessInitException",
"}",
"."
] | train | https://github.com/zeroturnaround/zt-exec/blob/6c3b93b99bf3c69c9f41d6350bf7707005b6a4cd/src/main/java/org/zeroturnaround/exec/ProcessInitException.java#L60-L81 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java | GVRSceneObject.prettyPrint | public void prettyPrint(StringBuffer sb, int indent) {
"""
Generate debug dump of the tree from the scene object.
It should include a newline character at the end.
@param sb the {@code StringBuffer} to dump the object.
@param indent indentation level as number of spaces.
"""
sb.append(Log.getSpace... | java | public void prettyPrint(StringBuffer sb, int indent) {
sb.append(Log.getSpaces(indent));
sb.append(getClass().getSimpleName());
sb.append(" [name=");
sb.append(this.getName());
sb.append("]");
sb.append(System.lineSeparator());
GVRRenderData rdata = getRenderData(... | [
"public",
"void",
"prettyPrint",
"(",
"StringBuffer",
"sb",
",",
"int",
"indent",
")",
"{",
"sb",
".",
"append",
"(",
"Log",
".",
"getSpaces",
"(",
"indent",
")",
")",
";",
"sb",
".",
"append",
"(",
"getClass",
"(",
")",
".",
"getSimpleName",
"(",
")... | Generate debug dump of the tree from the scene object.
It should include a newline character at the end.
@param sb the {@code StringBuffer} to dump the object.
@param indent indentation level as number of spaces. | [
"Generate",
"debug",
"dump",
"of",
"the",
"tree",
"from",
"the",
"scene",
"object",
".",
"It",
"should",
"include",
"a",
"newline",
"character",
"at",
"the",
"end",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java#L1183-L1208 |
h2oai/h2o-3 | h2o-core/src/main/java/water/util/VecUtils.java | VecUtils.UUIDToStringVec | public static Vec UUIDToStringVec(Vec src) {
"""
Create a new {@link Vec} of string values from a UUID {@link Vec}.
String {@link Vec} is the standard hexadecimal representations of a UUID.
@param src a UUID {@link Vec}
@return a string {@link Vec}
"""
if( !src.isUUID() ) throw new H2OIllegalArgumen... | java | public static Vec UUIDToStringVec(Vec src) {
if( !src.isUUID() ) throw new H2OIllegalArgumentException("UUIDToStringVec() conversion only works on UUID columns");
Vec res = new MRTask() {
@Override public void map(Chunk chk, NewChunk newChk) {
if (chk instanceof C0DChunk) { // all NAs
fo... | [
"public",
"static",
"Vec",
"UUIDToStringVec",
"(",
"Vec",
"src",
")",
"{",
"if",
"(",
"!",
"src",
".",
"isUUID",
"(",
")",
")",
"throw",
"new",
"H2OIllegalArgumentException",
"(",
"\"UUIDToStringVec() conversion only works on UUID columns\"",
")",
";",
"Vec",
"res... | Create a new {@link Vec} of string values from a UUID {@link Vec}.
String {@link Vec} is the standard hexadecimal representations of a UUID.
@param src a UUID {@link Vec}
@return a string {@link Vec} | [
"Create",
"a",
"new",
"{",
"@link",
"Vec",
"}",
"of",
"string",
"values",
"from",
"a",
"UUID",
"{",
"@link",
"Vec",
"}",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/util/VecUtils.java#L367-L386 |
apollographql/apollo-android | apollo-api/src/main/java/com/apollographql/apollo/api/ResponseField.java | ResponseField.forBoolean | public static ResponseField forBoolean(String responseName, String fieldName, Map<String, Object> arguments,
boolean optional, List<Condition> conditions) {
"""
Factory method for creating a Field instance representing {@link Type#BOOLEAN}.
@param responseName alias for the result of a field
@param field... | java | public static ResponseField forBoolean(String responseName, String fieldName, Map<String, Object> arguments,
boolean optional, List<Condition> conditions) {
return new ResponseField(Type.BOOLEAN, responseName, fieldName, arguments, optional, conditions);
} | [
"public",
"static",
"ResponseField",
"forBoolean",
"(",
"String",
"responseName",
",",
"String",
"fieldName",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"arguments",
",",
"boolean",
"optional",
",",
"List",
"<",
"Condition",
">",
"conditions",
")",
"{",
... | Factory method for creating a Field instance representing {@link Type#BOOLEAN}.
@param responseName alias for the result of a field
@param fieldName name of the field in the GraphQL operation
@param arguments arguments to be passed along with the field
@param optional whether the arguments passed along are o... | [
"Factory",
"method",
"for",
"creating",
"a",
"Field",
"instance",
"representing",
"{",
"@link",
"Type#BOOLEAN",
"}",
"."
] | train | https://github.com/apollographql/apollo-android/blob/a78869a76e17f77e42c7a88f0099914fe7ffa5b6/apollo-api/src/main/java/com/apollographql/apollo/api/ResponseField.java#L100-L103 |
tvbarthel/Cheerleader | library/src/main/java/fr/tvbarthel/cheerleader/library/player/PlaybackService.java | PlaybackService.loadArtwork | private void loadArtwork(final Context context, final String artworkUrl) {
"""
Load the track artwork.
@param context context used by {@link com.squareup.picasso.Picasso} to load the artwork asynchronously.
@param artworkUrl artwork url of the track.
"""
mMainThreadHandler.post(new Runnable() {
... | java | private void loadArtwork(final Context context, final String artworkUrl) {
mMainThreadHandler.post(new Runnable() {
@Override
public void run() {
final Picasso picasso = Picasso.with(context);
picasso.cancelRequest(mMediaSessionArtworkTarget);
... | [
"private",
"void",
"loadArtwork",
"(",
"final",
"Context",
"context",
",",
"final",
"String",
"artworkUrl",
")",
"{",
"mMainThreadHandler",
".",
"post",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"final"... | Load the track artwork.
@param context context used by {@link com.squareup.picasso.Picasso} to load the artwork asynchronously.
@param artworkUrl artwork url of the track. | [
"Load",
"the",
"track",
"artwork",
"."
] | train | https://github.com/tvbarthel/Cheerleader/blob/f61527e4cc44fcd0ed2e1e98aca285f8c236f24e/library/src/main/java/fr/tvbarthel/cheerleader/library/player/PlaybackService.java#L778-L790 |
JodaOrg/joda-time | src/main/java/org/joda/time/convert/CalendarConverter.java | CalendarConverter.getChronology | public Chronology getChronology(Object object, Chronology chrono) {
"""
Gets the chronology.
<p>
If a chronology is specified then it is used.
Otherwise, it is the GJChronology if a GregorianCalendar is used,
BuddhistChronology if a BuddhistCalendar is used or ISOChronology otherwise.
The time zone is extract... | java | public Chronology getChronology(Object object, Chronology chrono) {
if (chrono != null) {
return chrono;
}
Calendar cal = (Calendar) object;
DateTimeZone zone = null;
try {
zone = DateTimeZone.forTimeZone(cal.getTimeZone());
} catch (I... | [
"public",
"Chronology",
"getChronology",
"(",
"Object",
"object",
",",
"Chronology",
"chrono",
")",
"{",
"if",
"(",
"chrono",
"!=",
"null",
")",
"{",
"return",
"chrono",
";",
"}",
"Calendar",
"cal",
"=",
"(",
"Calendar",
")",
"object",
";",
"DateTimeZone",... | Gets the chronology.
<p>
If a chronology is specified then it is used.
Otherwise, it is the GJChronology if a GregorianCalendar is used,
BuddhistChronology if a BuddhistCalendar is used or ISOChronology otherwise.
The time zone is extracted from the calendar if possible, default used if not.
@param object the Calenda... | [
"Gets",
"the",
"chronology",
".",
"<p",
">",
"If",
"a",
"chronology",
"is",
"specified",
"then",
"it",
"is",
"used",
".",
"Otherwise",
"it",
"is",
"the",
"GJChronology",
"if",
"a",
"GregorianCalendar",
"is",
"used",
"BuddhistChronology",
"if",
"a",
"Buddhist... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/CalendarConverter.java#L67-L80 |
Erudika/para | para-server/src/main/java/com/erudika/para/i18n/LanguageUtils.java | LanguageUtils.disapproveTranslation | public boolean disapproveTranslation(String appid, String langCode, String key) {
"""
Disapproves a translation for a given language.
@param appid appid name of the {@link com.erudika.para.core.App}
@param langCode the 2-letter language code
@param key the translation key
@return true if the operation was succ... | java | public boolean disapproveTranslation(String appid, String langCode, String key) {
if (StringUtils.isBlank(langCode) || key == null || getDefaultLanguageCode().equals(langCode)) {
return false;
}
Sysprop s = dao.read(appid, keyPrefix.concat(langCode));
if (s != null) {
String value = getDefaultLanguage(app... | [
"public",
"boolean",
"disapproveTranslation",
"(",
"String",
"appid",
",",
"String",
"langCode",
",",
"String",
"key",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"langCode",
")",
"||",
"key",
"==",
"null",
"||",
"getDefaultLanguageCode",
"(",
"... | Disapproves a translation for a given language.
@param appid appid name of the {@link com.erudika.para.core.App}
@param langCode the 2-letter language code
@param key the translation key
@return true if the operation was successful | [
"Disapproves",
"a",
"translation",
"for",
"a",
"given",
"language",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/i18n/LanguageUtils.java#L351-L367 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/ScrollBarButtonPainter.java | ScrollBarButtonPainter.fillScrollBarButtonInteriorColors | private void fillScrollBarButtonInteriorColors(Graphics2D g, Shape s, boolean isIncrease, boolean buttonsTogether) {
"""
DOCUMENT ME!
@param g DOCUMENT ME!
@param s DOCUMENT ME!
@param isIncrease DOCUMENT ME!
@param buttonsTogether DOCUMENT ME!
"""
g.setPaint(getS... | java | private void fillScrollBarButtonInteriorColors(Graphics2D g, Shape s, boolean isIncrease, boolean buttonsTogether) {
g.setPaint(getScrollBarButtonBackgroundPaint(s, isIncrease, buttonsTogether));
g.fill(s);
int width = s.getBounds().width;
g.setPaint(getScrollBarButtonLinePaint());
... | [
"private",
"void",
"fillScrollBarButtonInteriorColors",
"(",
"Graphics2D",
"g",
",",
"Shape",
"s",
",",
"boolean",
"isIncrease",
",",
"boolean",
"buttonsTogether",
")",
"{",
"g",
".",
"setPaint",
"(",
"getScrollBarButtonBackgroundPaint",
"(",
"s",
",",
"isIncrease",... | DOCUMENT ME!
@param g DOCUMENT ME!
@param s DOCUMENT ME!
@param isIncrease DOCUMENT ME!
@param buttonsTogether DOCUMENT ME! | [
"DOCUMENT",
"ME!"
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/ScrollBarButtonPainter.java#L298-L313 |
lightblueseas/vintage-time | src/main/java/de/alpharogroup/date/CalculateDateExtensions.java | CalculateDateExtensions.substractMonthsFromDate | public static Date substractMonthsFromDate(final Date date, final int substractMonths) {
"""
Substract months to the given Date object and returns it.
@param date
The Date object to substract the months.
@param substractMonths
The months to substract.
@return The resulted Date object.
"""
final Calend... | java | public static Date substractMonthsFromDate(final Date date, final int substractMonths)
{
final Calendar dateOnCalendar = Calendar.getInstance();
dateOnCalendar.setTime(date);
dateOnCalendar.add(Calendar.MONTH, substractMonths * -1);
return dateOnCalendar.getTime();
} | [
"public",
"static",
"Date",
"substractMonthsFromDate",
"(",
"final",
"Date",
"date",
",",
"final",
"int",
"substractMonths",
")",
"{",
"final",
"Calendar",
"dateOnCalendar",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"dateOnCalendar",
".",
"setTime",
"(... | Substract months to the given Date object and returns it.
@param date
The Date object to substract the months.
@param substractMonths
The months to substract.
@return The resulted Date object. | [
"Substract",
"months",
"to",
"the",
"given",
"Date",
"object",
"and",
"returns",
"it",
"."
] | train | https://github.com/lightblueseas/vintage-time/blob/fbf201e679d9f9b92e7b5771f3eea1413cc2e113/src/main/java/de/alpharogroup/date/CalculateDateExtensions.java#L405-L411 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Utilities.java | Utilities.convertToUtf32 | public static int convertToUtf32(String text, int idx) {
"""
Converts a unicode character in a String to a UTF32 code point value
@param text a String that has the unicode character(s)
@param idx the index of the 'high' character
@return the codepoint value
@since 2.1.2
"""
return (((text.charAt(i... | java | public static int convertToUtf32(String text, int idx) {
return (((text.charAt(idx) - 0xd800) * 0x400) + (text.charAt(idx + 1) - 0xdc00)) + 0x10000;
} | [
"public",
"static",
"int",
"convertToUtf32",
"(",
"String",
"text",
",",
"int",
"idx",
")",
"{",
"return",
"(",
"(",
"(",
"text",
".",
"charAt",
"(",
"idx",
")",
"-",
"0xd800",
")",
"*",
"0x400",
")",
"+",
"(",
"text",
".",
"charAt",
"(",
"idx",
... | Converts a unicode character in a String to a UTF32 code point value
@param text a String that has the unicode character(s)
@param idx the index of the 'high' character
@return the codepoint value
@since 2.1.2 | [
"Converts",
"a",
"unicode",
"character",
"in",
"a",
"String",
"to",
"a",
"UTF32",
"code",
"point",
"value"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Utilities.java#L326-L328 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/ENU.java | ENU.enuToEcef | public Coordinate enuToEcef( Coordinate cEnu ) {
"""
Converts an ENU coordinate to Earth-Centered Earth-Fixed (ECEF).
@param cEnu the enu coordinate.
@return the ecef coordinate.
"""
double[][] enu = new double[][]{{cEnu.x}, {cEnu.y}, {cEnu.z}};
RealMatrix enuMatrix = MatrixUtils.createReal... | java | public Coordinate enuToEcef( Coordinate cEnu ) {
double[][] enu = new double[][]{{cEnu.x}, {cEnu.y}, {cEnu.z}};
RealMatrix enuMatrix = MatrixUtils.createRealMatrix(enu);
RealMatrix deltasMatrix = _inverseRotationMatrix.multiply(enuMatrix);
double[] column = deltasMatrix.getColumn(0);
... | [
"public",
"Coordinate",
"enuToEcef",
"(",
"Coordinate",
"cEnu",
")",
"{",
"double",
"[",
"]",
"[",
"]",
"enu",
"=",
"new",
"double",
"[",
"]",
"[",
"]",
"{",
"{",
"cEnu",
".",
"x",
"}",
",",
"{",
"cEnu",
".",
"y",
"}",
",",
"{",
"cEnu",
".",
... | Converts an ENU coordinate to Earth-Centered Earth-Fixed (ECEF).
@param cEnu the enu coordinate.
@return the ecef coordinate. | [
"Converts",
"an",
"ENU",
"coordinate",
"to",
"Earth",
"-",
"Centered",
"Earth",
"-",
"Fixed",
"(",
"ECEF",
")",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/ENU.java#L185-L197 |
thombergs/docx-stamper | src/main/java/org/wickedsource/docxstamper/el/ExpressionResolver.java | ExpressionResolver.resolveExpression | public Object resolveExpression(String expressionString, Object contextRoot) {
"""
Runs the given expression against the given context object and returns the result of the evaluated expression.
@param expressionString the expression to evaluate.
@param contextRoot the context object against which the expr... | java | public Object resolveExpression(String expressionString, Object contextRoot) {
if ((expressionString.startsWith("${") || expressionString.startsWith("#{")) && expressionString.endsWith("}")) {
expressionString = expressionUtil.stripExpression(expressionString);
}
ExpressionParser par... | [
"public",
"Object",
"resolveExpression",
"(",
"String",
"expressionString",
",",
"Object",
"contextRoot",
")",
"{",
"if",
"(",
"(",
"expressionString",
".",
"startsWith",
"(",
"\"${\"",
")",
"||",
"expressionString",
".",
"startsWith",
"(",
"\"#{\"",
")",
")",
... | Runs the given expression against the given context object and returns the result of the evaluated expression.
@param expressionString the expression to evaluate.
@param contextRoot the context object against which the expression is evaluated.
@return the result of the evaluated expression. | [
"Runs",
"the",
"given",
"expression",
"against",
"the",
"given",
"context",
"object",
"and",
"returns",
"the",
"result",
"of",
"the",
"evaluated",
"expression",
"."
] | train | https://github.com/thombergs/docx-stamper/blob/f1a7e3e92a59abaffac299532fe49450c3b041eb/src/main/java/org/wickedsource/docxstamper/el/ExpressionResolver.java#L30-L39 |
maguro/aunit | junit/src/main/java/com/toolazydogs/aunit/Assert.java | Assert.assertTree | public static void assertTree(String message, String rootText, String preorder, Tree tree) {
"""
Asserts a parse tree.
@param message the message to display on failure.
@param rootText the text of the root of the tree.
@param preorder the preorder traversal of the tree.
@param tree an ANTLR tree to asse... | java | public static void assertTree(String message, String rootText, String preorder, Tree tree)
{
assertNotNull("tree should be non-null", tree);
assertEquals(message + " (asserting type of root)", rootText, tree.getText());
assertPreordered(message, preorder, tree);
} | [
"public",
"static",
"void",
"assertTree",
"(",
"String",
"message",
",",
"String",
"rootText",
",",
"String",
"preorder",
",",
"Tree",
"tree",
")",
"{",
"assertNotNull",
"(",
"\"tree should be non-null\"",
",",
"tree",
")",
";",
"assertEquals",
"(",
"message",
... | Asserts a parse tree.
@param message the message to display on failure.
@param rootText the text of the root of the tree.
@param preorder the preorder traversal of the tree.
@param tree an ANTLR tree to assert on. | [
"Asserts",
"a",
"parse",
"tree",
"."
] | train | https://github.com/maguro/aunit/blob/1f972e35b28327e5e2e7881befc928df0546d74c/junit/src/main/java/com/toolazydogs/aunit/Assert.java#L324-L329 |
foundation-runtime/logging | logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java | TransactionLogger.addTimePerComponent | private static void addTimePerComponent(HashMap<String, Long> mapComponentTimes, Component component) {
"""
Add component processing time to given map
@param mapComponentTimes
@param component
"""
Long currentTimeOfComponent = 0L;
String key = component.getComponentType();
if (mapComponentTimes.c... | java | private static void addTimePerComponent(HashMap<String, Long> mapComponentTimes, Component component) {
Long currentTimeOfComponent = 0L;
String key = component.getComponentType();
if (mapComponentTimes.containsKey(key)) {
currentTimeOfComponent = mapComponentTimes.get(key);
}
//when transacti... | [
"private",
"static",
"void",
"addTimePerComponent",
"(",
"HashMap",
"<",
"String",
",",
"Long",
">",
"mapComponentTimes",
",",
"Component",
"component",
")",
"{",
"Long",
"currentTimeOfComponent",
"=",
"0L",
";",
"String",
"key",
"=",
"component",
".",
"getCompo... | Add component processing time to given map
@param mapComponentTimes
@param component | [
"Add",
"component",
"processing",
"time",
"to",
"given",
"map"
] | train | https://github.com/foundation-runtime/logging/blob/cd0a07b3c5b458ecf90ab92a1e0c72a067f5cbd6/logging-api/src/main/java/com/cisco/oss/foundation/logging/transactions/TransactionLogger.java#L446-L456 |
google/closure-compiler | src/com/google/javascript/jscomp/CheckAccessControls.java | CheckAccessControls.checkNameVisibility | private void checkNameVisibility(Scope scope, Node name) {
"""
Reports an error if the given name is not visible in the current context.
@param scope The current scope.
@param name The name node.
"""
if (!name.isName()) {
return;
}
Var var = scope.getVar(name.getString());
if (var ==... | java | private void checkNameVisibility(Scope scope, Node name) {
if (!name.isName()) {
return;
}
Var var = scope.getVar(name.getString());
if (var == null) {
return;
}
Visibility v = checkPrivateNameConvention(
AccessControlUtils.getEffectiveNameVisibility(
name, var,... | [
"private",
"void",
"checkNameVisibility",
"(",
"Scope",
"scope",
",",
"Node",
"name",
")",
"{",
"if",
"(",
"!",
"name",
".",
"isName",
"(",
")",
")",
"{",
"return",
";",
"}",
"Var",
"var",
"=",
"scope",
".",
"getVar",
"(",
"name",
".",
"getString",
... | Reports an error if the given name is not visible in the current context.
@param scope The current scope.
@param name The name node. | [
"Reports",
"an",
"error",
"if",
"the",
"given",
"name",
"is",
"not",
"visible",
"in",
"the",
"current",
"context",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CheckAccessControls.java#L551-L591 |
anotheria/moskito | moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/AbstractMoskitoAspect.java | AbstractMoskitoAspect.getProducer | protected OnDemandStatsProducer<S> getProducer(final ProceedingJoinPoint pjp, final String aProducerId, final String aCategory, final String aSubsystem, final boolean withMethod,
final IOnDemandStatsFactory<S> factory, final boolean tracingSupported) {
"""
See {@link #getProducer(ProceedingJoinPoint... | java | protected OnDemandStatsProducer<S> getProducer(final ProceedingJoinPoint pjp, final String aProducerId, final String aCategory, final String aSubsystem, final boolean withMethod,
final IOnDemandStatsFactory<S> factory, final boolean tracingSupported) {
return getProducer(pjp, aProducerId, aCategory, aS... | [
"protected",
"OnDemandStatsProducer",
"<",
"S",
">",
"getProducer",
"(",
"final",
"ProceedingJoinPoint",
"pjp",
",",
"final",
"String",
"aProducerId",
",",
"final",
"String",
"aCategory",
",",
"final",
"String",
"aSubsystem",
",",
"final",
"boolean",
"withMethod",
... | See {@link #getProducer(ProceedingJoinPoint, String, String, String, boolean, IOnDemandStatsFactory, boolean, boolean)} - with attachLoggers -
providen by {@link MoskitoAspectConfiguration#isAttachDefaultStatLoggers()}.
@param pjp
the pjp is used to obtain the producer id automatically if it's not submitted.
@param aP... | [
"See",
"{",
"@link",
"#getProducer",
"(",
"ProceedingJoinPoint",
"String",
"String",
"String",
"boolean",
"IOnDemandStatsFactory",
"boolean",
"boolean",
")",
"}",
"-",
"with",
"attachLoggers",
"-",
"providen",
"by",
"{",
"@link",
"MoskitoAspectConfiguration#isAttachDefa... | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-aop/src/main/java/net/anotheria/moskito/aop/aspect/AbstractMoskitoAspect.java#L77-L80 |
forge/javaee-descriptors | impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/orm10/OrmDescriptorImpl.java | OrmDescriptorImpl.addNamespace | public OrmDescriptor addNamespace(String name, String value) {
"""
Adds a new namespace
@return the current instance of <code>OrmDescriptor</code>
"""
model.attribute(name, value);
return this;
} | java | public OrmDescriptor addNamespace(String name, String value)
{
model.attribute(name, value);
return this;
} | [
"public",
"OrmDescriptor",
"addNamespace",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"model",
".",
"attribute",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds a new namespace
@return the current instance of <code>OrmDescriptor</code> | [
"Adds",
"a",
"new",
"namespace"
] | train | https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/orm10/OrmDescriptorImpl.java#L92-L96 |
stratosphere/stratosphere | stratosphere-compiler/src/main/java/eu/stratosphere/compiler/DataStatistics.java | DataStatistics.cacheBaseStatistics | public void cacheBaseStatistics(BaseStatistics statistics, String identifyer) {
"""
Caches the given statistics. They are later retrievable under the given identifier.
@param statistics The statistics to cache.
@param identifyer The identifier which may be later used to retrieve the statistics.
"""
synch... | java | public void cacheBaseStatistics(BaseStatistics statistics, String identifyer) {
synchronized (this.baseStatisticsCache) {
this.baseStatisticsCache.put(identifyer, statistics);
}
} | [
"public",
"void",
"cacheBaseStatistics",
"(",
"BaseStatistics",
"statistics",
",",
"String",
"identifyer",
")",
"{",
"synchronized",
"(",
"this",
".",
"baseStatisticsCache",
")",
"{",
"this",
".",
"baseStatisticsCache",
".",
"put",
"(",
"identifyer",
",",
"statist... | Caches the given statistics. They are later retrievable under the given identifier.
@param statistics The statistics to cache.
@param identifyer The identifier which may be later used to retrieve the statistics. | [
"Caches",
"the",
"given",
"statistics",
".",
"They",
"are",
"later",
"retrievable",
"under",
"the",
"given",
"identifier",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-compiler/src/main/java/eu/stratosphere/compiler/DataStatistics.java#L59-L63 |
cdk/cdk | app/depict/src/main/java/org/openscience/cdk/depict/DepictionGenerator.java | DepictionGenerator.withHighlight | public DepictionGenerator withHighlight(Iterable<? extends IChemObject> chemObjs, Color color) {
"""
Highlight the provided set of atoms and bonds in the depiction in the
specified color.
Calling this methods appends to the current highlight buffer. The buffer
is cleared after each depiction is generated (e.g... | java | public DepictionGenerator withHighlight(Iterable<? extends IChemObject> chemObjs, Color color) {
DepictionGenerator copy = new DepictionGenerator(this);
for (IChemObject chemObj : chemObjs)
copy.highlight.put(chemObj, color);
return copy;
} | [
"public",
"DepictionGenerator",
"withHighlight",
"(",
"Iterable",
"<",
"?",
"extends",
"IChemObject",
">",
"chemObjs",
",",
"Color",
"color",
")",
"{",
"DepictionGenerator",
"copy",
"=",
"new",
"DepictionGenerator",
"(",
"this",
")",
";",
"for",
"(",
"IChemObjec... | Highlight the provided set of atoms and bonds in the depiction in the
specified color.
Calling this methods appends to the current highlight buffer. The buffer
is cleared after each depiction is generated (e.g. {@link #depict(IAtomContainer)}).
@param chemObjs set of atoms and bonds
@param color the color to highl... | [
"Highlight",
"the",
"provided",
"set",
"of",
"atoms",
"and",
"bonds",
"in",
"the",
"depiction",
"in",
"the",
"specified",
"color",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/DepictionGenerator.java#L978-L983 |
mikepenz/MaterialDrawer | library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java | DrawerUtils.addStickyFooterDivider | private static void addStickyFooterDivider(Context ctx, ViewGroup footerView) {
"""
adds the shadow to the stickyFooter
@param ctx
@param footerView
"""
LinearLayout divider = new LinearLayout(ctx);
LinearLayout.LayoutParams dividerParams = new LinearLayout.LayoutParams(ViewGroup.LayoutPara... | java | private static void addStickyFooterDivider(Context ctx, ViewGroup footerView) {
LinearLayout divider = new LinearLayout(ctx);
LinearLayout.LayoutParams dividerParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
divider.setMinimumHeigh... | [
"private",
"static",
"void",
"addStickyFooterDivider",
"(",
"Context",
"ctx",
",",
"ViewGroup",
"footerView",
")",
"{",
"LinearLayout",
"divider",
"=",
"new",
"LinearLayout",
"(",
"ctx",
")",
";",
"LinearLayout",
".",
"LayoutParams",
"dividerParams",
"=",
"new",
... | adds the shadow to the stickyFooter
@param ctx
@param footerView | [
"adds",
"the",
"shadow",
"to",
"the",
"stickyFooter"
] | train | https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerUtils.java#L381-L388 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/javax/el/ListELResolver.java | ListELResolver.isReadOnly | @Override
public boolean isReadOnly(ELContext context, Object base, Object property) {
"""
If the base object is a list, returns whether a call to
{@link #setValue(ELContext, Object, Object, Object)} will always fail. If the base is a List,
the propertyResolved property of the ELContext object must be set to tr... | java | @Override
public boolean isReadOnly(ELContext context, Object base, Object property) {
if (context == null) {
throw new NullPointerException("context is null");
}
if (isResolvable(base)) {
toIndex((List<?>) base, property);
context.setPropertyResolved(true);
}
return readOnly;
} | [
"@",
"Override",
"public",
"boolean",
"isReadOnly",
"(",
"ELContext",
"context",
",",
"Object",
"base",
",",
"Object",
"property",
")",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"context is null\"",
")",
... | If the base object is a list, returns whether a call to
{@link #setValue(ELContext, Object, Object, Object)} will always fail. If the base is a List,
the propertyResolved property of the ELContext object must be set to true by this resolver,
before returning. If this property is not true after this method is called, th... | [
"If",
"the",
"base",
"object",
"is",
"a",
"list",
"returns",
"whether",
"a",
"call",
"to",
"{",
"@link",
"#setValue",
"(",
"ELContext",
"Object",
"Object",
"Object",
")",
"}",
"will",
"always",
"fail",
".",
"If",
"the",
"base",
"is",
"a",
"List",
"the"... | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/javax/el/ListELResolver.java#L199-L209 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapComposedElement.java | MapComposedElement.addPoint | public int addPoint(double x, double y, int groupIndex) {
"""
Add the specified point at the end of the specified group.
@param x x coordinate
@param y y coordinate
@param groupIndex the index of the group.
@return the index of the point in the element.
@throws IndexOutOfBoundsException in case of error.
... | java | public int addPoint(double x, double y, int groupIndex) {
final int groupCount = getGroupCount();
if (groupIndex < 0) {
throw new IndexOutOfBoundsException(groupIndex + "<0"); //$NON-NLS-1$
}
if (groupIndex >= groupCount) {
throw new IndexOutOfBoundsException(groupIndex + ">=" + groupCount); //$NON-NLS-1... | [
"public",
"int",
"addPoint",
"(",
"double",
"x",
",",
"double",
"y",
",",
"int",
"groupIndex",
")",
"{",
"final",
"int",
"groupCount",
"=",
"getGroupCount",
"(",
")",
";",
"if",
"(",
"groupIndex",
"<",
"0",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsExce... | Add the specified point at the end of the specified group.
@param x x coordinate
@param y y coordinate
@param groupIndex the index of the group.
@return the index of the point in the element.
@throws IndexOutOfBoundsException in case of error. | [
"Add",
"the",
"specified",
"point",
"at",
"the",
"end",
"of",
"the",
"specified",
"group",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapComposedElement.java#L604-L647 |
elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/textwriter/TextWriterWriterInterface.java | TextWriterWriterInterface.writeObject | @SuppressWarnings("unchecked")
public final void writeObject(TextWriterStream out, String label, Object object) throws IOException {
"""
Non-type-checking version.
@param out Output stream
@param label Label to prefix
@param object object to output
@throws IOException on IO errors
"""
write(out, la... | java | @SuppressWarnings("unchecked")
public final void writeObject(TextWriterStream out, String label, Object object) throws IOException {
write(out, label, (O) object);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"final",
"void",
"writeObject",
"(",
"TextWriterStream",
"out",
",",
"String",
"label",
",",
"Object",
"object",
")",
"throws",
"IOException",
"{",
"write",
"(",
"out",
",",
"label",
",",
"(",
"O"... | Non-type-checking version.
@param out Output stream
@param label Label to prefix
@param object object to output
@throws IOException on IO errors | [
"Non",
"-",
"type",
"-",
"checking",
"version",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/textwriter/TextWriterWriterInterface.java#L52-L55 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCrossConnectionsInner.java | ExpressRouteCrossConnectionsInner.getByResourceGroupAsync | public Observable<ExpressRouteCrossConnectionInner> getByResourceGroupAsync(String resourceGroupName, String crossConnectionName) {
"""
Gets details about the specified ExpressRouteCrossConnection.
@param resourceGroupName The name of the resource group (peering location of the circuit).
@param crossConnection... | java | public Observable<ExpressRouteCrossConnectionInner> getByResourceGroupAsync(String resourceGroupName, String crossConnectionName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, crossConnectionName).map(new Func1<ServiceResponse<ExpressRouteCrossConnectionInner>, ExpressRouteCrossConnecti... | [
"public",
"Observable",
"<",
"ExpressRouteCrossConnectionInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"crossConnectionName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"crossConn... | Gets details about the specified ExpressRouteCrossConnection.
@param resourceGroupName The name of the resource group (peering location of the circuit).
@param crossConnectionName The name of the ExpressRouteCrossConnection (service key of the circuit).
@throws IllegalArgumentException thrown if parameters fail the va... | [
"Gets",
"details",
"about",
"the",
"specified",
"ExpressRouteCrossConnection",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCrossConnectionsInner.java#L384-L391 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_GET | public OvhExchangeService organizationName_service_exchangeService_GET(String organizationName, String exchangeService) throws IOException {
"""
Get this object properties
REST: GET /email/exchange/{organizationName}/service/{exchangeService}
@param organizationName [required] The internal name of your exchang... | java | public OvhExchangeService organizationName_service_exchangeService_GET(String organizationName, String exchangeService) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}";
StringBuilder sb = path(qPath, organizationName, exchangeService);
String resp = exec(qPath, "... | [
"public",
"OvhExchangeService",
"organizationName_service_exchangeService_GET",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/exchange/{organizationName}/service/{exchangeService}\"",
";",
... | Get this object properties
REST: GET /email/exchange/{organizationName}/service/{exchangeService}
@param organizationName [required] The internal name of your exchange organization
@param exchangeService [required] The internal name of your exchange service | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L96-L101 |
javagl/ND | nd-arrays/src/main/java/de/javagl/nd/arrays/Utils.java | Utils.checkForEqualSizes | public static void checkForEqualSizes(ArrayND a0, ArrayND a1) {
"""
Checks whether given given {@link ArrayND}s have equal sizes,
and throws an <code>IllegalArgumentException</code> if not.
@param a0 The first array
@param a1 The second array
@throws NullPointerException If any argument is <code>null</code>
... | java | public static void checkForEqualSizes(ArrayND a0, ArrayND a1)
{
if (!a0.getSize().equals(a1.getSize()))
{
throw new IllegalArgumentException(
"Arrays have different sizes: "+a0.getSize() +
" and "+a1.getSize());
}
} | [
"public",
"static",
"void",
"checkForEqualSizes",
"(",
"ArrayND",
"a0",
",",
"ArrayND",
"a1",
")",
"{",
"if",
"(",
"!",
"a0",
".",
"getSize",
"(",
")",
".",
"equals",
"(",
"a1",
".",
"getSize",
"(",
")",
")",
")",
"{",
"throw",
"new",
"IllegalArgumen... | Checks whether given given {@link ArrayND}s have equal sizes,
and throws an <code>IllegalArgumentException</code> if not.
@param a0 The first array
@param a1 The second array
@throws NullPointerException If any argument is <code>null</code>
@throws IllegalArgumentException If the given arrays
do not have equal sizes | [
"Checks",
"whether",
"given",
"given",
"{",
"@link",
"ArrayND",
"}",
"s",
"have",
"equal",
"sizes",
"and",
"throws",
"an",
"<code",
">",
"IllegalArgumentException<",
"/",
"code",
">",
"if",
"not",
"."
] | train | https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-arrays/src/main/java/de/javagl/nd/arrays/Utils.java#L69-L77 |
wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/BundlePackager.java | BundlePackager.readMavenProperties | public static Properties readMavenProperties(File baseDir) throws IOException {
"""
We should have generated a {@code target/osgi/osgi.properties} file with the metadata we inherit from Maven.
@param baseDir the project directory
@return the computed set of properties
"""
return Instructions.load(n... | java | public static Properties readMavenProperties(File baseDir) throws IOException {
return Instructions.load(new File(baseDir, org.wisdom.maven.Constants.OSGI_PROPERTIES));
} | [
"public",
"static",
"Properties",
"readMavenProperties",
"(",
"File",
"baseDir",
")",
"throws",
"IOException",
"{",
"return",
"Instructions",
".",
"load",
"(",
"new",
"File",
"(",
"baseDir",
",",
"org",
".",
"wisdom",
".",
"maven",
".",
"Constants",
".",
"OS... | We should have generated a {@code target/osgi/osgi.properties} file with the metadata we inherit from Maven.
@param baseDir the project directory
@return the computed set of properties | [
"We",
"should",
"have",
"generated",
"a",
"{",
"@code",
"target",
"/",
"osgi",
"/",
"osgi",
".",
"properties",
"}",
"file",
"with",
"the",
"metadata",
"we",
"inherit",
"from",
"Maven",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/BundlePackager.java#L187-L189 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.