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 |
|---|---|---|---|---|---|---|---|---|---|---|
mgormley/pacaya | src/main/java/edu/jhu/pacaya/hypergraph/depparse/HyperDepParser.java | HyperDepParser.insideSingleRootEntropyFoe | public static Pair<O1DpHypergraph, Scores> insideSingleRootEntropyFoe(double[] fracRoot, double[][] fracChild) {
"""
Runs the inside-outside algorithm for dependency parsing.
@param fracRoot Input: The edge weights from the wall to each child.
@param fracChild Input: The edge weights from parent to child.
@re... | java | public static Pair<O1DpHypergraph, Scores> insideSingleRootEntropyFoe(double[] fracRoot, double[][] fracChild) {
final Algebra semiring = LogSignAlgebra.getInstance();
return insideSingleRootEntropyFoe(fracRoot, fracChild, semiring);
} | [
"public",
"static",
"Pair",
"<",
"O1DpHypergraph",
",",
"Scores",
">",
"insideSingleRootEntropyFoe",
"(",
"double",
"[",
"]",
"fracRoot",
",",
"double",
"[",
"]",
"[",
"]",
"fracChild",
")",
"{",
"final",
"Algebra",
"semiring",
"=",
"LogSignAlgebra",
".",
"g... | Runs the inside-outside algorithm for dependency parsing.
@param fracRoot Input: The edge weights from the wall to each child.
@param fracChild Input: The edge weights from parent to child.
@return The parse chart. | [
"Runs",
"the",
"inside",
"-",
"outside",
"algorithm",
"for",
"dependency",
"parsing",
"."
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/hypergraph/depparse/HyperDepParser.java#L120-L123 |
real-logic/agrona | agrona/src/main/java/org/agrona/References.java | References.isReferringTo | public static <T> boolean isReferringTo(final Reference<T> ref, final T obj) {
"""
Indicate whether a Reference refers to a given object.
@param ref The {@link Reference} to be tested.
@param obj The object to which the {@link Reference} may, or may not, be referring.
@param <T> the class of the referent.
@r... | java | public static <T> boolean isReferringTo(final Reference<T> ref, final T obj)
{
return ref.get() == obj;
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"isReferringTo",
"(",
"final",
"Reference",
"<",
"T",
">",
"ref",
",",
"final",
"T",
"obj",
")",
"{",
"return",
"ref",
".",
"get",
"(",
")",
"==",
"obj",
";",
"}"
] | Indicate whether a Reference refers to a given object.
@param ref The {@link Reference} to be tested.
@param obj The object to which the {@link Reference} may, or may not, be referring.
@param <T> the class of the referent.
@return true if the {@link Reference}'s referent is obj, otherwise false. | [
"Indicate",
"whether",
"a",
"Reference",
"refers",
"to",
"a",
"given",
"object",
"."
] | train | https://github.com/real-logic/agrona/blob/d1ea76e6e3598cd6a0d34879687652ef123f639b/agrona/src/main/java/org/agrona/References.java#L70-L73 |
joniles/mpxj | src/main/java/net/sf/mpxj/json/JsonWriter.java | JsonWriter.writeFields | private void writeFields(String objectName, FieldContainer container, FieldType[] fields) throws IOException {
"""
Write a set of fields from a field container to a JSON file.
@param objectName name of the object, or null if no name required
@param container field container
@param fields fields to write
"""... | java | private void writeFields(String objectName, FieldContainer container, FieldType[] fields) throws IOException
{
m_writer.writeStartObject(objectName);
for (FieldType field : fields)
{
Object value = container.getCurrentValue(field);
if (value != null)
{
writeFi... | [
"private",
"void",
"writeFields",
"(",
"String",
"objectName",
",",
"FieldContainer",
"container",
",",
"FieldType",
"[",
"]",
"fields",
")",
"throws",
"IOException",
"{",
"m_writer",
".",
"writeStartObject",
"(",
"objectName",
")",
";",
"for",
"(",
"FieldType",... | Write a set of fields from a field container to a JSON file.
@param objectName name of the object, or null if no name required
@param container field container
@param fields fields to write | [
"Write",
"a",
"set",
"of",
"fields",
"from",
"a",
"field",
"container",
"to",
"a",
"JSON",
"file",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonWriter.java#L255-L267 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/convert/Convert.java | Convert.toDate | public static Date toDate(Object value, Date defaultValue) {
"""
转换为Date<br>
如果给定的值为空,或者转换失败,返回默认值<br>
转换失败不会报错
@param value 被转换的值
@param defaultValue 转换错误时的默认值
@return 结果
@since 4.1.6
"""
return convert(Date.class, value, defaultValue);
} | java | public static Date toDate(Object value, Date defaultValue) {
return convert(Date.class, value, defaultValue);
} | [
"public",
"static",
"Date",
"toDate",
"(",
"Object",
"value",
",",
"Date",
"defaultValue",
")",
"{",
"return",
"convert",
"(",
"Date",
".",
"class",
",",
"value",
",",
"defaultValue",
")",
";",
"}"
] | 转换为Date<br>
如果给定的值为空,或者转换失败,返回默认值<br>
转换失败不会报错
@param value 被转换的值
@param defaultValue 转换错误时的默认值
@return 结果
@since 4.1.6 | [
"转换为Date<br",
">",
"如果给定的值为空,或者转换失败,返回默认值<br",
">",
"转换失败不会报错"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/convert/Convert.java#L447-L449 |
Pi4J/pi4j | pi4j-device/src/main/java/com/pi4j/component/potentiometer/microchip/impl/MicrochipPotentiometerDeviceController.java | MicrochipPotentiometerDeviceController.increase | public void increase(final DeviceControllerChannel channel, final int steps)
throws IOException {
"""
Increments the volatile wiper for the given number steps.
@param channel Which wiper
@param steps The number of steps
@throws IOException Thrown if communication fails or device returned a malformed result... | java | public void increase(final DeviceControllerChannel channel, final int steps)
throws IOException {
if (channel == null) {
throw new RuntimeException("null-channel is not allowed. For devices "
+ "knowing just one wiper Channel.A is mandatory for "
+ "parameter 'channel'");
}
// decrease only work... | [
"public",
"void",
"increase",
"(",
"final",
"DeviceControllerChannel",
"channel",
",",
"final",
"int",
"steps",
")",
"throws",
"IOException",
"{",
"if",
"(",
"channel",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"null-channel is not allowed... | Increments the volatile wiper for the given number steps.
@param channel Which wiper
@param steps The number of steps
@throws IOException Thrown if communication fails or device returned a malformed result | [
"Increments",
"the",
"volatile",
"wiper",
"for",
"the",
"given",
"number",
"steps",
"."
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-device/src/main/java/com/pi4j/component/potentiometer/microchip/impl/MicrochipPotentiometerDeviceController.java#L158-L172 |
trustathsh/ifmapj | src/main/java/de/hshannover/f4/trust/ifmapj/messages/Requests.java | Requests.createPublishDelete | public static PublishDelete createPublishDelete(Identifier i1, Identifier i2) {
"""
Create a new {@link PublishDelete} instance for a link between two
{@link Identifier} instances in order to delete all metadata of the link.
@param i1 the first {@link Identifier} of the link
@param i2 the second {@link Identi... | java | public static PublishDelete createPublishDelete(Identifier i1, Identifier i2) {
return createPublishDelete(i1, i2, null);
} | [
"public",
"static",
"PublishDelete",
"createPublishDelete",
"(",
"Identifier",
"i1",
",",
"Identifier",
"i2",
")",
"{",
"return",
"createPublishDelete",
"(",
"i1",
",",
"i2",
",",
"null",
")",
";",
"}"
] | Create a new {@link PublishDelete} instance for a link between two
{@link Identifier} instances in order to delete all metadata of the link.
@param i1 the first {@link Identifier} of the link
@param i2 the second {@link Identifier} of the link
@return the new {@link PublishDelete} instance | [
"Create",
"a",
"new",
"{",
"@link",
"PublishDelete",
"}",
"instance",
"for",
"a",
"link",
"between",
"two",
"{",
"@link",
"Identifier",
"}",
"instances",
"in",
"order",
"to",
"delete",
"all",
"metadata",
"of",
"the",
"link",
"."
] | train | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/de/hshannover/f4/trust/ifmapj/messages/Requests.java#L578-L580 |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/CharMatcher.java | CharMatcher.collapseFrom | public String collapseFrom(CharSequence sequence, char replacement) {
"""
Returns a string copy of the input character sequence, with each group of consecutive
characters that match this matcher replaced by a single replacement character. For example:
<pre> {@code
CharMatcher.anyOf("eko").collapseFrom("book... | java | public String collapseFrom(CharSequence sequence, char replacement) {
// This implementation avoids unnecessary allocation.
int len = sequence.length();
for (int i = 0; i < len; i++) {
char c = sequence.charAt(i);
if (matches(c)) {
if (c == replacement
&& (i == len - 1 || !ma... | [
"public",
"String",
"collapseFrom",
"(",
"CharSequence",
"sequence",
",",
"char",
"replacement",
")",
"{",
"// This implementation avoids unnecessary allocation.",
"int",
"len",
"=",
"sequence",
".",
"length",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";"... | Returns a string copy of the input character sequence, with each group of consecutive
characters that match this matcher replaced by a single replacement character. For example:
<pre> {@code
CharMatcher.anyOf("eko").collapseFrom("bookkeeper", '-')}</pre>
... returns {@code "b-p-r"}.
<p>The default implementation u... | [
"Returns",
"a",
"string",
"copy",
"of",
"the",
"input",
"character",
"sequence",
"with",
"each",
"group",
"of",
"consecutive",
"characters",
"that",
"match",
"this",
"matcher",
"replaced",
"by",
"a",
"single",
"replacement",
"character",
".",
"For",
"example",
... | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/CharMatcher.java#L1469-L1489 |
Azure/azure-sdk-for-java | iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java | IotHubResourcesInner.getEventHubConsumerGroup | public EventHubConsumerGroupInfoInner getEventHubConsumerGroup(String resourceGroupName, String resourceName, String eventHubEndpointName, String name) {
"""
Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub.
Get a consumer group from the Event Hub-compatible device-to-clo... | java | public EventHubConsumerGroupInfoInner getEventHubConsumerGroup(String resourceGroupName, String resourceName, String eventHubEndpointName, String name) {
return getEventHubConsumerGroupWithServiceResponseAsync(resourceGroupName, resourceName, eventHubEndpointName, name).toBlocking().single().body();
} | [
"public",
"EventHubConsumerGroupInfoInner",
"getEventHubConsumerGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"String",
"eventHubEndpointName",
",",
"String",
"name",
")",
"{",
"return",
"getEventHubConsumerGroupWithServiceResponseAsync",
"(",
... | Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub.
Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub.
@param resourceGroupName The name of the resource group that contains the IoT hub.
@param resourceName The name of the IoT hub.
@param ... | [
"Get",
"a",
"consumer",
"group",
"from",
"the",
"Event",
"Hub",
"-",
"compatible",
"device",
"-",
"to",
"-",
"cloud",
"endpoint",
"for",
"an",
"IoT",
"hub",
".",
"Get",
"a",
"consumer",
"group",
"from",
"the",
"Event",
"Hub",
"-",
"compatible",
"device",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iothub/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/iothub/v2018_04_01/implementation/IotHubResourcesInner.java#L1770-L1772 |
landawn/AbacusUtil | src/com/landawn/abacus/util/JdbcUtil.java | JdbcUtil.prepareCallableQuery | public static PreparedCallableQuery prepareCallableQuery(final Connection conn, final String sql) throws SQLException {
"""
Never write below code because it will definitely cause {@code Connection} leak:
<pre>
<code>
JdbcUtil.prepareCallableQuery(dataSource.getConnection(), sql);
</code>
</pre>
@param con... | java | public static PreparedCallableQuery prepareCallableQuery(final Connection conn, final String sql) throws SQLException {
return new PreparedCallableQuery(conn.prepareCall(sql));
} | [
"public",
"static",
"PreparedCallableQuery",
"prepareCallableQuery",
"(",
"final",
"Connection",
"conn",
",",
"final",
"String",
"sql",
")",
"throws",
"SQLException",
"{",
"return",
"new",
"PreparedCallableQuery",
"(",
"conn",
".",
"prepareCall",
"(",
"sql",
")",
... | Never write below code because it will definitely cause {@code Connection} leak:
<pre>
<code>
JdbcUtil.prepareCallableQuery(dataSource.getConnection(), sql);
</code>
</pre>
@param conn the specified {@code conn} won't be close after this query is executed.
@param sql
@return
@throws SQLException | [
"Never",
"write",
"below",
"code",
"because",
"it",
"will",
"definitely",
"cause",
"{",
"@code",
"Connection",
"}",
"leak",
":",
"<pre",
">",
"<code",
">",
"JdbcUtil",
".",
"prepareCallableQuery",
"(",
"dataSource",
".",
"getConnection",
"()",
"sql",
")",
";... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/JdbcUtil.java#L1371-L1373 |
j256/ormlite-core | src/main/java/com/j256/ormlite/stmt/UpdateBuilder.java | UpdateBuilder.updateColumnValue | public UpdateBuilder<T, ID> updateColumnValue(String columnName, Object value) throws SQLException {
"""
Add a column to be set to a value for UPDATE statements. This will generate something like columnName = 'value'
with the value escaped if necessary.
"""
FieldType fieldType = verifyColumnName(columnName)... | java | public UpdateBuilder<T, ID> updateColumnValue(String columnName, Object value) throws SQLException {
FieldType fieldType = verifyColumnName(columnName);
if (fieldType.isForeignCollection()) {
throw new SQLException("Can't update foreign colletion field: " + columnName);
}
addUpdateColumnToList(columnName, ne... | [
"public",
"UpdateBuilder",
"<",
"T",
",",
"ID",
">",
"updateColumnValue",
"(",
"String",
"columnName",
",",
"Object",
"value",
")",
"throws",
"SQLException",
"{",
"FieldType",
"fieldType",
"=",
"verifyColumnName",
"(",
"columnName",
")",
";",
"if",
"(",
"field... | Add a column to be set to a value for UPDATE statements. This will generate something like columnName = 'value'
with the value escaped if necessary. | [
"Add",
"a",
"column",
"to",
"be",
"set",
"to",
"a",
"value",
"for",
"UPDATE",
"statements",
".",
"This",
"will",
"generate",
"something",
"like",
"columnName",
"=",
"value",
"with",
"the",
"value",
"escaped",
"if",
"necessary",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/stmt/UpdateBuilder.java#L46-L53 |
berkesa/datatree | src/main/java/io/datatree/Tree.java | Tree.putMap | public Tree putMap(String path, boolean putIfAbsent) {
"""
Associates the specified Map (~= JSON object) container with the
specified path. If the structure previously contained a mapping for the
path, the old value is replaced. Sample code:<br>
<br>
Tree response = ...<br>
Tree headers = response.getMeta().p... | java | public Tree putMap(String path, boolean putIfAbsent) {
return putObjectInternal(path, new LinkedHashMap<String, Object>(), putIfAbsent);
} | [
"public",
"Tree",
"putMap",
"(",
"String",
"path",
",",
"boolean",
"putIfAbsent",
")",
"{",
"return",
"putObjectInternal",
"(",
"path",
",",
"new",
"LinkedHashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
",",
"putIfAbsent",
")",
";",
"}"
] | Associates the specified Map (~= JSON object) container with the
specified path. If the structure previously contained a mapping for the
path, the old value is replaced. Sample code:<br>
<br>
Tree response = ...<br>
Tree headers = response.getMeta().putMap("headers", true);<br>
headers.put("Content-Type", "text/html");... | [
"Associates",
"the",
"specified",
"Map",
"(",
"~",
"=",
"JSON",
"object",
")",
"container",
"with",
"the",
"specified",
"path",
".",
"If",
"the",
"structure",
"previously",
"contained",
"a",
"mapping",
"for",
"the",
"path",
"the",
"old",
"value",
"is",
"re... | train | https://github.com/berkesa/datatree/blob/79aea9b45c7b46ab28af0a09310bc01c421c6b3a/src/main/java/io/datatree/Tree.java#L2032-L2034 |
EdwardRaff/JSAT | JSAT/src/jsat/distributions/kernels/RBFKernel.java | RBFKernel.gammToSigma | public static double gammToSigma(double gamma) {
"""
Another common (equivalent) form of the RBF kernel is k(x, y) =
exp(-γ||x-y||<sup>2</sup>). This method converts the γ value
equivalent σ value used by this class.
@param gamma the value of γ
@return the equivalent σ value
"... | java | public static double gammToSigma(double gamma)
{
if(gamma <= 0 || Double.isNaN(gamma) || Double.isInfinite(gamma))
throw new IllegalArgumentException("gamma must be positive, not " + gamma);
return 1/Math.sqrt(2*gamma);
} | [
"public",
"static",
"double",
"gammToSigma",
"(",
"double",
"gamma",
")",
"{",
"if",
"(",
"gamma",
"<=",
"0",
"||",
"Double",
".",
"isNaN",
"(",
"gamma",
")",
"||",
"Double",
".",
"isInfinite",
"(",
"gamma",
")",
")",
"throw",
"new",
"IllegalArgumentExce... | Another common (equivalent) form of the RBF kernel is k(x, y) =
exp(-γ||x-y||<sup>2</sup>). This method converts the γ value
equivalent σ value used by this class.
@param gamma the value of γ
@return the equivalent σ value | [
"Another",
"common",
"(",
"equivalent",
")",
"form",
"of",
"the",
"RBF",
"kernel",
"is",
"k",
"(",
"x",
"y",
")",
"=",
"exp",
"(",
"-",
"&gamma",
";",
"||x",
"-",
"y||<sup",
">",
"2<",
"/",
"sup",
">",
")",
".",
"This",
"method",
"converts",
"the... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/kernels/RBFKernel.java#L125-L130 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/flow/HornSchunckPyramid.java | HornSchunckPyramid.interpolateFlowScale | protected void interpolateFlowScale(GrayF32 prev, GrayF32 curr) {
"""
Takes the flow from the previous lower resolution layer and uses it to initialize the flow
in the current layer. Adjusts for change in image scale.
"""
interp.setImage(prev);
float scaleX = (float)(prev.width-1)/(float)(curr.width-1)*... | java | protected void interpolateFlowScale(GrayF32 prev, GrayF32 curr) {
interp.setImage(prev);
float scaleX = (float)(prev.width-1)/(float)(curr.width-1)*0.999f;
float scaleY = (float)(prev.height-1)/(float)(curr.height-1)*0.999f;
float scale = (float)prev.width/(float)curr.width;
int indexCurr = 0;
for( int y... | [
"protected",
"void",
"interpolateFlowScale",
"(",
"GrayF32",
"prev",
",",
"GrayF32",
"curr",
")",
"{",
"interp",
".",
"setImage",
"(",
"prev",
")",
";",
"float",
"scaleX",
"=",
"(",
"float",
")",
"(",
"prev",
".",
"width",
"-",
"1",
")",
"/",
"(",
"f... | Takes the flow from the previous lower resolution layer and uses it to initialize the flow
in the current layer. Adjusts for change in image scale. | [
"Takes",
"the",
"flow",
"from",
"the",
"previous",
"lower",
"resolution",
"layer",
"and",
"uses",
"it",
"to",
"initialize",
"the",
"flow",
"in",
"the",
"current",
"layer",
".",
"Adjusts",
"for",
"change",
"in",
"image",
"scale",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/flow/HornSchunckPyramid.java#L175-L189 |
probedock/probedock-java | src/main/java/io/probedock/client/core/filters/FilterTargetData.java | FilterTargetData.mergeTickets | private static String mergeTickets(ProbeTest mAnnotation, ProbeTestClass cAnnotation) {
"""
Create a string containing all the tickets from method and class annotations
@param mAnnotation Method annotation
@param cAnnotation Class annotation
@return The string of tickets
"""
List<String> tickets =... | java | private static String mergeTickets(ProbeTest mAnnotation, ProbeTestClass cAnnotation) {
List<String> tickets = new ArrayList<>();
if (mAnnotation != null) {
tickets.addAll(Arrays.asList(mAnnotation.tickets()));
}
if (cAnnotation != null) {
tickets.addAll(Arrays.... | [
"private",
"static",
"String",
"mergeTickets",
"(",
"ProbeTest",
"mAnnotation",
",",
"ProbeTestClass",
"cAnnotation",
")",
"{",
"List",
"<",
"String",
">",
"tickets",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"mAnnotation",
"!=",
"null",
")",
... | Create a string containing all the tickets from method and class annotations
@param mAnnotation Method annotation
@param cAnnotation Class annotation
@return The string of tickets | [
"Create",
"a",
"string",
"containing",
"all",
"the",
"tickets",
"from",
"method",
"and",
"class",
"annotations"
] | train | https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/core/filters/FilterTargetData.java#L188-L200 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsInner.java | ExpressRoutePortsInner.createOrUpdateAsync | public Observable<ExpressRoutePortInner> createOrUpdateAsync(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) {
"""
Creates or updates the specified ExpressRoutePort resource.
@param resourceGroupName The name of the resource group.
@param expressRoutePortName The name o... | java | public Observable<ExpressRoutePortInner> createOrUpdateAsync(String resourceGroupName, String expressRoutePortName, ExpressRoutePortInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, expressRoutePortName, parameters).map(new Func1<ServiceResponse<ExpressRoutePortInner>, Express... | [
"public",
"Observable",
"<",
"ExpressRoutePortInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"expressRoutePortName",
",",
"ExpressRoutePortInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourc... | Creates or updates the specified ExpressRoutePort resource.
@param resourceGroupName The name of the resource group.
@param expressRoutePortName The name of the ExpressRoutePort resource.
@param parameters Parameters supplied to the create ExpressRoutePort operation.
@throws IllegalArgumentException thrown if paramete... | [
"Creates",
"or",
"updates",
"the",
"specified",
"ExpressRoutePort",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRoutePortsInner.java#L389-L396 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/utilities/SpaceCharacters.java | SpaceCharacters.indent | public static void indent(int num, StringBuilder out) {
"""
Write a number of whitespaces to a StringBuffer
@param num
@param out
"""
if (num <= SIXTY_FOUR) {
out.append(SIXTY_FOUR_SPACES, 0, num);
return;
} else if (num <= 128){
// avoid initializing loop ... | java | public static void indent(int num, StringBuilder out) {
if (num <= SIXTY_FOUR) {
out.append(SIXTY_FOUR_SPACES, 0, num);
return;
} else if (num <= 128){
// avoid initializing loop counters if only one iteration
out.append(SIXTY_FOUR_SPACES, 0, SIXTY_FOUR);
... | [
"public",
"static",
"void",
"indent",
"(",
"int",
"num",
",",
"StringBuilder",
"out",
")",
"{",
"if",
"(",
"num",
"<=",
"SIXTY_FOUR",
")",
"{",
"out",
".",
"append",
"(",
"SIXTY_FOUR_SPACES",
",",
"0",
",",
"num",
")",
";",
"return",
";",
"}",
"else"... | Write a number of whitespaces to a StringBuffer
@param num
@param out | [
"Write",
"a",
"number",
"of",
"whitespaces",
"to",
"a",
"StringBuffer"
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/utilities/SpaceCharacters.java#L51-L68 |
alkacon/opencms-core | src/org/opencms/ade/configuration/formatters/CmsFormatterBeanParser.java | CmsFormatterBeanParser.parseMetaMappings | private List<CmsMetaMapping> parseMetaMappings(I_CmsXmlContentLocation formatterLoc) {
"""
Parses the mappings.<p>
@param formatterLoc the formatter value location
@return the mappings
"""
List<CmsMetaMapping> mappings = new ArrayList<CmsMetaMapping>();
for (I_CmsXmlContentValueLocation ... | java | private List<CmsMetaMapping> parseMetaMappings(I_CmsXmlContentLocation formatterLoc) {
List<CmsMetaMapping> mappings = new ArrayList<CmsMetaMapping>();
for (I_CmsXmlContentValueLocation mappingLoc : formatterLoc.getSubValues(N_META_MAPPING)) {
String key = CmsConfigurationReader.getString(m... | [
"private",
"List",
"<",
"CmsMetaMapping",
">",
"parseMetaMappings",
"(",
"I_CmsXmlContentLocation",
"formatterLoc",
")",
"{",
"List",
"<",
"CmsMetaMapping",
">",
"mappings",
"=",
"new",
"ArrayList",
"<",
"CmsMetaMapping",
">",
"(",
")",
";",
"for",
"(",
"I_CmsXm... | Parses the mappings.<p>
@param formatterLoc the formatter value location
@return the mappings | [
"Parses",
"the",
"mappings",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/formatters/CmsFormatterBeanParser.java#L788-L808 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbDataSource.java | MariaDbDataSource.getConnection | public Connection getConnection(final String username, final String password)
throws SQLException {
"""
Attempts to establish a connection with the data source that this <code>DataSource</code>
object represents.
@param username the database user on whose behalf the connection is being made
@param passw... | java | public Connection getConnection(final String username, final String password)
throws SQLException {
try {
if (urlParser == null) {
this.user = username;
this.password = password;
initialize();
}
UrlParser urlParser = (UrlParser) this.urlParser.clone();
urlParse... | [
"public",
"Connection",
"getConnection",
"(",
"final",
"String",
"username",
",",
"final",
"String",
"password",
")",
"throws",
"SQLException",
"{",
"try",
"{",
"if",
"(",
"urlParser",
"==",
"null",
")",
"{",
"this",
".",
"user",
"=",
"username",
";",
"thi... | Attempts to establish a connection with the data source that this <code>DataSource</code>
object represents.
@param username the database user on whose behalf the connection is being made
@param password the user's password
@return a connection to the data source
@throws SQLException if a database access error occurs | [
"Attempts",
"to",
"establish",
"a",
"connection",
"with",
"the",
"data",
"source",
"that",
"this",
"<code",
">",
"DataSource<",
"/",
"code",
">",
"object",
"represents",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbDataSource.java#L303-L322 |
reactor/reactor-netty | src/main/java/reactor/netty/tcp/TcpServer.java | TcpServer.doOnLifecycle | public final TcpServer doOnLifecycle(Consumer<? super ServerBootstrap> onBind,
Consumer<? super DisposableServer> onBound,
Consumer<? super DisposableServer> onUnbound) {
"""
Setups all lifecycle callbacks called on or after {@link io.netty.channel.Channel}
has been bound and after it has been unbound.
@... | java | public final TcpServer doOnLifecycle(Consumer<? super ServerBootstrap> onBind,
Consumer<? super DisposableServer> onBound,
Consumer<? super DisposableServer> onUnbound) {
Objects.requireNonNull(onBind, "onBind");
Objects.requireNonNull(onBound, "onBound");
Objects.requireNonNull(onUnbound, "onUnbound");
r... | [
"public",
"final",
"TcpServer",
"doOnLifecycle",
"(",
"Consumer",
"<",
"?",
"super",
"ServerBootstrap",
">",
"onBind",
",",
"Consumer",
"<",
"?",
"super",
"DisposableServer",
">",
"onBound",
",",
"Consumer",
"<",
"?",
"super",
"DisposableServer",
">",
"onUnbound... | Setups all lifecycle callbacks called on or after {@link io.netty.channel.Channel}
has been bound and after it has been unbound.
@param onBind a consumer observing server start event
@param onBound a consumer observing server started event
@param onUnbound a consumer observing server stop event
@return a new {@link T... | [
"Setups",
"all",
"lifecycle",
"callbacks",
"called",
"on",
"or",
"after",
"{",
"@link",
"io",
".",
"netty",
".",
"channel",
".",
"Channel",
"}",
"has",
"been",
"bound",
"and",
"after",
"it",
"has",
"been",
"unbound",
"."
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/tcp/TcpServer.java#L299-L306 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/EnvelopesApi.java | EnvelopesApi.getRecipientSignatureImage | public byte[] getRecipientSignatureImage(String accountId, String envelopeId, String recipientId) throws ApiException {
"""
Retrieve signature image information for a signer/sign-in-person recipient.
Retrieves the specified user signature image. The image is returned in the same format as uploaded. In the request... | java | public byte[] getRecipientSignatureImage(String accountId, String envelopeId, String recipientId) throws ApiException {
return getRecipientSignatureImage(accountId, envelopeId, recipientId, null);
} | [
"public",
"byte",
"[",
"]",
"getRecipientSignatureImage",
"(",
"String",
"accountId",
",",
"String",
"envelopeId",
",",
"String",
"recipientId",
")",
"throws",
"ApiException",
"{",
"return",
"getRecipientSignatureImage",
"(",
"accountId",
",",
"envelopeId",
",",
"re... | Retrieve signature image information for a signer/sign-in-person recipient.
Retrieves the specified user signature image. The image is returned in the same format as uploaded. In the request you can specify if the chrome (the added line and identifier around the initial image) is returned with the image. The userId sp... | [
"Retrieve",
"signature",
"image",
"information",
"for",
"a",
"signer",
"/",
"sign",
"-",
"in",
"-",
"person",
"recipient",
".",
"Retrieves",
"the",
"specified",
"user",
"signature",
"image",
".",
"The",
"image",
"is",
"returned",
"in",
"the",
"same",
"format... | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/EnvelopesApi.java#L3362-L3364 |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/flatfile/FlatFileUtils.java | FlatFileUtils.shrink | public static String shrink(String string, char c) {
"""
Trims the string and replaces runs of whitespace with a single character.
"""
if (string == null) {
return null;
}
string = string.trim();
Pattern pattern = Pattern.compile("\\" + String.valueOf(c) + "{2,}");
return pattern.matcher(string).r... | java | public static String shrink(String string, char c) {
if (string == null) {
return null;
}
string = string.trim();
Pattern pattern = Pattern.compile("\\" + String.valueOf(c) + "{2,}");
return pattern.matcher(string).replaceAll(String.valueOf(c));
} | [
"public",
"static",
"String",
"shrink",
"(",
"String",
"string",
",",
"char",
"c",
")",
"{",
"if",
"(",
"string",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"string",
"=",
"string",
".",
"trim",
"(",
")",
";",
"Pattern",
"pattern",
"=",
"P... | Trims the string and replaces runs of whitespace with a single character. | [
"Trims",
"the",
"string",
"and",
"replaces",
"runs",
"of",
"whitespace",
"with",
"a",
"single",
"character",
"."
] | train | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/flatfile/FlatFileUtils.java#L215-L222 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/Stream.java | Stream.findIndexed | @NotNull
public Optional<IntPair<T>> findIndexed(@NotNull IndexedPredicate<? super T> predicate) {
"""
Finds the first element and its index that matches the given predicate.
<p>This is a short-circuiting terminal operation.
<p>Example:
<pre>
predicate: (index, value) -> index + value == 7
stream: ... | java | @NotNull
public Optional<IntPair<T>> findIndexed(@NotNull IndexedPredicate<? super T> predicate) {
return findIndexed(0, 1, predicate);
} | [
"@",
"NotNull",
"public",
"Optional",
"<",
"IntPair",
"<",
"T",
">",
">",
"findIndexed",
"(",
"@",
"NotNull",
"IndexedPredicate",
"<",
"?",
"super",
"T",
">",
"predicate",
")",
"{",
"return",
"findIndexed",
"(",
"0",
",",
"1",
",",
"predicate",
")",
";... | Finds the first element and its index that matches the given predicate.
<p>This is a short-circuiting terminal operation.
<p>Example:
<pre>
predicate: (index, value) -> index + value == 7
stream: [1, 2, 3, 4, 5, 2, 0]
index: [0, 1, 2, 3, 4, 5, 6]
result: Optional.of(IntPair(3, 4))
</pre>
@param predicate the pr... | [
"Finds",
"the",
"first",
"element",
"and",
"its",
"index",
"that",
"matches",
"the",
"given",
"predicate",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/Stream.java#L1975-L1978 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Order.java | Order.compare | public int compare(@Nonnull Value left, @Nonnull Value right) {
"""
Main comparison function for all Firestore types.
@return -1 is left < right, 0 if left == right, otherwise 1
"""
// First compare the types.
TypeOrder leftType = TypeOrder.fromValue(left);
TypeOrder rightType = TypeOrder.fromVa... | java | public int compare(@Nonnull Value left, @Nonnull Value right) {
// First compare the types.
TypeOrder leftType = TypeOrder.fromValue(left);
TypeOrder rightType = TypeOrder.fromValue(right);
int typeComparison = leftType.compareTo(rightType);
if (typeComparison != 0) {
return typeComparison;
... | [
"public",
"int",
"compare",
"(",
"@",
"Nonnull",
"Value",
"left",
",",
"@",
"Nonnull",
"Value",
"right",
")",
"{",
"// First compare the types.",
"TypeOrder",
"leftType",
"=",
"TypeOrder",
".",
"fromValue",
"(",
"left",
")",
";",
"TypeOrder",
"rightType",
"=",... | Main comparison function for all Firestore types.
@return -1 is left < right, 0 if left == right, otherwise 1 | [
"Main",
"comparison",
"function",
"for",
"all",
"Firestore",
"types",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Order.java#L84-L118 |
centic9/commons-dost | src/main/java/org/dstadler/commons/exec/ExecutionHelper.java | ExecutionHelper.getCommandResult | public static InputStream getCommandResult(
CommandLine cmdLine, File dir, int expectedExit,
long timeout, InputStream input) throws IOException {
"""
Run the given commandline in the given directory and provide the given input to the command.
Also verify that the tool has the expected exit code and does fi... | java | public static InputStream getCommandResult(
CommandLine cmdLine, File dir, int expectedExit,
long timeout, InputStream input) throws IOException {
DefaultExecutor executor = getDefaultExecutor(dir, expectedExit, timeout);
try (ByteArrayOutputStream outStr = new ByteArrayOutputStream()) {
executor.setStrea... | [
"public",
"static",
"InputStream",
"getCommandResult",
"(",
"CommandLine",
"cmdLine",
",",
"File",
"dir",
",",
"int",
"expectedExit",
",",
"long",
"timeout",
",",
"InputStream",
"input",
")",
"throws",
"IOException",
"{",
"DefaultExecutor",
"executor",
"=",
"getDe... | Run the given commandline in the given directory and provide the given input to the command.
Also verify that the tool has the expected exit code and does finish in the timeout.
Note: The resulting output is stored in memory, running a command
which prints out a huge amount of data to stdout or stderr will
cause memor... | [
"Run",
"the",
"given",
"commandline",
"in",
"the",
"given",
"directory",
"and",
"provide",
"the",
"given",
"input",
"to",
"the",
"command",
".",
"Also",
"verify",
"that",
"the",
"tool",
"has",
"the",
"expected",
"exit",
"code",
"and",
"does",
"finish",
"in... | train | https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/exec/ExecutionHelper.java#L70-L86 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/Stylesheet.java | Stylesheet.setNonXslTopLevel | public void setNonXslTopLevel(QName name, Object obj) {
"""
Set found a non-xslt element.
@see <a href="http://www.w3.org/TR/xslt#stylesheet-element">stylesheet-element in XSLT Specification</a>
@param name Qualified name of the element
@param obj The element object
"""
if (null == m_NonXslTopLevel)
... | java | public void setNonXslTopLevel(QName name, Object obj)
{
if (null == m_NonXslTopLevel)
m_NonXslTopLevel = new Hashtable();
m_NonXslTopLevel.put(name, obj);
} | [
"public",
"void",
"setNonXslTopLevel",
"(",
"QName",
"name",
",",
"Object",
"obj",
")",
"{",
"if",
"(",
"null",
"==",
"m_NonXslTopLevel",
")",
"m_NonXslTopLevel",
"=",
"new",
"Hashtable",
"(",
")",
";",
"m_NonXslTopLevel",
".",
"put",
"(",
"name",
",",
"ob... | Set found a non-xslt element.
@see <a href="http://www.w3.org/TR/xslt#stylesheet-element">stylesheet-element in XSLT Specification</a>
@param name Qualified name of the element
@param obj The element object | [
"Set",
"found",
"a",
"non",
"-",
"xslt",
"element",
".",
"@see",
"<a",
"href",
"=",
"http",
":",
"//",
"www",
".",
"w3",
".",
"org",
"/",
"TR",
"/",
"xslt#stylesheet",
"-",
"element",
">",
"stylesheet",
"-",
"element",
"in",
"XSLT",
"Specification<",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/Stylesheet.java#L1163-L1170 |
apache/groovy | subprojects/groovy-xml/src/main/java/groovy/xml/XmlUtil.java | XmlUtil.newSAXParser | public static SAXParser newSAXParser(String schemaLanguage, boolean namespaceAware, boolean validating, Source... schemas) throws SAXException, ParserConfigurationException {
"""
Factory method to create a SAXParser configured to validate according to a particular schema language and
optionally providing the sche... | java | public static SAXParser newSAXParser(String schemaLanguage, boolean namespaceAware, boolean validating, Source... schemas) throws SAXException, ParserConfigurationException {
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setValidating(validating);
factory.setNamespaceAware(n... | [
"public",
"static",
"SAXParser",
"newSAXParser",
"(",
"String",
"schemaLanguage",
",",
"boolean",
"namespaceAware",
",",
"boolean",
"validating",
",",
"Source",
"...",
"schemas",
")",
"throws",
"SAXException",
",",
"ParserConfigurationException",
"{",
"SAXParserFactory"... | Factory method to create a SAXParser configured to validate according to a particular schema language and
optionally providing the schema sources to validate with.
@param schemaLanguage the schema language used, e.g. XML Schema or RelaxNG (as per the String representation in javax.xml.XMLConstants)
@param namespaceAwa... | [
"Factory",
"method",
"to",
"create",
"a",
"SAXParser",
"configured",
"to",
"validate",
"according",
"to",
"a",
"particular",
"schema",
"language",
"and",
"optionally",
"providing",
"the",
"schema",
"sources",
"to",
"validate",
"with",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-xml/src/main/java/groovy/xml/XmlUtil.java#L246-L259 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java | AbstractExecutableMemberWriter.addReceiverAnnotations | protected void addReceiverAnnotations(ExecutableElement member, TypeMirror rcvrType,
List<? extends AnnotationMirror> annotationMirrors, Content tree) {
"""
Add the receiver annotations information.
@param member the member to write receiver annotations for.
@param rcvrType the receiver type.
@par... | java | protected void addReceiverAnnotations(ExecutableElement member, TypeMirror rcvrType,
List<? extends AnnotationMirror> annotationMirrors, Content tree) {
writer.addReceiverAnnotationInfo(member, rcvrType, annotationMirrors, tree);
tree.addContent(Contents.SPACE);
tree.addContent(utils... | [
"protected",
"void",
"addReceiverAnnotations",
"(",
"ExecutableElement",
"member",
",",
"TypeMirror",
"rcvrType",
",",
"List",
"<",
"?",
"extends",
"AnnotationMirror",
">",
"annotationMirrors",
",",
"Content",
"tree",
")",
"{",
"writer",
".",
"addReceiverAnnotationInf... | Add the receiver annotations information.
@param member the member to write receiver annotations for.
@param rcvrType the receiver type.
@param descList list of annotation description.
@param tree the content tree to which the information will be added. | [
"Add",
"the",
"receiver",
"annotations",
"information",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java#L171-L180 |
att/AAF | cadi/core/src/main/java/com/att/cadi/Hash.java | Hash.hashSHA256asStringHex | public static String hashSHA256asStringHex(String input, int salt) throws NoSuchAlgorithmException {
"""
Convenience Function: Hash from String to String Hex representation
@param input
@return
@throws NoSuchAlgorithmException
"""
byte[] in = input.getBytes();
ByteBuffer bb = ByteBuffer.allocate(Integ... | java | public static String hashSHA256asStringHex(String input, int salt) throws NoSuchAlgorithmException {
byte[] in = input.getBytes();
ByteBuffer bb = ByteBuffer.allocate(Integer.SIZE + in.length);
bb.putInt(salt);
bb.put(input.getBytes());
byte[] output = Hash.hashSHA256(bb.array());
StringBuilder sb = new Str... | [
"public",
"static",
"String",
"hashSHA256asStringHex",
"(",
"String",
"input",
",",
"int",
"salt",
")",
"throws",
"NoSuchAlgorithmException",
"{",
"byte",
"[",
"]",
"in",
"=",
"input",
".",
"getBytes",
"(",
")",
";",
"ByteBuffer",
"bb",
"=",
"ByteBuffer",
".... | Convenience Function: Hash from String to String Hex representation
@param input
@return
@throws NoSuchAlgorithmException | [
"Convenience",
"Function",
":",
"Hash",
"from",
"String",
"to",
"String",
"Hex",
"representation"
] | train | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/core/src/main/java/com/att/cadi/Hash.java#L104-L116 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/HttpUtils.java | HttpUtils.createBasicAuthHeaders | public static org.springframework.http.HttpHeaders createBasicAuthHeaders(final String basicAuthUser, final String basicAuthPassword) {
"""
Create headers org . springframework . http . http headers.
@param basicAuthUser the basic auth user
@param basicAuthPassword the basic auth password
@return the org ... | java | public static org.springframework.http.HttpHeaders createBasicAuthHeaders(final String basicAuthUser, final String basicAuthPassword) {
val acceptHeaders = new org.springframework.http.HttpHeaders();
acceptHeaders.setAccept(CollectionUtils.wrap(MediaType.APPLICATION_JSON));
if (StringUtils.isNot... | [
"public",
"static",
"org",
".",
"springframework",
".",
"http",
".",
"HttpHeaders",
"createBasicAuthHeaders",
"(",
"final",
"String",
"basicAuthUser",
",",
"final",
"String",
"basicAuthPassword",
")",
"{",
"val",
"acceptHeaders",
"=",
"new",
"org",
".",
"springfra... | Create headers org . springframework . http . http headers.
@param basicAuthUser the basic auth user
@param basicAuthPassword the basic auth password
@return the org . springframework . http . http headers | [
"Create",
"headers",
"org",
".",
"springframework",
".",
"http",
".",
"http",
"headers",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/HttpUtils.java#L428-L437 |
datumbox/datumbox-framework | datumbox-framework-common/src/main/java/com/datumbox/framework/common/storage/abstracts/BigMapHolder.java | BigMapHolder.initializeBigMapField | private void initializeBigMapField(StorageEngine storageEngine, Field field) {
"""
Initializes a field which is marked as BigMap.
@param storageEngine
@param field
"""
field.setAccessible(true);
try {
BigMap a = field.getAnnotation(BigMap.class);
field.set(this, sto... | java | private void initializeBigMapField(StorageEngine storageEngine, Field field) {
field.setAccessible(true);
try {
BigMap a = field.getAnnotation(BigMap.class);
field.set(this, storageEngine.getBigMap(field.getName(), a.keyClass(), a.valueClass(), a.mapType(), a.storageHint(), a.co... | [
"private",
"void",
"initializeBigMapField",
"(",
"StorageEngine",
"storageEngine",
",",
"Field",
"field",
")",
"{",
"field",
".",
"setAccessible",
"(",
"true",
")",
";",
"try",
"{",
"BigMap",
"a",
"=",
"field",
".",
"getAnnotation",
"(",
"BigMap",
".",
"clas... | Initializes a field which is marked as BigMap.
@param storageEngine
@param field | [
"Initializes",
"a",
"field",
"which",
"is",
"marked",
"as",
"BigMap",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-common/src/main/java/com/datumbox/framework/common/storage/abstracts/BigMapHolder.java#L65-L75 |
r0adkll/Slidr | library/src/main/java/com/r0adkll/slidr/Slidr.java | Slidr.attachSliderPanel | @NonNull
private static SliderPanel attachSliderPanel(@NonNull Activity activity, @NonNull SlidrConfig config) {
"""
Attach a new {@link SliderPanel} to the root of the activity's content
"""
// Hijack the decorview
ViewGroup decorView = (ViewGroup) activity.getWindow().getDecorView();
... | java | @NonNull
private static SliderPanel attachSliderPanel(@NonNull Activity activity, @NonNull SlidrConfig config) {
// Hijack the decorview
ViewGroup decorView = (ViewGroup) activity.getWindow().getDecorView();
View oldScreen = decorView.getChildAt(0);
decorView.removeViewAt(0);
... | [
"@",
"NonNull",
"private",
"static",
"SliderPanel",
"attachSliderPanel",
"(",
"@",
"NonNull",
"Activity",
"activity",
",",
"@",
"NonNull",
"SlidrConfig",
"config",
")",
"{",
"// Hijack the decorview",
"ViewGroup",
"decorView",
"=",
"(",
"ViewGroup",
")",
"activity",... | Attach a new {@link SliderPanel} to the root of the activity's content | [
"Attach",
"a",
"new",
"{"
] | train | https://github.com/r0adkll/Slidr/blob/737db115eb68435764648fbd905b1dea4b52f039/library/src/main/java/com/r0adkll/slidr/Slidr.java#L86-L100 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/HasPositionalPredChecker.java | HasPositionalPredChecker.visitPredicate | public boolean visitPredicate(ExpressionOwner owner, Expression pred) {
"""
Visit a predicate within a location path. Note that there isn't a
proper unique component for predicates, and that the expression will
be called also for whatever type Expression is.
@param owner The owner of the expression, to which... | java | public boolean visitPredicate(ExpressionOwner owner, Expression pred)
{
m_predDepth++;
if(m_predDepth == 1)
{
if((pred instanceof Variable) ||
(pred instanceof XNumber) ||
(pred instanceof Div) ||
(pred instanceof Plus) ||
(pred instanceof Minus) ||
(pr... | [
"public",
"boolean",
"visitPredicate",
"(",
"ExpressionOwner",
"owner",
",",
"Expression",
"pred",
")",
"{",
"m_predDepth",
"++",
";",
"if",
"(",
"m_predDepth",
"==",
"1",
")",
"{",
"if",
"(",
"(",
"pred",
"instanceof",
"Variable",
")",
"||",
"(",
"pred",
... | Visit a predicate within a location path. Note that there isn't a
proper unique component for predicates, and that the expression will
be called also for whatever type Expression is.
@param owner The owner of the expression, to which the expression can
be reset if rewriting takes place.
@param pred The predicate obje... | [
"Visit",
"a",
"predicate",
"within",
"a",
"location",
"path",
".",
"Note",
"that",
"there",
"isn",
"t",
"a",
"proper",
"unique",
"component",
"for",
"predicates",
"and",
"that",
"the",
"expression",
"will",
"be",
"called",
"also",
"for",
"whatever",
"type",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/HasPositionalPredChecker.java#L95-L120 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/view/zml/ZScreenField.java | ZScreenField.printZmlToolbarControls | public boolean printZmlToolbarControls(PrintWriter out, int iHtmlOptions) {
"""
Display this screen's toolbars in html input format.
@param out The html out stream.
@return true if default params were found for this form.
@exception DBException File exception.
"""
boolean bFieldsFound = false;
... | java | public boolean printZmlToolbarControls(PrintWriter out, int iHtmlOptions)
{
boolean bFieldsFound = false;
int iNumCols = ((BasePanel)this.getScreenField()).getSFieldCount();
for (int iIndex = 0; iIndex < iNumCols; iIndex++)
{
ScreenField sField = ((BasePanel)this.getScree... | [
"public",
"boolean",
"printZmlToolbarControls",
"(",
"PrintWriter",
"out",
",",
"int",
"iHtmlOptions",
")",
"{",
"boolean",
"bFieldsFound",
"=",
"false",
";",
"int",
"iNumCols",
"=",
"(",
"(",
"BasePanel",
")",
"this",
".",
"getScreenField",
"(",
")",
")",
"... | Display this screen's toolbars in html input format.
@param out The html out stream.
@return true if default params were found for this form.
@exception DBException File exception. | [
"Display",
"this",
"screen",
"s",
"toolbars",
"in",
"html",
"input",
"format",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/view/zml/ZScreenField.java#L192-L206 |
grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.applyMethodTarget | public static MethodCallExpression applyMethodTarget(final MethodCallExpression methodCallExpression, final ClassNode targetClassNode, final Class<?>... targetParameterClassTypes) {
"""
Set the method target of a MethodCallExpression to the first matching method with same number and type of arguments.
@param me... | java | public static MethodCallExpression applyMethodTarget(final MethodCallExpression methodCallExpression, final ClassNode targetClassNode, final Class<?>... targetParameterClassTypes) {
return applyMethodTarget(methodCallExpression, targetClassNode, convertTargetParameterTypes(targetParameterClassTypes));
} | [
"public",
"static",
"MethodCallExpression",
"applyMethodTarget",
"(",
"final",
"MethodCallExpression",
"methodCallExpression",
",",
"final",
"ClassNode",
"targetClassNode",
",",
"final",
"Class",
"<",
"?",
">",
"...",
"targetParameterClassTypes",
")",
"{",
"return",
"ap... | Set the method target of a MethodCallExpression to the first matching method with same number and type of arguments.
@param methodCallExpression
@param targetClassNode
@param targetParameterClassTypes
@return The method call expression | [
"Set",
"the",
"method",
"target",
"of",
"a",
"MethodCallExpression",
"to",
"the",
"first",
"matching",
"method",
"with",
"same",
"number",
"and",
"type",
"of",
"arguments",
"."
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L1268-L1270 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF3.java | CommonOps_DDF3.elementMult | public static void elementMult( DMatrix3 a , DMatrix3 b , DMatrix3 c ) {
"""
<p>Performs an element by element multiplication operation:<br>
<br>
c<sub>i</sub> = a<sub>i</sub> * b<sub>j</sub> <br>
</p>
@param a The left vector in the multiplication operation. Not modified.
@param b The right vector in the mul... | java | public static void elementMult( DMatrix3 a , DMatrix3 b , DMatrix3 c ) {
c.a1 = a.a1*b.a1;
c.a2 = a.a2*b.a2;
c.a3 = a.a3*b.a3;
} | [
"public",
"static",
"void",
"elementMult",
"(",
"DMatrix3",
"a",
",",
"DMatrix3",
"b",
",",
"DMatrix3",
"c",
")",
"{",
"c",
".",
"a1",
"=",
"a",
".",
"a1",
"*",
"b",
".",
"a1",
";",
"c",
".",
"a2",
"=",
"a",
".",
"a2",
"*",
"b",
".",
"a2",
... | <p>Performs an element by element multiplication operation:<br>
<br>
c<sub>i</sub> = a<sub>i</sub> * b<sub>j</sub> <br>
</p>
@param a The left vector in the multiplication operation. Not modified.
@param b The right vector in the multiplication operation. Not modified.
@param c Where the results of the operation are st... | [
"<p",
">",
"Performs",
"an",
"element",
"by",
"element",
"multiplication",
"operation",
":",
"<br",
">",
"<br",
">",
"c<sub",
">",
"i<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"*",
"b<sub",
">",
"j<",
"/",
"sub",
">",
"<br",
"... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF3.java#L1083-L1087 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/format/DateTimeParseContext.java | DateTimeParseContext.charEqualsIgnoreCase | static boolean charEqualsIgnoreCase(char c1, char c2) {
"""
Compares two characters ignoring case.
@param c1 the first
@param c2 the second
@return true if equal
"""
return c1 == c2 ||
Character.toUpperCase(c1) == Character.toUpperCase(c2) ||
Character.toLowerCase... | java | static boolean charEqualsIgnoreCase(char c1, char c2) {
return c1 == c2 ||
Character.toUpperCase(c1) == Character.toUpperCase(c2) ||
Character.toLowerCase(c1) == Character.toLowerCase(c2);
} | [
"static",
"boolean",
"charEqualsIgnoreCase",
"(",
"char",
"c1",
",",
"char",
"c2",
")",
"{",
"return",
"c1",
"==",
"c2",
"||",
"Character",
".",
"toUpperCase",
"(",
"c1",
")",
"==",
"Character",
".",
"toUpperCase",
"(",
"c2",
")",
"||",
"Character",
".",... | Compares two characters ignoring case.
@param c1 the first
@param c2 the second
@return true if equal | [
"Compares",
"two",
"characters",
"ignoring",
"case",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/format/DateTimeParseContext.java#L255-L259 |
CloudBees-community/syslog-java-client | src/main/java/com/cloudbees/syslog/SyslogMessage.java | SyslogMessage.toSyslogMessage | public void toSyslogMessage(@Nonnull MessageFormat messageFormat, @Nonnull Writer out) throws IOException {
"""
Generates a Syslog message complying to the <a href="http://tools.ietf.org/html/rfc5424">RFC-5424</a> format
or to the <a href="http://tools.ietf.org/html/rfc3164">RFC-3164</a> format.
@param message... | java | public void toSyslogMessage(@Nonnull MessageFormat messageFormat, @Nonnull Writer out) throws IOException {
switch (messageFormat) {
case RFC_3164:
toRfc3164SyslogMessage(out);
break;
case RFC_5424:
toRfc5424SyslogMessage(out);
... | [
"public",
"void",
"toSyslogMessage",
"(",
"@",
"Nonnull",
"MessageFormat",
"messageFormat",
",",
"@",
"Nonnull",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"switch",
"(",
"messageFormat",
")",
"{",
"case",
"RFC_3164",
":",
"toRfc3164SyslogMessage",
"(",
... | Generates a Syslog message complying to the <a href="http://tools.ietf.org/html/rfc5424">RFC-5424</a> format
or to the <a href="http://tools.ietf.org/html/rfc3164">RFC-3164</a> format.
@param messageFormat message format
@param out output {@linkplain Writer} | [
"Generates",
"a",
"Syslog",
"message",
"complying",
"to",
"the",
"<a",
"href",
"=",
"http",
":",
"//",
"tools",
".",
"ietf",
".",
"org",
"/",
"html",
"/",
"rfc5424",
">",
"RFC",
"-",
"5424<",
"/",
"a",
">",
"format",
"or",
"to",
"the",
"<a",
"href"... | train | https://github.com/CloudBees-community/syslog-java-client/blob/41e01206e4ce17c6d225ffb443bf19792a3f3c3a/src/main/java/com/cloudbees/syslog/SyslogMessage.java#L268-L282 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/org/semanticweb/owlapi/model/IRI_CustomFieldSerializer.java | IRI_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, IRI instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.Seria... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, IRI instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"IRI",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.client.rp... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{"
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/org/semanticweb/owlapi/model/IRI_CustomFieldSerializer.java#L62-L65 |
lets-blade/blade | src/main/java/com/blade/kit/ConvertKit.java | ConvertKit.string2InputStream | public static InputStream string2InputStream(final String string, final String charsetName) {
"""
string转inputStream按编码
@param string 字符串
@param charsetName 编码格式
@return 输入流
"""
if (string == null || isSpace(charsetName)) return null;
try {
return new ByteArrayInputStream(... | java | public static InputStream string2InputStream(final String string, final String charsetName) {
if (string == null || isSpace(charsetName)) return null;
try {
return new ByteArrayInputStream(string.getBytes(charsetName));
} catch (UnsupportedEncodingException e) {
e.printSt... | [
"public",
"static",
"InputStream",
"string2InputStream",
"(",
"final",
"String",
"string",
",",
"final",
"String",
"charsetName",
")",
"{",
"if",
"(",
"string",
"==",
"null",
"||",
"isSpace",
"(",
"charsetName",
")",
")",
"return",
"null",
";",
"try",
"{",
... | string转inputStream按编码
@param string 字符串
@param charsetName 编码格式
@return 输入流 | [
"string转inputStream按编码"
] | train | https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/kit/ConvertKit.java#L355-L363 |
logic-ng/LogicNG | src/main/java/org/logicng/cardinalityconstraints/CCTotalizer.java | CCTotalizer.buildALK | void buildALK(final EncodingResult result, final Variable[] vars, int rhs) {
"""
Builds an at-least-k constraint.
@param result the result
@param vars the variables
@param rhs the right-hand side
@throws IllegalArgumentException if the right hand side of the constraint was negative
"""
final LNGVe... | java | void buildALK(final EncodingResult result, final Variable[] vars, int rhs) {
final LNGVector<Variable> cardinalityOutvars = this.initializeConstraint(result, vars);
this.incData = new CCIncrementalData(result, CCConfig.ALK_ENCODER.TOTALIZER, rhs, vars.length, cardinalityOutvars);
this.toCNF(cardinalityOutva... | [
"void",
"buildALK",
"(",
"final",
"EncodingResult",
"result",
",",
"final",
"Variable",
"[",
"]",
"vars",
",",
"int",
"rhs",
")",
"{",
"final",
"LNGVector",
"<",
"Variable",
">",
"cardinalityOutvars",
"=",
"this",
".",
"initializeConstraint",
"(",
"result",
... | Builds an at-least-k constraint.
@param result the result
@param vars the variables
@param rhs the right-hand side
@throws IllegalArgumentException if the right hand side of the constraint was negative | [
"Builds",
"an",
"at",
"-",
"least",
"-",
"k",
"constraint",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/cardinalityconstraints/CCTotalizer.java#L99-L106 |
wildfly/wildfly-core | embedded/src/main/java/org/wildfly/core/embedded/SystemPropertyContext.java | SystemPropertyContext.addPropertyIfAbsent | void addPropertyIfAbsent(final String name, final Object value) {
"""
Adds a system property only if the property does not currently exist. If the property does not exist on
{@link #restore()} the property will be cleared.
@param name the name of the property
@param value the value to set if the property is ... | java | void addPropertyIfAbsent(final String name, final Object value) {
final String currentValue = SecurityActions.getPropertyPrivileged(name);
if (currentValue == null) {
SecurityActions.setPropertyPrivileged(name, value.toString());
propertiesToClear.add(name);
}
} | [
"void",
"addPropertyIfAbsent",
"(",
"final",
"String",
"name",
",",
"final",
"Object",
"value",
")",
"{",
"final",
"String",
"currentValue",
"=",
"SecurityActions",
".",
"getPropertyPrivileged",
"(",
"name",
")",
";",
"if",
"(",
"currentValue",
"==",
"null",
"... | Adds a system property only if the property does not currently exist. If the property does not exist on
{@link #restore()} the property will be cleared.
@param name the name of the property
@param value the value to set if the property is absent | [
"Adds",
"a",
"system",
"property",
"only",
"if",
"the",
"property",
"does",
"not",
"currently",
"exist",
".",
"If",
"the",
"property",
"does",
"not",
"exist",
"on",
"{",
"@link",
"#restore",
"()",
"}",
"the",
"property",
"will",
"be",
"cleared",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/embedded/src/main/java/org/wildfly/core/embedded/SystemPropertyContext.java#L122-L128 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java | BigtableInstanceAdminClient.setIamPolicy | @SuppressWarnings("WeakerAccess")
public Policy setIamPolicy(String instanceId, Policy policy) {
"""
Replaces the IAM policy associated with the specified instance.
<p>Sample code:
<pre>{@code
Policy newPolicy = client.setIamPolicy("my-instance",
Policy.newBuilder()
.addIdentity(Role.of("bigtable.user")... | java | @SuppressWarnings("WeakerAccess")
public Policy setIamPolicy(String instanceId, Policy policy) {
return ApiExceptions.callAndTranslateApiException(setIamPolicyAsync(instanceId, policy));
} | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"Policy",
"setIamPolicy",
"(",
"String",
"instanceId",
",",
"Policy",
"policy",
")",
"{",
"return",
"ApiExceptions",
".",
"callAndTranslateApiException",
"(",
"setIamPolicyAsync",
"(",
"instanceId",
",",... | Replaces the IAM policy associated with the specified instance.
<p>Sample code:
<pre>{@code
Policy newPolicy = client.setIamPolicy("my-instance",
Policy.newBuilder()
.addIdentity(Role.of("bigtable.user"), Identity.user("someone@example.com"))
.addIdentity(Role.of("bigtable.admin"), Identity.group("admins@example.com"... | [
"Replaces",
"the",
"IAM",
"policy",
"associated",
"with",
"the",
"specified",
"instance",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BigtableInstanceAdminClient.java#L1162-L1165 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java | WhiteboxImpl.newInstance | @SuppressWarnings("unchecked")
public static <T> T newInstance(Class<T> classToInstantiate) {
"""
Create a new instance of a class without invoking its constructor.
No byte-code manipulation is needed to perform this operation and thus
it's not necessary use the {@code PowerMockRunner} or
{@code PrepareFo... | java | @SuppressWarnings("unchecked")
public static <T> T newInstance(Class<T> classToInstantiate) {
int modifiers = classToInstantiate.getModifiers();
final Object object;
if (Modifier.isInterface(modifiers)) {
object = Proxy.newProxyInstance(WhiteboxImpl.class.getClassLoader(), new C... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"newInstance",
"(",
"Class",
"<",
"T",
">",
"classToInstantiate",
")",
"{",
"int",
"modifiers",
"=",
"classToInstantiate",
".",
"getModifiers",
"(",
")",
";",
"final"... | Create a new instance of a class without invoking its constructor.
No byte-code manipulation is needed to perform this operation and thus
it's not necessary use the {@code PowerMockRunner} or
{@code PrepareForTest} annotation to use this functionality.
@param <T> The type of the instance to create.
@pa... | [
"Create",
"a",
"new",
"instance",
"of",
"a",
"class",
"without",
"invoking",
"its",
"constructor",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L239-L263 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.beginGetTroubleshootingResultAsync | public Observable<TroubleshootingResultInner> beginGetTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) {
"""
Get the last completed troubleshooting result on a specified resource.
@param resourceGroupName The name of the resource group.
@param networkWatc... | java | public Observable<TroubleshootingResultInner> beginGetTroubleshootingResultAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) {
return beginGetTroubleshootingResultWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1<ServiceResponse<Tro... | [
"public",
"Observable",
"<",
"TroubleshootingResultInner",
">",
"beginGetTroubleshootingResultAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"String",
"targetResourceId",
")",
"{",
"return",
"beginGetTroubleshootingResultWithServiceResponseA... | Get the last completed troubleshooting result on a specified resource.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher resource.
@param targetResourceId The target resource ID to query the troubleshooting result.
@throws IllegalArgumentException thrown... | [
"Get",
"the",
"last",
"completed",
"troubleshooting",
"result",
"on",
"a",
"specified",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L1735-L1742 |
google/closure-templates | java/src/com/google/template/soy/jssrc/dsl/Statement.java | Statement.forLoop | public static Statement forLoop(String localVar, Expression limit, Statement body) {
"""
Creates a code chunk representing a for loop, with default values for initial & increment.
"""
return For.create(localVar, Expression.number(0), limit, Expression.number(1), body);
} | java | public static Statement forLoop(String localVar, Expression limit, Statement body) {
return For.create(localVar, Expression.number(0), limit, Expression.number(1), body);
} | [
"public",
"static",
"Statement",
"forLoop",
"(",
"String",
"localVar",
",",
"Expression",
"limit",
",",
"Statement",
"body",
")",
"{",
"return",
"For",
".",
"create",
"(",
"localVar",
",",
"Expression",
".",
"number",
"(",
"0",
")",
",",
"limit",
",",
"E... | Creates a code chunk representing a for loop, with default values for initial & increment. | [
"Creates",
"a",
"code",
"chunk",
"representing",
"a",
"for",
"loop",
"with",
"default",
"values",
"for",
"initial",
"&",
"increment",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/dsl/Statement.java#L73-L75 |
apache/spark | core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java | TaskMemoryManager.freePage | public void freePage(MemoryBlock page, MemoryConsumer consumer) {
"""
Free a block of memory allocated via {@link TaskMemoryManager#allocatePage}.
"""
assert (page.pageNumber != MemoryBlock.NO_PAGE_NUMBER) :
"Called freePage() on memory that wasn't allocated with allocatePage()";
assert (page.pag... | java | public void freePage(MemoryBlock page, MemoryConsumer consumer) {
assert (page.pageNumber != MemoryBlock.NO_PAGE_NUMBER) :
"Called freePage() on memory that wasn't allocated with allocatePage()";
assert (page.pageNumber != MemoryBlock.FREED_IN_ALLOCATOR_PAGE_NUMBER) :
"Called freePage() on a memory ... | [
"public",
"void",
"freePage",
"(",
"MemoryBlock",
"page",
",",
"MemoryConsumer",
"consumer",
")",
"{",
"assert",
"(",
"page",
".",
"pageNumber",
"!=",
"MemoryBlock",
".",
"NO_PAGE_NUMBER",
")",
":",
"\"Called freePage() on memory that wasn't allocated with allocatePage()\... | Free a block of memory allocated via {@link TaskMemoryManager#allocatePage}. | [
"Free",
"a",
"block",
"of",
"memory",
"allocated",
"via",
"{"
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java#L329-L351 |
gosu-lang/gosu-lang | gosu-core/src/main/java/gw/internal/gosu/parser/ClassCache.java | ClassCache.isPackage | private boolean isPackage( StringBuilder s, int i ) {
"""
Short-circuit the case where com.foo.Fred is not a class name, but
com.foo is a package. Avoid the expensive test for com.foo$Fred as a an
inner class (and then com$foo$Fred).
<p>
Yes, java supports a package and a class having the same name, but in th... | java | private boolean isPackage( StringBuilder s, int i ) {
try {
String maybePackage = s.substring( 0, i );
if( getPackageMethod().invoke( _module.getModuleClassLoader(), maybePackage ) != null ) {
return true;
}
}
catch( Exception e ) {
throw new RuntimeException( e );
}
... | [
"private",
"boolean",
"isPackage",
"(",
"StringBuilder",
"s",
",",
"int",
"i",
")",
"{",
"try",
"{",
"String",
"maybePackage",
"=",
"s",
".",
"substring",
"(",
"0",
",",
"i",
")",
";",
"if",
"(",
"getPackageMethod",
"(",
")",
".",
"invoke",
"(",
"_mo... | Short-circuit the case where com.foo.Fred is not a class name, but
com.foo is a package. Avoid the expensive test for com.foo$Fred as a an
inner class (and then com$foo$Fred).
<p>
Yes, java supports a package and a class having the same name, but in this case
we are checking for an inner class of a class having the sa... | [
"Short",
"-",
"circuit",
"the",
"case",
"where",
"com",
".",
"foo",
".",
"Fred",
"is",
"not",
"a",
"class",
"name",
"but",
"com",
".",
"foo",
"is",
"a",
"package",
".",
"Avoid",
"the",
"expensive",
"test",
"for",
"com",
".",
"foo$Fred",
"as",
"a",
... | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core/src/main/java/gw/internal/gosu/parser/ClassCache.java#L219-L230 |
lessthanoptimal/BoofCV | integration/boofcv-swing/src/main/java/boofcv/gui/image/VisualizeImageData.java | VisualizeImageData.grayMagnitude | public static BufferedImage grayMagnitude(ImageGray src, BufferedImage dst, double normalize) {
"""
<p>
Renders a gray scale image of the input image's intensity.<br>
<br>
dst(i,j) = 255*abs(src(i,j))/normalize
</p>
@param src Input single band image.
@param dst Where the image is rendered into... | java | public static BufferedImage grayMagnitude(ImageGray src, BufferedImage dst, double normalize) {
if (normalize < 0)
normalize = GImageStatistics.maxAbs(src);
dst = checkInputs(src, dst);
if (src.getDataType().isInteger()) {
return grayMagnitude((GrayI) src, dst, (int) normalize);
} else if( src instanceo... | [
"public",
"static",
"BufferedImage",
"grayMagnitude",
"(",
"ImageGray",
"src",
",",
"BufferedImage",
"dst",
",",
"double",
"normalize",
")",
"{",
"if",
"(",
"normalize",
"<",
"0",
")",
"normalize",
"=",
"GImageStatistics",
".",
"maxAbs",
"(",
"src",
")",
";"... | <p>
Renders a gray scale image of the input image's intensity.<br>
<br>
dst(i,j) = 255*abs(src(i,j))/normalize
</p>
@param src Input single band image.
@param dst Where the image is rendered into. If null a new BufferedImage will be created and return.
@param normalize Used to normalize the input image. I... | [
"<p",
">",
"Renders",
"a",
"gray",
"scale",
"image",
"of",
"the",
"input",
"image",
"s",
"intensity",
".",
"<br",
">",
"<br",
">",
"dst",
"(",
"i",
"j",
")",
"=",
"255",
"*",
"abs",
"(",
"src",
"(",
"i",
"j",
"))",
"/",
"normalize",
"<",
"/",
... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/image/VisualizeImageData.java#L159-L174 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/LibraryLoader.java | LibraryLoader.findLibraryURL | @Pure
public static URL findLibraryURL(String path, String libName) {
"""
Replies the URL for the specified library.
<p>The call <code>LibraryLoader.findLibraryURL(path,name)</code> is effectively equivalent
to the call:
<blockquote><pre>
getClassLoader().getResource(path+System.mapLibraryName(name))
</pre... | java | @Pure
public static URL findLibraryURL(String path, String libName) {
return findLibraryURL(path, libName, null, null);
} | [
"@",
"Pure",
"public",
"static",
"URL",
"findLibraryURL",
"(",
"String",
"path",
",",
"String",
"libName",
")",
"{",
"return",
"findLibraryURL",
"(",
"path",
",",
"libName",
",",
"null",
",",
"null",
")",
";",
"}"
] | Replies the URL for the specified library.
<p>The call <code>LibraryLoader.findLibraryURL(path,name)</code> is effectively equivalent
to the call:
<blockquote><pre>
getClassLoader().getResource(path+System.mapLibraryName(name))
</pre></blockquote>
@param path is the resource's path where the library was located.
@par... | [
"Replies",
"the",
"URL",
"for",
"the",
"specified",
"library",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/LibraryLoader.java#L250-L253 |
michaelliao/jsonstream | src/main/java/com/itranswarp/jsonstream/JsonBuilder.java | JsonBuilder.registerTypeAdapter | public <T> JsonBuilder registerTypeAdapter(Class<T> clazz, TypeAdapter<T> typeAdapter) {
"""
Register a TypeAdapter.
@param <T> Type to adapted-to.
@param clazz The adapted-to class.
@param typeAdapter The TypeAdapter instance.
@return JsonBuilder itself.
"""
typeAdapters.registerTypeAdapter(claz... | java | public <T> JsonBuilder registerTypeAdapter(Class<T> clazz, TypeAdapter<T> typeAdapter) {
typeAdapters.registerTypeAdapter(clazz, typeAdapter);
return this;
} | [
"public",
"<",
"T",
">",
"JsonBuilder",
"registerTypeAdapter",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"TypeAdapter",
"<",
"T",
">",
"typeAdapter",
")",
"{",
"typeAdapters",
".",
"registerTypeAdapter",
"(",
"clazz",
",",
"typeAdapter",
")",
";",
"return",... | Register a TypeAdapter.
@param <T> Type to adapted-to.
@param clazz The adapted-to class.
@param typeAdapter The TypeAdapter instance.
@return JsonBuilder itself. | [
"Register",
"a",
"TypeAdapter",
"."
] | train | https://github.com/michaelliao/jsonstream/blob/50adcff2e1293e655462eef5fc5f1b59277de514/src/main/java/com/itranswarp/jsonstream/JsonBuilder.java#L38-L41 |
joniles/mpxj | src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java | TurboProjectReader.addCalendarExceptions | private void addCalendarExceptions(Table table, ProjectCalendar calendar, Integer exceptionID) {
"""
Read exceptions for a calendar.
@param table calendar exception data
@param calendar calendar
@param exceptionID first exception ID
"""
Integer currentExceptionID = exceptionID;
while (true)
... | java | private void addCalendarExceptions(Table table, ProjectCalendar calendar, Integer exceptionID)
{
Integer currentExceptionID = exceptionID;
while (true)
{
MapRow row = table.find(currentExceptionID);
if (row == null)
{
break;
}
Date date = ro... | [
"private",
"void",
"addCalendarExceptions",
"(",
"Table",
"table",
",",
"ProjectCalendar",
"calendar",
",",
"Integer",
"exceptionID",
")",
"{",
"Integer",
"currentExceptionID",
"=",
"exceptionID",
";",
"while",
"(",
"true",
")",
"{",
"MapRow",
"row",
"=",
"table... | Read exceptions for a calendar.
@param table calendar exception data
@param calendar calendar
@param exceptionID first exception ID | [
"Read",
"exceptions",
"for",
"a",
"calendar",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/TurboProjectReader.java#L246-L267 |
andrehertwig/admintool | admin-tools-security/admin-tools-security-dbuser/src/main/java/de/chandre/admintool/security/dbuser/contoller/ATSecDBAbctractController.java | ATSecDBAbctractController.handleException | protected <E extends Throwable, V extends ATSecDBValidator> Set<ATError> handleException(E e, Log logger, V validator,
String key, String suffix, String defaultMessagePrefix, Object... arguments) {
"""
logging the error and creates {@link ATError} list output
@param e - required: the exception
@param logg... | java | protected <E extends Throwable, V extends ATSecDBValidator> Set<ATError> handleException(E e, Log logger, V validator,
String key, String suffix, String defaultMessagePrefix, Object... arguments) {
if(null != logger) {
logger.error(e.getMessage(), e);
}
Set<ATError> errors = new HashSet<>(1);
if (n... | [
"protected",
"<",
"E",
"extends",
"Throwable",
",",
"V",
"extends",
"ATSecDBValidator",
">",
"Set",
"<",
"ATError",
">",
"handleException",
"(",
"E",
"e",
",",
"Log",
"logger",
",",
"V",
"validator",
",",
"String",
"key",
",",
"String",
"suffix",
",",
"S... | logging the error and creates {@link ATError} list output
@param e - required: the exception
@param logger - optional: (could be null), if not null, exception will be logged as error
@param validator - optional: (could be null)
@param key - required: the error key
@param suffix the suffix for resource message key (pre... | [
"logging",
"the",
"error",
"and",
"creates",
"{",
"@link",
"ATError",
"}",
"list",
"output"
] | train | https://github.com/andrehertwig/admintool/blob/6d391e2d26969b70e3ccabfc34202abe8d915080/admin-tools-security/admin-tools-security-dbuser/src/main/java/de/chandre/admintool/security/dbuser/contoller/ATSecDBAbctractController.java#L72-L89 |
alibaba/otter | node/etl/src/main/java/com/alibaba/otter/node/etl/common/db/dialect/AbstractSqlTemplate.java | AbstractSqlTemplate.appendExcludeSingleShardColumnEquals | protected void appendExcludeSingleShardColumnEquals(StringBuilder sql, String[] columns, String separator, boolean updatePks, String excludeShardColumn) {
"""
针对DRDS改造, 在 update set 集合中, 排除 单个拆分键 的赋值操作
@param sql
@param columns
@param separator
@param excludeShardColumn 需要排除的 拆分列
"""
int size = col... | java | protected void appendExcludeSingleShardColumnEquals(StringBuilder sql, String[] columns, String separator, boolean updatePks, String excludeShardColumn) {
int size = columns.length;
for (int i = 0; i < size; i++) {
// 如果是DRDS数据库, 并且存在拆分键 且 等于当前循环列, 跳过
if(!updatePks && excludeShar... | [
"protected",
"void",
"appendExcludeSingleShardColumnEquals",
"(",
"StringBuilder",
"sql",
",",
"String",
"[",
"]",
"columns",
",",
"String",
"separator",
",",
"boolean",
"updatePks",
",",
"String",
"excludeShardColumn",
")",
"{",
"int",
"size",
"=",
"columns",
"."... | 针对DRDS改造, 在 update set 集合中, 排除 单个拆分键 的赋值操作
@param sql
@param columns
@param separator
@param excludeShardColumn 需要排除的 拆分列 | [
"针对DRDS改造",
"在",
"update",
"set",
"集合中",
"排除",
"单个拆分键",
"的赋值操作"
] | train | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/node/etl/src/main/java/com/alibaba/otter/node/etl/common/db/dialect/AbstractSqlTemplate.java#L113-L125 |
cdapio/tigon | tigon-api/src/main/java/co/cask/tigon/internal/io/SchemaHash.java | SchemaHash.updateHash | private MessageDigest updateHash(MessageDigest md5, Schema schema, Set<String> knownRecords) {
"""
Updates md5 based on the given schema.
@param md5 {@link java.security.MessageDigest} to update.
@param schema {@link Schema} for updating the md5.
@param knownRecords bytes to use for updating the md5 for recor... | java | private MessageDigest updateHash(MessageDigest md5, Schema schema, Set<String> knownRecords) {
// Don't use enum.ordinal() as ordering in enum could change
switch (schema.getType()) {
case NULL:
md5.update((byte) 0);
break;
case BOOLEAN:
md5.update((byte) 1);
break;
... | [
"private",
"MessageDigest",
"updateHash",
"(",
"MessageDigest",
"md5",
",",
"Schema",
"schema",
",",
"Set",
"<",
"String",
">",
"knownRecords",
")",
"{",
"// Don't use enum.ordinal() as ordering in enum could change",
"switch",
"(",
"schema",
".",
"getType",
"(",
")",... | Updates md5 based on the given schema.
@param md5 {@link java.security.MessageDigest} to update.
@param schema {@link Schema} for updating the md5.
@param knownRecords bytes to use for updating the md5 for records that're seen before.
@return The same {@link java.security.MessageDigest} in the parameter. | [
"Updates",
"md5",
"based",
"on",
"the",
"given",
"schema",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-api/src/main/java/co/cask/tigon/internal/io/SchemaHash.java#L108-L168 |
skuzzle/TinyPlugz | tiny-plugz/src/main/java/de/skuzzle/tinyplugz/internal/DelegateClassLoader.java | DelegateClassLoader.forPlugins | public static DelegateClassLoader forPlugins(Stream<URL> urls,
ClassLoader appClassLoader) {
"""
Creates a new ClassLoader which provides access to all plugins given by
the collection of URLs.
@param urls The URLs, each pointing to a plugin to be loaded.
@param appClassLoader The ClassLoader to us... | java | public static DelegateClassLoader forPlugins(Stream<URL> urls,
ClassLoader appClassLoader) {
Require.nonNull(urls, "urls");
Require.nonNull(appClassLoader, "parent");
final Collection<DependencyResolver> plugins = new ArrayList<>();
final Collection<PluginInformation> inform... | [
"public",
"static",
"DelegateClassLoader",
"forPlugins",
"(",
"Stream",
"<",
"URL",
">",
"urls",
",",
"ClassLoader",
"appClassLoader",
")",
"{",
"Require",
".",
"nonNull",
"(",
"urls",
",",
"\"urls\"",
")",
";",
"Require",
".",
"nonNull",
"(",
"appClassLoader"... | Creates a new ClassLoader which provides access to all plugins given by
the collection of URLs.
@param urls The URLs, each pointing to a plugin to be loaded.
@param appClassLoader The ClassLoader to use as parent.
@return The created ClassLoader. | [
"Creates",
"a",
"new",
"ClassLoader",
"which",
"provides",
"access",
"to",
"all",
"plugins",
"given",
"by",
"the",
"collection",
"of",
"URLs",
"."
] | train | https://github.com/skuzzle/TinyPlugz/blob/739858ed0ba5a0c75b6ccf18df9a4d5612374a4b/tiny-plugz/src/main/java/de/skuzzle/tinyplugz/internal/DelegateClassLoader.java#L63-L89 |
pmlopes/yoke | framework/src/main/java/com/jetdrone/vertx/yoke/engine/AbstractEngine.java | AbstractEngine.isFresh | public void isFresh(final String filename, final Handler<Boolean> next) {
"""
Verifies if a file in the filesystem is still fresh against the cache. Errors are treated as not fresh.
@param filename File to look for
@param next next asynchronous handler
"""
final FileSystem fileSystem = vertx.fileSy... | java | public void isFresh(final String filename, final Handler<Boolean> next) {
final FileSystem fileSystem = vertx.fileSystem();
fileSystem.props(filename, new AsyncResultHandler<FileProps>() {
@Override
public void handle(AsyncResult<FileProps> asyncResult) {
if (asy... | [
"public",
"void",
"isFresh",
"(",
"final",
"String",
"filename",
",",
"final",
"Handler",
"<",
"Boolean",
">",
"next",
")",
"{",
"final",
"FileSystem",
"fileSystem",
"=",
"vertx",
".",
"fileSystem",
"(",
")",
";",
"fileSystem",
".",
"props",
"(",
"filename... | Verifies if a file in the filesystem is still fresh against the cache. Errors are treated as not fresh.
@param filename File to look for
@param next next asynchronous handler | [
"Verifies",
"if",
"a",
"file",
"in",
"the",
"filesystem",
"is",
"still",
"fresh",
"against",
"the",
"cache",
".",
"Errors",
"are",
"treated",
"as",
"not",
"fresh",
"."
] | train | https://github.com/pmlopes/yoke/blob/fe8a64036f09fb745f0644faddd46162d64faf3c/framework/src/main/java/com/jetdrone/vertx/yoke/engine/AbstractEngine.java#L51-L77 |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/astar/AStar.java | AStar.addAStarListener | public void addAStarListener(AStarListener<ST, PT> listener) {
"""
Add listener on A* algorithm events.
@param listener the listener.
"""
if (this.listeners == null) {
this.listeners = new ArrayList<>();
}
this.listeners.add(listener);
} | java | public void addAStarListener(AStarListener<ST, PT> listener) {
if (this.listeners == null) {
this.listeners = new ArrayList<>();
}
this.listeners.add(listener);
} | [
"public",
"void",
"addAStarListener",
"(",
"AStarListener",
"<",
"ST",
",",
"PT",
">",
"listener",
")",
"{",
"if",
"(",
"this",
".",
"listeners",
"==",
"null",
")",
"{",
"this",
".",
"listeners",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"}",
"th... | Add listener on A* algorithm events.
@param listener the listener. | [
"Add",
"listener",
"on",
"A",
"*",
"algorithm",
"events",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/astar/AStar.java#L91-L96 |
amzn/ion-java | src/com/amazon/ion/util/IonTextUtils.java | IonTextUtils.printLongString | public static void printLongString(Appendable out, CharSequence text)
throws IOException {
"""
Prints characters as an ASCII-encoded Ion "long string",
including surrounding triple-quotes.
If the {@code text} is null, this prints {@code null.string}.
@param out the stream to receive the data.
@param ... | java | public static void printLongString(Appendable out, CharSequence text)
throws IOException
{
if (text == null)
{
out.append("null.string");
}
else
{
out.append("'''");
printCodePoints(out, text, EscapeMode.ION_LONG_STRING);
... | [
"public",
"static",
"void",
"printLongString",
"(",
"Appendable",
"out",
",",
"CharSequence",
"text",
")",
"throws",
"IOException",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"out",
".",
"append",
"(",
"\"null.string\"",
")",
";",
"}",
"else",
"{",
... | Prints characters as an ASCII-encoded Ion "long string",
including surrounding triple-quotes.
If the {@code text} is null, this prints {@code null.string}.
@param out the stream to receive the data.
@param text the text to print; may be {@code null}.
@throws IOException if the {@link Appendable} throws an exception.
... | [
"Prints",
"characters",
"as",
"an",
"ASCII",
"-",
"encoded",
"Ion",
"long",
"string",
"including",
"surrounding",
"triple",
"-",
"quotes",
".",
"If",
"the",
"{",
"@code",
"text",
"}",
"is",
"null",
"this",
"prints",
"{",
"@code",
"null",
".",
"string",
"... | train | https://github.com/amzn/ion-java/blob/4ce1f0f58c6a5a8e42d0425ccdb36e38be3e2270/src/com/amazon/ion/util/IonTextUtils.java#L525-L538 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/util/ArrayUtils.java | ArrayUtils.getElementAt | public static <T> T getElementAt(T[] array, int index, T defaultValue) {
"""
Returns the element at the given index in the {@code array}.
@param <T> {@link Class} type of elements in the array.
@param array array from which to extract the given element at index.
@param index integer indicating the index of th... | java | public static <T> T getElementAt(T[] array, int index, T defaultValue) {
return nullSafeLength(array) > index ? array[index] : defaultValue;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getElementAt",
"(",
"T",
"[",
"]",
"array",
",",
"int",
"index",
",",
"T",
"defaultValue",
")",
"{",
"return",
"nullSafeLength",
"(",
"array",
")",
">",
"index",
"?",
"array",
"[",
"index",
"]",
":",
"defaultV... | Returns the element at the given index in the {@code array}.
@param <T> {@link Class} type of elements in the array.
@param array array from which to extract the given element at index.
@param index integer indicating the index of the element in the array to return.
@param defaultValue default value to return if the a... | [
"Returns",
"the",
"element",
"at",
"the",
"given",
"index",
"in",
"the",
"{",
"@code",
"array",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/util/ArrayUtils.java#L440-L442 |
dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/DateParser.java | DateParser.stripSuffix | private String stripSuffix(final String input, final String searchString) {
"""
Strip the searchString with and trim the result.
@param input the source string
@param searchString the string to look for in the source
@return the stripped string
"""
final String stripped = input.replace(searchStrin... | java | private String stripSuffix(final String input, final String searchString) {
final String stripped = input.replace(searchString, "");
return stripped.trim();
} | [
"private",
"String",
"stripSuffix",
"(",
"final",
"String",
"input",
",",
"final",
"String",
"searchString",
")",
"{",
"final",
"String",
"stripped",
"=",
"input",
".",
"replace",
"(",
"searchString",
",",
"\"\"",
")",
";",
"return",
"stripped",
".",
"trim",... | Strip the searchString with and trim the result.
@param input the source string
@param searchString the string to look for in the source
@return the stripped string | [
"Strip",
"the",
"searchString",
"with",
"and",
"trim",
"the",
"result",
"."
] | train | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/DateParser.java#L194-L197 |
glyptodon/guacamole-client | guacamole/src/main/java/org/apache/guacamole/extension/LanguageResourceService.java | LanguageResourceService.getLanguageNames | public Map<String, String> getLanguageNames() {
"""
Returns a mapping of all language keys to their corresponding human-
readable language names. If an error occurs while parsing a language
resource, its key/name pair will simply be omitted. The returned map
cannot be modified.
@return
A map of all language... | java | public Map<String, String> getLanguageNames() {
Map<String, String> languageNames = new HashMap<String, String>();
// For each language key/resource pair
for (Map.Entry<String, Resource> entry : resources.entrySet()) {
// Get language key and resource
String languageKe... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getLanguageNames",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"languageNames",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"// For each language key/resource pair... | Returns a mapping of all language keys to their corresponding human-
readable language names. If an error occurs while parsing a language
resource, its key/name pair will simply be omitted. The returned map
cannot be modified.
@return
A map of all language keys and their corresponding human-readable
names. | [
"Returns",
"a",
"mapping",
"of",
"all",
"language",
"keys",
"to",
"their",
"corresponding",
"human",
"-",
"readable",
"language",
"names",
".",
"If",
"an",
"error",
"occurs",
"while",
"parsing",
"a",
"language",
"resource",
"its",
"key",
"/",
"name",
"pair",... | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole/src/main/java/org/apache/guacamole/extension/LanguageResourceService.java#L403-L448 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/io/IO.java | IO.writeFile | public static void writeFile(final File file, final FileOutput output, final IProgressMonitor monitor) throws CoreException {
"""
Write the contents of a java.io.File
@param file
the file to write to
@param output
the FileOutput object responsible for generating the data
"""
try (FileOutputStream... | java | public static void writeFile(final File file, final FileOutput output, final IProgressMonitor monitor) throws CoreException {
try (FileOutputStream fout = new FileOutputStream(file);
BufferedOutputStream bout = new BufferedOutputStream(fout)) {
if (monitor != null) {
... | [
"public",
"static",
"void",
"writeFile",
"(",
"final",
"File",
"file",
",",
"final",
"FileOutput",
"output",
",",
"final",
"IProgressMonitor",
"monitor",
")",
"throws",
"CoreException",
"{",
"try",
"(",
"FileOutputStream",
"fout",
"=",
"new",
"FileOutputStream",
... | Write the contents of a java.io.File
@param file
the file to write to
@param output
the FileOutput object responsible for generating the data | [
"Write",
"the",
"contents",
"of",
"a",
"java",
".",
"io",
".",
"File"
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/io/IO.java#L104-L116 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/Tools.java | Tools.Mod | public static int Mod(int x, int m) {
"""
Gets the proper modulus operation.
@param x Integer.
@param m Modulo.
@return Modulus.
"""
if (m < 0) m = -m;
int r = x % m;
return r < 0 ? r + m : r;
} | java | public static int Mod(int x, int m) {
if (m < 0) m = -m;
int r = x % m;
return r < 0 ? r + m : r;
} | [
"public",
"static",
"int",
"Mod",
"(",
"int",
"x",
",",
"int",
"m",
")",
"{",
"if",
"(",
"m",
"<",
"0",
")",
"m",
"=",
"-",
"m",
";",
"int",
"r",
"=",
"x",
"%",
"m",
";",
"return",
"r",
"<",
"0",
"?",
"r",
"+",
"m",
":",
"r",
";",
"}"... | Gets the proper modulus operation.
@param x Integer.
@param m Modulo.
@return Modulus. | [
"Gets",
"the",
"proper",
"modulus",
"operation",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/Tools.java#L349-L353 |
jhy/jsoup | src/main/java/org/jsoup/helper/DataUtil.java | DataUtil.crossStreams | static void crossStreams(final InputStream in, final OutputStream out) throws IOException {
"""
Writes the input stream to the output stream. Doesn't close them.
@param in input stream to read from
@param out output stream to write to
@throws IOException on IO error
"""
final byte[] buffer = new byt... | java | static void crossStreams(final InputStream in, final OutputStream out) throws IOException {
final byte[] buffer = new byte[bufferSize];
int len;
while ((len = in.read(buffer)) != -1) {
out.write(buffer, 0, len);
}
} | [
"static",
"void",
"crossStreams",
"(",
"final",
"InputStream",
"in",
",",
"final",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"final",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
"bufferSize",
"]",
";",
"int",
"len",
";",
"while",
... | Writes the input stream to the output stream. Doesn't close them.
@param in input stream to read from
@param out output stream to write to
@throws IOException on IO error | [
"Writes",
"the",
"input",
"stream",
"to",
"the",
"output",
"stream",
".",
"Doesn",
"t",
"close",
"them",
"."
] | train | https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/helper/DataUtil.java#L88-L94 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/CeCPMain.java | CeCPMain.calculateMinCP | protected static CPRange calculateMinCP(int[] block, int blockLen, int ca2len, int minCPlength) {
"""
Finds the alignment index of the residues minCPlength before and after
the duplication.
@param block The permuted block being considered, generally optAln[0][1]
@param blockLen The length of the block (in cas... | java | protected static CPRange calculateMinCP(int[] block, int blockLen, int ca2len, int minCPlength) {
CPRange range = new CPRange();
// Find the cut point within the alignment.
// Either returns the index i of the alignment such that block[i] == ca2len,
// or else returns -i-1 where block[i] is the first element >... | [
"protected",
"static",
"CPRange",
"calculateMinCP",
"(",
"int",
"[",
"]",
"block",
",",
"int",
"blockLen",
",",
"int",
"ca2len",
",",
"int",
"minCPlength",
")",
"{",
"CPRange",
"range",
"=",
"new",
"CPRange",
"(",
")",
";",
"// Find the cut point within the al... | Finds the alignment index of the residues minCPlength before and after
the duplication.
@param block The permuted block being considered, generally optAln[0][1]
@param blockLen The length of the block (in case extra memory was allocated in block)
@param ca2len The length, in residues, of the protein specified by block... | [
"Finds",
"the",
"alignment",
"index",
"of",
"the",
"residues",
"minCPlength",
"before",
"and",
"after",
"the",
"duplication",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/ce/CeCPMain.java#L635-L668 |
bechte/junit-hierarchicalcontextrunner | src/main/java/de/bechte/junit/runners/context/HierarchicalContextRunner.java | HierarchicalContextRunner.runChildren | protected Statement runChildren(final Description description, final RunNotifier notifier) {
"""
This method returns a {@link Statement} that is responsible for running all children of the given test class. In
order to run more than one {@link Statement}, please use the {@link RunAll} statement for grouping.
N... | java | protected Statement runChildren(final Description description, final RunNotifier notifier) {
return new RunAll(
new RunChildren<FrameworkMethod>(testClass, methodRunner, methodResolver, notifier),
new RunChildren<Class<?>>(testClass, contextRunner, contextResolver, notifier)
);
... | [
"protected",
"Statement",
"runChildren",
"(",
"final",
"Description",
"description",
",",
"final",
"RunNotifier",
"notifier",
")",
"{",
"return",
"new",
"RunAll",
"(",
"new",
"RunChildren",
"<",
"FrameworkMethod",
">",
"(",
"testClass",
",",
"methodRunner",
",",
... | This method returns a {@link Statement} that is responsible for running all children of the given test class. In
order to run more than one {@link Statement}, please use the {@link RunAll} statement for grouping.
Note: Clients may override this method. The statement returned should only be responsible for running the
... | [
"This",
"method",
"returns",
"a",
"{",
"@link",
"Statement",
"}",
"that",
"is",
"responsible",
"for",
"running",
"all",
"children",
"of",
"the",
"given",
"test",
"class",
".",
"In",
"order",
"to",
"run",
"more",
"than",
"one",
"{",
"@link",
"Statement",
... | train | https://github.com/bechte/junit-hierarchicalcontextrunner/blob/c11bb846613a3db730ec2dd812e16cd2aaefc924/src/main/java/de/bechte/junit/runners/context/HierarchicalContextRunner.java#L151-L156 |
reactor/reactor-netty | src/main/java/reactor/netty/http/client/HttpClient.java | HttpClient.cookieCodec | public final HttpClient cookieCodec(ClientCookieEncoder encoder) {
"""
Configure the
{@link ClientCookieEncoder}, {@link ClientCookieDecoder} will be
chosen based on the encoder
@param encoder the preferred ClientCookieEncoder
@return a new {@link HttpClient}
"""
ClientCookieDecoder decoder = encoder... | java | public final HttpClient cookieCodec(ClientCookieEncoder encoder) {
ClientCookieDecoder decoder = encoder == ClientCookieEncoder.LAX ?
ClientCookieDecoder.LAX : ClientCookieDecoder.STRICT;
return cookieCodec(encoder, decoder);
} | [
"public",
"final",
"HttpClient",
"cookieCodec",
"(",
"ClientCookieEncoder",
"encoder",
")",
"{",
"ClientCookieDecoder",
"decoder",
"=",
"encoder",
"==",
"ClientCookieEncoder",
".",
"LAX",
"?",
"ClientCookieDecoder",
".",
"LAX",
":",
"ClientCookieDecoder",
".",
"STRICT... | Configure the
{@link ClientCookieEncoder}, {@link ClientCookieDecoder} will be
chosen based on the encoder
@param encoder the preferred ClientCookieEncoder
@return a new {@link HttpClient} | [
"Configure",
"the",
"{",
"@link",
"ClientCookieEncoder",
"}",
"{",
"@link",
"ClientCookieDecoder",
"}",
"will",
"be",
"chosen",
"based",
"on",
"the",
"encoder"
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/http/client/HttpClient.java#L459-L463 |
Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java | Cells.getInteger | public Integer getInteger(String nameSpace, String cellName) {
"""
Returns the {@code Integer} value of the {@link Cell} (associated to {@code table}) whose name iscellName, or
null if this Cells object contains no cell whose name is cellName.
@param nameSpace the name of the owning table
@param cellName the... | java | public Integer getInteger(String nameSpace, String cellName) {
return getValue(nameSpace, cellName, Integer.class);
} | [
"public",
"Integer",
"getInteger",
"(",
"String",
"nameSpace",
",",
"String",
"cellName",
")",
"{",
"return",
"getValue",
"(",
"nameSpace",
",",
"cellName",
",",
"Integer",
".",
"class",
")",
";",
"}"
] | Returns the {@code Integer} value of the {@link Cell} (associated to {@code table}) whose name iscellName, or
null if this Cells object contains no cell whose name is cellName.
@param nameSpace the name of the owning table
@param cellName the name of the Cell we want to retrieve from this Cells object.
@return the {@... | [
"Returns",
"the",
"{",
"@code",
"Integer",
"}",
"value",
"of",
"the",
"{",
"@link",
"Cell",
"}",
"(",
"associated",
"to",
"{",
"@code",
"table",
"}",
")",
"whose",
"name",
"iscellName",
"or",
"null",
"if",
"this",
"Cells",
"object",
"contains",
"no",
"... | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/entity/Cells.java#L1027-L1029 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/DPathUtils.java | DPathUtils.getDate | public static Date getDate(JsonNode node, String dPath, String dateTimeFormat) {
"""
Extract a date value from the target {@link JsonNode} using DPath expression. If the
extracted value is a string, parse it as a {@link Date} using the specified date-time format.
@param node
@param dPath
@param dateTimeForma... | java | public static Date getDate(JsonNode node, String dPath, String dateTimeFormat) {
JsonNode obj = getValue(node, dPath);
return ValueUtils.convertDate(obj, dateTimeFormat);
} | [
"public",
"static",
"Date",
"getDate",
"(",
"JsonNode",
"node",
",",
"String",
"dPath",
",",
"String",
"dateTimeFormat",
")",
"{",
"JsonNode",
"obj",
"=",
"getValue",
"(",
"node",
",",
"dPath",
")",
";",
"return",
"ValueUtils",
".",
"convertDate",
"(",
"ob... | Extract a date value from the target {@link JsonNode} using DPath expression. If the
extracted value is a string, parse it as a {@link Date} using the specified date-time format.
@param node
@param dPath
@param dateTimeFormat
see {@link SimpleDateFormat}
@return
@since 0.6.2 | [
"Extract",
"a",
"date",
"value",
"from",
"the",
"target",
"{",
"@link",
"JsonNode",
"}",
"using",
"DPath",
"expression",
".",
"If",
"the",
"extracted",
"value",
"is",
"a",
"string",
"parse",
"it",
"as",
"a",
"{",
"@link",
"Date",
"}",
"using",
"the",
"... | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/DPathUtils.java#L447-L450 |
TrueNight/Utils | android-utils/src/main/java/xyz/truenight/utils/PermissionRequest.java | PermissionRequest.hasAllPermission | public static boolean hasAllPermission(@NonNull Fragment context, @NonNull String... permissions) {
"""
Check if the user has granted the permissions.
@param context a Android context
@param permissions The Permission you are need to check.
@return true if all permissions are granted or false if any permi... | java | public static boolean hasAllPermission(@NonNull Fragment context, @NonNull String... permissions) {
if (Build.VERSION.SDK_INT < 23) {
return true;
} else {
for (String permission : permissions) {
if (ContextCompat.checkSelfPermission(context.getContext(), permissi... | [
"public",
"static",
"boolean",
"hasAllPermission",
"(",
"@",
"NonNull",
"Fragment",
"context",
",",
"@",
"NonNull",
"String",
"...",
"permissions",
")",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
"<",
"23",
")",
"{",
"return",
"true",
";",
... | Check if the user has granted the permissions.
@param context a Android context
@param permissions The Permission you are need to check.
@return true if all permissions are granted or false if any permission is missing | [
"Check",
"if",
"the",
"user",
"has",
"granted",
"the",
"permissions",
"."
] | train | https://github.com/TrueNight/Utils/blob/78a11faa16258b09f08826797370310ab650530c/android-utils/src/main/java/xyz/truenight/utils/PermissionRequest.java#L117-L128 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java | GeneratedDConnectionDaoImpl.queryByUserRoles | public Iterable<DConnection> queryByUserRoles(java.lang.String userRoles) {
"""
query-by method for field userRoles
@param userRoles the specified attribute
@return an Iterable of DConnections for the specified userRoles
"""
return queryByField(null, DConnectionMapper.Field.USERROLES.getFieldName(), user... | java | public Iterable<DConnection> queryByUserRoles(java.lang.String userRoles) {
return queryByField(null, DConnectionMapper.Field.USERROLES.getFieldName(), userRoles);
} | [
"public",
"Iterable",
"<",
"DConnection",
">",
"queryByUserRoles",
"(",
"java",
".",
"lang",
".",
"String",
"userRoles",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DConnectionMapper",
".",
"Field",
".",
"USERROLES",
".",
"getFieldName",
"(",
")",
... | query-by method for field userRoles
@param userRoles the specified attribute
@return an Iterable of DConnections for the specified userRoles | [
"query",
"-",
"by",
"method",
"for",
"field",
"userRoles"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDConnectionDaoImpl.java#L178-L180 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/udpchannel/internal/BufferDump.java | BufferDump.getHexDump | static public String getHexDump(byte[] data, int length) {
"""
Debug print the input byte[] up to the input maximum length. This will be
a sequence of 16 byte lines, starting with a line indicator, the hex
bytes and then the ASCII representation.
@param data
@param length
@return String
"""
// b... | java | static public String getHexDump(byte[] data, int length) {
// boundary checks....
if (null == data || 0 > length) {
return null;
}
// if we have less than the target amount, just print what we have
if (data.length < length) {
length = data.length;
... | [
"static",
"public",
"String",
"getHexDump",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"length",
")",
"{",
"// boundary checks....",
"if",
"(",
"null",
"==",
"data",
"||",
"0",
">",
"length",
")",
"{",
"return",
"null",
";",
"}",
"// if we have less than t... | Debug print the input byte[] up to the input maximum length. This will be
a sequence of 16 byte lines, starting with a line indicator, the hex
bytes and then the ASCII representation.
@param data
@param length
@return String | [
"Debug",
"print",
"the",
"input",
"byte",
"[]",
"up",
"to",
"the",
"input",
"maximum",
"length",
".",
"This",
"will",
"be",
"a",
"sequence",
"of",
"16",
"byte",
"lines",
"starting",
"with",
"a",
"line",
"indicator",
"the",
"hex",
"bytes",
"and",
"then",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/udpchannel/internal/BufferDump.java#L60-L85 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/algorithm/ahocorasick/trie/Trie.java | Trie.storeEmits | private static void storeEmits(int position, State currentState, List<Emit> collectedEmits) {
"""
保存匹配结果
@param position 当前位置,也就是匹配到的模式串的结束位置+1
@param currentState 当前状态
@param collectedEmits 保存位置
"""
Collection<String> emits = currentState.emit();
if (emits != null && !emits.isEmpt... | java | private static void storeEmits(int position, State currentState, List<Emit> collectedEmits)
{
Collection<String> emits = currentState.emit();
if (emits != null && !emits.isEmpty())
{
for (String emit : emits)
{
collectedEmits.add(new Emit(position - em... | [
"private",
"static",
"void",
"storeEmits",
"(",
"int",
"position",
",",
"State",
"currentState",
",",
"List",
"<",
"Emit",
">",
"collectedEmits",
")",
"{",
"Collection",
"<",
"String",
">",
"emits",
"=",
"currentState",
".",
"emit",
"(",
")",
";",
"if",
... | 保存匹配结果
@param position 当前位置,也就是匹配到的模式串的结束位置+1
@param currentState 当前状态
@param collectedEmits 保存位置 | [
"保存匹配结果"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/algorithm/ahocorasick/trie/Trie.java#L301-L311 |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java | AbstractValidate.exclusiveBetween | public <T, V extends Comparable<T>> V exclusiveBetween(final T start, final T end, final V value, final String message, final Object... values) {
"""
<p>Validate that the specified argument object fall between the two exclusive values specified; otherwise, throws an exception with the specified message.</p>
<pre>... | java | public <T, V extends Comparable<T>> V exclusiveBetween(final T start, final T end, final V value, final String message, final Object... values) {
if (value.compareTo(start) <= 0 || value.compareTo(end) >= 0) {
fail(String.format(message, values));
}
return value;
} | [
"public",
"<",
"T",
",",
"V",
"extends",
"Comparable",
"<",
"T",
">",
">",
"V",
"exclusiveBetween",
"(",
"final",
"T",
"start",
",",
"final",
"T",
"end",
",",
"final",
"V",
"value",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"v... | <p>Validate that the specified argument object fall between the two exclusive values specified; otherwise, throws an exception with the specified message.</p>
<pre>Validate.exclusiveBetween(0, 2, 1, "Not in boundaries");</pre>
@param <T>
the type of the start and end values
@param <V>
the type of the object
@param sta... | [
"<p",
">",
"Validate",
"that",
"the",
"specified",
"argument",
"object",
"fall",
"between",
"the",
"two",
"exclusive",
"values",
"specified",
";",
"otherwise",
"throws",
"an",
"exception",
"with",
"the",
"specified",
"message",
".",
"<",
"/",
"p",
">",
"<pre... | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/AbstractValidate.java#L1419-L1424 |
rollbar/rollbar-java | rollbar-log4j2/src/main/java/com/rollbar/log4j2/RollbarAppender.java | RollbarAppender.createAppender | @PluginFactory
public static RollbarAppender createAppender(
@PluginAttribute("accessToken") @Required final String accessToken,
@PluginAttribute("endpoint") final String endpoint,
@PluginAttribute("environment") final String environment,
@PluginAttribute("language") final String language,
... | java | @PluginFactory
public static RollbarAppender createAppender(
@PluginAttribute("accessToken") @Required final String accessToken,
@PluginAttribute("endpoint") final String endpoint,
@PluginAttribute("environment") final String environment,
@PluginAttribute("language") final String language,
... | [
"@",
"PluginFactory",
"public",
"static",
"RollbarAppender",
"createAppender",
"(",
"@",
"PluginAttribute",
"(",
"\"accessToken\"",
")",
"@",
"Required",
"final",
"String",
"accessToken",
",",
"@",
"PluginAttribute",
"(",
"\"endpoint\"",
")",
"final",
"String",
"end... | Create appender plugin factory method.
@param accessToken the Rollbar access token.
@param endpoint the Rollbar endpoint to be used.
@param environment the environment.
@param language the language.
@param configProviderClassName The class name of the config provider implementation to get
the configuration.
@param nam... | [
"Create",
"appender",
"plugin",
"factory",
"method",
"."
] | train | https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-log4j2/src/main/java/com/rollbar/log4j2/RollbarAppender.java#L75-L109 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.beginGetNetworkConfigurationDiagnosticAsync | public Observable<NetworkConfigurationDiagnosticResponseInner> beginGetNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) {
"""
Get network configuration diagnostic.
@param resourceGroupName The name of the resource group... | java | public Observable<NetworkConfigurationDiagnosticResponseInner> beginGetNetworkConfigurationDiagnosticAsync(String resourceGroupName, String networkWatcherName, NetworkConfigurationDiagnosticParameters parameters) {
return beginGetNetworkConfigurationDiagnosticWithServiceResponseAsync(resourceGroupName, networkW... | [
"public",
"Observable",
"<",
"NetworkConfigurationDiagnosticResponseInner",
">",
"beginGetNetworkConfigurationDiagnosticAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"NetworkConfigurationDiagnosticParameters",
"parameters",
")",
"{",
"return"... | Get network configuration diagnostic.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param parameters Parameters to get network configuration diagnostic.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observabl... | [
"Get",
"network",
"configuration",
"diagnostic",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkWatchersInner.java#L2759-L2766 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.accessRestriction_u2f_id_validate_POST | public void accessRestriction_u2f_id_validate_POST(Long id, String clientData, String registrationData) throws IOException {
"""
Validate your U2F account
REST: POST /me/accessRestriction/u2f/{id}/validate
@param registrationData [required]
@param clientData [required]
@param id [required] The Id of the rest... | java | public void accessRestriction_u2f_id_validate_POST(Long id, String clientData, String registrationData) throws IOException {
String qPath = "/me/accessRestriction/u2f/{id}/validate";
StringBuilder sb = path(qPath, id);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "clientData", clientData... | [
"public",
"void",
"accessRestriction_u2f_id_validate_POST",
"(",
"Long",
"id",
",",
"String",
"clientData",
",",
"String",
"registrationData",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/accessRestriction/u2f/{id}/validate\"",
";",
"StringBuilder",
"... | Validate your U2F account
REST: POST /me/accessRestriction/u2f/{id}/validate
@param registrationData [required]
@param clientData [required]
@param id [required] The Id of the restriction | [
"Validate",
"your",
"U2F",
"account"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L4215-L4222 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java | FileOperations.listFilesFromComputeNode | public PagedList<NodeFile> listFilesFromComputeNode(String poolId, String nodeId, Boolean recursive, DetailLevel detailLevel) throws BatchErrorException, IOException {
"""
Lists files on the specified compute node.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the com... | java | public PagedList<NodeFile> listFilesFromComputeNode(String poolId, String nodeId, Boolean recursive, DetailLevel detailLevel) throws BatchErrorException, IOException {
return listFilesFromComputeNode(poolId, nodeId, recursive, detailLevel, null);
} | [
"public",
"PagedList",
"<",
"NodeFile",
">",
"listFilesFromComputeNode",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"Boolean",
"recursive",
",",
"DetailLevel",
"detailLevel",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"return",
"listF... | Lists files on the specified compute node.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node.
@param recursive If true, recursively lists all files on the compute node. If false or null, lists only the files in the compute node root directory.
@param detailLevel ... | [
"Lists",
"files",
"on",
"the",
"specified",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/FileOperations.java#L137-L139 |
imsweb/naaccr-xml | src/main/java/com/imsweb/naaccrxml/runtime/NaaccrStreamConfiguration.java | NaaccrStreamConfiguration.registerTag | public void registerTag(String namespacePrefix, String tagName, Class<?> clazz, String fieldName, Class<?> fieldClass) {
"""
Registers a tag corresponding to a specific field of a specific class, in a the given namespace.
@param namespacePrefix namespace prefix, required
@param tagName tag name, required
@param... | java | public void registerTag(String namespacePrefix, String tagName, Class<?> clazz, String fieldName, Class<?> fieldClass) {
if (!_namespaces.containsKey(namespacePrefix))
throw new RuntimeException("Namespace prefix '" + namespacePrefix + "' has not been registered yet");
_xstream.alias(namespa... | [
"public",
"void",
"registerTag",
"(",
"String",
"namespacePrefix",
",",
"String",
"tagName",
",",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"fieldName",
",",
"Class",
"<",
"?",
">",
"fieldClass",
")",
"{",
"if",
"(",
"!",
"_namespaces",
".",
"conta... | Registers a tag corresponding to a specific field of a specific class, in a the given namespace.
@param namespacePrefix namespace prefix, required
@param tagName tag name, required
@param clazz class containing the field, required
@param fieldName field name, required
@param fieldClass field type, required | [
"Registers",
"a",
"tag",
"corresponding",
"to",
"a",
"specific",
"field",
"of",
"a",
"specific",
"class",
"in",
"a",
"the",
"given",
"namespace",
"."
] | train | https://github.com/imsweb/naaccr-xml/blob/a3a501faa2a0c3411dd5248b2c1379f279131696/src/main/java/com/imsweb/naaccrxml/runtime/NaaccrStreamConfiguration.java#L272-L278 |
alkacon/opencms-core | src/org/opencms/widgets/CmsCalendarWidget.java | CmsCalendarWidget.getCalendarLocalizedTime | public static String getCalendarLocalizedTime(Locale locale, CmsMessages messages, long timestamp) {
"""
Returns the given timestamp as String formatted in a localized pattern.<p>
@param locale the locale for the time format
@param messages the messages that contain the time format definitions
@param timestam... | java | public static String getCalendarLocalizedTime(Locale locale, CmsMessages messages, long timestamp) {
// get the current date & time
TimeZone zone = TimeZone.getDefault();
GregorianCalendar cal = new GregorianCalendar(zone, locale);
cal.setTimeInMillis(timestamp);
// format it ni... | [
"public",
"static",
"String",
"getCalendarLocalizedTime",
"(",
"Locale",
"locale",
",",
"CmsMessages",
"messages",
",",
"long",
"timestamp",
")",
"{",
"// get the current date & time",
"TimeZone",
"zone",
"=",
"TimeZone",
".",
"getDefault",
"(",
")",
";",
"Gregorian... | Returns the given timestamp as String formatted in a localized pattern.<p>
@param locale the locale for the time format
@param messages the messages that contain the time format definitions
@param timestamp the time to format
@return the given timestamp as String formatted in a localized pattern | [
"Returns",
"the",
"given",
"timestamp",
"as",
"String",
"formatted",
"in",
"a",
"localized",
"pattern",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/CmsCalendarWidget.java#L266-L279 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DataTable.java | DataTable.setHeadings | public void setHeadings(int i, String v) {
"""
indexed setter for headings - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array
"""
if (DataTable_Type.featOkTst && ((DataTable_Type)jcasType).casFeat_headings == null)
jcasType.jcas.throwFeatM... | java | public void setHeadings(int i, String v) {
if (DataTable_Type.featOkTst && ((DataTable_Type)jcasType).casFeat_headings == null)
jcasType.jcas.throwFeatMissing("headings", "ch.epfl.bbp.uima.types.DataTable");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((DataTable_Type)jcasType).ca... | [
"public",
"void",
"setHeadings",
"(",
"int",
"i",
",",
"String",
"v",
")",
"{",
"if",
"(",
"DataTable_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"DataTable_Type",
")",
"jcasType",
")",
".",
"casFeat_headings",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".... | indexed setter for headings - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"headings",
"-",
"sets",
"an",
"indexed",
"value",
"-"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/ch/epfl/bbp/uima/types/DataTable.java#L205-L209 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getUntilFirstIncl | @Nullable
public static String getUntilFirstIncl (@Nullable final String sStr, final char cSearch) {
"""
Get everything from the string up to and including the first passed char.
@param sStr
The source string. May be <code>null</code>.
@param cSearch
The character to search.
@return <code>null</code> if t... | java | @Nullable
public static String getUntilFirstIncl (@Nullable final String sStr, final char cSearch)
{
return _getUntilFirst (sStr, cSearch, true);
} | [
"@",
"Nullable",
"public",
"static",
"String",
"getUntilFirstIncl",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"final",
"char",
"cSearch",
")",
"{",
"return",
"_getUntilFirst",
"(",
"sStr",
",",
"cSearch",
",",
"true",
")",
";",
"}"
] | Get everything from the string up to and including the first passed char.
@param sStr
The source string. May be <code>null</code>.
@param cSearch
The character to search.
@return <code>null</code> if the passed string does not contain the search
character. | [
"Get",
"everything",
"from",
"the",
"string",
"up",
"to",
"and",
"including",
"the",
"first",
"passed",
"char",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L4756-L4760 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplace.java | CmsWorkplace.getStaticResourceUri | public static String getStaticResourceUri(String resourceName, String versionInfo) {
"""
Returns the URI to static resources served from the class path.<p>
@param resourceName the resource name
@param versionInfo add an additional version info parameter to avoid browser caching issues
@return the URI
""... | java | public static String getStaticResourceUri(String resourceName, String versionInfo) {
resourceName = CmsStaticResourceHandler.removeStaticResourcePrefix(resourceName);
String uri = CmsStringUtil.joinPaths(OpenCms.getSystemInfo().getStaticResourceContext(), resourceName);
if (versionInfo != null)... | [
"public",
"static",
"String",
"getStaticResourceUri",
"(",
"String",
"resourceName",
",",
"String",
"versionInfo",
")",
"{",
"resourceName",
"=",
"CmsStaticResourceHandler",
".",
"removeStaticResourcePrefix",
"(",
"resourceName",
")",
";",
"String",
"uri",
"=",
"CmsSt... | Returns the URI to static resources served from the class path.<p>
@param resourceName the resource name
@param versionInfo add an additional version info parameter to avoid browser caching issues
@return the URI | [
"Returns",
"the",
"URI",
"to",
"static",
"resources",
"served",
"from",
"the",
"class",
"path",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplace.java#L654-L662 |
OpenLiberty/open-liberty | dev/com.ibm.ws.app.manager.springboot/src/com/ibm/ws/app/manager/springboot/container/config/ConfigElementList.java | ConfigElementList.getOrCreateById | public E getOrCreateById(String id, Class<E> type) throws IllegalAccessException, InstantiationException {
"""
Returns the first element in this list with a matching identifier, or adds a new element to the end of this list and sets the identifier
@param id the identifier to search for
@param type the type of ... | java | public E getOrCreateById(String id, Class<E> type) throws IllegalAccessException, InstantiationException {
E element = this.getById(id);
if (element == null) {
element = type.newInstance();
element.setId(id);
this.add(element);
}
return element;
} | [
"public",
"E",
"getOrCreateById",
"(",
"String",
"id",
",",
"Class",
"<",
"E",
">",
"type",
")",
"throws",
"IllegalAccessException",
",",
"InstantiationException",
"{",
"E",
"element",
"=",
"this",
".",
"getById",
"(",
"id",
")",
";",
"if",
"(",
"element",... | Returns the first element in this list with a matching identifier, or adds a new element to the end of this list and sets the identifier
@param id the identifier to search for
@param type the type of the element to add when no existing element is found. The type MUST have a public no-argument constructor (but it proba... | [
"Returns",
"the",
"first",
"element",
"in",
"this",
"list",
"with",
"a",
"matching",
"identifier",
"or",
"adds",
"a",
"new",
"element",
"to",
"the",
"end",
"of",
"this",
"list",
"and",
"sets",
"the",
"identifier"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.app.manager.springboot/src/com/ibm/ws/app/manager/springboot/container/config/ConfigElementList.java#L146-L154 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/DiagnosticsInner.java | DiagnosticsInner.listSiteDetectorResponsesAsync | public Observable<Page<DetectorResponseInner>> listSiteDetectorResponsesAsync(final String resourceGroupName, final String siteName) {
"""
List Site Detector Responses.
List Site Detector Responses.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@... | java | public Observable<Page<DetectorResponseInner>> listSiteDetectorResponsesAsync(final String resourceGroupName, final String siteName) {
return listSiteDetectorResponsesWithServiceResponseAsync(resourceGroupName, siteName)
.map(new Func1<ServiceResponse<Page<DetectorResponseInner>>, Page<DetectorRespo... | [
"public",
"Observable",
"<",
"Page",
"<",
"DetectorResponseInner",
">",
">",
"listSiteDetectorResponsesAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"siteName",
")",
"{",
"return",
"listSiteDetectorResponsesWithServiceResponseAsync",
"(",
"r... | List Site Detector Responses.
List Site Detector Responses.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<DetectorResponseInner> object | [
"List",
"Site",
"Detector",
"Responses",
".",
"List",
"Site",
"Detector",
"Responses",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/DiagnosticsInner.java#L578-L586 |
nutzam/nutzboot | nutzboot-starter/nutzboot-starter-tio-websocket/src/main/java/org/nutz/boot/starter/tio/websocketbean/TioWebsocketMsgHandler.java | TioWebsocketMsgHandler.onClose | @Override
public Object onClose(WsRequest wsRequest, byte[] bytes, ChannelContext channelContext) throws Exception {
"""
close connection
@param wsRequest wsRequest
@param bytes bytes
@param channelContext channelContext
@return AnyObject
@throws Exception e
"""
TioWebsocketMethodMapper onClos... | java | @Override
public Object onClose(WsRequest wsRequest, byte[] bytes, ChannelContext channelContext) throws Exception {
TioWebsocketMethodMapper onClose = methods.getOnClose();
if (onClose != null) {
onClose.getMethod().invoke(onClose.getInstance(), channelContext);
}
log.de... | [
"@",
"Override",
"public",
"Object",
"onClose",
"(",
"WsRequest",
"wsRequest",
",",
"byte",
"[",
"]",
"bytes",
",",
"ChannelContext",
"channelContext",
")",
"throws",
"Exception",
"{",
"TioWebsocketMethodMapper",
"onClose",
"=",
"methods",
".",
"getOnClose",
"(",
... | close connection
@param wsRequest wsRequest
@param bytes bytes
@param channelContext channelContext
@return AnyObject
@throws Exception e | [
"close",
"connection"
] | train | https://github.com/nutzam/nutzboot/blob/fd33fd4fdce058eab594f28e4d3202f997e3c66a/nutzboot-starter/nutzboot-starter-tio-websocket/src/main/java/org/nutz/boot/starter/tio/websocketbean/TioWebsocketMsgHandler.java#L73-L82 |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/collect/Iterators.java | Iterators.removeAll | @CanIgnoreReturnValue
public static boolean removeAll(Iterator<?> removeFrom, Collection<?> elementsToRemove) {
"""
Traverses an iterator and removes every element that belongs to the
provided collection. The iterator will be left exhausted: its
{@code hasNext()} method will return {@code false}.
@param rem... | java | @CanIgnoreReturnValue
public static boolean removeAll(Iterator<?> removeFrom, Collection<?> elementsToRemove) {
return removeIf(removeFrom, in(elementsToRemove));
} | [
"@",
"CanIgnoreReturnValue",
"public",
"static",
"boolean",
"removeAll",
"(",
"Iterator",
"<",
"?",
">",
"removeFrom",
",",
"Collection",
"<",
"?",
">",
"elementsToRemove",
")",
"{",
"return",
"removeIf",
"(",
"removeFrom",
",",
"in",
"(",
"elementsToRemove",
... | Traverses an iterator and removes every element that belongs to the
provided collection. The iterator will be left exhausted: its
{@code hasNext()} method will return {@code false}.
@param removeFrom the iterator to (potentially) remove elements from
@param elementsToRemove the elements to remove
@return {@code true} ... | [
"Traverses",
"an",
"iterator",
"and",
"removes",
"every",
"element",
"that",
"belongs",
"to",
"the",
"provided",
"collection",
".",
"The",
"iterator",
"will",
"be",
"left",
"exhausted",
":",
"its",
"{",
"@code",
"hasNext",
"()",
"}",
"method",
"will",
"retur... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/collect/Iterators.java#L220-L223 |
mijecu25/dsa | src/main/java/com/mijecu25/dsa/algorithms/search/logarithmic/BinarySearch.java | BinarySearch.searchDescending | public static int searchDescending(long[] longArray, long value) {
"""
Search for the value in the reverse sorted long array and return the index.
@param longArray array that we are searching in.
@param value value that is being searched in the array.
@return the index where the value is found in the array,... | java | public static int searchDescending(long[] longArray, long value) {
int start = 0;
int end = longArray.length - 1;
int middle = 0;
while(start <= end) {
middle = (start + end) >> 1;
if(value == longArray[middle]) {
return middle;
... | [
"public",
"static",
"int",
"searchDescending",
"(",
"long",
"[",
"]",
"longArray",
",",
"long",
"value",
")",
"{",
"int",
"start",
"=",
"0",
";",
"int",
"end",
"=",
"longArray",
".",
"length",
"-",
"1",
";",
"int",
"middle",
"=",
"0",
";",
"while",
... | Search for the value in the reverse sorted long array and return the index.
@param longArray array that we are searching in.
@param value value that is being searched in the array.
@return the index where the value is found in the array, else -1. | [
"Search",
"for",
"the",
"value",
"in",
"the",
"reverse",
"sorted",
"long",
"array",
"and",
"return",
"the",
"index",
"."
] | train | https://github.com/mijecu25/dsa/blob/a22971b746833e78a3939ae4de65e8f6bf2e3fd4/src/main/java/com/mijecu25/dsa/algorithms/search/logarithmic/BinarySearch.java#L537-L559 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/domain/ValidationData.java | ValidationData.replaceValue | public void replaceValue(Object bodyObj, Object replaceValue) {
"""
Replace value.
@param bodyObj the body obj
@param replaceValue the replace value
"""
Object parentObj = bodyObj;
if(this.listChild) {
ValidationData rootListParent = this.findListParent();
if(t... | java | public void replaceValue(Object bodyObj, Object replaceValue) {
Object parentObj = bodyObj;
if(this.listChild) {
ValidationData rootListParent = this.findListParent();
if(this.deepLevel - rootListParent.deepLevel > 1 ){
parentObj = this.parent.getValue(bodyObj);
... | [
"public",
"void",
"replaceValue",
"(",
"Object",
"bodyObj",
",",
"Object",
"replaceValue",
")",
"{",
"Object",
"parentObj",
"=",
"bodyObj",
";",
"if",
"(",
"this",
".",
"listChild",
")",
"{",
"ValidationData",
"rootListParent",
"=",
"this",
".",
"findListParen... | Replace value.
@param bodyObj the body obj
@param replaceValue the replace value | [
"Replace",
"value",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/domain/ValidationData.java#L137-L153 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/CassandraClientBase.java | CassandraClientBase.populateFkey | protected Column populateFkey(String rlName, Object rlValue, long timestamp) throws PropertyAccessException {
"""
Populates foreign key as column.
@param rlName
relation name
@param rlValue
relation value
@param timestamp
the timestamp
@return the column
@throws PropertyAccessException
the property acce... | java | protected Column populateFkey(String rlName, Object rlValue, long timestamp) throws PropertyAccessException {
Column col = new Column();
col.setName(PropertyAccessorFactory.STRING.toBytes(rlName));
col.setValue(PropertyAccessorHelper.getBytes(rlValue));
col.setTimestamp(timestamp);
... | [
"protected",
"Column",
"populateFkey",
"(",
"String",
"rlName",
",",
"Object",
"rlValue",
",",
"long",
"timestamp",
")",
"throws",
"PropertyAccessException",
"{",
"Column",
"col",
"=",
"new",
"Column",
"(",
")",
";",
"col",
".",
"setName",
"(",
"PropertyAccess... | Populates foreign key as column.
@param rlName
relation name
@param rlValue
relation value
@param timestamp
the timestamp
@return the column
@throws PropertyAccessException
the property access exception | [
"Populates",
"foreign",
"key",
"as",
"column",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/CassandraClientBase.java#L195-L201 |
whitesource/agents | wss-agent-client/src/main/java/org/whitesource/agent/client/WssServiceClientImpl.java | WssServiceClientImpl.extractResultData | protected String extractResultData(String response) throws IOException, WssServiceException {
"""
The method extract the data from the given {@link org.whitesource.agent.api.dispatch.ResultEnvelope}.
@param response HTTP response as string.
@return String with logical result in JSON format.
@throws IOExceptio... | java | protected String extractResultData(String response) throws IOException, WssServiceException {
// parse response
ResultEnvelope envelope = gson.fromJson(response, ResultEnvelope.class);
if (envelope == null) {
throw new WssServiceException("Empty response, response data is: " + respon... | [
"protected",
"String",
"extractResultData",
"(",
"String",
"response",
")",
"throws",
"IOException",
",",
"WssServiceException",
"{",
"// parse response",
"ResultEnvelope",
"envelope",
"=",
"gson",
".",
"fromJson",
"(",
"response",
",",
"ResultEnvelope",
".",
"class",... | The method extract the data from the given {@link org.whitesource.agent.api.dispatch.ResultEnvelope}.
@param response HTTP response as string.
@return String with logical result in JSON format.
@throws IOException
@throws WssServiceException | [
"The",
"method",
"extract",
"the",
"data",
"from",
"the",
"given",
"{",
"@link",
"org",
".",
"whitesource",
".",
"agent",
".",
"api",
".",
"dispatch",
".",
"ResultEnvelope",
"}",
"."
] | train | https://github.com/whitesource/agents/blob/8a947a3dbad257aff70f23f79fb3a55ca90b765f/wss-agent-client/src/main/java/org/whitesource/agent/client/WssServiceClientImpl.java#L419-L436 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDataTableRenderer.java | WDataTableRenderer.paintPaginationElement | private void paintPaginationElement(final WDataTable table, final XmlStringBuilder xml) {
"""
Paint the pagination aspects of the WDataTable.
@param table the WDataTable being rendered
@param xml the string builder in use
"""
TableDataModel model = table.getDataModel();
xml.appendTagOpen("ui:pagination")... | java | private void paintPaginationElement(final WDataTable table, final XmlStringBuilder xml) {
TableDataModel model = table.getDataModel();
xml.appendTagOpen("ui:pagination");
if (model instanceof TreeTableDataModel) {
// For tree tables, we only include top-level nodes for pagination.
TreeNode firstNode = (... | [
"private",
"void",
"paintPaginationElement",
"(",
"final",
"WDataTable",
"table",
",",
"final",
"XmlStringBuilder",
"xml",
")",
"{",
"TableDataModel",
"model",
"=",
"table",
".",
"getDataModel",
"(",
")",
";",
"xml",
".",
"appendTagOpen",
"(",
"\"ui:pagination\"",... | Paint the pagination aspects of the WDataTable.
@param table the WDataTable being rendered
@param xml the string builder in use | [
"Paint",
"the",
"pagination",
"aspects",
"of",
"the",
"WDataTable",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WDataTableRenderer.java#L120-L152 |
BrunoEberhard/minimal-j | src/main/java/org/minimalj/util/CloneHelper.java | CloneHelper.deepCopy | public static void deepCopy(Object from, Object to) {
"""
note: deepCopy works only with special classes validatable through
ModelTest .
@param from the original object
@param to an empty object to be filled
"""
if (from == null) throw new IllegalArgumentException("from must not be null");
if (to == n... | java | public static void deepCopy(Object from, Object to) {
if (from == null) throw new IllegalArgumentException("from must not be null");
if (to == null) throw new IllegalArgumentException("to must not be null");
if (from.getClass() != to.getClass()) throw new IllegalArgumentException("from and to must have exactly sa... | [
"public",
"static",
"void",
"deepCopy",
"(",
"Object",
"from",
",",
"Object",
"to",
")",
"{",
"if",
"(",
"from",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"from must not be null\"",
")",
";",
"if",
"(",
"to",
"==",
"null",
")",
... | note: deepCopy works only with special classes validatable through
ModelTest .
@param from the original object
@param to an empty object to be filled | [
"note",
":",
"deepCopy",
"works",
"only",
"with",
"special",
"classes",
"validatable",
"through",
"ModelTest",
"."
] | train | https://github.com/BrunoEberhard/minimal-j/blob/f7c5461b2b47a10b383aee1e2f1f150f6773703b/src/main/java/org/minimalj/util/CloneHelper.java#L62-L72 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1alpha/WebSecurityScannerClient.java | WebSecurityScannerClient.createScanConfig | public final ScanConfig createScanConfig(String parent, ScanConfig scanConfig) {
"""
Creates a new ScanConfig.
<p>Sample code:
<pre><code>
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ScanConfig scanConfig =... | java | public final ScanConfig createScanConfig(String parent, ScanConfig scanConfig) {
CreateScanConfigRequest request =
CreateScanConfigRequest.newBuilder().setParent(parent).setScanConfig(scanConfig).build();
return createScanConfig(request);
} | [
"public",
"final",
"ScanConfig",
"createScanConfig",
"(",
"String",
"parent",
",",
"ScanConfig",
"scanConfig",
")",
"{",
"CreateScanConfigRequest",
"request",
"=",
"CreateScanConfigRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"parent",
")",
".",
"... | Creates a new ScanConfig.
<p>Sample code:
<pre><code>
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ScanConfig scanConfig = ScanConfig.newBuilder().build();
ScanConfig response = webSecurityScannerClient.createScanConfig... | [
"Creates",
"a",
"new",
"ScanConfig",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1alpha/WebSecurityScannerClient.java#L210-L215 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/graph/SparkComputationGraph.java | SparkComputationGraph.evaluateRegressionMDS | public <T extends RegressionEvaluation> T evaluateRegressionMDS(JavaRDD<MultiDataSet> data) {
"""
Evaluate the network (regression performance) in a distributed manner on the provided data
@param data Data to evaluate
@return {@link RegressionEvaluation} instance with regression performance
"""
... | java | public <T extends RegressionEvaluation> T evaluateRegressionMDS(JavaRDD<MultiDataSet> data) {
return evaluateRegressionMDS(data, DEFAULT_EVAL_SCORE_BATCH_SIZE);
} | [
"public",
"<",
"T",
"extends",
"RegressionEvaluation",
">",
"T",
"evaluateRegressionMDS",
"(",
"JavaRDD",
"<",
"MultiDataSet",
">",
"data",
")",
"{",
"return",
"evaluateRegressionMDS",
"(",
"data",
",",
"DEFAULT_EVAL_SCORE_BATCH_SIZE",
")",
";",
"}"
] | Evaluate the network (regression performance) in a distributed manner on the provided data
@param data Data to evaluate
@return {@link RegressionEvaluation} instance with regression performance | [
"Evaluate",
"the",
"network",
"(",
"regression",
"performance",
")",
"in",
"a",
"distributed",
"manner",
"on",
"the",
"provided",
"data"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/graph/SparkComputationGraph.java#L743-L745 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.toAsync | public static Func0<Observable<Void>> toAsync(Action0 action) {
"""
Convert a synchronous action call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.an.png" alt="">
<p>
@param action the action to conv... | java | public static Func0<Observable<Void>> toAsync(Action0 action) {
return toAsync(action, Schedulers.computation());
} | [
"public",
"static",
"Func0",
"<",
"Observable",
"<",
"Void",
">",
">",
"toAsync",
"(",
"Action0",
"action",
")",
"{",
"return",
"toAsync",
"(",
"action",
",",
"Schedulers",
".",
"computation",
"(",
")",
")",
";",
"}"
] | Convert a synchronous action call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.an.png" alt="">
<p>
@param action the action to convert
@return a function that returns an Observable that executes the {@code ac... | [
"Convert",
"a",
"synchronous",
"action",
"call",
"into",
"an",
"asynchronous",
"function",
"call",
"through",
"an",
"Observable",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"wiki",
... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L146-L148 |
junit-team/junit4 | src/main/java/org/junit/runner/Description.java | Description.createSuiteDescription | public static Description createSuiteDescription(Class<?> testClass, Annotation... annotations) {
"""
Create a <code>Description</code> named after <code>testClass</code>
@param testClass A not null {@link Class} containing tests
@param annotations meta-data about the test, for downstream interpreters
@return... | java | public static Description createSuiteDescription(Class<?> testClass, Annotation... annotations) {
return new Description(testClass, testClass.getName(), annotations);
} | [
"public",
"static",
"Description",
"createSuiteDescription",
"(",
"Class",
"<",
"?",
">",
"testClass",
",",
"Annotation",
"...",
"annotations",
")",
"{",
"return",
"new",
"Description",
"(",
"testClass",
",",
"testClass",
".",
"getName",
"(",
")",
",",
"annota... | Create a <code>Description</code> named after <code>testClass</code>
@param testClass A not null {@link Class} containing tests
@param annotations meta-data about the test, for downstream interpreters
@return a <code>Description</code> of <code>testClass</code> | [
"Create",
"a",
"<code",
">",
"Description<",
"/",
"code",
">",
"named",
"after",
"<code",
">",
"testClass<",
"/",
"code",
">"
] | train | https://github.com/junit-team/junit4/blob/d9861ecdb6e487f6c352437ee823879aca3b81d4/src/main/java/org/junit/runner/Description.java#L134-L136 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.findAll | public static <T> Collection<T> findAll(Collection<T> self) {
"""
Finds the items matching the IDENTITY Closure (i.e. matching Groovy truth).
<p>
Example:
<pre class="groovyTestCase">
def items = [1, 2, 0, false, true, '', 'foo', [], [4, 5], null]
assert items.findAll() == [1, 2, true, 'foo', [4, 5]]
</... | java | public static <T> Collection<T> findAll(Collection<T> self) {
return findAll(self, Closure.IDENTITY);
} | [
"public",
"static",
"<",
"T",
">",
"Collection",
"<",
"T",
">",
"findAll",
"(",
"Collection",
"<",
"T",
">",
"self",
")",
"{",
"return",
"findAll",
"(",
"self",
",",
"Closure",
".",
"IDENTITY",
")",
";",
"}"
] | Finds the items matching the IDENTITY Closure (i.e. matching Groovy truth).
<p>
Example:
<pre class="groovyTestCase">
def items = [1, 2, 0, false, true, '', 'foo', [], [4, 5], null]
assert items.findAll() == [1, 2, true, 'foo', [4, 5]]
</pre>
@param self a Collection
@return a Collection of the values found
@s... | [
"Finds",
"the",
"items",
"matching",
"the",
"IDENTITY",
"Closure",
"(",
"i",
".",
"e",
".",
" ",
";",
"matching",
"Groovy",
"truth",
")",
".",
"<p",
">",
"Example",
":",
"<pre",
"class",
"=",
"groovyTestCase",
">",
"def",
"items",
"=",
"[",
"1",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L4847-L4849 |
litsec/eidas-opensaml | opensaml3/src/main/java/se/litsec/eidas/opensaml/ext/RequestedAttributeTemplates.java | RequestedAttributeTemplates.CURRENT_ADDRESS | public static RequestedAttribute CURRENT_ADDRESS(Boolean isRequired, boolean includeFriendlyName) {
"""
Creates a {@code RequestedAttribute} object for the CurrentAddress attribute.
@param isRequired
flag to tell whether the attribute is required
@param includeFriendlyName
flag that tells whether the friendl... | java | public static RequestedAttribute CURRENT_ADDRESS(Boolean isRequired, boolean includeFriendlyName) {
return create(AttributeConstants.EIDAS_CURRENT_ADDRESS_ATTRIBUTE_NAME,
includeFriendlyName ? AttributeConstants.EIDAS_CURRENT_ADDRESS_ATTRIBUTE_FRIENDLY_NAME : null,
Attribute.URI_REFERENCE, isRequired);
... | [
"public",
"static",
"RequestedAttribute",
"CURRENT_ADDRESS",
"(",
"Boolean",
"isRequired",
",",
"boolean",
"includeFriendlyName",
")",
"{",
"return",
"create",
"(",
"AttributeConstants",
".",
"EIDAS_CURRENT_ADDRESS_ATTRIBUTE_NAME",
",",
"includeFriendlyName",
"?",
"Attribut... | Creates a {@code RequestedAttribute} object for the CurrentAddress attribute.
@param isRequired
flag to tell whether the attribute is required
@param includeFriendlyName
flag that tells whether the friendly name should be included
@return a {@code RequestedAttribute} object representing the CurrentAddress attribute | [
"Creates",
"a",
"{",
"@code",
"RequestedAttribute",
"}",
"object",
"for",
"the",
"CurrentAddress",
"attribute",
"."
] | train | https://github.com/litsec/eidas-opensaml/blob/522ba6dba433a9524cb8a02464cc3b087b47a2b7/opensaml3/src/main/java/se/litsec/eidas/opensaml/ext/RequestedAttributeTemplates.java#L116-L120 |
jMotif/SAX | src/main/java/net/seninp/jmotif/sax/SAXProcessor.java | SAXProcessor.checkMinDistIsZero | public boolean checkMinDistIsZero(char[] a, char[] b) {
"""
Check for trivial mindist case.
@param a first string.
@param b second string.
@return true if mindist between strings is zero.
"""
for (int i = 0; i < a.length; i++) {
if (charDistance(a[i], b[i]) > 1) {
return false;
... | java | public boolean checkMinDistIsZero(char[] a, char[] b) {
for (int i = 0; i < a.length; i++) {
if (charDistance(a[i], b[i]) > 1) {
return false;
}
}
return true;
} | [
"public",
"boolean",
"checkMinDistIsZero",
"(",
"char",
"[",
"]",
"a",
",",
"char",
"[",
"]",
"b",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"a",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"charDistance",
"(",
"a",
"... | Check for trivial mindist case.
@param a first string.
@param b second string.
@return true if mindist between strings is zero. | [
"Check",
"for",
"trivial",
"mindist",
"case",
"."
] | train | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/SAXProcessor.java#L389-L396 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.