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 |
|---|---|---|---|---|---|---|---|---|---|---|
apache/flink | flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/HadoopInputs.java | HadoopInputs.readHadoopFile | public static <K, V> org.apache.flink.api.java.hadoop.mapreduce.HadoopInputFormat<K, V> readHadoopFile(
org.apache.hadoop.mapreduce.lib.input.FileInputFormat<K, V> mapreduceInputFormat, Class<K> key, Class<V> value, String inputPath, Job job) throws IOException {
"""
Creates a Flink {@link InputFormat} that wra... | java | public static <K, V> org.apache.flink.api.java.hadoop.mapreduce.HadoopInputFormat<K, V> readHadoopFile(
org.apache.hadoop.mapreduce.lib.input.FileInputFormat<K, V> mapreduceInputFormat, Class<K> key, Class<V> value, String inputPath, Job job) throws IOException {
// set input path in Job
org.apache.hadoop.mapred... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"org",
".",
"apache",
".",
"flink",
".",
"api",
".",
"java",
".",
"hadoop",
".",
"mapreduce",
".",
"HadoopInputFormat",
"<",
"K",
",",
"V",
">",
"readHadoopFile",
"(",
"org",
".",
"apache",
".",
"hadoop",
... | Creates a Flink {@link InputFormat} that wraps the given Hadoop {@link org.apache.hadoop.mapreduce.lib.input.FileInputFormat}.
@return A Flink InputFormat that wraps the Hadoop FileInputFormat. | [
"Creates",
"a",
"Flink",
"{",
"@link",
"InputFormat",
"}",
"that",
"wraps",
"the",
"given",
"Hadoop",
"{",
"@link",
"org",
".",
"apache",
".",
"hadoop",
".",
"mapreduce",
".",
"lib",
".",
"input",
".",
"FileInputFormat",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/hadoopcompatibility/HadoopInputs.java#L89-L95 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/ra/inbound/impl/SibRaStringGenerator.java | SibRaStringGenerator.addPasswordField | void addPasswordField(final String name, final String value)
throws IllegalStateException {
"""
Adds a string representation of the given password field.
@param name
the name of the field
@param value
the value of the field
@throws IllegalStateException
if the string representation has already ... | java | void addPasswordField(final String name, final String value)
throws IllegalStateException {
addField(name, (value == null) ? null : "*****");
} | [
"void",
"addPasswordField",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"value",
")",
"throws",
"IllegalStateException",
"{",
"addField",
"(",
"name",
",",
"(",
"value",
"==",
"null",
")",
"?",
"null",
":",
"\"*****\"",
")",
";",
"}"
] | Adds a string representation of the given password field.
@param name
the name of the field
@param value
the value of the field
@throws IllegalStateException
if the string representation has already been completed | [
"Adds",
"a",
"string",
"representation",
"of",
"the",
"given",
"password",
"field",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/ra/inbound/impl/SibRaStringGenerator.java#L114-L119 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_serviceMonitoring_monitoringId_alert_sms_alertId_PUT | public void serviceName_serviceMonitoring_monitoringId_alert_sms_alertId_PUT(String serviceName, Long monitoringId, Long alertId, OvhSmsAlert body) throws IOException {
"""
Alter this object properties
REST: PUT /dedicated/server/{serviceName}/serviceMonitoring/{monitoringId}/alert/sms/{alertId}
@param body [r... | java | public void serviceName_serviceMonitoring_monitoringId_alert_sms_alertId_PUT(String serviceName, Long monitoringId, Long alertId, OvhSmsAlert body) throws IOException {
String qPath = "/dedicated/server/{serviceName}/serviceMonitoring/{monitoringId}/alert/sms/{alertId}";
StringBuilder sb = path(qPath, serviceName, ... | [
"public",
"void",
"serviceName_serviceMonitoring_monitoringId_alert_sms_alertId_PUT",
"(",
"String",
"serviceName",
",",
"Long",
"monitoringId",
",",
"Long",
"alertId",
",",
"OvhSmsAlert",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/se... | Alter this object properties
REST: PUT /dedicated/server/{serviceName}/serviceMonitoring/{monitoringId}/alert/sms/{alertId}
@param body [required] New object properties
@param serviceName [required] The internal name of your dedicated server
@param monitoringId [required] This monitoring id
@param alertId [required] I... | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L2164-L2168 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_ip_GET | public ArrayList<OvhCloudIp> project_serviceName_ip_GET(String serviceName) throws IOException {
"""
Get ips
REST: GET /cloud/project/{serviceName}/ip
@param serviceName [required] Project id
"""
String qPath = "/cloud/project/{serviceName}/ip";
StringBuilder sb = path(qPath, serviceName);
String res... | java | public ArrayList<OvhCloudIp> project_serviceName_ip_GET(String serviceName) throws IOException {
String qPath = "/cloud/project/{serviceName}/ip";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t14);
} | [
"public",
"ArrayList",
"<",
"OvhCloudIp",
">",
"project_serviceName_ip_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/ip\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"... | Get ips
REST: GET /cloud/project/{serviceName}/ip
@param serviceName [required] Project id | [
"Get",
"ips"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1336-L1341 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java | AtomicAllocator.purgeZeroObject | protected void purgeZeroObject(Long bucketId, Long objectId, AllocationPoint point, boolean copyback) {
"""
This method frees native system memory referenced by specified tracking id/AllocationPoint
@param bucketId
@param objectId
@param point
@param copyback
"""
allocationsMap.remove(objectId);
... | java | protected void purgeZeroObject(Long bucketId, Long objectId, AllocationPoint point, boolean copyback) {
allocationsMap.remove(objectId);
memoryHandler.purgeZeroObject(bucketId, objectId, point, copyback);
getFlowController().getEventsProvider().storeEvent(point.getLastWriteEvent());
ge... | [
"protected",
"void",
"purgeZeroObject",
"(",
"Long",
"bucketId",
",",
"Long",
"objectId",
",",
"AllocationPoint",
"point",
",",
"boolean",
"copyback",
")",
"{",
"allocationsMap",
".",
"remove",
"(",
"objectId",
")",
";",
"memoryHandler",
".",
"purgeZeroObject",
... | This method frees native system memory referenced by specified tracking id/AllocationPoint
@param bucketId
@param objectId
@param point
@param copyback | [
"This",
"method",
"frees",
"native",
"system",
"memory",
"referenced",
"by",
"specified",
"tracking",
"id",
"/",
"AllocationPoint"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/impl/AtomicAllocator.java#L530-L537 |
tiesebarrell/process-assertions | process-assertions-api/src/main/java/org/toxos/processassertions/api/internal/AssertUtils.java | AssertUtils.isEqualCollection | public static boolean isEqualCollection(Collection<String> list1, Collection<String> list2) {
"""
Determines whether the provided collections of strings are equal. Equality is considered:
<ul>
<li>Both lists are empty, or</li>
<li>Both lists are of the same size and contain the same elements.</li>
</ul>
... | java | public static boolean isEqualCollection(Collection<String> list1, Collection<String> list2) {
Validate.notNull(list1);
Validate.notNull(list2);
boolean result = true;
if (list1.size() == list2.size()) {
for (final String currentString : list1) {
if (!list2.c... | [
"public",
"static",
"boolean",
"isEqualCollection",
"(",
"Collection",
"<",
"String",
">",
"list1",
",",
"Collection",
"<",
"String",
">",
"list2",
")",
"{",
"Validate",
".",
"notNull",
"(",
"list1",
")",
";",
"Validate",
".",
"notNull",
"(",
"list2",
")",... | Determines whether the provided collections of strings are equal. Equality is considered:
<ul>
<li>Both lists are empty, or</li>
<li>Both lists are of the same size and contain the same elements.</li>
</ul>
@param list1
the first list, may not be {@code null}
@param list2
the second list, may not be {@code null}
@re... | [
"Determines",
"whether",
"the",
"provided",
"collections",
"of",
"strings",
"are",
"equal",
".",
"Equality",
"is",
"considered",
":"
] | train | https://github.com/tiesebarrell/process-assertions/blob/932a8443982e356cdf5a230165a35c725d9306ab/process-assertions-api/src/main/java/org/toxos/processassertions/api/internal/AssertUtils.java#L126-L144 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/StringUtils.java | StringUtils.stringToProperties | public static Properties stringToProperties(String str) {
"""
This method converts a comma-separated String (with whitespace
optionally allowed after the comma) representing properties
to a Properties object. Each property is "property=value". The value
for properties without an explicitly given value is set ... | java | public static Properties stringToProperties(String str) {
Properties result = new Properties();
return stringToProperties(str, result);
} | [
"public",
"static",
"Properties",
"stringToProperties",
"(",
"String",
"str",
")",
"{",
"Properties",
"result",
"=",
"new",
"Properties",
"(",
")",
";",
"return",
"stringToProperties",
"(",
"str",
",",
"result",
")",
";",
"}"
] | This method converts a comma-separated String (with whitespace
optionally allowed after the comma) representing properties
to a Properties object. Each property is "property=value". The value
for properties without an explicitly given value is set to "true". This can be used for a 2nd level
of properties, for example... | [
"This",
"method",
"converts",
"a",
"comma",
"-",
"separated",
"String",
"(",
"with",
"whitespace",
"optionally",
"allowed",
"after",
"the",
"comma",
")",
"representing",
"properties",
"to",
"a",
"Properties",
"object",
".",
"Each",
"property",
"is",
"property",
... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/StringUtils.java#L827-L830 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPMeasurementUnitPersistenceImpl.java | CPMeasurementUnitPersistenceImpl.findAll | @Override
public List<CPMeasurementUnit> findAll() {
"""
Returns all the cp measurement units.
@return the cp measurement units
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CPMeasurementUnit> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPMeasurementUnit",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the cp measurement units.
@return the cp measurement units | [
"Returns",
"all",
"the",
"cp",
"measurement",
"units",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPMeasurementUnitPersistenceImpl.java#L4130-L4133 |
zxing/zxing | javase/src/main/java/com/google/zxing/client/j2se/MatrixToImageWriter.java | MatrixToImageWriter.writeToPath | public static void writeToPath(BitMatrix matrix, String format, Path file) throws IOException {
"""
Writes a {@link BitMatrix} to a file with default configuration.
@param matrix {@link BitMatrix} to write
@param format image format
@param file file {@link Path} to write image to
@throws IOException if write... | java | public static void writeToPath(BitMatrix matrix, String format, Path file) throws IOException {
writeToPath(matrix, format, file, DEFAULT_CONFIG);
} | [
"public",
"static",
"void",
"writeToPath",
"(",
"BitMatrix",
"matrix",
",",
"String",
"format",
",",
"Path",
"file",
")",
"throws",
"IOException",
"{",
"writeToPath",
"(",
"matrix",
",",
"format",
",",
"file",
",",
"DEFAULT_CONFIG",
")",
";",
"}"
] | Writes a {@link BitMatrix} to a file with default configuration.
@param matrix {@link BitMatrix} to write
@param format image format
@param file file {@link Path} to write image to
@throws IOException if writes to the stream fail
@see #toBufferedImage(BitMatrix) | [
"Writes",
"a",
"{",
"@link",
"BitMatrix",
"}",
"to",
"a",
"file",
"with",
"default",
"configuration",
"."
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/javase/src/main/java/com/google/zxing/client/j2se/MatrixToImageWriter.java#L99-L101 |
janus-project/guava.janusproject.io | guava/src/com/google/common/io/Resources.java | Resources.readLines | public static <T> T readLines(URL url, Charset charset,
LineProcessor<T> callback) throws IOException {
"""
Streams lines from a URL, stopping when our callback returns false, or we
have read all of the lines.
@param url the URL to read from
@param charset the charset used to decode the input stream; se... | java | public static <T> T readLines(URL url, Charset charset,
LineProcessor<T> callback) throws IOException {
return asCharSource(url, charset).readLines(callback);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"readLines",
"(",
"URL",
"url",
",",
"Charset",
"charset",
",",
"LineProcessor",
"<",
"T",
">",
"callback",
")",
"throws",
"IOException",
"{",
"return",
"asCharSource",
"(",
"url",
",",
"charset",
")",
".",
"readLi... | Streams lines from a URL, stopping when our callback returns false, or we
have read all of the lines.
@param url the URL to read from
@param charset the charset used to decode the input stream; see {@link
Charsets} for helpful predefined constants
@param callback the LineProcessor to use to handle the lines
@return th... | [
"Streams",
"lines",
"from",
"a",
"URL",
"stopping",
"when",
"our",
"callback",
"returns",
"false",
"or",
"we",
"have",
"read",
"all",
"of",
"the",
"lines",
"."
] | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/io/Resources.java#L127-L130 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/el/CompositeComponentELUtils.java | CompositeComponentELUtils.saveCompositeComponentForResolver | public static void saveCompositeComponentForResolver(FacesContext facesContext, Location location, int ccLevel) {
"""
Trys to get the composite component using getCompositeComponentBasedOnLocation()
and saves it in an attribute on the FacesContext, which is then used by
CompositeComponentImplicitObject.
@param ... | java | public static void saveCompositeComponentForResolver(FacesContext facesContext, Location location, int ccLevel)
{
UIComponent cc = ccLevel > 0 ? getCompositeComponentBasedOnLocation(facesContext, location, ccLevel)
: getCompositeComponentBasedOnLocation(facesContext, location);
List<... | [
"public",
"static",
"void",
"saveCompositeComponentForResolver",
"(",
"FacesContext",
"facesContext",
",",
"Location",
"location",
",",
"int",
"ccLevel",
")",
"{",
"UIComponent",
"cc",
"=",
"ccLevel",
">",
"0",
"?",
"getCompositeComponentBasedOnLocation",
"(",
"facesC... | Trys to get the composite component using getCompositeComponentBasedOnLocation()
and saves it in an attribute on the FacesContext, which is then used by
CompositeComponentImplicitObject.
@param facesContext
@param location | [
"Trys",
"to",
"get",
"the",
"composite",
"component",
"using",
"getCompositeComponentBasedOnLocation",
"()",
"and",
"saves",
"it",
"in",
"an",
"attribute",
"on",
"the",
"FacesContext",
"which",
"is",
"then",
"used",
"by",
"CompositeComponentImplicitObject",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/el/CompositeComponentELUtils.java#L436-L447 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplaceMessages.java | CmsWorkplaceMessages.getResourceTypeDescription | public static String getResourceTypeDescription(Locale locale, String name) {
"""
Returns the description of the given resource type name.<p>
If this key is not found, the value of the name input will be returned.<p>
@param locale the right locale to use
@param name the resource type name to generate the ni... | java | public static String getResourceTypeDescription(Locale locale, String name) {
CmsExplorerTypeSettings settings = OpenCms.getWorkplaceManager().getExplorerTypeSetting(name);
if (settings != null) {
// try to find the localized key
String key = settings.getInfo();
if (... | [
"public",
"static",
"String",
"getResourceTypeDescription",
"(",
"Locale",
"locale",
",",
"String",
"name",
")",
"{",
"CmsExplorerTypeSettings",
"settings",
"=",
"OpenCms",
".",
"getWorkplaceManager",
"(",
")",
".",
"getExplorerTypeSetting",
"(",
"name",
")",
";",
... | Returns the description of the given resource type name.<p>
If this key is not found, the value of the name input will be returned.<p>
@param locale the right locale to use
@param name the resource type name to generate the nice name for
@return the description of the given resource type name | [
"Returns",
"the",
"description",
"of",
"the",
"given",
"resource",
"type",
"name",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplaceMessages.java#L149-L160 |
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.getVpnProfilePackageUrl | public String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName) {
"""
Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile.
@param resourceGroupName The nam... | java | public String getVpnProfilePackageUrl(String resourceGroupName, String virtualNetworkGatewayName) {
return getVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().body();
} | [
"public",
"String",
"getVpnProfilePackageUrl",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
")",
"{",
"return",
"getVpnProfilePackageUrlWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNetworkGatewayName",
")",
".",
"toBlockin... | Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified resource group. The profile needs to be generated first using generateVpnProfile.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@throws Ille... | [
"Gets",
"pre",
"-",
"generated",
"VPN",
"profile",
"for",
"P2S",
"client",
"of",
"the",
"virtual",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
".",
"The",
"profile",
"needs",
"to",
"be",
"generated",
"first",
"using",
"generateVpnProfi... | 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#L1799-L1801 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataDecoder.java | DataDecoder.decodeByteObj | public static Byte decodeByteObj(byte[] src, int srcOffset)
throws CorruptEncodingException {
"""
Decodes a signed Byte object from exactly 1 or 2 bytes. If null is
returned, then 1 byte was read.
@param src source of encoded bytes
@param srcOffset offset into source array
@return signed Byte object... | java | public static Byte decodeByteObj(byte[] src, int srcOffset)
throws CorruptEncodingException
{
try {
int b = src[srcOffset];
if (b == NULL_BYTE_HIGH || b == NULL_BYTE_LOW) {
return null;
}
return decodeByte(src, srcOffset + 1);
... | [
"public",
"static",
"Byte",
"decodeByteObj",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"srcOffset",
")",
"throws",
"CorruptEncodingException",
"{",
"try",
"{",
"int",
"b",
"=",
"src",
"[",
"srcOffset",
"]",
";",
"if",
"(",
"b",
"==",
"NULL_BYTE_HIGH",
"|... | Decodes a signed Byte object from exactly 1 or 2 bytes. If null is
returned, then 1 byte was read.
@param src source of encoded bytes
@param srcOffset offset into source array
@return signed Byte object or null | [
"Decodes",
"a",
"signed",
"Byte",
"object",
"from",
"exactly",
"1",
"or",
"2",
"bytes",
".",
"If",
"null",
"is",
"returned",
"then",
"1",
"byte",
"was",
"read",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataDecoder.java#L153-L165 |
ModeShape/modeshape | sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/StandardDdlParser.java | StandardDdlParser.parseCreateCollationStatement | protected AstNode parseCreateCollationStatement( DdlTokenStream tokens,
AstNode parentNode ) throws ParsingException {
"""
Parses DDL CREATE COLLATION {@link AstNode} based on SQL 92 specifications.
@param tokens the {@link DdlTokenStream} representing the to... | java | protected AstNode parseCreateCollationStatement( DdlTokenStream tokens,
AstNode parentNode ) throws ParsingException {
assert tokens != null;
assert parentNode != null;
markStartOfStatement(tokens);
tokens.consume(STMT_CREATE_COLLATI... | [
"protected",
"AstNode",
"parseCreateCollationStatement",
"(",
"DdlTokenStream",
"tokens",
",",
"AstNode",
"parentNode",
")",
"throws",
"ParsingException",
"{",
"assert",
"tokens",
"!=",
"null",
";",
"assert",
"parentNode",
"!=",
"null",
";",
"markStartOfStatement",
"(... | Parses DDL CREATE COLLATION {@link AstNode} based on SQL 92 specifications.
@param tokens the {@link DdlTokenStream} representing the tokenized DDL content; may not be null
@param parentNode the parent {@link AstNode} node; may not be null
@return the parsed statement node {@link AstNode}
@throws ParsingException | [
"Parses",
"DDL",
"CREATE",
"COLLATION",
"{",
"@link",
"AstNode",
"}",
"based",
"on",
"SQL",
"92",
"specifications",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/StandardDdlParser.java#L1107-L1154 |
yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/http/multipart/StandardMultipartResolver.java | StandardMultipartResolver.parseFileItems | protected MultipartParsingResult parseFileItems(List<FileItem> fileItems, String encoding) {
"""
Parse the given List of Commons FileItems into a MultipartParsingResult, containing MultipartFile instances and a
Map of multipart parameter.
@param fileItems the Commons FileItems to parse.
@param encoding the en... | java | protected MultipartParsingResult parseFileItems(List<FileItem> fileItems, String encoding) {
MultiValueMap<String, MultipartFile> multipartFiles = new LinkedMultiValueMap<>();
MultiValueMap<String, String> multipartParameters = new LinkedMultiValueMap<>();
Map<String, String> multipartContentTyp... | [
"protected",
"MultipartParsingResult",
"parseFileItems",
"(",
"List",
"<",
"FileItem",
">",
"fileItems",
",",
"String",
"encoding",
")",
"{",
"MultiValueMap",
"<",
"String",
",",
"MultipartFile",
">",
"multipartFiles",
"=",
"new",
"LinkedMultiValueMap",
"<>",
"(",
... | Parse the given List of Commons FileItems into a MultipartParsingResult, containing MultipartFile instances and a
Map of multipart parameter.
@param fileItems the Commons FileItems to parse.
@param encoding the encoding to use for form fields.
@return the MultipartParsingResult.
@see StandardMultipartFile#StandardMu... | [
"Parse",
"the",
"given",
"List",
"of",
"Commons",
"FileItems",
"into",
"a",
"MultipartParsingResult",
"containing",
"MultipartFile",
"instances",
"and",
"a",
"Map",
"of",
"multipart",
"parameter",
"."
] | train | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/http/multipart/StandardMultipartResolver.java#L219-L255 |
google/Accessibility-Test-Framework-for-Android | src/main/java/com/googlecode/eyesfree/utils/AccessibilityNodeInfoUtils.java | AccessibilityNodeInfoUtils.isLongClickable | public static boolean isLongClickable(AccessibilityNodeInfoCompat node) {
"""
Returns whether a node is long clickable. That is, the node supports at least one of the
following:
<ul>
<li>{@link AccessibilityNodeInfoCompat#isLongClickable()}</li>
<li>{@link AccessibilityNodeInfoCompat#ACTION_LONG_CLICK}</li>
<... | java | public static boolean isLongClickable(AccessibilityNodeInfoCompat node) {
if (node == null) {
return false;
}
if (node.isLongClickable()) {
return true;
}
return supportsAnyAction(node, AccessibilityNodeInfoCompat.ACTION_LONG_CLICK);
} | [
"public",
"static",
"boolean",
"isLongClickable",
"(",
"AccessibilityNodeInfoCompat",
"node",
")",
"{",
"if",
"(",
"node",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"node",
".",
"isLongClickable",
"(",
")",
")",
"{",
"return",
"true",... | Returns whether a node is long clickable. That is, the node supports at least one of the
following:
<ul>
<li>{@link AccessibilityNodeInfoCompat#isLongClickable()}</li>
<li>{@link AccessibilityNodeInfoCompat#ACTION_LONG_CLICK}</li>
</ul>
@param node The node to examine.
@return {@code true} if node is long clickable. | [
"Returns",
"whether",
"a",
"node",
"is",
"long",
"clickable",
".",
"That",
"is",
"the",
"node",
"supports",
"at",
"least",
"one",
"of",
"the",
"following",
":",
"<ul",
">",
"<li",
">",
"{",
"@link",
"AccessibilityNodeInfoCompat#isLongClickable",
"()",
"}",
"... | train | https://github.com/google/Accessibility-Test-Framework-for-Android/blob/a6117fe0059c82dd764fa628d3817d724570f69e/src/main/java/com/googlecode/eyesfree/utils/AccessibilityNodeInfoUtils.java#L387-L397 |
Waikato/moa | moa/src/main/java/moa/classifiers/rules/AbstractAMRules.java | AbstractAMRules.getVotes | public Vote getVotes(Instance instance) {
"""
getVotes extension of the instance method getVotesForInstance
in moa.classifier.java
returns the prediction of the instance.
Called in WeightedRandomRules
"""
ErrorWeightedVote errorWeightedVote=newErrorWeightedVote();
//DoubleVector combinedVote = new Doubl... | java | public Vote getVotes(Instance instance) {
ErrorWeightedVote errorWeightedVote=newErrorWeightedVote();
//DoubleVector combinedVote = new DoubleVector();
debug("Test",3);
int numberOfRulesCovering = 0;
VerboseToConsole(instance); // Verbose to console Dataset name.
for (Rule rule : ruleSet) {
if (rule... | [
"public",
"Vote",
"getVotes",
"(",
"Instance",
"instance",
")",
"{",
"ErrorWeightedVote",
"errorWeightedVote",
"=",
"newErrorWeightedVote",
"(",
")",
";",
"//DoubleVector combinedVote = new DoubleVector();",
"debug",
"(",
"\"Test\"",
",",
"3",
")",
";",
"int",
"number... | getVotes extension of the instance method getVotesForInstance
in moa.classifier.java
returns the prediction of the instance.
Called in WeightedRandomRules | [
"getVotes",
"extension",
"of",
"the",
"instance",
"method",
"getVotesForInstance",
"in",
"moa",
".",
"classifier",
".",
"java",
"returns",
"the",
"prediction",
"of",
"the",
"instance",
".",
"Called",
"in",
"WeightedRandomRules"
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/rules/AbstractAMRules.java#L403-L438 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java | CommonOps_DDRM.maxCols | public static DMatrixRMaj maxCols(DMatrixRMaj input , DMatrixRMaj output ) {
"""
<p>
Finds the element with the minimum value along column in the input matrix and returns the results in a vector:<br>
<br>
b<sub>j</sub> = min(i=1:m ; a<sub>ij</sub>)
</p>
@param input Input matrix
@param output Optional stor... | java | public static DMatrixRMaj maxCols(DMatrixRMaj input , DMatrixRMaj output ) {
if( output == null ) {
output = new DMatrixRMaj(1,input.numCols);
} else {
output.reshape(1,input.numCols);
}
for( int cols = 0; cols < input.numCols; cols++ ) {
double maximu... | [
"public",
"static",
"DMatrixRMaj",
"maxCols",
"(",
"DMatrixRMaj",
"input",
",",
"DMatrixRMaj",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"{",
"output",
"=",
"new",
"DMatrixRMaj",
"(",
"1",
",",
"input",
".",
"numCols",
")",
";",
"}",
... | <p>
Finds the element with the minimum value along column in the input matrix and returns the results in a vector:<br>
<br>
b<sub>j</sub> = min(i=1:m ; a<sub>ij</sub>)
</p>
@param input Input matrix
@param output Optional storage for output. Reshaped into a row vector. Modified.
@return Vector containing the maximum o... | [
"<p",
">",
"Finds",
"the",
"element",
"with",
"the",
"minimum",
"value",
"along",
"column",
"in",
"the",
"input",
"matrix",
"and",
"returns",
"the",
"results",
"in",
"a",
"vector",
":",
"<br",
">",
"<br",
">",
"b<sub",
">",
"j<",
"/",
"sub",
">",
"="... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L2024-L2044 |
apptik/jus | jus-java/src/main/java/io/apptik/comm/jus/toolbox/HttpHeaderParser.java | HttpHeaderParser.parseCharset | public static String parseCharset(Map<String, String> headers) {
"""
Returns the charset specified in the Content-Type of this header,
or the HTTP default (ISO-8859-1) if none can be found.
"""
return parseCharset(headers, HTTP.DEFAULT_CONTENT_CHARSET);
} | java | public static String parseCharset(Map<String, String> headers) {
return parseCharset(headers, HTTP.DEFAULT_CONTENT_CHARSET);
} | [
"public",
"static",
"String",
"parseCharset",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"{",
"return",
"parseCharset",
"(",
"headers",
",",
"HTTP",
".",
"DEFAULT_CONTENT_CHARSET",
")",
";",
"}"
] | Returns the charset specified in the Content-Type of this header,
or the HTTP default (ISO-8859-1) if none can be found. | [
"Returns",
"the",
"charset",
"specified",
"in",
"the",
"Content",
"-",
"Type",
"of",
"this",
"header",
"or",
"the",
"HTTP",
"default",
"(",
"ISO",
"-",
"8859",
"-",
"1",
")",
"if",
"none",
"can",
"be",
"found",
"."
] | train | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/jus-java/src/main/java/io/apptik/comm/jus/toolbox/HttpHeaderParser.java#L173-L175 |
timewalker74/ffmq | core/src/main/java/net/timewalker/ffmq4/local/destination/LocalQueue.java | LocalQueue.redeliverLocked | public boolean redeliverLocked( TransactionItem[] items , MessageLockSet locks ) throws JMSException {
"""
Rollback get operations on this queue (messages are unlocked)..
Consumers are notified of rollbacked messages availability
@return true if a commit is required to ensure data safety
"""
checkNotClo... | java | public boolean redeliverLocked( TransactionItem[] items , MessageLockSet locks ) throws JMSException
{
checkNotClosed();
checkTransactionLock();
int volatileRollbacked = 0;
int persistentRollbacked = 0;
synchronized (storeLock)
{
for (int n = 0 ; n < items.leng... | [
"public",
"boolean",
"redeliverLocked",
"(",
"TransactionItem",
"[",
"]",
"items",
",",
"MessageLockSet",
"locks",
")",
"throws",
"JMSException",
"{",
"checkNotClosed",
"(",
")",
";",
"checkTransactionLock",
"(",
")",
";",
"int",
"volatileRollbacked",
"=",
"0",
... | Rollback get operations on this queue (messages are unlocked)..
Consumers are notified of rollbacked messages availability
@return true if a commit is required to ensure data safety | [
"Rollback",
"get",
"operations",
"on",
"this",
"queue",
"(",
"messages",
"are",
"unlocked",
")",
"..",
"Consumers",
"are",
"notified",
"of",
"rollbacked",
"messages",
"availability"
] | train | https://github.com/timewalker74/ffmq/blob/638773ee29a4a5f9c6119ed74ad14ac9c46382b3/core/src/main/java/net/timewalker/ffmq4/local/destination/LocalQueue.java#L307-L361 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/Collectors.java | Collectors.teeing | @NotNull
public static <T, R1, R2, R> Collector<T, ?, R> teeing(
@NotNull final Collector<? super T, ?, R1> downstream1,
@NotNull final Collector<? super T, ?, R2> downstream2,
@NotNull final BiFunction<? super R1, ? super R2, R> merger) {
"""
Returns a {@code Collector} tha... | java | @NotNull
public static <T, R1, R2, R> Collector<T, ?, R> teeing(
@NotNull final Collector<? super T, ?, R1> downstream1,
@NotNull final Collector<? super T, ?, R2> downstream2,
@NotNull final BiFunction<? super R1, ? super R2, R> merger) {
return teeingImpl(downstream1, d... | [
"@",
"NotNull",
"public",
"static",
"<",
"T",
",",
"R1",
",",
"R2",
",",
"R",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"R",
">",
"teeing",
"(",
"@",
"NotNull",
"final",
"Collector",
"<",
"?",
"super",
"T",
",",
"?",
",",
"R1",
">",
"downstrea... | Returns a {@code Collector} that composites two collectors.
Each element is processed by two specified collectors,
then their results are merged using the merge function into the final result.
@param <T> the type of the input elements
@param <R1> the result type of the first collector
@param <R2> the result type of th... | [
"Returns",
"a",
"{",
"@code",
"Collector",
"}",
"that",
"composites",
"two",
"collectors",
".",
"Each",
"element",
"is",
"processed",
"by",
"two",
"specified",
"collectors",
"then",
"their",
"results",
"are",
"merged",
"using",
"the",
"merge",
"function",
"int... | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/Collectors.java#L1068-L1074 |
jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapEntryLite.java | MapEntryLite.computeSerializedSize | static <K, V> int computeSerializedSize(Metadata<K, V> metadata, K key, V value) {
"""
Compute serialized size.
@param <K> the key type
@param <V> the value type
@param metadata the metadata
@param key the key
@param value the value
@return the int
"""
return CodedConstant.computeElementSize(me... | java | static <K, V> int computeSerializedSize(Metadata<K, V> metadata, K key, V value) {
return CodedConstant.computeElementSize(metadata.keyType, KEY_FIELD_NUMBER, key)
+ CodedConstant.computeElementSize(metadata.valueType, VALUE_FIELD_NUMBER, value);
} | [
"static",
"<",
"K",
",",
"V",
">",
"int",
"computeSerializedSize",
"(",
"Metadata",
"<",
"K",
",",
"V",
">",
"metadata",
",",
"K",
"key",
",",
"V",
"value",
")",
"{",
"return",
"CodedConstant",
".",
"computeElementSize",
"(",
"metadata",
".",
"keyType",
... | Compute serialized size.
@param <K> the key type
@param <V> the value type
@param metadata the metadata
@param key the key
@param value the value
@return the int | [
"Compute",
"serialized",
"size",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapEntryLite.java#L185-L188 |
fuzzylite/jfuzzylite | jfuzzylite/src/main/java/com/fuzzylite/defuzzifier/Bisector.java | Bisector.defuzzify | @Override
public double defuzzify(Term term, double minimum, double maximum) {
"""
Computes the bisector of a fuzzy set. The defuzzification process
integrates over the fuzzy set utilizing the boundaries given as parameters.
The integration algorithm is the midpoint rectangle method
(https://en.wikipedia.or... | java | @Override
public double defuzzify(Term term, double minimum, double maximum) {
if (!Op.isFinite(minimum + maximum)) {
return Double.NaN;
}
final double dx = (maximum - minimum) / getResolution();
int counter = getResolution();
int left = 0, right = 0;
doub... | [
"@",
"Override",
"public",
"double",
"defuzzify",
"(",
"Term",
"term",
",",
"double",
"minimum",
",",
"double",
"maximum",
")",
"{",
"if",
"(",
"!",
"Op",
".",
"isFinite",
"(",
"minimum",
"+",
"maximum",
")",
")",
"{",
"return",
"Double",
".",
"NaN",
... | Computes the bisector of a fuzzy set. The defuzzification process
integrates over the fuzzy set utilizing the boundaries given as parameters.
The integration algorithm is the midpoint rectangle method
(https://en.wikipedia.org/wiki/Rectangle_method).
@param term is the fuzzy set
@param minimum is the minimum value of ... | [
"Computes",
"the",
"bisector",
"of",
"a",
"fuzzy",
"set",
".",
"The",
"defuzzification",
"process",
"integrates",
"over",
"the",
"fuzzy",
"set",
"utilizing",
"the",
"boundaries",
"given",
"as",
"parameters",
".",
"The",
"integration",
"algorithm",
"is",
"the",
... | train | https://github.com/fuzzylite/jfuzzylite/blob/583ac1928f39512af75de80d560e67448039595a/jfuzzylite/src/main/java/com/fuzzylite/defuzzifier/Bisector.java#L53-L76 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/random/RandomString.java | RandomString.nextString | public static String nextString(int min, int max) {
"""
Generates a random string, consisting of upper and lower case letters (of the
English alphabet), digits (0-9), and symbols.
@param min (optional) minimum string length.
@param max maximum string length.
@return a random string.
"""
StringBuilder r... | java | public static String nextString(int min, int max) {
StringBuilder result = new StringBuilder();
int length = RandomInteger.nextInteger(min, max);
for (int i = 0; i < length; i++) {
int index = RandomInteger.nextInteger(_chars.length());
result.append(_chars.charAt(index));
}
return result.toString();
... | [
"public",
"static",
"String",
"nextString",
"(",
"int",
"min",
",",
"int",
"max",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"int",
"length",
"=",
"RandomInteger",
".",
"nextInteger",
"(",
"min",
",",
"max",
")",
";"... | Generates a random string, consisting of upper and lower case letters (of the
English alphabet), digits (0-9), and symbols.
@param min (optional) minimum string length.
@param max maximum string length.
@return a random string. | [
"Generates",
"a",
"random",
"string",
"consisting",
"of",
"upper",
"and",
"lower",
"case",
"letters",
"(",
"of",
"the",
"English",
"alphabet",
")",
"digits",
"(",
"0",
"-",
"9",
")",
"and",
"symbols",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/random/RandomString.java#L86-L96 |
hawkular/hawkular-agent | hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SecurityDomainJBossASClient.java | SecurityDomainJBossASClient.createNewSecurityDomain | public void createNewSecurityDomain(String securityDomainName, LoginModuleRequest... loginModules)
throws Exception {
"""
Creates a new security domain including one or more login modules.
The security domain will be replaced if it exists.
@param securityDomainName the name of the new security doma... | java | public void createNewSecurityDomain(String securityDomainName, LoginModuleRequest... loginModules)
throws Exception {
//do not close the controller client here, we're using our own..
CoreJBossASClient coreClient = new CoreJBossASClient(getModelControllerClient());
String serverVersio... | [
"public",
"void",
"createNewSecurityDomain",
"(",
"String",
"securityDomainName",
",",
"LoginModuleRequest",
"...",
"loginModules",
")",
"throws",
"Exception",
"{",
"//do not close the controller client here, we're using our own..",
"CoreJBossASClient",
"coreClient",
"=",
"new",
... | Creates a new security domain including one or more login modules.
The security domain will be replaced if it exists.
@param securityDomainName the name of the new security domain
@param loginModules an array of login modules to place in the security domain.
They are ordered top-down in the same index order of the arr... | [
"Creates",
"a",
"new",
"security",
"domain",
"including",
"one",
"or",
"more",
"login",
"modules",
".",
"The",
"security",
"domain",
"will",
"be",
"replaced",
"if",
"it",
"exists",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SecurityDomainJBossASClient.java#L274-L286 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/DescriptorFactory.java | DescriptorFactory.getFieldDescriptor | public FieldDescriptor getFieldDescriptor(@SlashedClassName String className, String name, String signature, boolean isStatic) {
"""
Get a FieldDescriptor.
@param className
the name of the class the field belongs to, in VM format
(e.g., "java/lang/String")
@param name
the name of the field
@param signature... | java | public FieldDescriptor getFieldDescriptor(@SlashedClassName String className, String name, String signature, boolean isStatic) {
FieldDescriptor fieldDescriptor = new FieldDescriptor(className, name, signature, isStatic);
FieldDescriptor existing = fieldDescriptorMap.get(fieldDescriptor);
if (ex... | [
"public",
"FieldDescriptor",
"getFieldDescriptor",
"(",
"@",
"SlashedClassName",
"String",
"className",
",",
"String",
"name",
",",
"String",
"signature",
",",
"boolean",
"isStatic",
")",
"{",
"FieldDescriptor",
"fieldDescriptor",
"=",
"new",
"FieldDescriptor",
"(",
... | Get a FieldDescriptor.
@param className
the name of the class the field belongs to, in VM format
(e.g., "java/lang/String")
@param name
the name of the field
@param signature
the field signature (type)
@param isStatic
true if field is static, false if not
@return FieldDescriptor | [
"Get",
"a",
"FieldDescriptor",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/DescriptorFactory.java#L239-L247 |
wildfly/wildfly-maven-plugin | plugin/src/main/java/org/wildfly/plugin/deployment/resource/AddResourceMojo.java | AddResourceMojo.resourceExists | private boolean resourceExists(final ModelNode address, final ModelControllerClient client) throws IOException {
"""
Checks the existence of a resource. If the resource exists, {@code true} is returned, otherwise {@code false}.
@param address the address of the resource to check.
@param client the client used... | java | private boolean resourceExists(final ModelNode address, final ModelControllerClient client) throws IOException {
final Property childAddress = ServerOperations.getChildAddress(address);
final ModelNode parentAddress = ServerOperations.getParentAddress(address);
final ModelNode r = client.execute... | [
"private",
"boolean",
"resourceExists",
"(",
"final",
"ModelNode",
"address",
",",
"final",
"ModelControllerClient",
"client",
")",
"throws",
"IOException",
"{",
"final",
"Property",
"childAddress",
"=",
"ServerOperations",
".",
"getChildAddress",
"(",
"address",
")",... | Checks the existence of a resource. If the resource exists, {@code true} is returned, otherwise {@code false}.
@param address the address of the resource to check.
@param client the client used to execute the operation.
@return {@code true} if the resources exists, otherwise {@code false}.
@throws IOException ... | [
"Checks",
"the",
"existence",
"of",
"a",
"resource",
".",
"If",
"the",
"resource",
"exists",
"{",
"@code",
"true",
"}",
"is",
"returned",
"otherwise",
"{",
"@code",
"false",
"}",
"."
] | train | https://github.com/wildfly/wildfly-maven-plugin/blob/c0e2d7ee28e511092561801959eae253b2b56def/plugin/src/main/java/org/wildfly/plugin/deployment/resource/AddResourceMojo.java#L247-L265 |
jayantk/jklol | src/com/jayantkrish/jklol/ccg/CcgParser.java | CcgParser.calculateInsideBeamSingleThreaded | public boolean calculateInsideBeamSingleThreaded(CcgChart chart, LogFunction log, long maxParseTimeMillis) {
"""
Performs a beam search over possible CCG parses given a
{@code chart} initialized with entries for all terminals.
@param chart
@param log
"""
int chartSize = chart.size();
long currentT... | java | public boolean calculateInsideBeamSingleThreaded(CcgChart chart, LogFunction log, long maxParseTimeMillis) {
int chartSize = chart.size();
long currentTime = 0;
long endTime = System.currentTimeMillis() + maxParseTimeMillis;
for (int spanSize = 1; spanSize < chartSize; spanSize++) {
for (int spanS... | [
"public",
"boolean",
"calculateInsideBeamSingleThreaded",
"(",
"CcgChart",
"chart",
",",
"LogFunction",
"log",
",",
"long",
"maxParseTimeMillis",
")",
"{",
"int",
"chartSize",
"=",
"chart",
".",
"size",
"(",
")",
";",
"long",
"currentTime",
"=",
"0",
";",
"lon... | Performs a beam search over possible CCG parses given a
{@code chart} initialized with entries for all terminals.
@param chart
@param log | [
"Performs",
"a",
"beam",
"search",
"over",
"possible",
"CCG",
"parses",
"given",
"a",
"{",
"@code",
"chart",
"}",
"initialized",
"with",
"entries",
"for",
"all",
"terminals",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/ccg/CcgParser.java#L850-L874 |
cloudfoundry/uaa | server/src/main/java/org/cloudfoundry/identity/uaa/oauth/UaaAuthorizationRequestManager.java | UaaAuthorizationRequestManager.createAuthorizationRequest | @Override
public AuthorizationRequest createAuthorizationRequest(Map<String, String> authorizationParameters) {
"""
Create an authorization request applying various UAA rules to the
authorizationParameters and the registered
client details.
<ul>
<li>For client_credentials grants, the default requested scop... | java | @Override
public AuthorizationRequest createAuthorizationRequest(Map<String, String> authorizationParameters) {
String clientId = authorizationParameters.get("client_id");
BaseClientDetails clientDetails = (BaseClientDetails)clientDetailsService.loadClientByClientId(clientId, IdentityZoneHolder.get... | [
"@",
"Override",
"public",
"AuthorizationRequest",
"createAuthorizationRequest",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"authorizationParameters",
")",
"{",
"String",
"clientId",
"=",
"authorizationParameters",
".",
"get",
"(",
"\"client_id\"",
")",
";",
"Ba... | Create an authorization request applying various UAA rules to the
authorizationParameters and the registered
client details.
<ul>
<li>For client_credentials grants, the default requested scopes are the client's
granted authorities</li>
<li>For other grant types the default requested scopes are the registered requested ... | [
"Create",
"an",
"authorization",
"request",
"applying",
"various",
"UAA",
"rules",
"to",
"the",
"authorizationParameters",
"and",
"the",
"registered",
"client",
"details",
".",
"<ul",
">",
"<li",
">",
"For",
"client_credentials",
"grants",
"the",
"default",
"reque... | train | https://github.com/cloudfoundry/uaa/blob/e8df3d7060580c92d33461106399f9e4f36e3cd2/server/src/main/java/org/cloudfoundry/identity/uaa/oauth/UaaAuthorizationRequestManager.java#L150-L197 |
deephacks/confit | api-admin/src/main/java/org/deephacks/confit/admin/query/BeanQueryBuilder.java | BeanQueryBuilder.greaterThan | public static <A extends Comparable<A>> BeanRestriction greaterThan(String property, A value) {
"""
Query which asserts that a property is greater than (but not equal to) a value.
@param property field to query
@param value value to query for
@return restriction to be added to {@link BeanQuery}.
"""
... | java | public static <A extends Comparable<A>> BeanRestriction greaterThan(String property, A value) {
return new GreaterThan<>(property, value);
} | [
"public",
"static",
"<",
"A",
"extends",
"Comparable",
"<",
"A",
">",
">",
"BeanRestriction",
"greaterThan",
"(",
"String",
"property",
",",
"A",
"value",
")",
"{",
"return",
"new",
"GreaterThan",
"<>",
"(",
"property",
",",
"value",
")",
";",
"}"
] | Query which asserts that a property is greater than (but not equal to) a value.
@param property field to query
@param value value to query for
@return restriction to be added to {@link BeanQuery}. | [
"Query",
"which",
"asserts",
"that",
"a",
"property",
"is",
"greater",
"than",
"(",
"but",
"not",
"equal",
"to",
")",
"a",
"value",
"."
] | train | https://github.com/deephacks/confit/blob/4e6d4ee5fed32cbc5104433e61de1bcf1b360832/api-admin/src/main/java/org/deephacks/confit/admin/query/BeanQueryBuilder.java#L58-L60 |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/recognition/ExampleColorHistogramLookup.java | ExampleColorHistogramLookup.coupledRGB | public static List<double[]> coupledRGB( List<File> images ) {
"""
Constructs a 3D histogram using RGB. RGB is a popular color space, but the resulting histogram will
depend on lighting conditions and might not produce the accurate results.
"""
List<double[]> points = new ArrayList<>();
Planar<GrayF32> ... | java | public static List<double[]> coupledRGB( List<File> images ) {
List<double[]> points = new ArrayList<>();
Planar<GrayF32> rgb = new Planar<>(GrayF32.class,1,1,3);
for( File f : images ) {
BufferedImage buffered = UtilImageIO.loadImage(f.getPath());
if( buffered == null ) throw new RuntimeException("Can't ... | [
"public",
"static",
"List",
"<",
"double",
"[",
"]",
">",
"coupledRGB",
"(",
"List",
"<",
"File",
">",
"images",
")",
"{",
"List",
"<",
"double",
"[",
"]",
">",
"points",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Planar",
"<",
"GrayF32",
">",
... | Constructs a 3D histogram using RGB. RGB is a popular color space, but the resulting histogram will
depend on lighting conditions and might not produce the accurate results. | [
"Constructs",
"a",
"3D",
"histogram",
"using",
"RGB",
".",
"RGB",
"is",
"a",
"popular",
"color",
"space",
"but",
"the",
"resulting",
"histogram",
"will",
"depend",
"on",
"lighting",
"conditions",
"and",
"might",
"not",
"produce",
"the",
"accurate",
"results",
... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/recognition/ExampleColorHistogramLookup.java#L148-L174 |
Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.bipush | final void bipush(CompletableFuture<?> b, BiCompletion<?, ?, ?> c) {
"""
Pushes completion to this and b unless both done. Caller should first check that either result
or b.result is null.
"""
if (c != null) {
while (result == null) {
if (tryPushStack(c)) {
if (b.result == null)
... | java | final void bipush(CompletableFuture<?> b, BiCompletion<?, ?, ?> c) {
if (c != null) {
while (result == null) {
if (tryPushStack(c)) {
if (b.result == null)
b.unipush(new CoCompletion(c));
else if (result != null)
c.tryFire(SYNC);
return;
}
... | [
"final",
"void",
"bipush",
"(",
"CompletableFuture",
"<",
"?",
">",
"b",
",",
"BiCompletion",
"<",
"?",
",",
"?",
",",
"?",
">",
"c",
")",
"{",
"if",
"(",
"c",
"!=",
"null",
")",
"{",
"while",
"(",
"result",
"==",
"null",
")",
"{",
"if",
"(",
... | Pushes completion to this and b unless both done. Caller should first check that either result
or b.result is null. | [
"Pushes",
"completion",
"to",
"this",
"and",
"b",
"unless",
"both",
"done",
".",
"Caller",
"should",
"first",
"check",
"that",
"either",
"result",
"or",
"b",
".",
"result",
"is",
"null",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L1006-L1019 |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/handler/demux/DemuxingIoHandler.java | DemuxingIoHandler.messageSent | @Override
public void messageSent(IoSession session, Object message) throws Exception {
"""
Invoked when a message written by IoSession.write(Object) is sent out.
<b>Warning !</b> If you are to overload this method, be aware that you
_must_ call the messageHandler in your own method, otherwise it won't
be... | java | @Override
public void messageSent(IoSession session, Object message) throws Exception {
MessageHandler<Object> handler = findSentMessageHandler(message.getClass());
if (handler != null) {
handler.handleMessage(session, message);
} else {
throw new UnknownMessageTypeEx... | [
"@",
"Override",
"public",
"void",
"messageSent",
"(",
"IoSession",
"session",
",",
"Object",
"message",
")",
"throws",
"Exception",
"{",
"MessageHandler",
"<",
"Object",
">",
"handler",
"=",
"findSentMessageHandler",
"(",
"message",
".",
"getClass",
"(",
")",
... | Invoked when a message written by IoSession.write(Object) is sent out.
<b>Warning !</b> If you are to overload this method, be aware that you
_must_ call the messageHandler in your own method, otherwise it won't
be called. | [
"Invoked",
"when",
"a",
"message",
"written",
"by",
"IoSession",
".",
"write",
"(",
"Object",
")",
"is",
"sent",
"out",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/handler/demux/DemuxingIoHandler.java#L243-L253 |
Whiley/WhileyCompiler | src/main/java/wyil/check/DefiniteAssignmentCheck.java | DefiniteAssignmentCheck.visitProperty | @Override
public ControlFlow visitProperty(Decl.Property declaration, DefinitelyAssignedSet dummy) {
"""
Check a function or method declaration for definite assignment.
@param declaration
@return
"""
DefinitelyAssignedSet environment = new DefinitelyAssignedSet();
// Definitely assigned variables incl... | java | @Override
public ControlFlow visitProperty(Decl.Property declaration, DefinitelyAssignedSet dummy) {
DefinitelyAssignedSet environment = new DefinitelyAssignedSet();
// Definitely assigned variables includes all parameters.
environment = environment.addAll(declaration.getParameters());
// Iterate through each ... | [
"@",
"Override",
"public",
"ControlFlow",
"visitProperty",
"(",
"Decl",
".",
"Property",
"declaration",
",",
"DefinitelyAssignedSet",
"dummy",
")",
"{",
"DefinitelyAssignedSet",
"environment",
"=",
"new",
"DefinitelyAssignedSet",
"(",
")",
";",
"// Definitely assigned v... | Check a function or method declaration for definite assignment.
@param declaration
@return | [
"Check",
"a",
"function",
"or",
"method",
"declaration",
"for",
"definite",
"assignment",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/check/DefiniteAssignmentCheck.java#L94-L104 |
fuinorg/event-store-commons | spi/src/main/java/org/fuin/esc/spi/EscSpiUtils.java | EscSpiUtils.nodeToString | public static String nodeToString(final Node node) {
"""
Render a node as string.
@param node
Node to render.
@return XML.
"""
try {
final Transformer t = TransformerFactory.newInstance().newTransformer();
t.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
... | java | public static String nodeToString(final Node node) {
try {
final Transformer t = TransformerFactory.newInstance().newTransformer();
t.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
final StringWriter sw = new StringWriter();
t.transform(new DOMSource(n... | [
"public",
"static",
"String",
"nodeToString",
"(",
"final",
"Node",
"node",
")",
"{",
"try",
"{",
"final",
"Transformer",
"t",
"=",
"TransformerFactory",
".",
"newInstance",
"(",
")",
".",
"newTransformer",
"(",
")",
";",
"t",
".",
"setOutputProperty",
"(",
... | Render a node as string.
@param node
Node to render.
@return XML. | [
"Render",
"a",
"node",
"as",
"string",
"."
] | train | https://github.com/fuinorg/event-store-commons/blob/ea175582d8cda2b5a6d2fe52bbb2f1c183eee77c/spi/src/main/java/org/fuin/esc/spi/EscSpiUtils.java#L243-L253 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/collection/impl/txnqueue/TransactionalQueueProxySupport.java | TransactionalQueueProxySupport.offerInternal | boolean offerInternal(Data data, long timeout) {
"""
Tries to accomodate one more item in the queue in addition to the
already offered items. If it succeeds by getting an item ID, it will
add the item to the
Makes a reservation for a {@link TransactionalQueue#offer} operation
and adds the commit operation to t... | java | boolean offerInternal(Data data, long timeout) {
TxnReserveOfferOperation operation
= new TxnReserveOfferOperation(name, timeout, offeredQueue.size(), tx.getTxnId());
operation.setCallerUuid(tx.getOwnerUuid());
try {
Future<Long> future = invoke(operation);
... | [
"boolean",
"offerInternal",
"(",
"Data",
"data",
",",
"long",
"timeout",
")",
"{",
"TxnReserveOfferOperation",
"operation",
"=",
"new",
"TxnReserveOfferOperation",
"(",
"name",
",",
"timeout",
",",
"offeredQueue",
".",
"size",
"(",
")",
",",
"tx",
".",
"getTxn... | Tries to accomodate one more item in the queue in addition to the
already offered items. If it succeeds by getting an item ID, it will
add the item to the
Makes a reservation for a {@link TransactionalQueue#offer} operation
and adds the commit operation to the transaction log.
@param data the serialised item being ... | [
"Tries",
"to",
"accomodate",
"one",
"more",
"item",
"in",
"the",
"queue",
"in",
"addition",
"to",
"the",
"already",
"offered",
"items",
".",
"If",
"it",
"succeeds",
"by",
"getting",
"an",
"item",
"ID",
"it",
"will",
"add",
"the",
"item",
"to",
"the",
"... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/collection/impl/txnqueue/TransactionalQueueProxySupport.java#L111-L131 |
structurizr/java | structurizr-core/src/com/structurizr/model/Model.java | Model.addDeploymentNode | @Nonnull
public DeploymentNode addDeploymentNode(@Nonnull String name, @Nullable String description, @Nullable String technology) {
"""
Adds a top-level deployment node to this model.
@param name the name of the deployment node
@param description the description of the deployment node
@param techno... | java | @Nonnull
public DeploymentNode addDeploymentNode(@Nonnull String name, @Nullable String description, @Nullable String technology) {
return addDeploymentNode(DeploymentElement.DEFAULT_DEPLOYMENT_ENVIRONMENT, name, description, technology);
} | [
"@",
"Nonnull",
"public",
"DeploymentNode",
"addDeploymentNode",
"(",
"@",
"Nonnull",
"String",
"name",
",",
"@",
"Nullable",
"String",
"description",
",",
"@",
"Nullable",
"String",
"technology",
")",
"{",
"return",
"addDeploymentNode",
"(",
"DeploymentElement",
... | Adds a top-level deployment node to this model.
@param name the name of the deployment node
@param description the description of the deployment node
@param technology the technology associated with the deployment node
@return a DeploymentNode instance
@throws IllegalArgumentException if the name is not specif... | [
"Adds",
"a",
"top",
"-",
"level",
"deployment",
"node",
"to",
"this",
"model",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/Model.java#L558-L561 |
lucee/Lucee | core/src/main/java/lucee/runtime/type/scope/session/SessionCache.java | SessionCache.getInstance | public static Session getInstance(String cacheName, String appName, PageContext pc, Session existing, Log log) throws PageException {
"""
load an new instance of the client datasource scope
@param cacheName
@param appName
@param pc
@return client datasource scope
@throws PageException
"""
if (appName !... | java | public static Session getInstance(String cacheName, String appName, PageContext pc, Session existing, Log log) throws PageException {
if (appName != null && appName.startsWith("no-in-memory-cache-")) existing = null;
synchronized (token) {
StorageValue sv = _loadData(pc, cacheName, appName, "session", log);
... | [
"public",
"static",
"Session",
"getInstance",
"(",
"String",
"cacheName",
",",
"String",
"appName",
",",
"PageContext",
"pc",
",",
"Session",
"existing",
",",
"Log",
"log",
")",
"throws",
"PageException",
"{",
"if",
"(",
"appName",
"!=",
"null",
"&&",
"appNa... | load an new instance of the client datasource scope
@param cacheName
@param appName
@param pc
@return client datasource scope
@throws PageException | [
"load",
"an",
"new",
"instance",
"of",
"the",
"client",
"datasource",
"scope"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/session/SessionCache.java#L64-L87 |
m-m-m/util | pojo/src/main/java/net/sf/mmm/util/pojo/descriptor/impl/AbstractPojoDescriptorImpl.java | AbstractPojoDescriptorImpl.addPropertyDescriptor | protected void addPropertyDescriptor(PojoPropertyDescriptorImpl descriptor) {
"""
This method adds the given {@link PojoPropertyDescriptorImpl}.
@param descriptor is the {@link PojoPropertyDescriptorImpl} to add.
"""
PojoPropertyDescriptorImpl old = this.propertyMap.put(descriptor.getName(), descriptor... | java | protected void addPropertyDescriptor(PojoPropertyDescriptorImpl descriptor) {
PojoPropertyDescriptorImpl old = this.propertyMap.put(descriptor.getName(), descriptor);
if (old != null) {
throw new DuplicateObjectException(descriptor, descriptor.getName(), old);
}
} | [
"protected",
"void",
"addPropertyDescriptor",
"(",
"PojoPropertyDescriptorImpl",
"descriptor",
")",
"{",
"PojoPropertyDescriptorImpl",
"old",
"=",
"this",
".",
"propertyMap",
".",
"put",
"(",
"descriptor",
".",
"getName",
"(",
")",
",",
"descriptor",
")",
";",
"if... | This method adds the given {@link PojoPropertyDescriptorImpl}.
@param descriptor is the {@link PojoPropertyDescriptorImpl} to add. | [
"This",
"method",
"adds",
"the",
"given",
"{",
"@link",
"PojoPropertyDescriptorImpl",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/pojo/src/main/java/net/sf/mmm/util/pojo/descriptor/impl/AbstractPojoDescriptorImpl.java#L147-L153 |
sarl/sarl | docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/references/SarlLinkFactory.java | SarlLinkFactory.setBoundsLinkInfo | protected void setBoundsLinkInfo(LinkInfo linkInfo, Type bound) {
"""
Change the bounds into the link info.
@param linkInfo the link info.
@param bound the new bounds.
"""
Reflect.callProc(this, LinkFactory.class, "setBoundsLinkInfo", //$NON-NLS-1$
new Class<?>[]{LinkInfo.class, Type.class},
link... | java | protected void setBoundsLinkInfo(LinkInfo linkInfo, Type bound) {
Reflect.callProc(this, LinkFactory.class, "setBoundsLinkInfo", //$NON-NLS-1$
new Class<?>[]{LinkInfo.class, Type.class},
linkInfo, bound);
} | [
"protected",
"void",
"setBoundsLinkInfo",
"(",
"LinkInfo",
"linkInfo",
",",
"Type",
"bound",
")",
"{",
"Reflect",
".",
"callProc",
"(",
"this",
",",
"LinkFactory",
".",
"class",
",",
"\"setBoundsLinkInfo\"",
",",
"//$NON-NLS-1$",
"new",
"Class",
"<",
"?",
">",... | Change the bounds into the link info.
@param linkInfo the link info.
@param bound the new bounds. | [
"Change",
"the",
"bounds",
"into",
"the",
"link",
"info",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/docs/io.sarl.docs.doclet/src/main/java/io/sarl/docs/doclet/references/SarlLinkFactory.java#L145-L149 |
hector-client/hector | core/src/main/java/me/prettyprint/hector/api/factory/HFactory.java | HFactory.createKeyspace | public static Keyspace createKeyspace(String keyspace, Cluster cluster,
ConsistencyLevelPolicy consistencyLevelPolicy) {
"""
Creates a Keyspace with the given consistency level. For a reference
to the consistency level, please refer to http://wiki.apache.org/cassandra/API.
@param keyspace
@param cluster... | java | public static Keyspace createKeyspace(String keyspace, Cluster cluster,
ConsistencyLevelPolicy consistencyLevelPolicy) {
return createKeyspace(keyspace, cluster, consistencyLevelPolicy,
FailoverPolicy.ON_FAIL_TRY_ALL_AVAILABLE);
} | [
"public",
"static",
"Keyspace",
"createKeyspace",
"(",
"String",
"keyspace",
",",
"Cluster",
"cluster",
",",
"ConsistencyLevelPolicy",
"consistencyLevelPolicy",
")",
"{",
"return",
"createKeyspace",
"(",
"keyspace",
",",
"cluster",
",",
"consistencyLevelPolicy",
",",
... | Creates a Keyspace with the given consistency level. For a reference
to the consistency level, please refer to http://wiki.apache.org/cassandra/API.
@param keyspace
@param cluster
@param consistencyLevelPolicy
@return | [
"Creates",
"a",
"Keyspace",
"with",
"the",
"given",
"consistency",
"level",
".",
"For",
"a",
"reference",
"to",
"the",
"consistency",
"level",
"please",
"refer",
"to",
"http",
":",
"//",
"wiki",
".",
"apache",
".",
"org",
"/",
"cassandra",
"/",
"API",
".... | train | https://github.com/hector-client/hector/blob/a302e68ca8d91b45d332e8c9afd7d98030b54de1/core/src/main/java/me/prettyprint/hector/api/factory/HFactory.java#L255-L259 |
palatable/lambda | src/main/java/com/jnape/palatable/lambda/optics/lenses/HListLens.java | HListLens.elementAt | public static <E, List extends HCons<?, ?>> Lens.Simple<List, E> elementAt(Index<E, List> index) {
"""
Focus invariantly on the element at the specified {@link Index} in an {@link HList}.
@param index the index of the element to focus on
@param <E> the element type
@param <List> the HList under focus
@re... | java | public static <E, List extends HCons<?, ?>> Lens.Simple<List, E> elementAt(Index<E, List> index) {
return simpleLens(index::get, (l, e) -> index.set(e, l));
} | [
"public",
"static",
"<",
"E",
",",
"List",
"extends",
"HCons",
"<",
"?",
",",
"?",
">",
">",
"Lens",
".",
"Simple",
"<",
"List",
",",
"E",
">",
"elementAt",
"(",
"Index",
"<",
"E",
",",
"List",
">",
"index",
")",
"{",
"return",
"simpleLens",
"(",... | Focus invariantly on the element at the specified {@link Index} in an {@link HList}.
@param index the index of the element to focus on
@param <E> the element type
@param <List> the HList under focus
@return a lens focusing on the element at index | [
"Focus",
"invariantly",
"on",
"the",
"element",
"at",
"the",
"specified",
"{",
"@link",
"Index",
"}",
"in",
"an",
"{",
"@link",
"HList",
"}",
"."
] | train | https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/optics/lenses/HListLens.java#L24-L26 |
fcrepo4/fcrepo4 | fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/FedoraTypesUtils.java | FedoraTypesUtils.touch | private static void touch(final Node node, final Calendar modified, final String modifyingUser) {
"""
Updates the LAST_MODIFIED_DATE and LAST_MODIFIED_BY properties to the provided values.
@param node The JCR node
@param modified the modification date, or null if not explicitly set
@param modifyingUser the us... | java | private static void touch(final Node node, final Calendar modified, final String modifyingUser) {
touch(node, null, null, modified, modifyingUser);
} | [
"private",
"static",
"void",
"touch",
"(",
"final",
"Node",
"node",
",",
"final",
"Calendar",
"modified",
",",
"final",
"String",
"modifyingUser",
")",
"{",
"touch",
"(",
"node",
",",
"null",
",",
"null",
",",
"modified",
",",
"modifyingUser",
")",
";",
... | Updates the LAST_MODIFIED_DATE and LAST_MODIFIED_BY properties to the provided values.
@param node The JCR node
@param modified the modification date, or null if not explicitly set
@param modifyingUser the userID who modified this resource or null if not explicitly set | [
"Updates",
"the",
"LAST_MODIFIED_DATE",
"and",
"LAST_MODIFIED_BY",
"properties",
"to",
"the",
"provided",
"values",
"."
] | train | https://github.com/fcrepo4/fcrepo4/blob/7489ad5bc8fb44e2442c93eceb7d97ac54553ab6/fcrepo-kernel-modeshape/src/main/java/org/fcrepo/kernel/modeshape/utils/FedoraTypesUtils.java#L454-L456 |
apache/incubator-gobblin | gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java | State.getPropAsLong | public long getPropAsLong(String key, long def) {
"""
Get the value of a property as a long integer, using the given default value if the property is not set.
@param key property key
@param def default value
@return long integer value associated with the key or the default value if the property is not set
... | java | public long getPropAsLong(String key, long def) {
return Long.parseLong(getProp(key, String.valueOf(def)));
} | [
"public",
"long",
"getPropAsLong",
"(",
"String",
"key",
",",
"long",
"def",
")",
"{",
"return",
"Long",
".",
"parseLong",
"(",
"getProp",
"(",
"key",
",",
"String",
".",
"valueOf",
"(",
"def",
")",
")",
")",
";",
"}"
] | Get the value of a property as a long integer, using the given default value if the property is not set.
@param key property key
@param def default value
@return long integer value associated with the key or the default value if the property is not set | [
"Get",
"the",
"value",
"of",
"a",
"property",
"as",
"a",
"long",
"integer",
"using",
"the",
"given",
"default",
"value",
"if",
"the",
"property",
"is",
"not",
"set",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/configuration/State.java#L363-L365 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.consumption_usage_forecast_GET | public ArrayList<net.minidev.ovh.api.me.consumption.OvhTransaction> consumption_usage_forecast_GET() throws IOException {
"""
Get forecasted consumptions for all services
REST: GET /me/consumption/usage/forecast
"""
String qPath = "/me/consumption/usage/forecast";
StringBuilder sb = path(qPath);
Strin... | java | public ArrayList<net.minidev.ovh.api.me.consumption.OvhTransaction> consumption_usage_forecast_GET() throws IOException {
String qPath = "/me/consumption/usage/forecast";
StringBuilder sb = path(qPath);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t7);
} | [
"public",
"ArrayList",
"<",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"me",
".",
"consumption",
".",
"OvhTransaction",
">",
"consumption_usage_forecast_GET",
"(",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/consumption/usage/forecas... | Get forecasted consumptions for all services
REST: GET /me/consumption/usage/forecast | [
"Get",
"forecasted",
"consumptions",
"for",
"all",
"services"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2143-L2148 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/xtend-gen/org/eclipse/xtext/xbase/compiler/LoopExtensions.java | LoopExtensions.forEachWithShortcut | public <T extends Object> void forEachWithShortcut(final ITreeAppendable appendable, final Iterable<T> elements, final Procedure1<? super T> procedure) {
"""
Uses curly braces and comma as delimiters. Doesn't use them for single valued iterables.
"""
int _size = IterableExtensions.size(elements);
boole... | java | public <T extends Object> void forEachWithShortcut(final ITreeAppendable appendable, final Iterable<T> elements, final Procedure1<? super T> procedure) {
int _size = IterableExtensions.size(elements);
boolean _equals = (_size == 1);
if (_equals) {
T _head = IterableExtensions.<T>head(elements);
... | [
"public",
"<",
"T",
"extends",
"Object",
">",
"void",
"forEachWithShortcut",
"(",
"final",
"ITreeAppendable",
"appendable",
",",
"final",
"Iterable",
"<",
"T",
">",
"elements",
",",
"final",
"Procedure1",
"<",
"?",
"super",
"T",
">",
"procedure",
")",
"{",
... | Uses curly braces and comma as delimiters. Doesn't use them for single valued iterables. | [
"Uses",
"curly",
"braces",
"and",
"comma",
"as",
"delimiters",
".",
"Doesn",
"t",
"use",
"them",
"for",
"single",
"valued",
"iterables",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/xtend-gen/org/eclipse/xtext/xbase/compiler/LoopExtensions.java#L47-L63 |
mpetazzoni/ttorrent | ttorrent-client/src/main/java/com/turn/ttorrent/client/CommunicationManager.java | CommunicationManager.handlePieceCompleted | @Override
public void handlePieceCompleted(final SharingPeer peer, final Piece piece)
throws IOException {
"""
Piece download completion handler.
<p/>
<p>
When a piece is completed, and valid, we announce to all connected peers
that we now have this piece.
</p>
<p/>
<p>
We use this handler to i... | java | @Override
public void handlePieceCompleted(final SharingPeer peer, final Piece piece)
throws IOException {
final SharedTorrent torrent = peer.getTorrent();
final String torrentHash = torrent.getHexInfoHash();
try {
final Future<?> validationFuture = myPieceValidatorExecutor.submit(new Runn... | [
"@",
"Override",
"public",
"void",
"handlePieceCompleted",
"(",
"final",
"SharingPeer",
"peer",
",",
"final",
"Piece",
"piece",
")",
"throws",
"IOException",
"{",
"final",
"SharedTorrent",
"torrent",
"=",
"peer",
".",
"getTorrent",
"(",
")",
";",
"final",
"Str... | Piece download completion handler.
<p/>
<p>
When a piece is completed, and valid, we announce to all connected peers
that we now have this piece.
</p>
<p/>
<p>
We use this handler to identify when all of the pieces have been
downloaded. When that's the case, we can start the seeding period, if
any.
</p>
@param peer T... | [
"Piece",
"download",
"completion",
"handler",
".",
"<p",
"/",
">",
"<p",
">",
"When",
"a",
"piece",
"is",
"completed",
"and",
"valid",
"we",
"announce",
"to",
"all",
"connected",
"peers",
"that",
"we",
"now",
"have",
"this",
"piece",
".",
"<",
"/",
"p"... | train | https://github.com/mpetazzoni/ttorrent/blob/ecd0e6caf853b63393c4ab63cfd8f20114f73f70/ttorrent-client/src/main/java/com/turn/ttorrent/client/CommunicationManager.java#L717-L734 |
google/closure-templates | java/src/com/google/template/soy/SoyFileSet.java | SoyFileSet.generateParseInfo | ImmutableMap<String, String> generateParseInfo(String javaPackage, String javaClassNameSource) {
"""
Generates Java classes containing parse info (param names, template names, meta info). There
will be one Java class per Soy file.
@param javaPackage The Java package for the generated classes.
@param javaClass... | java | ImmutableMap<String, String> generateParseInfo(String javaPackage, String javaClassNameSource) {
resetErrorReporter();
// TODO(lukes): see if we can enforce that globals are provided at compile time here. given that
// types have to be, this should be possible. Currently it is disabled for backwards
//... | [
"ImmutableMap",
"<",
"String",
",",
"String",
">",
"generateParseInfo",
"(",
"String",
"javaPackage",
",",
"String",
"javaClassNameSource",
")",
"{",
"resetErrorReporter",
"(",
")",
";",
"// TODO(lukes): see if we can enforce that globals are provided at compile time here. give... | Generates Java classes containing parse info (param names, template names, meta info). There
will be one Java class per Soy file.
@param javaPackage The Java package for the generated classes.
@param javaClassNameSource Source of the generated class names. Must be one of "filename",
"namespace", or "generic".
@return ... | [
"Generates",
"Java",
"classes",
"containing",
"parse",
"info",
"(",
"param",
"names",
"template",
"names",
"meta",
"info",
")",
".",
"There",
"will",
"be",
"one",
"Java",
"class",
"per",
"Soy",
"file",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/SoyFileSet.java#L616-L639 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/photos/people/PeopleInterface.java | PeopleInterface.editCoords | public void editCoords(String photoId, String userId, Rectangle bounds) throws FlickrException {
"""
Edit the co-ordinates that the user shows in
@param photoId
@param userId
@param bounds
@throws FlickrException
"""
Map<String, Object> parameters = new HashMap<String, Object>();
parame... | java | public void editCoords(String photoId, String userId, Rectangle bounds) throws FlickrException {
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("method", METHOD_EDIT_COORDS);
parameters.put("photo_id", photoId);
parameters.put("user_id", userId);
... | [
"public",
"void",
"editCoords",
"(",
"String",
"photoId",
",",
"String",
"userId",
",",
"Rectangle",
"bounds",
")",
"throws",
"FlickrException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",... | Edit the co-ordinates that the user shows in
@param photoId
@param userId
@param bounds
@throws FlickrException | [
"Edit",
"the",
"co",
"-",
"ordinates",
"that",
"the",
"user",
"shows",
"in"
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/photos/people/PeopleInterface.java#L122-L137 |
fcrepo3/fcrepo | fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/util/ContextUtil.java | ContextUtil.setupSubjects | public List<Subject> setupSubjects(List<Map<URI, List<AttributeValue>>> subjs) {
"""
Sets up the Subject section of the request. Takes a list of Maps of
URI/AttributeValue pairs. Each list element represents one subject which
contains a map of URI/AttributeValues.
@return a Set of Subject instances for inclus... | java | public List<Subject> setupSubjects(List<Map<URI, List<AttributeValue>>> subjs) {
if (subjs == null || subjs.size() == 0) {
return Collections.singletonList(new Subject(new ArrayList<Attribute>()));
}
List<Subject> subjects = new ArrayList<Subject>(subjs.size());
// Go throu... | [
"public",
"List",
"<",
"Subject",
">",
"setupSubjects",
"(",
"List",
"<",
"Map",
"<",
"URI",
",",
"List",
"<",
"AttributeValue",
">",
">",
">",
"subjs",
")",
"{",
"if",
"(",
"subjs",
"==",
"null",
"||",
"subjs",
".",
"size",
"(",
")",
"==",
"0",
... | Sets up the Subject section of the request. Takes a list of Maps of
URI/AttributeValue pairs. Each list element represents one subject which
contains a map of URI/AttributeValues.
@return a Set of Subject instances for inclusion in a Request | [
"Sets",
"up",
"the",
"Subject",
"section",
"of",
"the",
"request",
".",
"Takes",
"a",
"list",
"of",
"Maps",
"of",
"URI",
"/",
"AttributeValue",
"pairs",
".",
"Each",
"list",
"element",
"represents",
"one",
"subject",
"which",
"contains",
"a",
"map",
"of",
... | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/util/ContextUtil.java#L103-L130 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/DBCleanService.java | DBCleanService.getWorkspaceDBCleaner | public static DBCleanerTool getWorkspaceDBCleaner(Connection jdbcConn, WorkspaceEntry wsEntry) throws DBCleanException {
"""
Returns database cleaner for workspace.
@param jdbcConn
database connection which need to use
@param wsEntry
workspace configuration
@return DBCleanerTool
@throws DBCleanException
... | java | public static DBCleanerTool getWorkspaceDBCleaner(Connection jdbcConn, WorkspaceEntry wsEntry) throws DBCleanException
{
SecurityHelper.validateSecurityPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_PERMISSION);
String dialect = resolveDialect(jdbcConn, wsEntry);
boolean autoCommit = dial... | [
"public",
"static",
"DBCleanerTool",
"getWorkspaceDBCleaner",
"(",
"Connection",
"jdbcConn",
",",
"WorkspaceEntry",
"wsEntry",
")",
"throws",
"DBCleanException",
"{",
"SecurityHelper",
".",
"validateSecurityPermission",
"(",
"JCRRuntimePermissions",
".",
"MANAGE_REPOSITORY_PE... | Returns database cleaner for workspace.
@param jdbcConn
database connection which need to use
@param wsEntry
workspace configuration
@return DBCleanerTool
@throws DBCleanException | [
"Returns",
"database",
"cleaner",
"for",
"workspace",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/clean/rdbms/DBCleanService.java#L191-L202 |
actframework/actframework | src/main/java/act/event/EventBus.java | EventBus.bindSync | public synchronized EventBus bindSync(SysEventId sysEventId, SysEventListener sysEventListener) {
"""
Bind an {@link SysEventListener} to a {@link SysEventId} synchronously.
**Note** this method is not supposed to be called by user application
directly.
@param sysEventId
the {@link SysEventId system event ... | java | public synchronized EventBus bindSync(SysEventId sysEventId, SysEventListener sysEventListener) {
return _bind(sysEventListeners, sysEventId, sysEventListener);
} | [
"public",
"synchronized",
"EventBus",
"bindSync",
"(",
"SysEventId",
"sysEventId",
",",
"SysEventListener",
"sysEventListener",
")",
"{",
"return",
"_bind",
"(",
"sysEventListeners",
",",
"sysEventId",
",",
"sysEventListener",
")",
";",
"}"
] | Bind an {@link SysEventListener} to a {@link SysEventId} synchronously.
**Note** this method is not supposed to be called by user application
directly.
@param sysEventId
the {@link SysEventId system event ID}
@param sysEventListener
an instance of {@link SysEventListener}
@return this event bus instance
@see #bind(Sy... | [
"Bind",
"an",
"{",
"@link",
"SysEventListener",
"}",
"to",
"a",
"{",
"@link",
"SysEventId",
"}",
"synchronously",
"."
] | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/event/EventBus.java#L751-L753 |
RuedigerMoeller/kontraktor | src/main/java/org/nustaq/kontraktor/asyncio/AsyncFile.java | AsyncFile.asInputStream | public InputStream asInputStream() {
"""
/*
return a pseudo-blocking input stream. Note: due to limitations of the current await implementation (stack based),
when reading many files concurrently from a single actor thread don't mix high latency file locations (e.g. remote file systems vs. local)
with low laten... | java | public InputStream asInputStream() {
if ( tmp != null )
throw new RuntimeException("can create Input/OutputStream only once");
tmp = new byte[1];
return new InputStream() {
@Override
public void close() throws IOException {
AsyncFile.this.clo... | [
"public",
"InputStream",
"asInputStream",
"(",
")",
"{",
"if",
"(",
"tmp",
"!=",
"null",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"can create Input/OutputStream only once\"",
")",
";",
"tmp",
"=",
"new",
"byte",
"[",
"1",
"]",
";",
"return",
"new",
"I... | /*
return a pseudo-blocking input stream. Note: due to limitations of the current await implementation (stack based),
when reading many files concurrently from a single actor thread don't mix high latency file locations (e.g. remote file systems vs. local)
with low latency ones. If this is required, fall back to the mo... | [
"/",
"*",
"return",
"a",
"pseudo",
"-",
"blocking",
"input",
"stream",
".",
"Note",
":",
"due",
"to",
"limitations",
"of",
"the",
"current",
"await",
"implementation",
"(",
"stack",
"based",
")",
"when",
"reading",
"many",
"files",
"concurrently",
"from",
... | train | https://github.com/RuedigerMoeller/kontraktor/blob/d5f3817f9476f3786187b8ef00400b7a4f25a404/src/main/java/org/nustaq/kontraktor/asyncio/AsyncFile.java#L58-L98 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AtomCache.java | AtomCache.getStructureForDomain | public Structure getStructureForDomain(ScopDomain domain) throws IOException, StructureException {
"""
Returns the representation of a {@link ScopDomain} as a BioJava {@link Structure} object.
@param domain
a SCOP domain
@return a Structure object
@throws IOException
@throws StructureException
"""
ret... | java | public Structure getStructureForDomain(ScopDomain domain) throws IOException, StructureException {
return getStructureForDomain(domain, ScopFactory.getSCOP());
} | [
"public",
"Structure",
"getStructureForDomain",
"(",
"ScopDomain",
"domain",
")",
"throws",
"IOException",
",",
"StructureException",
"{",
"return",
"getStructureForDomain",
"(",
"domain",
",",
"ScopFactory",
".",
"getSCOP",
"(",
")",
")",
";",
"}"
] | Returns the representation of a {@link ScopDomain} as a BioJava {@link Structure} object.
@param domain
a SCOP domain
@return a Structure object
@throws IOException
@throws StructureException | [
"Returns",
"the",
"representation",
"of",
"a",
"{",
"@link",
"ScopDomain",
"}",
"as",
"a",
"BioJava",
"{",
"@link",
"Structure",
"}",
"object",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AtomCache.java#L528-L530 |
knowm/XChart | xchart/src/main/java/org/knowm/xchart/OHLCChart.java | OHLCChart.addSeries | private OHLCSeries addSeries(
String seriesName,
double[] xData,
double[] openData,
double[] highData,
double[] lowData,
double[] closeData,
DataType dataType) {
"""
Add a series for a OHLC type chart
@param seriesName
@param xData the x-axis data
@param openData the ... | java | private OHLCSeries addSeries(
String seriesName,
double[] xData,
double[] openData,
double[] highData,
double[] lowData,
double[] closeData,
DataType dataType) {
if (seriesMap.keySet().contains(seriesName)) {
throw new IllegalArgumentException(
"Series name... | [
"private",
"OHLCSeries",
"addSeries",
"(",
"String",
"seriesName",
",",
"double",
"[",
"]",
"xData",
",",
"double",
"[",
"]",
"openData",
",",
"double",
"[",
"]",
"highData",
",",
"double",
"[",
"]",
"lowData",
",",
"double",
"[",
"]",
"closeData",
",",
... | Add a series for a OHLC type chart
@param seriesName
@param xData the x-axis data
@param openData the open data
@param highData the high data
@param lowData the low data
@param closeData the close data
@return A Series object that you can set properties on | [
"Add",
"a",
"series",
"for",
"a",
"OHLC",
"type",
"chart"
] | train | https://github.com/knowm/XChart/blob/677a105753a855edf24782fab1bf1f5aec3e642b/xchart/src/main/java/org/knowm/xchart/OHLCChart.java#L291-L326 |
the-fascinator/plugin-authentication-internal | src/main/java/com/googlecode/fascinator/authentication/internal/InternalAuthentication.java | InternalAuthentication.deleteUser | @Override
public void deleteUser(String username) throws AuthenticationException {
"""
Delete a user.
@param username The username of the user to delete.
@throws AuthenticationException if there was an error during deletion.
"""
String user = file_store.getProperty(username);
if (user =... | java | @Override
public void deleteUser(String username) throws AuthenticationException {
String user = file_store.getProperty(username);
if (user == null) {
throw new AuthenticationException("User '" + username
+ "' not found.");
}
file_store.remove(username... | [
"@",
"Override",
"public",
"void",
"deleteUser",
"(",
"String",
"username",
")",
"throws",
"AuthenticationException",
"{",
"String",
"user",
"=",
"file_store",
".",
"getProperty",
"(",
"username",
")",
";",
"if",
"(",
"user",
"==",
"null",
")",
"{",
"throw",... | Delete a user.
@param username The username of the user to delete.
@throws AuthenticationException if there was an error during deletion. | [
"Delete",
"a",
"user",
"."
] | train | https://github.com/the-fascinator/plugin-authentication-internal/blob/a2b9a0eda9b43bf20583036a406c83c938be3042/src/main/java/com/googlecode/fascinator/authentication/internal/InternalAuthentication.java#L345-L358 |
MTDdk/jawn | jawn-core-new/src/main/java/net/javapla/jawn/core/util/ConvertUtil.java | ConvertUtil.toLong | public static Long toLong(Object value) throws ConversionException {
"""
Converts value to Long if c it can. If value is a Long, it is returned, if it is a Number, it is
promoted to Long and then returned, in all other cases, it converts the value to String,
then tries to parse Long from it.
@param value valu... | java | public static Long toLong(Object value) throws ConversionException {
if (value == null) {
return null;
} else if (value instanceof Number) {
return ((Number)value).longValue();
} else {
NumberFormat nf = new DecimalFormat();
try {
... | [
"public",
"static",
"Long",
"toLong",
"(",
"Object",
"value",
")",
"throws",
"ConversionException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"value",
"instanceof",
"Number",
")",
"{",
"return",
"(",
... | Converts value to Long if c it can. If value is a Long, it is returned, if it is a Number, it is
promoted to Long and then returned, in all other cases, it converts the value to String,
then tries to parse Long from it.
@param value value to be converted to Long.
@return value converted to Long.
@throws ConversionExce... | [
"Converts",
"value",
"to",
"Long",
"if",
"c",
"it",
"can",
".",
"If",
"value",
"is",
"a",
"Long",
"it",
"is",
"returned",
"if",
"it",
"is",
"a",
"Number",
"it",
"is",
"promoted",
"to",
"Long",
"and",
"then",
"returned",
"in",
"all",
"other",
"cases",... | train | https://github.com/MTDdk/jawn/blob/4ec2d09b97d413efdead7487e6075e5bfd13b925/jawn-core-new/src/main/java/net/javapla/jawn/core/util/ConvertUtil.java#L122-L135 |
apache/spark | common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java | UTF8String.writeToMemory | public void writeToMemory(Object target, long targetOffset) {
"""
Writes the content of this string into a memory address, identified by an object and an offset.
The target memory address must already been allocated, and have enough space to hold all the
bytes in this string.
"""
Platform.copyMemory(base... | java | public void writeToMemory(Object target, long targetOffset) {
Platform.copyMemory(base, offset, target, targetOffset, numBytes);
} | [
"public",
"void",
"writeToMemory",
"(",
"Object",
"target",
",",
"long",
"targetOffset",
")",
"{",
"Platform",
".",
"copyMemory",
"(",
"base",
",",
"offset",
",",
"target",
",",
"targetOffset",
",",
"numBytes",
")",
";",
"}"
] | Writes the content of this string into a memory address, identified by an object and an offset.
The target memory address must already been allocated, and have enough space to hold all the
bytes in this string. | [
"Writes",
"the",
"content",
"of",
"this",
"string",
"into",
"a",
"memory",
"address",
"identified",
"by",
"an",
"object",
"and",
"an",
"offset",
".",
"The",
"target",
"memory",
"address",
"must",
"already",
"been",
"allocated",
"and",
"have",
"enough",
"spac... | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java#L170-L172 |
ebean-orm/ebean-mocker | src/main/java/io/ebean/DelegateEbeanServer.java | DelegateEbeanServer.withDelegate | public DelegateEbeanServer withDelegate(EbeanServer delegate) {
"""
Construct with a EbeanServer to delegate and using ImmediateBackgroundExecutor.
<p>
This delegate will be used on all method calls that are not overwritten.
"""
this.delegate = delegate;
this.delegateQuery = new DelegateQuery(delegat... | java | public DelegateEbeanServer withDelegate(EbeanServer delegate) {
this.delegate = delegate;
this.delegateQuery = new DelegateQuery(delegate, this);
this.save = new DelegateSave(delegate);
this.delete = new DelegateDelete(delegate);
this.bulkUpdate = new DelegateBulkUpdate(delegate);
this.find = ne... | [
"public",
"DelegateEbeanServer",
"withDelegate",
"(",
"EbeanServer",
"delegate",
")",
"{",
"this",
".",
"delegate",
"=",
"delegate",
";",
"this",
".",
"delegateQuery",
"=",
"new",
"DelegateQuery",
"(",
"delegate",
",",
"this",
")",
";",
"this",
".",
"save",
... | Construct with a EbeanServer to delegate and using ImmediateBackgroundExecutor.
<p>
This delegate will be used on all method calls that are not overwritten. | [
"Construct",
"with",
"a",
"EbeanServer",
"to",
"delegate",
"and",
"using",
"ImmediateBackgroundExecutor",
".",
"<p",
">",
"This",
"delegate",
"will",
"be",
"used",
"on",
"all",
"method",
"calls",
"that",
"are",
"not",
"overwritten",
"."
] | train | https://github.com/ebean-orm/ebean-mocker/blob/98c14a58253e8cd40b2a0c9b49526a307079389a/src/main/java/io/ebean/DelegateEbeanServer.java#L170-L180 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/util/ExpressionUtils.java | ExpressionUtils.createExpression | @Deprecated
public static JRDesignExpression createExpression(String name, CustomExpression expression) {
"""
Use {@link #createAndRegisterExpression(DynamicJasperDesign, String, CustomExpression)}
This deprecated version may cause wrong field values when expression is executed in a group footer
@param name
... | java | @Deprecated
public static JRDesignExpression createExpression(String name, CustomExpression expression) {
return createExpression(name, expression, false);
} | [
"@",
"Deprecated",
"public",
"static",
"JRDesignExpression",
"createExpression",
"(",
"String",
"name",
",",
"CustomExpression",
"expression",
")",
"{",
"return",
"createExpression",
"(",
"name",
",",
"expression",
",",
"false",
")",
";",
"}"
] | Use {@link #createAndRegisterExpression(DynamicJasperDesign, String, CustomExpression)}
This deprecated version may cause wrong field values when expression is executed in a group footer
@param name
@param expression
@return | [
"Use",
"{"
] | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/util/ExpressionUtils.java#L221-L224 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/proxy/cglib/CglibLazyInitializer.java | CglibLazyInitializer.getProxyInstance | private static KunderaProxy getProxyInstance(Class factory, CglibLazyInitializer instance) {
"""
Gets the proxy instance.
@param factory
the factory
@param instance
the instance
@return the proxy instance
@throws InstantiationException
the instantiation exception
@throws IllegalAccessException
the illeg... | java | private static KunderaProxy getProxyInstance(Class factory, CglibLazyInitializer instance)
{
KunderaProxy proxy;
try
{
Enhancer.registerCallbacks(factory, new Callback[] { instance, null });
proxy = (KunderaProxy) factory.newInstance();
}
catch... | [
"private",
"static",
"KunderaProxy",
"getProxyInstance",
"(",
"Class",
"factory",
",",
"CglibLazyInitializer",
"instance",
")",
"{",
"KunderaProxy",
"proxy",
";",
"try",
"{",
"Enhancer",
".",
"registerCallbacks",
"(",
"factory",
",",
"new",
"Callback",
"[",
"]",
... | Gets the proxy instance.
@param factory
the factory
@param instance
the instance
@return the proxy instance
@throws InstantiationException
the instantiation exception
@throws IllegalAccessException
the illegal access exception | [
"Gets",
"the",
"proxy",
"instance",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/proxy/cglib/CglibLazyInitializer.java#L155-L176 |
VoltDB/voltdb | src/frontend/org/voltdb/StatsAgent.java | StatsAgent.getStatsAggregate | public VoltTable getStatsAggregate(
final StatsSelector selector,
final boolean interval,
final Long now) {
"""
Get aggregate statistics on this node for the given selector.
If you need both site-wise and node-wise stats, register the appropriate StatsSources for that
selector... | java | public VoltTable getStatsAggregate(
final StatsSelector selector,
final boolean interval,
final Long now) {
return getStatsAggregateInternal(selector, interval, now);
} | [
"public",
"VoltTable",
"getStatsAggregate",
"(",
"final",
"StatsSelector",
"selector",
",",
"final",
"boolean",
"interval",
",",
"final",
"Long",
"now",
")",
"{",
"return",
"getStatsAggregateInternal",
"(",
"selector",
",",
"interval",
",",
"now",
")",
";",
"}"
... | Get aggregate statistics on this node for the given selector.
If you need both site-wise and node-wise stats, register the appropriate StatsSources for that
selector with each siteId and then some other value for the node-level stats (PLANNER stats uses -1).
This call will automatically aggregate every StatsSource regi... | [
"Get",
"aggregate",
"statistics",
"on",
"this",
"node",
"for",
"the",
"given",
"selector",
".",
"If",
"you",
"need",
"both",
"site",
"-",
"wise",
"and",
"node",
"-",
"wise",
"stats",
"register",
"the",
"appropriate",
"StatsSources",
"for",
"that",
"selector"... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/StatsAgent.java#L724-L729 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPoliciesInner.java | ContentKeyPoliciesInner.getAsync | public Observable<ContentKeyPolicyInner> getAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) {
"""
Get a Content Key Policy.
Get the details of a Content Key Policy in the Media Services account.
@param resourceGroupName The name of the resource group within the Azure subscripti... | java | public Observable<ContentKeyPolicyInner> getAsync(String resourceGroupName, String accountName, String contentKeyPolicyName) {
return getWithServiceResponseAsync(resourceGroupName, accountName, contentKeyPolicyName).map(new Func1<ServiceResponse<ContentKeyPolicyInner>, ContentKeyPolicyInner>() {
@Ov... | [
"public",
"Observable",
"<",
"ContentKeyPolicyInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"contentKeyPolicyName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",... | Get a Content Key Policy.
Get the details of a Content Key Policy in the Media Services account.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param contentKeyPolicyName The Content Key Policy name.
@throws IllegalArgumentExc... | [
"Get",
"a",
"Content",
"Key",
"Policy",
".",
"Get",
"the",
"details",
"of",
"a",
"Content",
"Key",
"Policy",
"in",
"the",
"Media",
"Services",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/ContentKeyPoliciesInner.java#L404-L411 |
ben-manes/caffeine | simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/sketch/segment/RandomWindowTinyLfuPolicy.java | RandomWindowTinyLfuPolicy.policies | public static Set<Policy> policies(Config config) {
"""
Returns all variations of this policy based on the configuration parameters.
"""
RandomWindowTinyLfuSettings settings = new RandomWindowTinyLfuSettings(config);
return settings.percentMain().stream()
.map(percentMain -> new RandomWindowTin... | java | public static Set<Policy> policies(Config config) {
RandomWindowTinyLfuSettings settings = new RandomWindowTinyLfuSettings(config);
return settings.percentMain().stream()
.map(percentMain -> new RandomWindowTinyLfuPolicy(percentMain, settings))
.collect(toSet());
} | [
"public",
"static",
"Set",
"<",
"Policy",
">",
"policies",
"(",
"Config",
"config",
")",
"{",
"RandomWindowTinyLfuSettings",
"settings",
"=",
"new",
"RandomWindowTinyLfuSettings",
"(",
"config",
")",
";",
"return",
"settings",
".",
"percentMain",
"(",
")",
".",
... | Returns all variations of this policy based on the configuration parameters. | [
"Returns",
"all",
"variations",
"of",
"this",
"policy",
"based",
"on",
"the",
"configuration",
"parameters",
"."
] | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/sketch/segment/RandomWindowTinyLfuPolicy.java#L67-L72 |
checkstyle-addons/checkstyle-addons | buildSrc/src/main/java/com/thomasjensen/checkstyle/addons/build/BuildUtil.java | BuildUtil.getTask | @Nonnull
public Task getTask(@Nonnull final TaskNames pTaskName, @Nonnull final DependencyConfig pDepConfig) {
"""
Convenience method for getting a specific task directly.
@param pTaskName the task to get
@param pDepConfig the dependency configuration for which the task is intended
@return a task object
... | java | @Nonnull
public Task getTask(@Nonnull final TaskNames pTaskName, @Nonnull final DependencyConfig pDepConfig)
{
return project.getTasks().getByName(pTaskName.getName(pDepConfig));
} | [
"@",
"Nonnull",
"public",
"Task",
"getTask",
"(",
"@",
"Nonnull",
"final",
"TaskNames",
"pTaskName",
",",
"@",
"Nonnull",
"final",
"DependencyConfig",
"pDepConfig",
")",
"{",
"return",
"project",
".",
"getTasks",
"(",
")",
".",
"getByName",
"(",
"pTaskName",
... | Convenience method for getting a specific task directly.
@param pTaskName the task to get
@param pDepConfig the dependency configuration for which the task is intended
@return a task object | [
"Convenience",
"method",
"for",
"getting",
"a",
"specific",
"task",
"directly",
"."
] | train | https://github.com/checkstyle-addons/checkstyle-addons/blob/fae1b4d341639c8e32c3e59ec5abdc0ffc11b865/buildSrc/src/main/java/com/thomasjensen/checkstyle/addons/build/BuildUtil.java#L144-L148 |
tdunning/t-digest | core/src/main/java/com/tdunning/math/stats/Comparison.java | Comparison.compareChi2 | @SuppressWarnings("WeakerAccess")
public static double compareChi2(Histogram dist1, Histogram dist2) {
"""
Use a log-likelihood ratio test to compare two distributions.
With non-linear histograms that have compatible bin boundaries,
all that we have to do is compare two count vectors using a
chi^2 test (act... | java | @SuppressWarnings("WeakerAccess")
public static double compareChi2(Histogram dist1, Histogram dist2) {
if (!dist1.getClass().equals(dist2.getClass())) {
throw new IllegalArgumentException(String.format("Must have same class arguments, got %s and %s",
dist1.getClass(), dist2.g... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"static",
"double",
"compareChi2",
"(",
"Histogram",
"dist1",
",",
"Histogram",
"dist2",
")",
"{",
"if",
"(",
"!",
"dist1",
".",
"getClass",
"(",
")",
".",
"equals",
"(",
"dist2",
".",
"getCl... | Use a log-likelihood ratio test to compare two distributions.
With non-linear histograms that have compatible bin boundaries,
all that we have to do is compare two count vectors using a
chi^2 test (actually a log-likelihood ratio version called a G-test).
@param dist1 First distribution (usually the reference)
@param ... | [
"Use",
"a",
"log",
"-",
"likelihood",
"ratio",
"test",
"to",
"compare",
"two",
"distributions",
".",
"With",
"non",
"-",
"linear",
"histograms",
"that",
"have",
"compatible",
"bin",
"boundaries",
"all",
"that",
"we",
"have",
"to",
"do",
"is",
"compare",
"t... | train | https://github.com/tdunning/t-digest/blob/0820b016fefc1f66fe3b089cec9b4ba220da4ef1/core/src/main/java/com/tdunning/math/stats/Comparison.java#L89-L112 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSymmetryDetector.java | QuatSymmetryDetector.calcGlobalSymmetry | public static QuatSymmetryResults calcGlobalSymmetry(Structure structure,
QuatSymmetryParameters symmParams,
SubunitClustererParameters clusterParams) {
"""
Calculate GLOBAL symmetry results. This means that all {@link Subunit}
are included in the symmetry.
@param structure
protein chains will be extrac... | java | public static QuatSymmetryResults calcGlobalSymmetry(Structure structure,
QuatSymmetryParameters symmParams,
SubunitClustererParameters clusterParams) {
Stoichiometry composition = SubunitClusterer.cluster(structure, clusterParams);
return calcGlobalSymmetry(composition, symmParams);
} | [
"public",
"static",
"QuatSymmetryResults",
"calcGlobalSymmetry",
"(",
"Structure",
"structure",
",",
"QuatSymmetryParameters",
"symmParams",
",",
"SubunitClustererParameters",
"clusterParams",
")",
"{",
"Stoichiometry",
"composition",
"=",
"SubunitClusterer",
".",
"cluster",
... | Calculate GLOBAL symmetry results. This means that all {@link Subunit}
are included in the symmetry.
@param structure
protein chains will be extracted as {@link Subunit}
@param symmParams
quaternary symmetry parameters
@param clusterParams
subunit clustering parameters
@return GLOBAL quaternary structure symmetry resu... | [
"Calculate",
"GLOBAL",
"symmetry",
"results",
".",
"This",
"means",
"that",
"all",
"{",
"@link",
"Subunit",
"}",
"are",
"included",
"in",
"the",
"symmetry",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/QuatSymmetryDetector.java#L88-L93 |
jbundle/jbundle | model/base/src/main/java/org/jbundle/model/util/Util.java | Util.convertClassName | public static String convertClassName(String className, String stringToInsert, int location) {
"""
Convert this class name by inserting this package after the domain.
ie., if location = 2, com.xyz.abc.ClassName -> com.xyz.newpackage.abc.ClassName.
@param className
@param package location (positive = from left, ... | java | public static String convertClassName(String className, String stringToInsert, int location)
{
int startSeq = 0;
if (location >= 0)
{
for (int i = 0; i < location; i++)
{
startSeq = className.indexOf('.', startSeq + 1);
}
}
else
... | [
"public",
"static",
"String",
"convertClassName",
"(",
"String",
"className",
",",
"String",
"stringToInsert",
",",
"int",
"location",
")",
"{",
"int",
"startSeq",
"=",
"0",
";",
"if",
"(",
"location",
">=",
"0",
")",
"{",
"for",
"(",
"int",
"i",
"=",
... | Convert this class name by inserting this package after the domain.
ie., if location = 2, com.xyz.abc.ClassName -> com.xyz.newpackage.abc.ClassName.
@param className
@param package location (positive = from left, negative = from right; 0 = before package, -1 = before class name, etc.)
@param stringToInsert
@return Conv... | [
"Convert",
"this",
"class",
"name",
"by",
"inserting",
"this",
"package",
"after",
"the",
"domain",
".",
"ie",
".",
"if",
"location",
"=",
"2",
"com",
".",
"xyz",
".",
"abc",
".",
"ClassName",
"-",
">",
"com",
".",
"xyz",
".",
"newpackage",
".",
"abc... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/model/base/src/main/java/org/jbundle/model/util/Util.java#L469-L494 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.assertTableExistsOnCassandraKeyspace | @Then("^a Cassandra keyspace '(.+?)' contains a table '(.+?)'$")
public void assertTableExistsOnCassandraKeyspace(String keyspace, String tableName) {
"""
Checks if a cassandra keyspace contains a table.
@param keyspace
@param tableName
"""
assertThat(commonspec.getCassandraClient().getTables(k... | java | @Then("^a Cassandra keyspace '(.+?)' contains a table '(.+?)'$")
public void assertTableExistsOnCassandraKeyspace(String keyspace, String tableName) {
assertThat(commonspec.getCassandraClient().getTables(keyspace)).as("The table " + tableName + "exists on cassandra").contains(tableName);
} | [
"@",
"Then",
"(",
"\"^a Cassandra keyspace '(.+?)' contains a table '(.+?)'$\"",
")",
"public",
"void",
"assertTableExistsOnCassandraKeyspace",
"(",
"String",
"keyspace",
",",
"String",
"tableName",
")",
"{",
"assertThat",
"(",
"commonspec",
".",
"getCassandraClient",
"(",
... | Checks if a cassandra keyspace contains a table.
@param keyspace
@param tableName | [
"Checks",
"if",
"a",
"cassandra",
"keyspace",
"contains",
"a",
"table",
"."
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L657-L660 |
ow2-chameleon/fuchsia | importers/zwave/src/main/java/org/ow2/chameleon/fuchsia/importer/zwave/internal/protocol/ZWaveController.java | ZWaveController.sendValue | public void sendValue(int nodeId, int endpoint, int value) {
"""
Send value to node.
@param nodeId the node Id to send the value to.
@param endpoint the endpoint to send the value to.
@param value the value to send
"""
ZWaveNode node = this.getNode(nodeId);
ZWaveSetCommands zwaveCommandClass = null;
S... | java | public void sendValue(int nodeId, int endpoint, int value) {
ZWaveNode node = this.getNode(nodeId);
ZWaveSetCommands zwaveCommandClass = null;
SerialMessage serialMessage = null;
for (ZWaveCommandClass.CommandClass commandClass : new ZWaveCommandClass.CommandClass[] { ZWaveCommandClass.CommandClass.SWITCH_MU... | [
"public",
"void",
"sendValue",
"(",
"int",
"nodeId",
",",
"int",
"endpoint",
",",
"int",
"value",
")",
"{",
"ZWaveNode",
"node",
"=",
"this",
".",
"getNode",
"(",
"nodeId",
")",
";",
"ZWaveSetCommands",
"zwaveCommandClass",
"=",
"null",
";",
"SerialMessage",... | Send value to node.
@param nodeId the node Id to send the value to.
@param endpoint the endpoint to send the value to.
@param value the value to send | [
"Send",
"value",
"to",
"node",
"."
] | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/importers/zwave/src/main/java/org/ow2/chameleon/fuchsia/importer/zwave/internal/protocol/ZWaveController.java#L1000-L1024 |
opencb/java-common-libs | commons-datastore/commons-datastore-solr/src/main/java/org/opencb/commons/datastore/solr/SolrFacetToFacetQueryResultItemConverter.java | SolrFacetToFacetQueryResultItemConverter.getBucketCount | private static int getBucketCount(SimpleOrderedMap<Object> solrFacets, int defaultCount) {
"""
In order to process type=query facets with a nested type=range.
@param solrFacets Solr facet
@param defaultCount Default count
@return Actual count
"""
List<SimpleOrderedMap<Object>> solrBuckets = (... | java | private static int getBucketCount(SimpleOrderedMap<Object> solrFacets, int defaultCount) {
List<SimpleOrderedMap<Object>> solrBuckets = (List<SimpleOrderedMap<Object>>) solrFacets.get("buckets");
if (solrBuckets == null) {
for (int i = 0; i < solrFacets.size(); i++) {
if (sol... | [
"private",
"static",
"int",
"getBucketCount",
"(",
"SimpleOrderedMap",
"<",
"Object",
">",
"solrFacets",
",",
"int",
"defaultCount",
")",
"{",
"List",
"<",
"SimpleOrderedMap",
"<",
"Object",
">>",
"solrBuckets",
"=",
"(",
"List",
"<",
"SimpleOrderedMap",
"<",
... | In order to process type=query facets with a nested type=range.
@param solrFacets Solr facet
@param defaultCount Default count
@return Actual count | [
"In",
"order",
"to",
"process",
"type",
"=",
"query",
"facets",
"with",
"a",
"nested",
"type",
"=",
"range",
"."
] | train | https://github.com/opencb/java-common-libs/blob/5c97682530d0be55828e1e4e374ff01fceb5f198/commons-datastore/commons-datastore-solr/src/main/java/org/opencb/commons/datastore/solr/SolrFacetToFacetQueryResultItemConverter.java#L70-L80 |
datasift/datasift-java | src/main/java/com/datasift/client/managedsource/DataSiftManagedSource.java | DataSiftManagedSource.get | public FutureData<ManagedSource> get(String id) {
"""
/*
@param id the ID of the managed source to fetch
@return the managed source for the ID provided
"""
FutureData<ManagedSource> future = new FutureData<>();
URI uri = newParams().put("id", id).forURL(config.newAPIEndpointURI(GET));
... | java | public FutureData<ManagedSource> get(String id) {
FutureData<ManagedSource> future = new FutureData<>();
URI uri = newParams().put("id", id).forURL(config.newAPIEndpointURI(GET));
Request request = config.http().
GET(uri, new PageReader(newRequestCallback(future, new ManagedSourc... | [
"public",
"FutureData",
"<",
"ManagedSource",
">",
"get",
"(",
"String",
"id",
")",
"{",
"FutureData",
"<",
"ManagedSource",
">",
"future",
"=",
"new",
"FutureData",
"<>",
"(",
")",
";",
"URI",
"uri",
"=",
"newParams",
"(",
")",
".",
"put",
"(",
"\"id\... | /*
@param id the ID of the managed source to fetch
@return the managed source for the ID provided | [
"/",
"*"
] | train | https://github.com/datasift/datasift-java/blob/09de124f2a1a507ff6181e59875c6f325290850e/src/main/java/com/datasift/client/managedsource/DataSiftManagedSource.java#L313-L320 |
dnsjava/dnsjava | org/xbill/DNS/Cache.java | Cache.addNegative | public synchronized void
addNegative(Name name, int type, SOARecord soa, int cred) {
"""
Adds a negative entry to the Cache.
@param name The name of the negative entry
@param type The type of the negative entry
@param soa The SOA record to add to the negative cache entry, or null.
The negative cache ttl is der... | java | public synchronized void
addNegative(Name name, int type, SOARecord soa, int cred) {
long ttl = 0;
if (soa != null)
ttl = soa.getTTL();
Element element = findElement(name, type, 0);
if (ttl == 0) {
if (element != null && element.compareCredibility(cred) <= 0)
removeElement(name, type);
} else {
if (elemen... | [
"public",
"synchronized",
"void",
"addNegative",
"(",
"Name",
"name",
",",
"int",
"type",
",",
"SOARecord",
"soa",
",",
"int",
"cred",
")",
"{",
"long",
"ttl",
"=",
"0",
";",
"if",
"(",
"soa",
"!=",
"null",
")",
"ttl",
"=",
"soa",
".",
"getTTL",
"(... | Adds a negative entry to the Cache.
@param name The name of the negative entry
@param type The type of the negative entry
@param soa The SOA record to add to the negative cache entry, or null.
The negative cache ttl is derived from the SOA.
@param cred The credibility of the negative entry | [
"Adds",
"a",
"negative",
"entry",
"to",
"the",
"Cache",
"."
] | train | https://github.com/dnsjava/dnsjava/blob/d97b6a0685d59143372bb392ab591dd8dd840b61/org/xbill/DNS/Cache.java#L381-L398 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java | EscapedFunctions2.sqllog | public static void sqllog(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
"""
log to ln translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens
"""
singleArgumentFunctionCall(buf, "ln(", "log", parse... | java | public static void sqllog(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
singleArgumentFunctionCall(buf, "ln(", "log", parsedArgs);
} | [
"public",
"static",
"void",
"sqllog",
"(",
"StringBuilder",
"buf",
",",
"List",
"<",
"?",
"extends",
"CharSequence",
">",
"parsedArgs",
")",
"throws",
"SQLException",
"{",
"singleArgumentFunctionCall",
"(",
"buf",
",",
"\"ln(\"",
",",
"\"log\"",
",",
"parsedArgs... | log to ln translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens | [
"log",
"to",
"ln",
"translation"
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L98-L100 |
greenjoe/sergeants | src/main/java/pl/joegreen/sergeants/framework/queue/QueueConfiguration.java | QueueConfiguration.customGame | public static QueueConfiguration customGame(boolean force, String gameId, int team) {
"""
Joins custom game.
@param force indicates if player should vote for "force start"
@param gameId identifier of the game to join (displayed in browser URL when starting custom game)
@param team number of team that bot will j... | java | public static QueueConfiguration customGame(boolean force, String gameId, int team) {
return new CustomGameQueueConfiguration(force, gameId, team);
} | [
"public",
"static",
"QueueConfiguration",
"customGame",
"(",
"boolean",
"force",
",",
"String",
"gameId",
",",
"int",
"team",
")",
"{",
"return",
"new",
"CustomGameQueueConfiguration",
"(",
"force",
",",
"gameId",
",",
"team",
")",
";",
"}"
] | Joins custom game.
@param force indicates if player should vote for "force start"
@param gameId identifier of the game to join (displayed in browser URL when starting custom game)
@param team number of team that bot will join in the custom game | [
"Joins",
"custom",
"game",
"."
] | train | https://github.com/greenjoe/sergeants/blob/db624bcea8597843210f138b82bc4a26b3ec92ca/src/main/java/pl/joegreen/sergeants/framework/queue/QueueConfiguration.java#L52-L54 |
mbrade/prefixedproperties | pp-spring/src/main/java/net/sf/prefixedproperties/spring/PrefixedPropertiesPersister.java | PrefixedPropertiesPersister.loadFromJson | public void loadFromJson(final Properties props, final Reader rd) throws IOException {
"""
Load from json.
@param props
the props
@param rd
the rd
@throws IOException
Signals that an I/O exception has occurred.
"""
try {
((PrefixedProperties) props).loadFromJSON(rd);
} catch (final NoSuchMethodE... | java | public void loadFromJson(final Properties props, final Reader rd) throws IOException {
try {
((PrefixedProperties) props).loadFromJSON(rd);
} catch (final NoSuchMethodError err) {
throw new IOException(
"Cannot load properties JSON file - not using PrefixedProperties: " + err.getMessage());
}
} | [
"public",
"void",
"loadFromJson",
"(",
"final",
"Properties",
"props",
",",
"final",
"Reader",
"rd",
")",
"throws",
"IOException",
"{",
"try",
"{",
"(",
"(",
"PrefixedProperties",
")",
"props",
")",
".",
"loadFromJSON",
"(",
"rd",
")",
";",
"}",
"catch",
... | Load from json.
@param props
the props
@param rd
the rd
@throws IOException
Signals that an I/O exception has occurred. | [
"Load",
"from",
"json",
"."
] | train | https://github.com/mbrade/prefixedproperties/blob/ac430409ea37e244158002b3cf1504417835a0b2/pp-spring/src/main/java/net/sf/prefixedproperties/spring/PrefixedPropertiesPersister.java#L72-L79 |
Cleveroad/AdaptiveTableLayout | library/src/main/java/com/cleveroad/adaptivetablelayout/AdaptiveTableLayout.java | AdaptiveTableLayout.setDraggingToRow | @SuppressWarnings("unused")
private void setDraggingToRow(int row, boolean isDragging) {
"""
Method set dragging flag to all view holders in the specific row
@param row specific row
@param isDragging flag to set
"""
Collection<ViewHolder> holders = mViewHolders.getRowItems(row);
... | java | @SuppressWarnings("unused")
private void setDraggingToRow(int row, boolean isDragging) {
Collection<ViewHolder> holders = mViewHolders.getRowItems(row);
for (ViewHolder holder : holders) {
holder.setIsDragging(isDragging);
}
ViewHolder holder = mHeaderRowViewHolders.get(... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"private",
"void",
"setDraggingToRow",
"(",
"int",
"row",
",",
"boolean",
"isDragging",
")",
"{",
"Collection",
"<",
"ViewHolder",
">",
"holders",
"=",
"mViewHolders",
".",
"getRowItems",
"(",
"row",
")",
";",
... | Method set dragging flag to all view holders in the specific row
@param row specific row
@param isDragging flag to set | [
"Method",
"set",
"dragging",
"flag",
"to",
"all",
"view",
"holders",
"in",
"the",
"specific",
"row"
] | train | https://github.com/Cleveroad/AdaptiveTableLayout/blob/188213b35e05e635497b03fe741799782dde7208/library/src/main/java/com/cleveroad/adaptivetablelayout/AdaptiveTableLayout.java#L1489-L1500 |
pressgang-ccms/PressGangCCMSContentSpecProcessor | src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecProcessor.java | ContentSpecProcessor.doesLevelMatch | protected boolean doesLevelMatch(final Level level, final CSNodeWrapper node, boolean matchContent) {
"""
Checks to see if a ContentSpec level matches a Content Spec Entity level.
@param level The ContentSpec level object.
@param node The Content Spec Entity level.
@param matchContent If the le... | java | protected boolean doesLevelMatch(final Level level, final CSNodeWrapper node, boolean matchContent) {
if (!EntityUtilities.isNodeALevel(node)) return false;
// If the unique id is not from the parser, than use the unique id to compare
if (level.getUniqueId() != null && level.getUniqueId().match... | [
"protected",
"boolean",
"doesLevelMatch",
"(",
"final",
"Level",
"level",
",",
"final",
"CSNodeWrapper",
"node",
",",
"boolean",
"matchContent",
")",
"{",
"if",
"(",
"!",
"EntityUtilities",
".",
"isNodeALevel",
"(",
"node",
")",
")",
"return",
"false",
";",
... | Checks to see if a ContentSpec level matches a Content Spec Entity level.
@param level The ContentSpec level object.
@param node The Content Spec Entity level.
@param matchContent If the level title has to match exactly, otherwise it should match to a reasonable extent.
@return True if the level is dete... | [
"Checks",
"to",
"see",
"if",
"a",
"ContentSpec",
"level",
"matches",
"a",
"Content",
"Spec",
"Entity",
"level",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecProcessor.java#L2072-L2094 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.beginPerformMaintenanceAsync | public Observable<OperationStatusResponseInner> beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName) {
"""
Perform maintenance on one or more virtual machines in a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.... | java | public Observable<OperationStatusResponseInner> beginPerformMaintenanceAsync(String resourceGroupName, String vmScaleSetName) {
return beginPerformMaintenanceWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1<ServiceResponse<OperationStatusResponseInner>, OperationStatusResponseInner>() {... | [
"public",
"Observable",
"<",
"OperationStatusResponseInner",
">",
"beginPerformMaintenanceAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
")",
"{",
"return",
"beginPerformMaintenanceWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmScaleS... | Perform maintenance on one or more virtual machines in a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the OperationStatusResponseInner object | [
"Perform",
"maintenance",
"on",
"one",
"or",
"more",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetsInner.java#L3368-L3375 |
netplex/json-smart-v2 | accessors-smart/src/main/java/net/minidev/asm/ASMUtil.java | ASMUtil.autoBoxing | public static void autoBoxing(MethodVisitor mv, Class<?> clz) {
"""
Append the call of proper autoboxing method for the given primitif type.
"""
autoBoxing(mv, Type.getType(clz));
} | java | public static void autoBoxing(MethodVisitor mv, Class<?> clz) {
autoBoxing(mv, Type.getType(clz));
} | [
"public",
"static",
"void",
"autoBoxing",
"(",
"MethodVisitor",
"mv",
",",
"Class",
"<",
"?",
">",
"clz",
")",
"{",
"autoBoxing",
"(",
"mv",
",",
"Type",
".",
"getType",
"(",
"clz",
")",
")",
";",
"}"
] | Append the call of proper autoboxing method for the given primitif type. | [
"Append",
"the",
"call",
"of",
"proper",
"autoboxing",
"method",
"for",
"the",
"given",
"primitif",
"type",
"."
] | train | https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/accessors-smart/src/main/java/net/minidev/asm/ASMUtil.java#L38-L40 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/document/json/JsonObject.java | JsonObject.getAndDecryptNumber | public Number getAndDecryptNumber(String name, String providerName) throws Exception {
"""
Retrieves the decrypted value from the field name and casts it to {@link Number}.
Note: Use of the Field Level Encryption functionality provided in the
com.couchbase.client.encryption namespace provided by Couchbase is
... | java | public Number getAndDecryptNumber(String name, String providerName) throws Exception {
return (Number) getAndDecrypt(name, providerName);
} | [
"public",
"Number",
"getAndDecryptNumber",
"(",
"String",
"name",
",",
"String",
"providerName",
")",
"throws",
"Exception",
"{",
"return",
"(",
"Number",
")",
"getAndDecrypt",
"(",
"name",
",",
"providerName",
")",
";",
"}"
] | Retrieves the decrypted value from the field name and casts it to {@link Number}.
Note: Use of the Field Level Encryption functionality provided in the
com.couchbase.client.encryption namespace provided by Couchbase is
subject to the Couchbase Inc. Enterprise Subscription License Agreement
at https://www.couchbase.com... | [
"Retrieves",
"the",
"decrypted",
"value",
"from",
"the",
"field",
"name",
"and",
"casts",
"it",
"to",
"{",
"@link",
"Number",
"}",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/document/json/JsonObject.java#L976-L978 |
alkacon/opencms-core | src/org/opencms/main/CmsShellCommands.java | CmsShellCommands.exportResources | public void exportResources(String exportFile, String pathList, boolean isReducedExportMode) throws Exception {
"""
Exports a list of resources from the current site root to a ZIP file.<p>
The resource names in the list must be separated with a ";".<p>
@param exportFile the name (absolute path) of the ZIP fi... | java | public void exportResources(String exportFile, String pathList, boolean isReducedExportMode) throws Exception {
StringTokenizer tok = new StringTokenizer(pathList, ";");
List<String> exportPaths = new ArrayList<String>();
while (tok.hasMoreTokens()) {
exportPaths.add(tok.nextToken()... | [
"public",
"void",
"exportResources",
"(",
"String",
"exportFile",
",",
"String",
"pathList",
",",
"boolean",
"isReducedExportMode",
")",
"throws",
"Exception",
"{",
"StringTokenizer",
"tok",
"=",
"new",
"StringTokenizer",
"(",
"pathList",
",",
"\";\"",
")",
";",
... | Exports a list of resources from the current site root to a ZIP file.<p>
The resource names in the list must be separated with a ";".<p>
@param exportFile the name (absolute path) of the ZIP file to export to
@param pathList the list of resource to export, separated with a ";"
@param isReducedExportMode flag, indicat... | [
"Exports",
"a",
"list",
"of",
"resources",
"from",
"the",
"current",
"site",
"root",
"to",
"a",
"ZIP",
"file",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsShellCommands.java#L679-L712 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/CollisionCategoryConfig.java | CollisionCategoryConfig.imports | public static CollisionCategory imports(Xml root, MapTileCollision map) {
"""
Create the category data from node.
@param root The root reference (must not be <code>null</code>).
@param map The map reference (must not be <code>null</code>).
@return The category node instance.
@throws LionEngineException If un... | java | public static CollisionCategory imports(Xml root, MapTileCollision map)
{
Check.notNull(root);
Check.notNull(map);
final Collection<Xml> children = root.getChildren(TileGroupsConfig.NODE_GROUP);
final Collection<CollisionGroup> groups = new ArrayList<>(children.size());
... | [
"public",
"static",
"CollisionCategory",
"imports",
"(",
"Xml",
"root",
",",
"MapTileCollision",
"map",
")",
"{",
"Check",
".",
"notNull",
"(",
"root",
")",
";",
"Check",
".",
"notNull",
"(",
"map",
")",
";",
"final",
"Collection",
"<",
"Xml",
">",
"chil... | Create the category data from node.
@param root The root reference (must not be <code>null</code>).
@param map The map reference (must not be <code>null</code>).
@return The category node instance.
@throws LionEngineException If unable to read node. | [
"Create",
"the",
"category",
"data",
"from",
"node",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/CollisionCategoryConfig.java#L127-L159 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/JdbcAccessImpl.java | JdbcAccessImpl.executeDelete | public void executeDelete(Query query, ClassDescriptor cld) throws PersistenceBrokerException {
"""
Performs a DELETE operation based on the given {@link Query} against RDBMS.
@param query the query string.
@param cld ClassDescriptor providing JDBC information.
"""
if (logger.isDebugEnabled())
... | java | public void executeDelete(Query query, ClassDescriptor cld) throws PersistenceBrokerException
{
if (logger.isDebugEnabled())
{
logger.debug("executeDelete (by Query): " + query);
}
final StatementManagerIF sm = broker.serviceStatementManager();
PreparedStat... | [
"public",
"void",
"executeDelete",
"(",
"Query",
"query",
",",
"ClassDescriptor",
"cld",
")",
"throws",
"PersistenceBrokerException",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"\"executeDelete (by Query): \""... | Performs a DELETE operation based on the given {@link Query} against RDBMS.
@param query the query string.
@param cld ClassDescriptor providing JDBC information. | [
"Performs",
"a",
"DELETE",
"operation",
"based",
"on",
"the",
"given",
"{"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/JdbcAccessImpl.java#L165-L193 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsQueueConnectionImpl.java | JmsQueueConnectionImpl.instantiateSession | JmsSessionImpl instantiateSession(boolean transacted, int acknowledgeMode, SICoreConnection coreConnection, JmsJcaSession jcaSession) throws JMSException {
"""
This method overrides a superclass method, so that the superclass's
createSession() method can be inherited, but still return an object of
this class's t... | java | JmsSessionImpl instantiateSession(boolean transacted, int acknowledgeMode, SICoreConnection coreConnection, JmsJcaSession jcaSession) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "instantiateSession", new Object[]{transacted, acknowledgeMode, coreConne... | [
"JmsSessionImpl",
"instantiateSession",
"(",
"boolean",
"transacted",
",",
"int",
"acknowledgeMode",
",",
"SICoreConnection",
"coreConnection",
",",
"JmsJcaSession",
"jcaSession",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",... | This method overrides a superclass method, so that the superclass's
createSession() method can be inherited, but still return an object of
this class's type. | [
"This",
"method",
"overrides",
"a",
"superclass",
"method",
"so",
"that",
"the",
"superclass",
"s",
"createSession",
"()",
"method",
"can",
"be",
"inherited",
"but",
"still",
"return",
"an",
"object",
"of",
"this",
"class",
"s",
"type",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsQueueConnectionImpl.java#L105-L110 |
julienledem/brennus | brennus-builder/src/main/java/brennus/ClassBuilder.java | ClassBuilder.startStaticMethod | public MethodDeclarationBuilder startStaticMethod(Protection protection, Type returnType, String methodName) {
"""
.startStaticMethod(protection, return, name){statements}.endMethod()
@param protection public/package/protected/private
@param returnType
@param methodName
@return a MethodDeclarationBuilder
... | java | public MethodDeclarationBuilder startStaticMethod(Protection protection, Type returnType, String methodName) {
return startMethod(protection, returnType, methodName, true);
} | [
"public",
"MethodDeclarationBuilder",
"startStaticMethod",
"(",
"Protection",
"protection",
",",
"Type",
"returnType",
",",
"String",
"methodName",
")",
"{",
"return",
"startMethod",
"(",
"protection",
",",
"returnType",
",",
"methodName",
",",
"true",
")",
";",
"... | .startStaticMethod(protection, return, name){statements}.endMethod()
@param protection public/package/protected/private
@param returnType
@param methodName
@return a MethodDeclarationBuilder | [
".",
"startStaticMethod",
"(",
"protection",
"return",
"name",
")",
"{",
"statements",
"}",
".",
"endMethod",
"()"
] | train | https://github.com/julienledem/brennus/blob/0798fb565d95af19ddc5accd084e58c4e882dbd0/brennus-builder/src/main/java/brennus/ClassBuilder.java#L104-L106 |
rsqn/useful-things | application-utilities/src/main/java/tech/rsqn/useful/things/encryption/RSAEncryptionTool.java | RSAEncryptionTool.fetchRemoteIfNecessary | private String fetchRemoteIfNecessary(String s) {
"""
review - remove the need for a keys dir - keep keys in memory
"""
if (s.startsWith("s3")) {
String[] bucketAndKey = parseBucketKeyAndFileName(s);
String bucket = bucketAndKey[0];
String key = bucketAndKey[1];
... | java | private String fetchRemoteIfNecessary(String s) {
if (s.startsWith("s3")) {
String[] bucketAndKey = parseBucketKeyAndFileName(s);
String bucket = bucketAndKey[0];
String key = bucketAndKey[1];
String fileName = bucketAndKey[2];
log.info("KeyTool - fet... | [
"private",
"String",
"fetchRemoteIfNecessary",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"s",
".",
"startsWith",
"(",
"\"s3\"",
")",
")",
"{",
"String",
"[",
"]",
"bucketAndKey",
"=",
"parseBucketKeyAndFileName",
"(",
"s",
")",
";",
"String",
"bucket",
"=",... | review - remove the need for a keys dir - keep keys in memory | [
"review",
"-",
"remove",
"the",
"need",
"for",
"a",
"keys",
"dir",
"-",
"keep",
"keys",
"in",
"memory"
] | train | https://github.com/rsqn/useful-things/blob/a21e6a9e07b97b0c239ff57a8efcb7385f645558/application-utilities/src/main/java/tech/rsqn/useful/things/encryption/RSAEncryptionTool.java#L171-L211 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/CommandExecutionSpec.java | CommandExecutionSpec.executeCommand | @Given("^I run '(.+?)' in the ssh connection( with exit status '(.+?)')?( and save the value in environment variable '(.+?)')?$")
public void executeCommand(String command, String foo, Integer exitStatus, String bar, String envVar) throws Exception {
"""
Executes the command specified in remote system
@para... | java | @Given("^I run '(.+?)' in the ssh connection( with exit status '(.+?)')?( and save the value in environment variable '(.+?)')?$")
public void executeCommand(String command, String foo, Integer exitStatus, String bar, String envVar) throws Exception {
if (exitStatus == null) {
exitStatus = 0;
... | [
"@",
"Given",
"(",
"\"^I run '(.+?)' in the ssh connection( with exit status '(.+?)')?( and save the value in environment variable '(.+?)')?$\"",
")",
"public",
"void",
"executeCommand",
"(",
"String",
"command",
",",
"String",
"foo",
",",
"Integer",
"exitStatus",
",",
"String",
... | Executes the command specified in remote system
@param command command to be run locally
@param foo regex needed to match method
@param exitStatus command exit status
@param bar regex needed to match method
@param envVar environment variable name
@throws Exception exception | [
"Executes",
"the",
"command",
"specified",
"in",
"remote",
"system"
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommandExecutionSpec.java#L129-L138 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java | EnvironmentSettingsInner.update | public EnvironmentSettingInner update(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, EnvironmentSettingFragment environmentSetting) {
"""
Modify properties of environment setting.
@param resourceGroupName The name of the resource group.
@param labAccountName The... | java | public EnvironmentSettingInner update(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, EnvironmentSettingFragment environmentSetting) {
return updateWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, environmentSetting).toB... | [
"public",
"EnvironmentSettingInner",
"update",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"labName",
",",
"String",
"environmentSettingName",
",",
"EnvironmentSettingFragment",
"environmentSetting",
")",
"{",
"return",
"updateWithSer... | Modify properties of environment setting.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@param environmentSettingName The name of the environment Setting.
@param environmentSetting Represents settings of an environment, f... | [
"Modify",
"properties",
"of",
"environment",
"setting",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java#L998-L1000 |
defei/codelogger-utils | src/main/java/org/codelogger/utils/ClassUtils.java | ClassUtils.instantiateClass | public static <T> T instantiateClass(final Class<T> clazz, final Class<?>[] parameterTypes,
final Object[] parameterValues) throws BeanInstantiationException {
"""
Create and initialize a new instance of the given class by given
parameterTypes and parameterValues.
@param clazz can not be null.
@param para... | java | public static <T> T instantiateClass(final Class<T> clazz, final Class<?>[] parameterTypes,
final Object[] parameterValues) throws BeanInstantiationException {
if (clazz.isInterface()) {
throw new BeanInstantiationException(clazz, CLASS_IS_INTERFACE);
}
try {
Constructor<T> constructor = cl... | [
"public",
"static",
"<",
"T",
">",
"T",
"instantiateClass",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
",",
"final",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
",",
"final",
"Object",
"[",
"]",
"parameterValues",
")",
"throws",
"BeanInstanti... | Create and initialize a new instance of the given class by given
parameterTypes and parameterValues.
@param clazz can not be null.
@param parameterTypes constructor parameters class type array.
@param parameterValues constructor parameters value array.
@return a newly allocated instance of the class represented by thi... | [
"Create",
"and",
"initialize",
"a",
"new",
"instance",
"of",
"the",
"given",
"class",
"by",
"given",
"parameterTypes",
"and",
"parameterValues",
"."
] | train | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/ClassUtils.java#L198-L211 |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/RepositoryResolver.java | RepositoryResolver.findResolvedDependency | ResolvedFeatureSearchResult findResolvedDependency(FeatureResource featureResource) {
"""
Find the actual resolved feature from a dependency with tolerates
<p>
Tries each of the tolerated versions in order until it finds one that exists in the set of resolved features.
<p>
Three types of results are possible:
... | java | ResolvedFeatureSearchResult findResolvedDependency(FeatureResource featureResource) {
ProvisioningFeatureDefinition feature = resolvedFeatures.get(featureResource.getSymbolicName());
if (feature != null) {
return new ResolvedFeatureSearchResult(ResultCategory.FOUND, feature.getSymbolicName()... | [
"ResolvedFeatureSearchResult",
"findResolvedDependency",
"(",
"FeatureResource",
"featureResource",
")",
"{",
"ProvisioningFeatureDefinition",
"feature",
"=",
"resolvedFeatures",
".",
"get",
"(",
"featureResource",
".",
"getSymbolicName",
"(",
")",
")",
";",
"if",
"(",
... | Find the actual resolved feature from a dependency with tolerates
<p>
Tries each of the tolerated versions in order until it finds one that exists in the set of resolved features.
<p>
Three types of results are possible:
<ul>
<li><b>FOUND</b>: We found the required feature</li>
<li><b>FOUND_WRONG_PRODUCT</b>: We found ... | [
"Find",
"the",
"actual",
"resolved",
"feature",
"from",
"a",
"dependency",
"with",
"tolerates",
"<p",
">",
"Tries",
"each",
"of",
"the",
"tolerated",
"versions",
"in",
"order",
"until",
"it",
"finds",
"one",
"that",
"exists",
"in",
"the",
"set",
"of",
"res... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/RepositoryResolver.java#L703-L728 |
google/closure-templates | java/src/com/google/template/soy/basetree/CopyState.java | CopyState.updateRefs | public <T> void updateRefs(T oldObject, T newObject) {
"""
Registers that the old object has been remapped to the new object.
<p>This is useful for auxiliary AST datastructures which may contain back-edges in the AST.
When being copied, the auxiliary data structure is registered with this method then AST nodes... | java | public <T> void updateRefs(T oldObject, T newObject) {
checkNotNull(oldObject);
checkNotNull(newObject);
checkArgument(!(newObject instanceof Listener));
Object previousMapping = mappings.put(oldObject, newObject);
if (previousMapping != null) {
if (previousMapping instanceof Listener) {
... | [
"public",
"<",
"T",
">",
"void",
"updateRefs",
"(",
"T",
"oldObject",
",",
"T",
"newObject",
")",
"{",
"checkNotNull",
"(",
"oldObject",
")",
";",
"checkNotNull",
"(",
"newObject",
")",
";",
"checkArgument",
"(",
"!",
"(",
"newObject",
"instanceof",
"Liste... | Registers that the old object has been remapped to the new object.
<p>This is useful for auxiliary AST datastructures which may contain back-edges in the AST.
When being copied, the auxiliary data structure is registered with this method then AST nodes
which have references to the old copy can register via {@link #reg... | [
"Registers",
"that",
"the",
"old",
"object",
"has",
"been",
"remapped",
"to",
"the",
"new",
"object",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/basetree/CopyState.java#L54-L68 |
carewebframework/carewebframework-vista | org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/BrokerSession.java | BrokerSession.onRPCError | protected void onRPCError(int asyncHandle, int asyncError, String text) {
"""
Invokes the callback for the specified handle when an error is encountered during an
asynchronous RPC call.
@param asyncHandle The unique handle for the asynchronous RPC call.
@param asyncError The error code.
@param text The error... | java | protected void onRPCError(int asyncHandle, int asyncError, String text) {
IAsyncRPCEvent callback = getCallback(asyncHandle);
if (callback != null) {
callback.onRPCError(asyncHandle, asyncError, text);
}
} | [
"protected",
"void",
"onRPCError",
"(",
"int",
"asyncHandle",
",",
"int",
"asyncError",
",",
"String",
"text",
")",
"{",
"IAsyncRPCEvent",
"callback",
"=",
"getCallback",
"(",
"asyncHandle",
")",
";",
"if",
"(",
"callback",
"!=",
"null",
")",
"{",
"callback"... | Invokes the callback for the specified handle when an error is encountered during an
asynchronous RPC call.
@param asyncHandle The unique handle for the asynchronous RPC call.
@param asyncError The error code.
@param text The error text. | [
"Invokes",
"the",
"callback",
"for",
"the",
"specified",
"handle",
"when",
"an",
"error",
"is",
"encountered",
"during",
"an",
"asynchronous",
"RPC",
"call",
"."
] | train | https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/BrokerSession.java#L666-L672 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/trees/BobChrisTreeNormalizer.java | BobChrisTreeNormalizer.normalizeWholeTree | @Override
public Tree normalizeWholeTree(Tree tree, TreeFactory tf) {
"""
Normalize a whole tree -- one can assume that this is the
root. This implementation deletes empty elements (ones with
nonterminal tag label '-NONE-') from the tree, and splices out
unary A over A nodes. It does work for a null tree.
... | java | @Override
public Tree normalizeWholeTree(Tree tree, TreeFactory tf) {
return tree.prune(emptyFilter, tf).spliceOut(aOverAFilter, tf);
} | [
"@",
"Override",
"public",
"Tree",
"normalizeWholeTree",
"(",
"Tree",
"tree",
",",
"TreeFactory",
"tf",
")",
"{",
"return",
"tree",
".",
"prune",
"(",
"emptyFilter",
",",
"tf",
")",
".",
"spliceOut",
"(",
"aOverAFilter",
",",
"tf",
")",
";",
"}"
] | Normalize a whole tree -- one can assume that this is the
root. This implementation deletes empty elements (ones with
nonterminal tag label '-NONE-') from the tree, and splices out
unary A over A nodes. It does work for a null tree. | [
"Normalize",
"a",
"whole",
"tree",
"--",
"one",
"can",
"assume",
"that",
"this",
"is",
"the",
"root",
".",
"This",
"implementation",
"deletes",
"empty",
"elements",
"(",
"ones",
"with",
"nonterminal",
"tag",
"label",
"-",
"NONE",
"-",
")",
"from",
"the",
... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/BobChrisTreeNormalizer.java#L101-L104 |
ReactiveX/RxNetty | rxnetty-http/src/main/java/io/reactivex/netty/protocol/http/server/HttpServer.java | HttpServer.newServer | public static HttpServer<ByteBuf, ByteBuf> newServer(SocketAddress socketAddress, EventLoopGroup serverGroup,
EventLoopGroup clientGroup,
Class<? extends ServerChannel> channelClass) {
"""
Creates a ne... | java | public static HttpServer<ByteBuf, ByteBuf> newServer(SocketAddress socketAddress, EventLoopGroup serverGroup,
EventLoopGroup clientGroup,
Class<? extends ServerChannel> channelClass) {
return _newSe... | [
"public",
"static",
"HttpServer",
"<",
"ByteBuf",
",",
"ByteBuf",
">",
"newServer",
"(",
"SocketAddress",
"socketAddress",
",",
"EventLoopGroup",
"serverGroup",
",",
"EventLoopGroup",
"clientGroup",
",",
"Class",
"<",
"?",
"extends",
"ServerChannel",
">",
"channelCl... | Creates a new server using the passed port.
@param socketAddress Socket address for the server.
@param serverGroup Eventloop group to be used for server sockets.
@param clientGroup Eventloop group to be used for client sockets.
@param channelClass The class to be used for server channel.
@return A new {@link HttpServ... | [
"Creates",
"a",
"new",
"server",
"using",
"the",
"passed",
"port",
"."
] | train | https://github.com/ReactiveX/RxNetty/blob/a7ca9a9c1d544a79c82f7b17036daf6958bf1cd6/rxnetty-http/src/main/java/io/reactivex/netty/protocol/http/server/HttpServer.java#L436-L440 |
spring-projects/spring-social-twitter | spring-social-twitter/src/main/java/org/springframework/social/twitter/api/AbstractStreamParameters.java | AbstractStreamParameters.addLocation | public AbstractStreamParameters addLocation(float west, float south, float east, float north) {
"""
Add a location to the filter
Does not replace any existing locations in the filter.
@param west the longitude of the western side of the location's bounding box.
@param south the latitude of the southern side of ... | java | public AbstractStreamParameters addLocation(float west, float south, float east, float north) {
if (locations.length() > 0) {
locations.append(',');
}
locations.append(west).append(',').append(south).append(',');
locations.append(east).append(',').append(north).append(',');
return this;
} | [
"public",
"AbstractStreamParameters",
"addLocation",
"(",
"float",
"west",
",",
"float",
"south",
",",
"float",
"east",
",",
"float",
"north",
")",
"{",
"if",
"(",
"locations",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"locations",
".",
"append",
"(",... | Add a location to the filter
Does not replace any existing locations in the filter.
@param west the longitude of the western side of the location's bounding box.
@param south the latitude of the southern side of the location's bounding box.
@param east the longitude of the eastern side of the location's bounding box.
@... | [
"Add",
"a",
"location",
"to",
"the",
"filter",
"Does",
"not",
"replace",
"any",
"existing",
"locations",
"in",
"the",
"filter",
"."
] | train | https://github.com/spring-projects/spring-social-twitter/blob/5df7b3556d7bdbe7db8d833f30141336b5552178/spring-social-twitter/src/main/java/org/springframework/social/twitter/api/AbstractStreamParameters.java#L61-L68 |
magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/SessionIdFormat.java | SessionIdFormat.createNewSessionId | @Nonnull
public String createNewSessionId( @Nonnull final String sessionId, @Nonnull final String newMemcachedId) {
"""
Change the provided session id (optionally already including a memcachedId) so that it
contains the provided newMemcachedId.
@param sessionId
the session id that may contain a former mem... | java | @Nonnull
public String createNewSessionId( @Nonnull final String sessionId, @Nonnull final String newMemcachedId) {
final int idxDot = sessionId.indexOf( '.' );
if ( idxDot != -1 ) {
final String plainSessionId = sessionId.substring( 0, idxDot );
final String jvmRouteWithDot ... | [
"@",
"Nonnull",
"public",
"String",
"createNewSessionId",
"(",
"@",
"Nonnull",
"final",
"String",
"sessionId",
",",
"@",
"Nonnull",
"final",
"String",
"newMemcachedId",
")",
"{",
"final",
"int",
"idxDot",
"=",
"sessionId",
".",
"indexOf",
"(",
"'",
"'",
")",... | Change the provided session id (optionally already including a memcachedId) so that it
contains the provided newMemcachedId.
@param sessionId
the session id that may contain a former memcachedId.
@param newMemcachedId
the new memcached id.
@return the sessionId which now contains the new memcachedId instead the
former... | [
"Change",
"the",
"provided",
"session",
"id",
"(",
"optionally",
"already",
"including",
"a",
"memcachedId",
")",
"so",
"that",
"it",
"contains",
"the",
"provided",
"newMemcachedId",
"."
] | train | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/SessionIdFormat.java#L98-L109 |
ical4j/ical4j | src/main/java/net/fortuna/ical4j/validate/ParameterValidator.java | ParameterValidator.assertNone | public void assertNone(final String paramName, final ParameterList parameters) throws ValidationException {
"""
Ensure a parameter doesn't occur in the specified list.
@param paramName the name of a parameter
@param parameters a list of parameters
@throws ValidationException thrown when the specified property
... | java | public void assertNone(final String paramName, final ParameterList parameters) throws ValidationException {
if (parameters.getParameter(paramName) != null) {
throw new ValidationException(ASSERT_NONE_MESSAGE, new Object[] {paramName});
}
} | [
"public",
"void",
"assertNone",
"(",
"final",
"String",
"paramName",
",",
"final",
"ParameterList",
"parameters",
")",
"throws",
"ValidationException",
"{",
"if",
"(",
"parameters",
".",
"getParameter",
"(",
"paramName",
")",
"!=",
"null",
")",
"{",
"throw",
"... | Ensure a parameter doesn't occur in the specified list.
@param paramName the name of a parameter
@param parameters a list of parameters
@throws ValidationException thrown when the specified property
is found in the list of properties | [
"Ensure",
"a",
"parameter",
"doesn",
"t",
"occur",
"in",
"the",
"specified",
"list",
"."
] | train | https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/validate/ParameterValidator.java#L106-L110 |
igniterealtime/Smack | smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLight.java | MultiUserChatLight.setRoomConfigs | public void setRoomConfigs(String roomName, HashMap<String, String> customConfigs)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Set the room configurations.
@param roomName
@param customConfigs
@throws NoResponseException
@throws XMPPErrorExcep... | java | public void setRoomConfigs(String roomName, HashMap<String, String> customConfigs)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
MUCLightSetConfigsIQ mucLightSetConfigIQ = new MUCLightSetConfigsIQ(room, roomName, customConfigs);
connection.crea... | [
"public",
"void",
"setRoomConfigs",
"(",
"String",
"roomName",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"customConfigs",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"MUCLigh... | Set the room configurations.
@param roomName
@param customConfigs
@throws NoResponseException
@throws XMPPErrorException
@throws NotConnectedException
@throws InterruptedException | [
"Set",
"the",
"room",
"configurations",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLight.java#L499-L503 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.