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 |
|---|---|---|---|---|---|---|---|---|---|---|
google/error-prone | check_api/src/main/java/com/google/errorprone/bugpatterns/BugChecker.java | BugChecker.describeMatch | @CheckReturnValue
protected Description describeMatch(JCTree node, Fix fix) {
"""
Helper to create a Description for the common case where there is a fix.
"""
return describeMatch((Tree) node, fix);
} | java | @CheckReturnValue
protected Description describeMatch(JCTree node, Fix fix) {
return describeMatch((Tree) node, fix);
} | [
"@",
"CheckReturnValue",
"protected",
"Description",
"describeMatch",
"(",
"JCTree",
"node",
",",
"Fix",
"fix",
")",
"{",
"return",
"describeMatch",
"(",
"(",
"Tree",
")",
"node",
",",
"fix",
")",
";",
"}"
] | Helper to create a Description for the common case where there is a fix. | [
"Helper",
"to",
"create",
"a",
"Description",
"for",
"the",
"common",
"case",
"where",
"there",
"is",
"a",
"fix",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/bugpatterns/BugChecker.java#L117-L120 |
james-hu/jabb-core | src/main/java/net/sf/jabb/util/db/ResultSetUtility.java | ResultSetUtility.convertToMap | public Map<String, Object> convertToMap(ResultSet rs) throws SQLException {
"""
Convert current row of the ResultSet to a Map. The keys of the Map are property names transformed from column names.
@param rs the result set
@return a Map representation of current row
@throws SQLException
"""
return convert... | java | public Map<String, Object> convertToMap(ResultSet rs) throws SQLException{
return convertToMap(rs, null);
} | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"convertToMap",
"(",
"ResultSet",
"rs",
")",
"throws",
"SQLException",
"{",
"return",
"convertToMap",
"(",
"rs",
",",
"null",
")",
";",
"}"
] | Convert current row of the ResultSet to a Map. The keys of the Map are property names transformed from column names.
@param rs the result set
@return a Map representation of current row
@throws SQLException | [
"Convert",
"current",
"row",
"of",
"the",
"ResultSet",
"to",
"a",
"Map",
".",
"The",
"keys",
"of",
"the",
"Map",
"are",
"property",
"names",
"transformed",
"from",
"column",
"names",
"."
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/db/ResultSetUtility.java#L60-L62 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.serviceName_modem_lan_lanName_dhcp_dhcpName_DHCPStaticAddresses_MACAddress_DELETE | public OvhTask serviceName_modem_lan_lanName_dhcp_dhcpName_DHCPStaticAddresses_MACAddress_DELETE(String serviceName, String lanName, String dhcpName, String MACAddress) throws IOException {
"""
Delete this port mapping
REST: DELETE /xdsl/{serviceName}/modem/lan/{lanName}/dhcp/{dhcpName}/DHCPStaticAddresses/{MAC... | java | public OvhTask serviceName_modem_lan_lanName_dhcp_dhcpName_DHCPStaticAddresses_MACAddress_DELETE(String serviceName, String lanName, String dhcpName, String MACAddress) throws IOException {
String qPath = "/xdsl/{serviceName}/modem/lan/{lanName}/dhcp/{dhcpName}/DHCPStaticAddresses/{MACAddress}";
StringBuilder sb = ... | [
"public",
"OvhTask",
"serviceName_modem_lan_lanName_dhcp_dhcpName_DHCPStaticAddresses_MACAddress_DELETE",
"(",
"String",
"serviceName",
",",
"String",
"lanName",
",",
"String",
"dhcpName",
",",
"String",
"MACAddress",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=... | Delete this port mapping
REST: DELETE /xdsl/{serviceName}/modem/lan/{lanName}/dhcp/{dhcpName}/DHCPStaticAddresses/{MACAddress}
@param serviceName [required] The internal name of your XDSL offer
@param lanName [required] Name of the LAN
@param dhcpName [required] Name of the DHCP
@param MACAddress [required] The MAC ad... | [
"Delete",
"this",
"port",
"mapping"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L1122-L1127 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Graphics.java | Graphics.drawLine | public void drawLine(float x1, float y1, float x2, float y2) {
"""
Draw a line on the canvas in the current colour
@param x1
The x coordinate of the start point
@param y1
The y coordinate of the start point
@param x2
The x coordinate of the end point
@param y2
The y coordinate of the end point
"""
... | java | public void drawLine(float x1, float y1, float x2, float y2) {
float lineWidth = this.lineWidth - 1;
if (LSR.applyGLLineFixes()) {
if (x1 == x2) {
if (y1 > y2) {
float temp = y2;
y2 = y1;
y1 = temp;
}
float step = 1 / sy;
lineWidth = lineWidth / sy;
fillRect(x1-(... | [
"public",
"void",
"drawLine",
"(",
"float",
"x1",
",",
"float",
"y1",
",",
"float",
"x2",
",",
"float",
"y2",
")",
"{",
"float",
"lineWidth",
"=",
"this",
".",
"lineWidth",
"-",
"1",
";",
"if",
"(",
"LSR",
".",
"applyGLLineFixes",
"(",
")",
")",
"{... | Draw a line on the canvas in the current colour
@param x1
The x coordinate of the start point
@param y1
The y coordinate of the start point
@param x2
The x coordinate of the end point
@param y2
The y coordinate of the end point | [
"Draw",
"a",
"line",
"on",
"the",
"canvas",
"in",
"the",
"current",
"colour"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Graphics.java#L452-L489 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dbaastimeseries/src/main/java/net/minidev/ovh/api/ApiOvhDbaastimeseries.java | ApiOvhDbaastimeseries.serviceName_token_opentsdb_tokenId_GET | public OvhOpenTSDBToken serviceName_token_opentsdb_tokenId_GET(String serviceName, String tokenId) throws IOException {
"""
Get a OpenTSDB token
REST: GET /dbaas/timeseries/{serviceName}/token/opentsdb/{tokenId}
@param serviceName [required] Service Name
@param tokenId [required] token id
API beta
"""
... | java | public OvhOpenTSDBToken serviceName_token_opentsdb_tokenId_GET(String serviceName, String tokenId) throws IOException {
String qPath = "/dbaas/timeseries/{serviceName}/token/opentsdb/{tokenId}";
StringBuilder sb = path(qPath, serviceName, tokenId);
String resp = exec(qPath, "GET", sb.toString(), null);
return c... | [
"public",
"OvhOpenTSDBToken",
"serviceName_token_opentsdb_tokenId_GET",
"(",
"String",
"serviceName",
",",
"String",
"tokenId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dbaas/timeseries/{serviceName}/token/opentsdb/{tokenId}\"",
";",
"StringBuilder",
"sb",... | Get a OpenTSDB token
REST: GET /dbaas/timeseries/{serviceName}/token/opentsdb/{tokenId}
@param serviceName [required] Service Name
@param tokenId [required] token id
API beta | [
"Get",
"a",
"OpenTSDB",
"token"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaastimeseries/src/main/java/net/minidev/ovh/api/ApiOvhDbaastimeseries.java#L101-L106 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/AbstractDb.java | AbstractDb.find | public <T> T find(Query query, RsHandler<T> rsh) throws SQLException {
"""
查询<br>
Query为查询所需数据的一个实体类,此对象中可以定义返回字段、查询条件,查询的表、分页等信息
@param <T> 需要处理成的结果对象类型
@param query {@link Query}对象,此对象中可以定义返回字段、查询条件,查询的表、分页等信息
@param rsh 结果集处理对象
@return 结果对象
@throws SQLException SQL执行异常
@since 4.0.0
"""
Connectio... | java | public <T> T find(Query query, RsHandler<T> rsh) throws SQLException {
Connection conn = null;
try {
conn = this.getConnection();
return runner.find(conn, query, rsh);
} catch (SQLException e) {
throw e;
} finally {
this.closeConnection(conn);
}
} | [
"public",
"<",
"T",
">",
"T",
"find",
"(",
"Query",
"query",
",",
"RsHandler",
"<",
"T",
">",
"rsh",
")",
"throws",
"SQLException",
"{",
"Connection",
"conn",
"=",
"null",
";",
"try",
"{",
"conn",
"=",
"this",
".",
"getConnection",
"(",
")",
";",
"... | 查询<br>
Query为查询所需数据的一个实体类,此对象中可以定义返回字段、查询条件,查询的表、分页等信息
@param <T> 需要处理成的结果对象类型
@param query {@link Query}对象,此对象中可以定义返回字段、查询条件,查询的表、分页等信息
@param rsh 结果集处理对象
@return 结果对象
@throws SQLException SQL执行异常
@since 4.0.0 | [
"查询<br",
">",
"Query为查询所需数据的一个实体类,此对象中可以定义返回字段、查询条件,查询的表、分页等信息"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/AbstractDb.java#L455-L465 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/utils/ValueMap.java | ValueMap.withJSON | public ValueMap withJSON(String key, String jsonValue) {
"""
Sets the value of the specified key to an object represented by the JSON
structure passed.
"""
super.put(key, valueConformer.transform(Jackson.fromJsonString(jsonValue, Object.class)));
return this;
} | java | public ValueMap withJSON(String key, String jsonValue) {
super.put(key, valueConformer.transform(Jackson.fromJsonString(jsonValue, Object.class)));
return this;
} | [
"public",
"ValueMap",
"withJSON",
"(",
"String",
"key",
",",
"String",
"jsonValue",
")",
"{",
"super",
".",
"put",
"(",
"key",
",",
"valueConformer",
".",
"transform",
"(",
"Jackson",
".",
"fromJsonString",
"(",
"jsonValue",
",",
"Object",
".",
"class",
")... | Sets the value of the specified key to an object represented by the JSON
structure passed. | [
"Sets",
"the",
"value",
"of",
"the",
"specified",
"key",
"to",
"an",
"object",
"represented",
"by",
"the",
"JSON",
"structure",
"passed",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/utils/ValueMap.java#L203-L206 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java | GeometryCoordinateDimension.convertSequence | private static CoordinateArraySequence convertSequence(Coordinate[] cs,int dimension) {
"""
Create a new CoordinateArraySequence and update its dimension
@param cs a coordinate array
@return a new CoordinateArraySequence
"""
for (int i = 0; i < cs.length; i++) {
Coordinate coor... | java | private static CoordinateArraySequence convertSequence(Coordinate[] cs,int dimension) {
for (int i = 0; i < cs.length; i++) {
Coordinate coord = cs[i];
switch (dimension) {
case 2:
coord.z = Double.NaN;
cs[i]=coord;
... | [
"private",
"static",
"CoordinateArraySequence",
"convertSequence",
"(",
"Coordinate",
"[",
"]",
"cs",
",",
"int",
"dimension",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"cs",
".",
"length",
";",
"i",
"++",
")",
"{",
"Coordinate",
"coor... | Create a new CoordinateArraySequence and update its dimension
@param cs a coordinate array
@return a new CoordinateArraySequence | [
"Create",
"a",
"new",
"CoordinateArraySequence",
"and",
"update",
"its",
"dimension"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java#L164-L185 |
lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java | RequireOS.displayOSInfo | public void displayOSInfo( Log log, boolean info ) {
"""
Log the current OS information.
@param log the log
@param info the info
"""
String string =
"OS Info: Arch: " + Os.OS_ARCH + " Family: " + Os.OS_FAMILY + " Name: " + Os.OS_NAME + " Version: "
+ Os.OS_VERSION;
... | java | public void displayOSInfo( Log log, boolean info )
{
String string =
"OS Info: Arch: " + Os.OS_ARCH + " Family: " + Os.OS_FAMILY + " Name: " + Os.OS_NAME + " Version: "
+ Os.OS_VERSION;
if ( !info )
{
log.debug( string );
}
else
... | [
"public",
"void",
"displayOSInfo",
"(",
"Log",
"log",
",",
"boolean",
"info",
")",
"{",
"String",
"string",
"=",
"\"OS Info: Arch: \"",
"+",
"Os",
".",
"OS_ARCH",
"+",
"\" Family: \"",
"+",
"Os",
".",
"OS_FAMILY",
"+",
"\" Name: \"",
"+",
"Os",
".",
"OS_NA... | Log the current OS information.
@param log the log
@param info the info | [
"Log",
"the",
"current",
"OS",
"information",
"."
] | train | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java#L161-L175 |
apache/groovy | subprojects/groovy-sql/src/main/java/groovy/sql/GroovyResultSetExtension.java | GroovyResultSetExtension.getProperty | public Object getProperty(String columnName) {
"""
Gets the value of the designated column in the current row
of as an <code>Object</code>.
@param columnName the SQL name of the column
@return the returned column value
@throws MissingPropertyException if an SQLException happens while getting the object
@see... | java | public Object getProperty(String columnName) {
try {
return getResultSet().getObject(columnName);
}
catch (SQLException e) {
throw new MissingPropertyException(columnName, GroovyResultSetProxy.class, e);
}
} | [
"public",
"Object",
"getProperty",
"(",
"String",
"columnName",
")",
"{",
"try",
"{",
"return",
"getResultSet",
"(",
")",
".",
"getObject",
"(",
"columnName",
")",
";",
"}",
"catch",
"(",
"SQLException",
"e",
")",
"{",
"throw",
"new",
"MissingPropertyExcepti... | Gets the value of the designated column in the current row
of as an <code>Object</code>.
@param columnName the SQL name of the column
@return the returned column value
@throws MissingPropertyException if an SQLException happens while getting the object
@see groovy.lang.GroovyObject#getProperty(java.lang.String)
@see R... | [
"Gets",
"the",
"value",
"of",
"the",
"designated",
"column",
"in",
"the",
"current",
"row",
"of",
"as",
"an",
"<code",
">",
"Object<",
"/",
"code",
">",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-sql/src/main/java/groovy/sql/GroovyResultSetExtension.java#L115-L122 |
jbossws/jbossws-common | src/main/java/org/jboss/ws/common/JavaUtils.java | JavaUtils.isAssignableFrom | public static boolean isAssignableFrom(Class<?> dest, Class<?> src) {
"""
Return true if the dest class is assignable from the src.
Also handles arrays and primitives.
"""
if (dest == null || src == null)
throw MESSAGES.cannotCheckClassIsAssignableFrom(dest, src);
boolean isAssignable = ... | java | public static boolean isAssignableFrom(Class<?> dest, Class<?> src)
{
if (dest == null || src == null)
throw MESSAGES.cannotCheckClassIsAssignableFrom(dest, src);
boolean isAssignable = dest.isAssignableFrom(src);
if (isAssignable == false && dest.getName().equals(src.getName()))
{
... | [
"public",
"static",
"boolean",
"isAssignableFrom",
"(",
"Class",
"<",
"?",
">",
"dest",
",",
"Class",
"<",
"?",
">",
"src",
")",
"{",
"if",
"(",
"dest",
"==",
"null",
"||",
"src",
"==",
"null",
")",
"throw",
"MESSAGES",
".",
"cannotCheckClassIsAssignable... | Return true if the dest class is assignable from the src.
Also handles arrays and primitives. | [
"Return",
"true",
"if",
"the",
"dest",
"class",
"is",
"assignable",
"from",
"the",
"src",
".",
"Also",
"handles",
"arrays",
"and",
"primitives",
"."
] | train | https://github.com/jbossws/jbossws-common/blob/fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7/src/main/java/org/jboss/ws/common/JavaUtils.java#L454-L478 |
voldemort/voldemort | src/java/voldemort/utils/pool/ResourcePoolConfig.java | ResourcePoolConfig.setTimeout | public ResourcePoolConfig setTimeout(long timeout, TimeUnit unit) {
"""
The timeout which we block for when a resource is not available
@param timeout The timeout
@param unit The units of the timeout
"""
if(timeout < 0)
throw new IllegalArgumentException("The timeout must be a non-negat... | java | public ResourcePoolConfig setTimeout(long timeout, TimeUnit unit) {
if(timeout < 0)
throw new IllegalArgumentException("The timeout must be a non-negative number.");
this.timeoutNs = TimeUnit.NANOSECONDS.convert(timeout, unit);
return this;
} | [
"public",
"ResourcePoolConfig",
"setTimeout",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"if",
"(",
"timeout",
"<",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The timeout must be a non-negative number.\"",
")",
";",
"this",
".",
... | The timeout which we block for when a resource is not available
@param timeout The timeout
@param unit The units of the timeout | [
"The",
"timeout",
"which",
"we",
"block",
"for",
"when",
"a",
"resource",
"is",
"not",
"available"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/utils/pool/ResourcePoolConfig.java#L59-L64 |
jcustenborder/connect-utils | connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java | Validators.validEnum | public static Validator validEnum(Class<? extends Enum> enumClass, Enum... excludes) {
"""
Method is used to create a new INSTANCE of the enum validator.
@param enumClass Enum class with the entries to validate for.
@param excludes Enum entries to exclude from the validator.
@return validator
"""
Str... | java | public static Validator validEnum(Class<? extends Enum> enumClass, Enum... excludes) {
String[] ex = new String[excludes.length];
for (int i = 0; i < ex.length; i++) {
ex[i] = excludes[i].toString();
}
return ValidEnum.of(enumClass, ex);
} | [
"public",
"static",
"Validator",
"validEnum",
"(",
"Class",
"<",
"?",
"extends",
"Enum",
">",
"enumClass",
",",
"Enum",
"...",
"excludes",
")",
"{",
"String",
"[",
"]",
"ex",
"=",
"new",
"String",
"[",
"excludes",
".",
"length",
"]",
";",
"for",
"(",
... | Method is used to create a new INSTANCE of the enum validator.
@param enumClass Enum class with the entries to validate for.
@param excludes Enum entries to exclude from the validator.
@return validator | [
"Method",
"is",
"used",
"to",
"create",
"a",
"new",
"INSTANCE",
"of",
"the",
"enum",
"validator",
"."
] | train | https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java#L134-L140 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/br/br_adduser.java | br_adduser.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
br_adduser_responses result = (br_adduser_responses) service.get_payloa... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
br_adduser_responses result = (br_adduser_responses) service.get_payload_formatter().string_to_resource(br_adduser_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode == S... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"br_adduser_responses",
"result",
"=",
"(",
"br_adduser_responses",
")",
"service",
".",
"get_payload_formatte... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/br/br_adduser.java#L199-L216 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java | Query.startAfter | public Query startAfter(Object... fieldValues) {
"""
Creates and returns a new Query that starts after the provided fields relative to the order of
the query. The order of the field values must match the order of the order by clauses of the
query.
@param fieldValues The field values to start this query after,... | java | public Query startAfter(Object... fieldValues) {
QueryOptions newOptions = new QueryOptions(options);
newOptions.startCursor = createCursor(newOptions.fieldOrders, fieldValues, false);
return new Query(firestore, path, newOptions);
} | [
"public",
"Query",
"startAfter",
"(",
"Object",
"...",
"fieldValues",
")",
"{",
"QueryOptions",
"newOptions",
"=",
"new",
"QueryOptions",
"(",
"options",
")",
";",
"newOptions",
".",
"startCursor",
"=",
"createCursor",
"(",
"newOptions",
".",
"fieldOrders",
",",... | Creates and returns a new Query that starts after the provided fields relative to the order of
the query. The order of the field values must match the order of the order by clauses of the
query.
@param fieldValues The field values to start this query after, in order of the query's order
by.
@return The created Query. | [
"Creates",
"and",
"returns",
"a",
"new",
"Query",
"that",
"starts",
"after",
"the",
"provided",
"fields",
"relative",
"to",
"the",
"order",
"of",
"the",
"query",
".",
"The",
"order",
"of",
"the",
"field",
"values",
"must",
"match",
"the",
"order",
"of",
... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java#L798-L802 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/CollisionCategoryConfig.java | CollisionCategoryConfig.imports | public static Collection<CollisionCategory> imports(Xml root) {
"""
Create the collision category data from node (should only be used to display names, as real content is
<code>null</code>, mainly UI specific to not have dependency on {@link MapTileCollision}).
@param root The node root reference (must not be ... | java | public static Collection<CollisionCategory> imports(Xml root)
{
Check.notNull(root);
final Collection<Xml> childrenCategory = root.getChildren(NODE_CATEGORY);
final Collection<CollisionCategory> categories = new ArrayList<>(childrenCategory.size());
for (final Xml node : chi... | [
"public",
"static",
"Collection",
"<",
"CollisionCategory",
">",
"imports",
"(",
"Xml",
"root",
")",
"{",
"Check",
".",
"notNull",
"(",
"root",
")",
";",
"final",
"Collection",
"<",
"Xml",
">",
"childrenCategory",
"=",
"root",
".",
"getChildren",
"(",
"NOD... | Create the collision category data from node (should only be used to display names, as real content is
<code>null</code>, mainly UI specific to not have dependency on {@link MapTileCollision}).
@param root The node root reference (must not be <code>null</code>).
@return The collisions category data.
@throws LionEngine... | [
"Create",
"the",
"collision",
"category",
"data",
"from",
"node",
"(",
"should",
"only",
"be",
"used",
"to",
"display",
"names",
"as",
"real",
"content",
"is",
"<code",
">",
"null<",
"/",
"code",
">",
"mainly",
"UI",
"specific",
"to",
"not",
"have",
"dep... | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/CollisionCategoryConfig.java#L63-L92 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/FunctionExtensions.java | FunctionExtensions.andThen | public static Procedure0 andThen(final Procedure0 before, final Procedure0 after) {
"""
Returns a composed {@code Procedure1} that performs, in sequence, the {@code before}
operation followed by the {@code after} operation. If performing either
operation throws an exception, it is relayed to the caller of the
c... | java | public static Procedure0 andThen(final Procedure0 before, final Procedure0 after) {
if (after == null)
throw new NullPointerException("after");
if (before == null)
throw new NullPointerException("before");
return new Procedures.Procedure0() {
@Override
public void apply() {
before.apply();
aft... | [
"public",
"static",
"Procedure0",
"andThen",
"(",
"final",
"Procedure0",
"before",
",",
"final",
"Procedure0",
"after",
")",
"{",
"if",
"(",
"after",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"after\"",
")",
";",
"if",
"(",
"before",
... | Returns a composed {@code Procedure1} that performs, in sequence, the {@code before}
operation followed by the {@code after} operation. If performing either
operation throws an exception, it is relayed to the caller of the
composed operation. If performing the {@code before} operation throws an exception,
the {@code af... | [
"Returns",
"a",
"composed",
"{",
"@code",
"Procedure1",
"}",
"that",
"performs",
"in",
"sequence",
"the",
"{",
"@code",
"before",
"}",
"operation",
"followed",
"by",
"the",
"{",
"@code",
"after",
"}",
"operation",
".",
"If",
"performing",
"either",
"operatio... | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/FunctionExtensions.java#L294-L306 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTree.java | WTree.getItemImageUrl | public String getItemImageUrl(final TreeItemImage item, final String itemId) {
"""
Retrieves a URL for the tree item image.
<p>
This method is used by the WTree Renderer.
</p>
@param item the tree item
@param itemId the tree item id
@return the URL to access the tree item image.
"""
if (item == null... | java | public String getItemImageUrl(final TreeItemImage item, final String itemId) {
if (item == null) {
return null;
}
// Check if has image url
String url = item.getUrl();
if (!Util.empty(url)) {
return url;
}
// Check if has image
Image image = item.getImage();
if (image == null) {
return nul... | [
"public",
"String",
"getItemImageUrl",
"(",
"final",
"TreeItemImage",
"item",
",",
"final",
"String",
"itemId",
")",
"{",
"if",
"(",
"item",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// Check if has image url",
"String",
"url",
"=",
"item",
".",
... | Retrieves a URL for the tree item image.
<p>
This method is used by the WTree Renderer.
</p>
@param item the tree item
@param itemId the tree item id
@return the URL to access the tree item image. | [
"Retrieves",
"a",
"URL",
"for",
"the",
"tree",
"item",
"image",
".",
"<p",
">",
"This",
"method",
"is",
"used",
"by",
"the",
"WTree",
"Renderer",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTree.java#L433-L483 |
Netflix/astyanax | astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/locks/OneStepDistributedRowLock.java | OneStepDistributedRowLock.fillLockMutation | public C fillLockMutation(MutationBatch m, Long time, Integer ttl) {
"""
Fill a mutation with the lock column. This may be used when the mutation
is executed externally but should be used with extreme caution to ensure
the lock is properly released
@param m
@param time
@param ttl
"""
if (lockCol... | java | public C fillLockMutation(MutationBatch m, Long time, Integer ttl) {
if (lockColumn != null) {
if (!lockColumn.equals(columnStrategy.generateLockColumn()))
throw new IllegalStateException("Can't change prefix or lockId after acquiring the lock");
}
else {
... | [
"public",
"C",
"fillLockMutation",
"(",
"MutationBatch",
"m",
",",
"Long",
"time",
",",
"Integer",
"ttl",
")",
"{",
"if",
"(",
"lockColumn",
"!=",
"null",
")",
"{",
"if",
"(",
"!",
"lockColumn",
".",
"equals",
"(",
"columnStrategy",
".",
"generateLockColum... | Fill a mutation with the lock column. This may be used when the mutation
is executed externally but should be used with extreme caution to ensure
the lock is properly released
@param m
@param time
@param ttl | [
"Fill",
"a",
"mutation",
"with",
"the",
"lock",
"column",
".",
"This",
"may",
"be",
"used",
"when",
"the",
"mutation",
"is",
"executed",
"externally",
"but",
"should",
"be",
"used",
"with",
"extreme",
"caution",
"to",
"ensure",
"the",
"lock",
"is",
"proper... | train | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/locks/OneStepDistributedRowLock.java#L387-L403 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/RestorePointsInner.java | RestorePointsInner.beginCreateAsync | public Observable<RestorePointInner> beginCreateAsync(String resourceGroupName, String serverName, String databaseName, String restorePointLabel) {
"""
Creates a restore point for a data warehouse.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from... | java | public Observable<RestorePointInner> beginCreateAsync(String resourceGroupName, String serverName, String databaseName, String restorePointLabel) {
return beginCreateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, restorePointLabel).map(new Func1<ServiceResponse<RestorePointInner>, Restore... | [
"public",
"Observable",
"<",
"RestorePointInner",
">",
"beginCreateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"restorePointLabel",
")",
"{",
"return",
"beginCreateWithServiceResponseAsync",
"(",
... | Creates a restore point for a data warehouse.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database.
@param restorePointLabel... | [
"Creates",
"a",
"restore",
"point",
"for",
"a",
"data",
"warehouse",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/RestorePointsInner.java#L305-L312 |
cogroo/cogroo4 | cogroo-gc/src/main/java/org/cogroo/tools/checker/rules/util/TagMaskUtils.java | TagMaskUtils.createTagMaskFromToken | public static TagMask createTagMaskFromToken(Token token, String text) {
"""
Returns a TagMask with the attributes collected from the given token.
@param token
the token whose attributes will be collected.
@param text
a string containing the attributes to get from the token,
e.g., "number gender"
@returna... | java | public static TagMask createTagMaskFromToken(Token token, String text) {
TagMask tm = new TagMask();
Matcher m = REPLACE_R2.matcher(text);
while (m.find()) {
String property = m.group(1);
switch (property) {
case "number":
tm.setNumber(token.getMorphologicalTag().getNumberE());
break;
... | [
"public",
"static",
"TagMask",
"createTagMaskFromToken",
"(",
"Token",
"token",
",",
"String",
"text",
")",
"{",
"TagMask",
"tm",
"=",
"new",
"TagMask",
"(",
")",
";",
"Matcher",
"m",
"=",
"REPLACE_R2",
".",
"matcher",
"(",
"text",
")",
";",
"while",
"("... | Returns a TagMask with the attributes collected from the given token.
@param token
the token whose attributes will be collected.
@param text
a string containing the attributes to get from the token,
e.g., "number gender"
@returna a TagMask object with the attributes collected | [
"Returns",
"a",
"TagMask",
"with",
"the",
"attributes",
"collected",
"from",
"the",
"given",
"token",
"."
] | train | https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/cogroo-gc/src/main/java/org/cogroo/tools/checker/rules/util/TagMaskUtils.java#L115-L146 |
recommenders/rival | rival-examples/src/main/java/net/recommenders/rival/examples/movietweetings/RandomMahoutIBRecommenderEvaluator.java | RandomMahoutIBRecommenderEvaluator.prepareSplits | public static void prepareSplits(final String url, final float percentage, final String inFile, final String folder, final String outPath) {
"""
Downloads a dataset and stores the splits generated from it.
@param url url where dataset can be downloaded from
@param percentage percentage to be used in the random... | java | public static void prepareSplits(final String url, final float percentage, final String inFile, final String folder, final String outPath) {
DataDownloader dd = new DataDownloader(url, folder);
dd.download();
boolean perUser = true;
long seed = SEED;
UIPParser parser = new UIPPa... | [
"public",
"static",
"void",
"prepareSplits",
"(",
"final",
"String",
"url",
",",
"final",
"float",
"percentage",
",",
"final",
"String",
"inFile",
",",
"final",
"String",
"folder",
",",
"final",
"String",
"outPath",
")",
"{",
"DataDownloader",
"dd",
"=",
"ne... | Downloads a dataset and stores the splits generated from it.
@param url url where dataset can be downloaded from
@param percentage percentage to be used in the random split
@param inFile file to be used once the dataset has been downloaded
@param folder folder where dataset will be stored
@param outPath path where the... | [
"Downloads",
"a",
"dataset",
"and",
"stores",
"the",
"splits",
"generated",
"from",
"it",
"."
] | train | https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-examples/src/main/java/net/recommenders/rival/examples/movietweetings/RandomMahoutIBRecommenderEvaluator.java#L121-L165 |
Erudika/para | para-core/src/main/java/com/erudika/para/utils/Utils.java | Utils.stripAndTrim | public static String stripAndTrim(String str, String replaceWith) {
"""
Strips all symbols, punctuation, whitespace and control chars from a string.
@param str a dirty string
@param replaceWith a string to replace spaces with
@return a clean string
"""
return stripAndTrim(str, replaceWith, false);
} | java | public static String stripAndTrim(String str, String replaceWith) {
return stripAndTrim(str, replaceWith, false);
} | [
"public",
"static",
"String",
"stripAndTrim",
"(",
"String",
"str",
",",
"String",
"replaceWith",
")",
"{",
"return",
"stripAndTrim",
"(",
"str",
",",
"replaceWith",
",",
"false",
")",
";",
"}"
] | Strips all symbols, punctuation, whitespace and control chars from a string.
@param str a dirty string
@param replaceWith a string to replace spaces with
@return a clean string | [
"Strips",
"all",
"symbols",
"punctuation",
"whitespace",
"and",
"control",
"chars",
"from",
"a",
"string",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/utils/Utils.java#L336-L338 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/CrateDigger.java | CrateDigger.deliverDatabaseUpdate | private void deliverDatabaseUpdate(SlotReference slot, Database database, boolean available) {
"""
Send a database announcement to all registered listeners.
@param slot the media slot whose database availability has changed
@param database the database whose relevance has changed
@param available if {@code} t... | java | private void deliverDatabaseUpdate(SlotReference slot, Database database, boolean available) {
for (final DatabaseListener listener : getDatabaseListeners()) {
try {
if (available) {
listener.databaseMounted(slot, database);
} else {
... | [
"private",
"void",
"deliverDatabaseUpdate",
"(",
"SlotReference",
"slot",
",",
"Database",
"database",
",",
"boolean",
"available",
")",
"{",
"for",
"(",
"final",
"DatabaseListener",
"listener",
":",
"getDatabaseListeners",
"(",
")",
")",
"{",
"try",
"{",
"if",
... | Send a database announcement to all registered listeners.
@param slot the media slot whose database availability has changed
@param database the database whose relevance has changed
@param available if {@code} true, the database is newly available, otherwise it is no longer relevant | [
"Send",
"a",
"database",
"announcement",
"to",
"all",
"registered",
"listeners",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/CrateDigger.java#L726-L738 |
google/truth | extensions/proto/src/main/java/com/google/common/truth/extensions/proto/MapWithProtoValuesSubject.java | MapWithProtoValuesSubject.ignoringFieldScopeForValues | public MapWithProtoValuesFluentAssertion<M> ignoringFieldScopeForValues(FieldScope fieldScope) {
"""
Excludes all specific field paths under the argument {@link FieldScope} from the comparison.
<p>This method is additive and has well-defined ordering semantics. If the invoking {@link
ProtoFluentAssertion} is a... | java | public MapWithProtoValuesFluentAssertion<M> ignoringFieldScopeForValues(FieldScope fieldScope) {
return usingConfig(config.ignoringFieldScope(checkNotNull(fieldScope, "fieldScope")));
} | [
"public",
"MapWithProtoValuesFluentAssertion",
"<",
"M",
">",
"ignoringFieldScopeForValues",
"(",
"FieldScope",
"fieldScope",
")",
"{",
"return",
"usingConfig",
"(",
"config",
".",
"ignoringFieldScope",
"(",
"checkNotNull",
"(",
"fieldScope",
",",
"\"fieldScope\"",
")",... | Excludes all specific field paths under the argument {@link FieldScope} from the comparison.
<p>This method is additive and has well-defined ordering semantics. If the invoking {@link
ProtoFluentAssertion} is already scoped to a {@link FieldScope} {@code X}, and this method is
invoked with {@link FieldScope} {@code Y}... | [
"Excludes",
"all",
"specific",
"field",
"paths",
"under",
"the",
"argument",
"{",
"@link",
"FieldScope",
"}",
"from",
"the",
"comparison",
"."
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/MapWithProtoValuesSubject.java#L719-L721 |
cloudendpoints/endpoints-management-java | endpoints-control/src/main/java/com/google/api/control/model/Distributions.java | Distributions.addSample | public static Distribution addSample(double value, Distribution distribution) {
"""
Updates as new distribution that contains value added to an existing one.
@param value the sample value
@param distribution a {@code Distribution}
@return the updated distribution
"""
Builder builder = distribution.toB... | java | public static Distribution addSample(double value, Distribution distribution) {
Builder builder = distribution.toBuilder();
switch (distribution.getBucketOptionCase()) {
case EXPLICIT_BUCKETS:
updateStatistics(value, builder);
updateExplicitBuckets(value, builder);
return builder.b... | [
"public",
"static",
"Distribution",
"addSample",
"(",
"double",
"value",
",",
"Distribution",
"distribution",
")",
"{",
"Builder",
"builder",
"=",
"distribution",
".",
"toBuilder",
"(",
")",
";",
"switch",
"(",
"distribution",
".",
"getBucketOptionCase",
"(",
")... | Updates as new distribution that contains value added to an existing one.
@param value the sample value
@param distribution a {@code Distribution}
@return the updated distribution | [
"Updates",
"as",
"new",
"distribution",
"that",
"contains",
"value",
"added",
"to",
"an",
"existing",
"one",
"."
] | train | https://github.com/cloudendpoints/endpoints-management-java/blob/5bbf20ddadbbd51b890049e3c338c28abe2c9f94/endpoints-control/src/main/java/com/google/api/control/model/Distributions.java#L135-L153 |
morimekta/utils | diff-util/src/main/java/net/morimekta/diff/Bisect.java | Bisect.fromDelta | public static Bisect fromDelta(String text1, String delta)
throws IllegalArgumentException {
"""
Given the original text1, and an encoded string which describes the
operations required to transform text1 into text2, compute the full diff.
@param text1 Source string for the diff.
@param delta Delta t... | java | public static Bisect fromDelta(String text1, String delta)
throws IllegalArgumentException {
return new Bisect(changesFromDelta(text1, delta));
} | [
"public",
"static",
"Bisect",
"fromDelta",
"(",
"String",
"text1",
",",
"String",
"delta",
")",
"throws",
"IllegalArgumentException",
"{",
"return",
"new",
"Bisect",
"(",
"changesFromDelta",
"(",
"text1",
",",
"delta",
")",
")",
";",
"}"
] | Given the original text1, and an encoded string which describes the
operations required to transform text1 into text2, compute the full diff.
@param text1 Source string for the diff.
@param delta Delta text.
@return Array of DiffBase objects or null if invalid.
@throws IllegalArgumentException If invalid input. | [
"Given",
"the",
"original",
"text1",
"and",
"an",
"encoded",
"string",
"which",
"describes",
"the",
"operations",
"required",
"to",
"transform",
"text1",
"into",
"text2",
"compute",
"the",
"full",
"diff",
"."
] | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/diff-util/src/main/java/net/morimekta/diff/Bisect.java#L79-L82 |
OpenLiberty/open-liberty | dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixCompareCommandTask.java | IFixCompareCommandTask.printAparIFixInfo | private void printAparIFixInfo(CommandConsole console, Map<String, Set<String>> aparToIFixMap) {
"""
This will print the map of APARs to iFixes by giving a line to each APAR listing which iFixes it is in
@param console The console to print to
@param aparToIFixMap The map to print
"""
for (Map.Entry... | java | private void printAparIFixInfo(CommandConsole console, Map<String, Set<String>> aparToIFixMap) {
for (Map.Entry<String, Set<String>> aparIFixInfo : aparToIFixMap.entrySet()) {
console.printlnInfoMessage(getMessage("compare.ifix.apar.info", aparIFixInfo.getKey(), aparIFixInfo.getValue()));
}
... | [
"private",
"void",
"printAparIFixInfo",
"(",
"CommandConsole",
"console",
",",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"aparToIFixMap",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"a... | This will print the map of APARs to iFixes by giving a line to each APAR listing which iFixes it is in
@param console The console to print to
@param aparToIFixMap The map to print | [
"This",
"will",
"print",
"the",
"map",
"of",
"APARs",
"to",
"iFixes",
"by",
"giving",
"a",
"line",
"to",
"each",
"APAR",
"listing",
"which",
"iFixes",
"it",
"is",
"in"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/IFixCompareCommandTask.java#L259-L263 |
apache/incubator-heron | heron/scheduler-core/src/java/org/apache/heron/scheduler/client/HttpServiceSchedulerClient.java | HttpServiceSchedulerClient.getCommandEndpoint | protected String getCommandEndpoint(String schedulerEndpoint, Command command) {
"""
Construct the endpoint to send http request for a particular command
Make sure the construction matches server sides.
@param schedulerEndpoint The scheduler http endpoint
@param command The command to request
@return The htt... | java | protected String getCommandEndpoint(String schedulerEndpoint, Command command) {
// Currently the server side receives command request in lower case
return String.format("http://%s/%s", schedulerEndpoint, command.name().toLowerCase());
} | [
"protected",
"String",
"getCommandEndpoint",
"(",
"String",
"schedulerEndpoint",
",",
"Command",
"command",
")",
"{",
"// Currently the server side receives command request in lower case",
"return",
"String",
".",
"format",
"(",
"\"http://%s/%s\"",
",",
"schedulerEndpoint",
"... | Construct the endpoint to send http request for a particular command
Make sure the construction matches server sides.
@param schedulerEndpoint The scheduler http endpoint
@param command The command to request
@return The http endpoint for particular command | [
"Construct",
"the",
"endpoint",
"to",
"send",
"http",
"request",
"for",
"a",
"particular",
"command",
"Make",
"sure",
"the",
"construction",
"matches",
"server",
"sides",
"."
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/scheduler-core/src/java/org/apache/heron/scheduler/client/HttpServiceSchedulerClient.java#L122-L125 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/BackupService.java | BackupService.createRestoreActivity | public RestoreActivity createRestoreActivity( File backupDirectory, RestoreOptions options ) {
"""
Create a new {@link RestoreActivity activity} instance that can restore the content of the repository to the state as it
exists in the specified backup directory.
@param options a {@link org.modeshape.jcr.api.Res... | java | public RestoreActivity createRestoreActivity( File backupDirectory, RestoreOptions options ) {
return new RestoreActivity(backupDirectory, documentStore, binaryStore, repositoryCache, options);
} | [
"public",
"RestoreActivity",
"createRestoreActivity",
"(",
"File",
"backupDirectory",
",",
"RestoreOptions",
"options",
")",
"{",
"return",
"new",
"RestoreActivity",
"(",
"backupDirectory",
",",
"documentStore",
",",
"binaryStore",
",",
"repositoryCache",
",",
"options"... | Create a new {@link RestoreActivity activity} instance that can restore the content of the repository to the state as it
exists in the specified backup directory.
@param options a {@link org.modeshape.jcr.api.RestoreOptions} instance; may no be null.
@param backupDirectory the directory on the file system that contain... | [
"Create",
"a",
"new",
"{",
"@link",
"RestoreActivity",
"activity",
"}",
"instance",
"that",
"can",
"restore",
"the",
"content",
"of",
"the",
"repository",
"to",
"the",
"state",
"as",
"it",
"exists",
"in",
"the",
"specified",
"backup",
"directory",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/BackupService.java#L206-L208 |
betfair/cougar | cougar-framework/net-util/src/main/java/com/betfair/cougar/netutil/InetSocketAddressUtils.java | InetSocketAddressUtils.createInetSocketAddress | public static InetSocketAddress createInetSocketAddress(String address, int defaultPort) {
"""
<p>Creates an InetSocketAddress given a host and optional port in a single String
<p/>
<p>This allows either IP4 or IP6 addresses (including port) to be provided as Strings as per rfc2732</p>
@param address the ... | java | public static InetSocketAddress createInetSocketAddress(String address, int defaultPort) {
String original = address.trim();
String host = original;
int port = defaultPort;
if (host.startsWith("[")) {
// it is an address in [host] or [host]port format
String[] s ... | [
"public",
"static",
"InetSocketAddress",
"createInetSocketAddress",
"(",
"String",
"address",
",",
"int",
"defaultPort",
")",
"{",
"String",
"original",
"=",
"address",
".",
"trim",
"(",
")",
";",
"String",
"host",
"=",
"original",
";",
"int",
"port",
"=",
"... | <p>Creates an InetSocketAddress given a host and optional port in a single String
<p/>
<p>This allows either IP4 or IP6 addresses (including port) to be provided as Strings as per rfc2732</p>
@param address the address in one of the following formats (the braces '[]'and colon ':' are literal here):
host<br>
[host]... | [
"<p",
">",
"Creates",
"an",
"InetSocketAddress",
"given",
"a",
"host",
"and",
"optional",
"port",
"in",
"a",
"single",
"String",
"<p",
"/",
">",
"<p",
">",
"This",
"allows",
"either",
"IP4",
"or",
"IP6",
"addresses",
"(",
"including",
"port",
")",
"to",
... | train | https://github.com/betfair/cougar/blob/08d1fe338fbd0e8572a9c2305bb5796402d5b1f5/cougar-framework/net-util/src/main/java/com/betfair/cougar/netutil/InetSocketAddressUtils.java#L95-L122 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/subdoc/MutateInBuilder.java | MutateInBuilder.arrayAppend | @Deprecated
public <T> MutateInBuilder arrayAppend(String path, T value, boolean createPath) {
"""
Append to an existing array, pushing the value to the back/last position in
the array.
@param path the path of the array.
@param value the value to insert at the back of the array.
@param createPath true to... | java | @Deprecated
public <T> MutateInBuilder arrayAppend(String path, T value, boolean createPath) {
asyncBuilder.arrayAppend(path, value, new SubdocOptionsBuilder().createPath(createPath));
return this;
} | [
"@",
"Deprecated",
"public",
"<",
"T",
">",
"MutateInBuilder",
"arrayAppend",
"(",
"String",
"path",
",",
"T",
"value",
",",
"boolean",
"createPath",
")",
"{",
"asyncBuilder",
".",
"arrayAppend",
"(",
"path",
",",
"value",
",",
"new",
"SubdocOptionsBuilder",
... | Append to an existing array, pushing the value to the back/last position in
the array.
@param path the path of the array.
@param value the value to insert at the back of the array.
@param createPath true to create missing intermediary nodes. | [
"Append",
"to",
"an",
"existing",
"array",
"pushing",
"the",
"value",
"to",
"the",
"back",
"/",
"last",
"position",
"in",
"the",
"array",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/subdoc/MutateInBuilder.java#L808-L812 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/XMLProperties.java | XMLProperties.getPropertyValue | public Object getPropertyValue(String pKey, Object pDefaultValue) {
"""
Searches for the property with the specified key in this property list.
If the key is not found in this property list, the default property
list, and its defaults, recursively, are then checked. The method
returns the default value argument... | java | public Object getPropertyValue(String pKey, Object pDefaultValue) {
Object value = super.get(pKey); // super.get() is EXTREMELEY IMPORTANT
if (value != null) {
return value;
}
if (defaults instanceof XMLProperties) {
return (((XMLProperties) defaults).getPropertyValue(pKey));
... | [
"public",
"Object",
"getPropertyValue",
"(",
"String",
"pKey",
",",
"Object",
"pDefaultValue",
")",
"{",
"Object",
"value",
"=",
"super",
".",
"get",
"(",
"pKey",
")",
";",
"// super.get() is EXTREMELEY IMPORTANT\r",
"if",
"(",
"value",
"!=",
"null",
")",
"{",... | Searches for the property with the specified key in this property list.
If the key is not found in this property list, the default property
list, and its defaults, recursively, are then checked. The method
returns the default value argument if the property is not found.
@param pKey the property key.
@param pDefaultVal... | [
"Searches",
"for",
"the",
"property",
"with",
"the",
"specified",
"key",
"in",
"this",
"property",
"list",
".",
"If",
"the",
"key",
"is",
"not",
"found",
"in",
"this",
"property",
"list",
"the",
"default",
"property",
"list",
"and",
"its",
"defaults",
"rec... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/XMLProperties.java#L551-L562 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/vod/VodClient.java | VodClient.generateMediaDeliveryInfo | public GenerateMediaDeliveryInfoResponse generateMediaDeliveryInfo(GenerateMediaDeliveryInfoRequest request) {
"""
Delete the specific media resource managed by VOD service.
<p>
The caller <i>must</i> authenticate with a valid BCE Access Key / Private Key pair.
@param request The request object containing all... | java | public GenerateMediaDeliveryInfoResponse generateMediaDeliveryInfo(GenerateMediaDeliveryInfoRequest request) {
checkStringNotEmpty(request.getMediaId(), "Media ID should not be null or empty!");
InternalRequest internalRequest =
createRequest(HttpMethodName.GET, request, PATH_MEDIA, requ... | [
"public",
"GenerateMediaDeliveryInfoResponse",
"generateMediaDeliveryInfo",
"(",
"GenerateMediaDeliveryInfoRequest",
"request",
")",
"{",
"checkStringNotEmpty",
"(",
"request",
".",
"getMediaId",
"(",
")",
",",
"\"Media ID should not be null or empty!\"",
")",
";",
"InternalReq... | Delete the specific media resource managed by VOD service.
<p>
The caller <i>must</i> authenticate with a valid BCE Access Key / Private Key pair.
@param request The request object containing all the options on how to
@return empty response will be returned | [
"Delete",
"the",
"specific",
"media",
"resource",
"managed",
"by",
"VOD",
"service",
".",
"<p",
">",
"The",
"caller",
"<i",
">",
"must<",
"/",
"i",
">",
"authenticate",
"with",
"a",
"valid",
"BCE",
"Access",
"Key",
"/",
"Private",
"Key",
"pair",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/vod/VodClient.java#L770-L776 |
microfocus-idol/java-configuration-impl | src/main/java/com/hp/autonomy/frontend/configuration/ConfigurationUtils.java | ConfigurationUtils.basicValidate | public static <F extends ConfigurationComponent<F>> void basicValidate(final F component, final String section) throws ConfigException {
"""
Calls {@link ConfigurationComponent#basicValidate(String)} on the supplied component if not null
@param component the nullable component
@param section the configuratio... | java | public static <F extends ConfigurationComponent<F>> void basicValidate(final F component, final String section) throws ConfigException {
final Optional<F> maybeComponent = Optional.ofNullable(component);
if (maybeComponent.isPresent()) {
maybeComponent.get().basicValidate(section);
}... | [
"public",
"static",
"<",
"F",
"extends",
"ConfigurationComponent",
"<",
"F",
">",
">",
"void",
"basicValidate",
"(",
"final",
"F",
"component",
",",
"final",
"String",
"section",
")",
"throws",
"ConfigException",
"{",
"final",
"Optional",
"<",
"F",
">",
"may... | Calls {@link ConfigurationComponent#basicValidate(String)} on the supplied component if not null
@param component the nullable component
@param section the configuration section
@param <F> the component type
@throws ConfigException validation failure | [
"Calls",
"{",
"@link",
"ConfigurationComponent#basicValidate",
"(",
"String",
")",
"}",
"on",
"the",
"supplied",
"component",
"if",
"not",
"null"
] | train | https://github.com/microfocus-idol/java-configuration-impl/blob/cd9d744cacfaaae3c76cacc211e65742bbc7b00a/src/main/java/com/hp/autonomy/frontend/configuration/ConfigurationUtils.java#L84-L89 |
logic-ng/LogicNG | src/main/java/org/logicng/backbones/BackboneGeneration.java | BackboneGeneration.computeNegative | public static Backbone computeNegative(final Formula formula, final Collection<Variable> variables) {
"""
Computes the negative backbone variables for a given formula w.r.t. a collection of variables.
@param formula the given formula
@param variables the given collection of relevant variables for the backbone ... | java | public static Backbone computeNegative(final Formula formula, final Collection<Variable> variables) {
return compute(formula, variables, BackboneType.ONLY_NEGATIVE);
} | [
"public",
"static",
"Backbone",
"computeNegative",
"(",
"final",
"Formula",
"formula",
",",
"final",
"Collection",
"<",
"Variable",
">",
"variables",
")",
"{",
"return",
"compute",
"(",
"formula",
",",
"variables",
",",
"BackboneType",
".",
"ONLY_NEGATIVE",
")",... | Computes the negative backbone variables for a given formula w.r.t. a collection of variables.
@param formula the given formula
@param variables the given collection of relevant variables for the backbone computation
@return the negative backbone or {@code null} if the formula is UNSAT | [
"Computes",
"the",
"negative",
"backbone",
"variables",
"for",
"a",
"given",
"formula",
"w",
".",
"r",
".",
"t",
".",
"a",
"collection",
"of",
"variables",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/backbones/BackboneGeneration.java#L221-L223 |
zackpollard/JavaTelegramBot-API | core/src/main/java/pro/zackpollard/telegrambot/api/TelegramBot.java | TelegramBot.editMessageReplyMarkup | public Message editMessageReplyMarkup(String chatId, Long messageId, InlineReplyMarkup inlineReplyMarkup) {
"""
This allows you to edit the InlineReplyMarkup of any message that you have sent previously.
@param chatId The chat ID of the chat containing the message you want to edit
@param message... | java | public Message editMessageReplyMarkup(String chatId, Long messageId, InlineReplyMarkup inlineReplyMarkup) {
if(inlineReplyMarkup != null && chatId != null && messageId != null) {
JSONObject jsonResponse = this.editMessageReplyMarkup(chatId, messageId, null, inlineReplyMarkup);
if(json... | [
"public",
"Message",
"editMessageReplyMarkup",
"(",
"String",
"chatId",
",",
"Long",
"messageId",
",",
"InlineReplyMarkup",
"inlineReplyMarkup",
")",
"{",
"if",
"(",
"inlineReplyMarkup",
"!=",
"null",
"&&",
"chatId",
"!=",
"null",
"&&",
"messageId",
"!=",
"null",
... | This allows you to edit the InlineReplyMarkup of any message that you have sent previously.
@param chatId The chat ID of the chat containing the message you want to edit
@param messageId The message ID of the message you want to edit
@param inlineReplyMarkup Any InlineReplyMarkup object ... | [
"This",
"allows",
"you",
"to",
"edit",
"the",
"InlineReplyMarkup",
"of",
"any",
"message",
"that",
"you",
"have",
"sent",
"previously",
"."
] | train | https://github.com/zackpollard/JavaTelegramBot-API/blob/9d100f351824042ca5fc0ea735d1fa376a13e81d/core/src/main/java/pro/zackpollard/telegrambot/api/TelegramBot.java#L858-L871 |
azkaban/azkaban | azkaban-web-server/src/main/java/azkaban/scheduler/AbstractQuartzJob.java | AbstractQuartzJob.asT | protected static <T extends Serializable> T asT(final Object service, final Class<T> type) {
"""
Cast the object to the original one with the type. The object must extend Serializable.
"""
return type.cast(service);
} | java | protected static <T extends Serializable> T asT(final Object service, final Class<T> type) {
return type.cast(service);
} | [
"protected",
"static",
"<",
"T",
"extends",
"Serializable",
">",
"T",
"asT",
"(",
"final",
"Object",
"service",
",",
"final",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"type",
".",
"cast",
"(",
"service",
")",
";",
"}"
] | Cast the object to the original one with the type. The object must extend Serializable. | [
"Cast",
"the",
"object",
"to",
"the",
"original",
"one",
"with",
"the",
"type",
".",
"The",
"object",
"must",
"extend",
"Serializable",
"."
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-web-server/src/main/java/azkaban/scheduler/AbstractQuartzJob.java#L28-L30 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/channels/Channels.java | Channels.newWriter | public static Writer newWriter(WritableByteChannel ch,
String csName) {
"""
Constructs a writer that encodes characters according to the named
charset and writes the resulting bytes to the given channel.
<p> An invocation of this method of the form
<blockquote><pre>
Chann... | java | public static Writer newWriter(WritableByteChannel ch,
String csName)
{
checkNotNull(csName, "csName");
return newWriter(ch, Charset.forName(csName).newEncoder(), -1);
} | [
"public",
"static",
"Writer",
"newWriter",
"(",
"WritableByteChannel",
"ch",
",",
"String",
"csName",
")",
"{",
"checkNotNull",
"(",
"csName",
",",
"\"csName\"",
")",
";",
"return",
"newWriter",
"(",
"ch",
",",
"Charset",
".",
"forName",
"(",
"csName",
")",
... | Constructs a writer that encodes characters according to the named
charset and writes the resulting bytes to the given channel.
<p> An invocation of this method of the form
<blockquote><pre>
Channels.newWriter(ch, csname)</pre></blockquote>
behaves in exactly the same way as the expression
<blockquote><pre>
Channel... | [
"Constructs",
"a",
"writer",
"that",
"encodes",
"characters",
"according",
"to",
"the",
"named",
"charset",
"and",
"writes",
"the",
"resulting",
"bytes",
"to",
"the",
"given",
"channel",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/channels/Channels.java#L455-L460 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java | FSDirectory.verifyQuotaForRename | private void verifyQuotaForRename(INode[] srcInodes, INode[] dstInodes)
throws QuotaExceededException {
"""
Verify quota for the rename operation where srcInodes[srcInodes.length-1] copies to
dstInodes[dstInodes.length-1]
@param srcInodes directory from where node is being moved.
@param dstInodes directory ... | java | private void verifyQuotaForRename(INode[] srcInodes, INode[] dstInodes)
throws QuotaExceededException {
if (!ready) {
// Do not check quota if edits log is still being processed
return;
}
INode srcInode = srcInodes[srcInodes.length - 1];
int minLength = Math.min(srcInodes.length, dstInodes... | [
"private",
"void",
"verifyQuotaForRename",
"(",
"INode",
"[",
"]",
"srcInodes",
",",
"INode",
"[",
"]",
"dstInodes",
")",
"throws",
"QuotaExceededException",
"{",
"if",
"(",
"!",
"ready",
")",
"{",
"// Do not check quota if edits log is still being processed",
"return... | Verify quota for the rename operation where srcInodes[srcInodes.length-1] copies to
dstInodes[dstInodes.length-1]
@param srcInodes directory from where node is being moved.
@param dstInodes directory to where node is moved to.
@throws QuotaExceededException if quota limit is exceeded. | [
"Verify",
"quota",
"for",
"the",
"rename",
"operation",
"where",
"srcInodes",
"[",
"srcInodes",
".",
"length",
"-",
"1",
"]",
"copies",
"to",
"dstInodes",
"[",
"dstInodes",
".",
"length",
"-",
"1",
"]"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L2519-L2539 |
autermann/yaml | src/main/java/com/github/autermann/yaml/Yaml.java | Yaml.dumpAll | public void dumpAll(Iterable<? extends YamlNode> data, OutputStream output) {
"""
Dumps {@code data} into a {@code OutputStream} using a {@code UTF-8}
encoding.
@param data the data
@param output the output stream
"""
dumpAll(data.iterator(), output);
} | java | public void dumpAll(Iterable<? extends YamlNode> data, OutputStream output) {
dumpAll(data.iterator(), output);
} | [
"public",
"void",
"dumpAll",
"(",
"Iterable",
"<",
"?",
"extends",
"YamlNode",
">",
"data",
",",
"OutputStream",
"output",
")",
"{",
"dumpAll",
"(",
"data",
".",
"iterator",
"(",
")",
",",
"output",
")",
";",
"}"
] | Dumps {@code data} into a {@code OutputStream} using a {@code UTF-8}
encoding.
@param data the data
@param output the output stream | [
"Dumps",
"{",
"@code",
"data",
"}",
"into",
"a",
"{",
"@code",
"OutputStream",
"}",
"using",
"a",
"{",
"@code",
"UTF",
"-",
"8",
"}",
"encoding",
"."
] | train | https://github.com/autermann/yaml/blob/5f8ab03e4fec3a2abe72c03561cdaa3a3936634d/src/main/java/com/github/autermann/yaml/Yaml.java#L198-L200 |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDao.java | ComponentDao.selectByQuery | public List<ComponentDto> selectByQuery(DbSession session, ComponentQuery query, int offset, int limit) {
"""
Same as {@link #selectByQuery(DbSession, String, ComponentQuery, int, int)} except
that the filter on organization is disabled.
"""
return selectByQueryImpl(session, null, query, offset, limit);
... | java | public List<ComponentDto> selectByQuery(DbSession session, ComponentQuery query, int offset, int limit) {
return selectByQueryImpl(session, null, query, offset, limit);
} | [
"public",
"List",
"<",
"ComponentDto",
">",
"selectByQuery",
"(",
"DbSession",
"session",
",",
"ComponentQuery",
"query",
",",
"int",
"offset",
",",
"int",
"limit",
")",
"{",
"return",
"selectByQueryImpl",
"(",
"session",
",",
"null",
",",
"query",
",",
"off... | Same as {@link #selectByQuery(DbSession, String, ComponentQuery, int, int)} except
that the filter on organization is disabled. | [
"Same",
"as",
"{"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDao.java#L108-L110 |
haraldk/TwelveMonkeys | servlet/src/main/java/com/twelvemonkeys/servlet/ServletUtil.java | ServletUtil.getDateParameter | public static long getDateParameter(final ServletRequest pReq, final String pName, final long pDefault) {
"""
Gets the value of the given parameter from the request converted to
a {@code Date}. If the parameter is not set or not parseable, the
default value is returned.
@param pReq the servlet reques... | java | public static long getDateParameter(final ServletRequest pReq, final String pName, final long pDefault) {
String str = pReq.getParameter(pName);
try {
return str != null ? StringUtil.toDate(str).getTime() : pDefault;
}
catch (IllegalArgumentException iae) {
... | [
"public",
"static",
"long",
"getDateParameter",
"(",
"final",
"ServletRequest",
"pReq",
",",
"final",
"String",
"pName",
",",
"final",
"long",
"pDefault",
")",
"{",
"String",
"str",
"=",
"pReq",
".",
"getParameter",
"(",
"pName",
")",
";",
"try",
"{",
"ret... | Gets the value of the given parameter from the request converted to
a {@code Date}. If the parameter is not set or not parseable, the
default value is returned.
@param pReq the servlet request
@param pName the parameter name
@param pDefault the default value
@return the value of the parameter converted to ... | [
"Gets",
"the",
"value",
"of",
"the",
"given",
"parameter",
"from",
"the",
"request",
"converted",
"to",
"a",
"{",
"@code",
"Date",
"}",
".",
" ",
";",
"If",
"the",
"parameter",
"is",
"not",
"set",
"or",
"not",
"parseable",
"the",
"default",
"value",
... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/servlet/src/main/java/com/twelvemonkeys/servlet/ServletUtil.java#L295-L303 |
deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/writable/BytesWritable.java | BytesWritable.asNd4jBuffer | public DataBuffer asNd4jBuffer(DataType type, int elementSize) {
"""
Convert the underlying contents of this {@link Writable}
to an nd4j {@link DataBuffer}. Note that this is a *copy*
of the underlying buffer.
Also note that {@link java.nio.ByteBuffer#allocateDirect(int)}
is used for allocation.
This should b... | java | public DataBuffer asNd4jBuffer(DataType type, int elementSize) {
int length = content.length / elementSize;
DataBuffer ret = Nd4j.createBuffer(ByteBuffer.allocateDirect(content.length),type,length,0);
for(int i = 0; i < length; i++) {
switch(type) {
case DOUBLE:
... | [
"public",
"DataBuffer",
"asNd4jBuffer",
"(",
"DataType",
"type",
",",
"int",
"elementSize",
")",
"{",
"int",
"length",
"=",
"content",
".",
"length",
"/",
"elementSize",
";",
"DataBuffer",
"ret",
"=",
"Nd4j",
".",
"createBuffer",
"(",
"ByteBuffer",
".",
"all... | Convert the underlying contents of this {@link Writable}
to an nd4j {@link DataBuffer}. Note that this is a *copy*
of the underlying buffer.
Also note that {@link java.nio.ByteBuffer#allocateDirect(int)}
is used for allocation.
This should be considered an expensive operation.
This buffer should be cached when used. O... | [
"Convert",
"the",
"underlying",
"contents",
"of",
"this",
"{",
"@link",
"Writable",
"}",
"to",
"an",
"nd4j",
"{",
"@link",
"DataBuffer",
"}",
".",
"Note",
"that",
"this",
"is",
"a",
"*",
"copy",
"*",
"of",
"the",
"underlying",
"buffer",
".",
"Also",
"n... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/writable/BytesWritable.java#L85-L105 |
javagl/Common | src/main/java/de/javagl/common/collections/Maps.java | Maps.addToList | public static <K, E> void addToList(Map<K, List<E>> map, K k, E e) {
"""
Adds the given element to the list that is stored under the
given key. If the list does not yet exist, it is created and
inserted into the map.
@param <K> The key type
@param <E> The element type
@param map The map
@param k The key
@... | java | public static <K, E> void addToList(Map<K, List<E>> map, K k, E e)
{
getList(map, k).add(e);
} | [
"public",
"static",
"<",
"K",
",",
"E",
">",
"void",
"addToList",
"(",
"Map",
"<",
"K",
",",
"List",
"<",
"E",
">",
">",
"map",
",",
"K",
"k",
",",
"E",
"e",
")",
"{",
"getList",
"(",
"map",
",",
"k",
")",
".",
"add",
"(",
"e",
")",
";",
... | Adds the given element to the list that is stored under the
given key. If the list does not yet exist, it is created and
inserted into the map.
@param <K> The key type
@param <E> The element type
@param map The map
@param k The key
@param e The element | [
"Adds",
"the",
"given",
"element",
"to",
"the",
"list",
"that",
"is",
"stored",
"under",
"the",
"given",
"key",
".",
"If",
"the",
"list",
"does",
"not",
"yet",
"exist",
"it",
"is",
"created",
"and",
"inserted",
"into",
"the",
"map",
"."
] | train | https://github.com/javagl/Common/blob/5a4876b48c3a2dc61d21324733cf37512d721c33/src/main/java/de/javagl/common/collections/Maps.java#L112-L115 |
google/closure-compiler | src/com/google/javascript/jscomp/type/ChainableReverseAbstractInterpreter.java | ChainableReverseAbstractInterpreter.declareNameInScope | @CheckReturnValue
protected FlowScope declareNameInScope(FlowScope scope, Node node, JSType type) {
"""
Declares a refined type in {@code scope} for the name represented by {@code node}. It must be
possible to refine the type of the given node in the given scope, as determined by {@link
#getTypeIfRefinable}. R... | java | @CheckReturnValue
protected FlowScope declareNameInScope(FlowScope scope, Node node, JSType type) {
switch (node.getToken()) {
case NAME:
return scope.inferSlotType(node.getString(), type);
case GETPROP:
String qualifiedName = node.getQualifiedName();
checkNotNull(qualifiedNam... | [
"@",
"CheckReturnValue",
"protected",
"FlowScope",
"declareNameInScope",
"(",
"FlowScope",
"scope",
",",
"Node",
"node",
",",
"JSType",
"type",
")",
"{",
"switch",
"(",
"node",
".",
"getToken",
"(",
")",
")",
"{",
"case",
"NAME",
":",
"return",
"scope",
".... | Declares a refined type in {@code scope} for the name represented by {@code node}. It must be
possible to refine the type of the given node in the given scope, as determined by {@link
#getTypeIfRefinable}. Returns an updated flow scope, which may be different from the passed-in
scope if any changes occur. | [
"Declares",
"a",
"refined",
"type",
"in",
"{"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/type/ChainableReverseAbstractInterpreter.java#L161-L183 |
alkacon/opencms-core | src/org/opencms/main/CmsShellCommands.java | CmsShellCommands.importModuleFromDefault | public void importModuleFromDefault(String importFile) throws Exception {
"""
Imports a module (zipfile) from the default module directory,
creating a temporary project for this.<p>
@param importFile the name of the import module located in the default module directory
@throws Exception if something goes wr... | java | public void importModuleFromDefault(String importFile) throws Exception {
String exportPath = OpenCms.getSystemInfo().getPackagesRfsPath();
String fileName = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf(
exportPath + CmsSystemInfo.FOLDER_MODULES + importFile);
CmsImpo... | [
"public",
"void",
"importModuleFromDefault",
"(",
"String",
"importFile",
")",
"throws",
"Exception",
"{",
"String",
"exportPath",
"=",
"OpenCms",
".",
"getSystemInfo",
"(",
")",
".",
"getPackagesRfsPath",
"(",
")",
";",
"String",
"fileName",
"=",
"OpenCms",
"."... | Imports a module (zipfile) from the default module directory,
creating a temporary project for this.<p>
@param importFile the name of the import module located in the default module directory
@throws Exception if something goes wrong
@see org.opencms.importexport.CmsImportExportManager#importData(CmsObject, I_CmsRep... | [
"Imports",
"a",
"module",
"(",
"zipfile",
")",
"from",
"the",
"default",
"module",
"directory",
"creating",
"a",
"temporary",
"project",
"for",
"this",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsShellCommands.java#L882-L894 |
twitter/cloudhopper-commons | ch-commons-gsm/src/main/java/com/cloudhopper/commons/gsm/GsmUtil.java | GsmUtil.toBcd | public static byte[] toBcd(String address) throws NullPointerException, IllegalArgumentException {
"""
Converts an address to a BCD-encoded byte array. Any odd-length address
such as "10950" will have an 0xF byte added as the most signification
digit onto the end. Used inside PDUs to encode addresses. For exa... | java | public static byte[] toBcd(String address) throws NullPointerException, IllegalArgumentException {
if (address == null) {
throw new NullPointerException("Address cannot be null for BCD encoding");
}
if (!StringUtil.containsOnlyDigits(address)) {
throw new IllegalArgument... | [
"public",
"static",
"byte",
"[",
"]",
"toBcd",
"(",
"String",
"address",
")",
"throws",
"NullPointerException",
",",
"IllegalArgumentException",
"{",
"if",
"(",
"address",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Address cannot be nu... | Converts an address to a BCD-encoded byte array. Any odd-length address
such as "10950" will have an 0xF byte added as the most signification
digit onto the end. Used inside PDUs to encode addresses. For example,
"10950" will look like this byte[] afterwards [0x01 0x59 0xf0].
@param address The address to encode suc... | [
"Converts",
"an",
"address",
"to",
"a",
"BCD",
"-",
"encoded",
"byte",
"array",
".",
"Any",
"odd",
"-",
"length",
"address",
"such",
"as",
"10950",
"will",
"have",
"an",
"0xF",
"byte",
"added",
"as",
"the",
"most",
"signification",
"digit",
"onto",
"the"... | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-gsm/src/main/java/com/cloudhopper/commons/gsm/GsmUtil.java#L45-L76 |
apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/publisher/TimePartitionedDataPublisher.java | TimePartitionedDataPublisher.addWriterOutputToExistingDir | @Override
protected void addWriterOutputToExistingDir(Path writerOutput, Path publisherOutput, WorkUnitState workUnitState,
int branchId, ParallelRunner parallelRunner) throws IOException {
"""
This method needs to be overridden for TimePartitionedDataPublisher, since the output folder structure
contains ... | java | @Override
protected void addWriterOutputToExistingDir(Path writerOutput, Path publisherOutput, WorkUnitState workUnitState,
int branchId, ParallelRunner parallelRunner) throws IOException {
for (FileStatus status : FileListUtils.listFilesRecursively(this.writerFileSystemByBranches.get(branchId),
wr... | [
"@",
"Override",
"protected",
"void",
"addWriterOutputToExistingDir",
"(",
"Path",
"writerOutput",
",",
"Path",
"publisherOutput",
",",
"WorkUnitState",
"workUnitState",
",",
"int",
"branchId",
",",
"ParallelRunner",
"parallelRunner",
")",
"throws",
"IOException",
"{",
... | This method needs to be overridden for TimePartitionedDataPublisher, since the output folder structure
contains timestamp, we have to move the files recursively.
For example, move {writerOutput}/2015/04/08/15/output.avro to {publisherOutput}/2015/04/08/15/output.avro | [
"This",
"method",
"needs",
"to",
"be",
"overridden",
"for",
"TimePartitionedDataPublisher",
"since",
"the",
"output",
"folder",
"structure",
"contains",
"timestamp",
"we",
"have",
"to",
"move",
"the",
"files",
"recursively",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/publisher/TimePartitionedDataPublisher.java#L58-L74 |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/export/CmsEntityWrapper.java | CmsEntityWrapper.setAttributeValueString | public void setAttributeValueString(String attributeName, String value, int index) {
"""
public void setAttributeValueEntity(String attributeName, CmsEntityWrapper value, int index) {
m_entity.setAttributeValue(attributeName, value.getEntity(), index);
}
public void setAttributeValueString(String attributeN... | java | public void setAttributeValueString(String attributeName, String value, int index) {
m_entity.setAttributeValue(attributeName, value, index);
} | [
"public",
"void",
"setAttributeValueString",
"(",
"String",
"attributeName",
",",
"String",
"value",
",",
"int",
"index",
")",
"{",
"m_entity",
".",
"setAttributeValue",
"(",
"attributeName",
",",
"value",
",",
"index",
")",
";",
"}"
] | public void setAttributeValueEntity(String attributeName, CmsEntityWrapper value, int index) {
m_entity.setAttributeValue(attributeName, value.getEntity(), index);
}
public void setAttributeValueString(String attributeName, String value) {
m_entity.setAttributeValue(attributeName, value);
}
Wrapper method.<p>
@pa... | [
"public",
"void",
"setAttributeValueEntity",
"(",
"String",
"attributeName",
"CmsEntityWrapper",
"value",
"int",
"index",
")",
"{"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/export/CmsEntityWrapper.java#L231-L234 |
Ekryd/sortpom | sorter/src/main/java/sortpom/wrapper/WrapperFactoryImpl.java | WrapperFactoryImpl.addElementsToSortOrderMap | private void addElementsToSortOrderMap(final Element element, int baseSortOrder) {
"""
Processes the chosen sort order. Adds sort order element and sort index to
a map.
"""
elementSortOrderMap.addElement(element, baseSortOrder);
final List<Element> castToChildElementList = castToChildElementLi... | java | private void addElementsToSortOrderMap(final Element element, int baseSortOrder) {
elementSortOrderMap.addElement(element, baseSortOrder);
final List<Element> castToChildElementList = castToChildElementList(element);
// Increments the sort order index for each element
int sortOrder = bas... | [
"private",
"void",
"addElementsToSortOrderMap",
"(",
"final",
"Element",
"element",
",",
"int",
"baseSortOrder",
")",
"{",
"elementSortOrderMap",
".",
"addElement",
"(",
"element",
",",
"baseSortOrder",
")",
";",
"final",
"List",
"<",
"Element",
">",
"castToChildE... | Processes the chosen sort order. Adds sort order element and sort index to
a map. | [
"Processes",
"the",
"chosen",
"sort",
"order",
".",
"Adds",
"sort",
"order",
"element",
"and",
"sort",
"index",
"to",
"a",
"map",
"."
] | train | https://github.com/Ekryd/sortpom/blob/27056420803ed04001e4149b04a719fbac774c5d/sorter/src/main/java/sortpom/wrapper/WrapperFactoryImpl.java#L84-L93 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryApi.java | RepositoryApi.getRepositoryArchive | public File getRepositoryArchive(Object projectIdOrPath, String sha, File directory, String format) throws GitLabApiException {
"""
Get an archive of the complete repository by SHA (optional) and saves to the specified directory.
If the archive already exists in the directory it will be overwritten.
<pre><code... | java | public File getRepositoryArchive(Object projectIdOrPath, String sha, File directory, String format) throws GitLabApiException {
ArchiveFormat archiveFormat = ArchiveFormat.forValue(format);
return (getRepositoryArchive(projectIdOrPath, sha, directory, archiveFormat));
} | [
"public",
"File",
"getRepositoryArchive",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"sha",
",",
"File",
"directory",
",",
"String",
"format",
")",
"throws",
"GitLabApiException",
"{",
"ArchiveFormat",
"archiveFormat",
"=",
"ArchiveFormat",
".",
"forValue",
"(... | Get an archive of the complete repository by SHA (optional) and saves to the specified directory.
If the archive already exists in the directory it will be overwritten.
<pre><code>GitLab Endpoint: GET /projects/:id/repository/archive</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), Strin... | [
"Get",
"an",
"archive",
"of",
"the",
"complete",
"repository",
"by",
"SHA",
"(",
"optional",
")",
"and",
"saves",
"to",
"the",
"specified",
"directory",
".",
"If",
"the",
"archive",
"already",
"exists",
"in",
"the",
"directory",
"it",
"will",
"be",
"overwr... | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryApi.java#L620-L623 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/transferlearning/TransferLearningHelper.java | TransferLearningHelper.featurize | public DataSet featurize(DataSet input) {
"""
During training frozen vertices/layers can be treated as "featurizing" the input
The forward pass through these frozen layer/vertices can be done in advance and the dataset saved to disk to iterate
quickly on the smaller unfrozen part of the model
Currently does not... | java | public DataSet featurize(DataSet input) {
if (isGraph) {
//trying to featurize for a computation graph
if (origGraph.getNumInputArrays() > 1 || origGraph.getNumOutputArrays() > 1) {
throw new IllegalArgumentException(
"Input or output size ... | [
"public",
"DataSet",
"featurize",
"(",
"DataSet",
"input",
")",
"{",
"if",
"(",
"isGraph",
")",
"{",
"//trying to featurize for a computation graph",
"if",
"(",
"origGraph",
".",
"getNumInputArrays",
"(",
")",
">",
"1",
"||",
"origGraph",
".",
"getNumOutputArrays"... | During training frozen vertices/layers can be treated as "featurizing" the input
The forward pass through these frozen layer/vertices can be done in advance and the dataset saved to disk to iterate
quickly on the smaller unfrozen part of the model
Currently does not support datasets with feature masks
@param input mul... | [
"During",
"training",
"frozen",
"vertices",
"/",
"layers",
"can",
"be",
"treated",
"as",
"featurizing",
"the",
"input",
"The",
"forward",
"pass",
"through",
"these",
"frozen",
"layer",
"/",
"vertices",
"can",
"be",
"done",
"in",
"advance",
"and",
"the",
"dat... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/transferlearning/TransferLearningHelper.java#L360-L383 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/RedisChannelHandler.java | RedisChannelHandler.registerCloseables | public void registerCloseables(final Collection<Closeable> registry, Closeable... closeables) {
"""
Register Closeable resources. Internal access only.
@param registry registry of closeables
@param closeables closeables to register
"""
registry.addAll(Arrays.asList(closeables));
addListen... | java | public void registerCloseables(final Collection<Closeable> registry, Closeable... closeables) {
registry.addAll(Arrays.asList(closeables));
addListener(resource -> {
for (Closeable closeable : closeables) {
if (closeable == RedisChannelHandler.this) {
co... | [
"public",
"void",
"registerCloseables",
"(",
"final",
"Collection",
"<",
"Closeable",
">",
"registry",
",",
"Closeable",
"...",
"closeables",
")",
"{",
"registry",
".",
"addAll",
"(",
"Arrays",
".",
"asList",
"(",
"closeables",
")",
")",
";",
"addListener",
... | Register Closeable resources. Internal access only.
@param registry registry of closeables
@param closeables closeables to register | [
"Register",
"Closeable",
"resources",
".",
"Internal",
"access",
"only",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/RedisChannelHandler.java#L225-L250 |
structr/structr | structr-ui/src/main/java/org/structr/web/common/FileHelper.java | FileHelper.createFile | public static <T extends File> T createFile(final SecurityContext securityContext, final byte[] fileData, final String contentType, final Class<T> t)
throws FrameworkException, IOException {
"""
Create a new file node from the given byte array
@param <T>
@param securityContext
@param fileData
@param conten... | java | public static <T extends File> T createFile(final SecurityContext securityContext, final byte[] fileData, final String contentType, final Class<T> t)
throws FrameworkException, IOException {
return createFile(securityContext, fileData, contentType, t, null, true);
} | [
"public",
"static",
"<",
"T",
"extends",
"File",
">",
"T",
"createFile",
"(",
"final",
"SecurityContext",
"securityContext",
",",
"final",
"byte",
"[",
"]",
"fileData",
",",
"final",
"String",
"contentType",
",",
"final",
"Class",
"<",
"T",
">",
"t",
")",
... | Create a new file node from the given byte array
@param <T>
@param securityContext
@param fileData
@param contentType
@param t defaults to File.class if null
@return file
@throws FrameworkException
@throws IOException | [
"Create",
"a",
"new",
"file",
"node",
"from",
"the",
"given",
"byte",
"array"
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L239-L244 |
motown-io/motown | samples/authentication/src/main/java/io/motown/sample/authentication/rest/TokenUtils.java | TokenUtils.computeSignature | public static String computeSignature(UserDetails userDetails, long expires) {
"""
Computes a signature for {@code UserDetails} and expiration time.
@param userDetails user details.
@param expires expiration time.
@return signature.
"""
MessageDigest digest;
try {
digest = ... | java | public static String computeSignature(UserDetails userDetails, long expires) {
MessageDigest digest;
try {
digest = MessageDigest.getInstance(MESSAGE_DIGEST_ALGORITHM);
} catch (NoSuchAlgorithmException e) {
throw new IllegalStateException("No " + MESSAGE_DIGEST_ALGORITHM... | [
"public",
"static",
"String",
"computeSignature",
"(",
"UserDetails",
"userDetails",
",",
"long",
"expires",
")",
"{",
"MessageDigest",
"digest",
";",
"try",
"{",
"digest",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"MESSAGE_DIGEST_ALGORITHM",
")",
";",
"}",
... | Computes a signature for {@code UserDetails} and expiration time.
@param userDetails user details.
@param expires expiration time.
@return signature. | [
"Computes",
"a",
"signature",
"for",
"{",
"@code",
"UserDetails",
"}",
"and",
"expiration",
"time",
"."
] | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/samples/authentication/src/main/java/io/motown/sample/authentication/rest/TokenUtils.java#L67-L78 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/McfCodeGen.java | McfCodeGen.writeManagedConnection | private void writeManagedConnection(Definition def, Writer out, int indent) throws IOException {
"""
Output ConnectionFactory method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException
"""
writeWithIndent(out, indent, "/**\n");
writeWithInd... | java | private void writeManagedConnection(Definition def, Writer out, int indent) throws IOException
{
writeWithIndent(out, indent, "/**\n");
writeWithIndent(out, indent, " * Creates a new physical connection to the underlying EIS resource manager.\n");
writeWithIndent(out, indent, " *\n");
writeWi... | [
"private",
"void",
"writeManagedConnection",
"(",
"Definition",
"def",
",",
"Writer",
"out",
",",
"int",
"indent",
")",
"throws",
"IOException",
"{",
"writeWithIndent",
"(",
"out",
",",
"indent",
",",
"\"/**\\n\"",
")",
";",
"writeWithIndent",
"(",
"out",
",",... | Output ConnectionFactory method
@param def definition
@param out Writer
@param indent space number
@throws IOException ioException | [
"Output",
"ConnectionFactory",
"method"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/McfCodeGen.java#L246-L302 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/db/CachedMultiPrintQuery.java | CachedMultiPrintQuery.get4Request | public static CachedMultiPrintQuery get4Request(final List<Instance> _instances)
throws EFapsException {
"""
Get a CachedMultiPrintQuery that will only cache during a request.
@param _instances instance to be updated.
@return the 4 request
@throws EFapsException on error
"""
return new Cac... | java | public static CachedMultiPrintQuery get4Request(final List<Instance> _instances)
throws EFapsException
{
return new CachedMultiPrintQuery(_instances, Context.getThreadContext().getRequestId()).setLifespan(5)
.setLifespanUnit(TimeUnit.MINUTES);
} | [
"public",
"static",
"CachedMultiPrintQuery",
"get4Request",
"(",
"final",
"List",
"<",
"Instance",
">",
"_instances",
")",
"throws",
"EFapsException",
"{",
"return",
"new",
"CachedMultiPrintQuery",
"(",
"_instances",
",",
"Context",
".",
"getThreadContext",
"(",
")"... | Get a CachedMultiPrintQuery that will only cache during a request.
@param _instances instance to be updated.
@return the 4 request
@throws EFapsException on error | [
"Get",
"a",
"CachedMultiPrintQuery",
"that",
"will",
"only",
"cache",
"during",
"a",
"request",
"."
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/CachedMultiPrintQuery.java#L182-L187 |
wildfly/wildfly-core | logging/src/main/java/org/jboss/as/logging/resolvers/FileResolver.java | FileResolver.resolvePath | public static String resolvePath(final OperationContext context, final String relativeToPath, final String path) {
"""
Resolves the path based on the relative to and the path. May return {@code null} if the service is not up.
@param context the operation context.
@param relativeToPath the relative to pa... | java | public static String resolvePath(final OperationContext context, final String relativeToPath, final String path) {
return INSTANCE.resolve(context, relativeToPath, path);
} | [
"public",
"static",
"String",
"resolvePath",
"(",
"final",
"OperationContext",
"context",
",",
"final",
"String",
"relativeToPath",
",",
"final",
"String",
"path",
")",
"{",
"return",
"INSTANCE",
".",
"resolve",
"(",
"context",
",",
"relativeToPath",
",",
"path"... | Resolves the path based on the relative to and the path. May return {@code null} if the service is not up.
@param context the operation context.
@param relativeToPath the relative to path, may be {@code null}.
@param path the path to append to the relative to path or the absolute path if the relative ... | [
"Resolves",
"the",
"path",
"based",
"on",
"the",
"relative",
"to",
"and",
"the",
"path",
".",
"May",
"return",
"{",
"@code",
"null",
"}",
"if",
"the",
"service",
"is",
"not",
"up",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/logging/src/main/java/org/jboss/as/logging/resolvers/FileResolver.java#L81-L83 |
EdwardRaff/JSAT | JSAT/src/jsat/math/Complex.java | Complex.mutableDivide | public void mutableDivide(double c, double d) {
"""
Alters this complex number as if a division by another complex number was performed.
@param c the real part of the other number
@param d the imaginary part of the other number
"""
final double[] r = new double[2];
cDiv(real, imag, c, d, r);
... | java | public void mutableDivide(double c, double d)
{
final double[] r = new double[2];
cDiv(real, imag, c, d, r);
this.real = r[0];
this.imag = r[1];
} | [
"public",
"void",
"mutableDivide",
"(",
"double",
"c",
",",
"double",
"d",
")",
"{",
"final",
"double",
"[",
"]",
"r",
"=",
"new",
"double",
"[",
"2",
"]",
";",
"cDiv",
"(",
"real",
",",
"imag",
",",
"c",
",",
"d",
",",
"r",
")",
";",
"this",
... | Alters this complex number as if a division by another complex number was performed.
@param c the real part of the other number
@param d the imaginary part of the other number | [
"Alters",
"this",
"complex",
"number",
"as",
"if",
"a",
"division",
"by",
"another",
"complex",
"number",
"was",
"performed",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/math/Complex.java#L249-L255 |
alkacon/opencms-core | src/org/opencms/util/PrintfFormat.java | PrintfFormat.nonControl | private String nonControl(String s, int start) {
"""
Return a substring starting at
<code>start</code> and ending at either the end
of the String <code>s</code>, the next unpaired
percent sign, or at the end of the String if the
last character is a percent sign.
@param s Control string.
@param start Positio... | java | private String nonControl(String s, int start) {
m_cPos = s.indexOf("%", start);
if (m_cPos == -1) {
m_cPos = s.length();
}
return s.substring(start, m_cPos);
} | [
"private",
"String",
"nonControl",
"(",
"String",
"s",
",",
"int",
"start",
")",
"{",
"m_cPos",
"=",
"s",
".",
"indexOf",
"(",
"\"%\"",
",",
"start",
")",
";",
"if",
"(",
"m_cPos",
"==",
"-",
"1",
")",
"{",
"m_cPos",
"=",
"s",
".",
"length",
"(",... | Return a substring starting at
<code>start</code> and ending at either the end
of the String <code>s</code>, the next unpaired
percent sign, or at the end of the String if the
last character is a percent sign.
@param s Control string.
@param start Position in the string
<code>s</code> to begin looking for the start
of... | [
"Return",
"a",
"substring",
"starting",
"at",
"<code",
">",
"start<",
"/",
"code",
">",
"and",
"ending",
"at",
"either",
"the",
"end",
"of",
"the",
"String",
"<code",
">",
"s<",
"/",
"code",
">",
"the",
"next",
"unpaired",
"percent",
"sign",
"or",
"at"... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/PrintfFormat.java#L3681-L3688 |
amaembo/streamex | src/main/java/one/util/streamex/EntryStream.java | EntryStream.toMapAndThen | public <R> R toMapAndThen(Function<? super Map<K, V>, R> finisher) {
"""
Creates a {@link Map} containing the elements of this stream, then
performs finishing transformation and returns its result. There are no
guarantees on the type or serializability of the {@code Map} created.
<p>
This is a <a href="packa... | java | public <R> R toMapAndThen(Function<? super Map<K, V>, R> finisher) {
if (context.fjp != null)
return context.terminate(() -> finisher.apply(toMap()));
return finisher.apply(toMap());
} | [
"public",
"<",
"R",
">",
"R",
"toMapAndThen",
"(",
"Function",
"<",
"?",
"super",
"Map",
"<",
"K",
",",
"V",
">",
",",
"R",
">",
"finisher",
")",
"{",
"if",
"(",
"context",
".",
"fjp",
"!=",
"null",
")",
"return",
"context",
".",
"terminate",
"("... | Creates a {@link Map} containing the elements of this stream, then
performs finishing transformation and returns its result. There are no
guarantees on the type or serializability of the {@code Map} created.
<p>
This is a <a href="package-summary.html#StreamOps">terminal</a>
operation.
<p>
Created {@code Map} is guar... | [
"Creates",
"a",
"{",
"@link",
"Map",
"}",
"containing",
"the",
"elements",
"of",
"this",
"stream",
"then",
"performs",
"finishing",
"transformation",
"and",
"returns",
"its",
"result",
".",
"There",
"are",
"no",
"guarantees",
"on",
"the",
"type",
"or",
"seri... | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/EntryStream.java#L1181-L1185 |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/HttpSupport.java | HttpSupport.sendCookie | public void sendCookie(String name, String value) {
"""
Sends cookie to browse with response.
@param name name of cookie
@param value value of cookie.
"""
RequestContext.getHttpResponse().addCookie(Cookie.toServletCookie(new Cookie(name, value)));
} | java | public void sendCookie(String name, String value) {
RequestContext.getHttpResponse().addCookie(Cookie.toServletCookie(new Cookie(name, value)));
} | [
"public",
"void",
"sendCookie",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"RequestContext",
".",
"getHttpResponse",
"(",
")",
".",
"addCookie",
"(",
"Cookie",
".",
"toServletCookie",
"(",
"new",
"Cookie",
"(",
"name",
",",
"value",
")",
")",... | Sends cookie to browse with response.
@param name name of cookie
@param value value of cookie. | [
"Sends",
"cookie",
"to",
"browse",
"with",
"response",
"."
] | train | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/HttpSupport.java#L1319-L1321 |
elki-project/elki | elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/query/RStarTreeKNNQuery.java | RStarTreeKNNQuery.getSortedEntries | protected List<DoubleDistanceEntry> getSortedEntries(AbstractRStarTreeNode<?, ?> node, DBIDs ids) {
"""
Sorts the entries of the specified node according to their minimum distance
to the specified objects.
@param node the node
@param ids the id of the objects
@return a list of the sorted entries
"""
... | java | protected List<DoubleDistanceEntry> getSortedEntries(AbstractRStarTreeNode<?, ?> node, DBIDs ids) {
List<DoubleDistanceEntry> result = new ArrayList<>();
for(int i = 0; i < node.getNumEntries(); i++) {
SpatialEntry entry = node.getEntry(i);
double minMinDist = Double.MAX_VALUE;
for(DBIDIter i... | [
"protected",
"List",
"<",
"DoubleDistanceEntry",
">",
"getSortedEntries",
"(",
"AbstractRStarTreeNode",
"<",
"?",
",",
"?",
">",
"node",
",",
"DBIDs",
"ids",
")",
"{",
"List",
"<",
"DoubleDistanceEntry",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")"... | Sorts the entries of the specified node according to their minimum distance
to the specified objects.
@param node the node
@param ids the id of the objects
@return a list of the sorted entries | [
"Sorts",
"the",
"entries",
"of",
"the",
"specified",
"node",
"according",
"to",
"their",
"minimum",
"distance",
"to",
"the",
"specified",
"objects",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/query/RStarTreeKNNQuery.java#L214-L230 |
mygreen/excel-cellformatter | src/main/java/com/github/mygreen/cellformatter/lang/ExcelDateUtils.java | ExcelDateUtils.convertJavaDate | public static Date convertJavaDate(final double numValue, final boolean startDate1904) {
"""
Excel表現上の数値をJavaの{@link Date}型(UTC形式)に変換する。
<p>1900年始まりの場合は以下の注意が必要。</p>
<ul>
<li>値{@literal 0.0}は、Excel上は1900年1月0日であるが、Date型へ変換した場合は1899年12月31日となります。</li>
<li>値{@literal 60.0}は、Excel上は1900年2月29日だが、グレゴリオ歴上は閏日ではあにため、190... | java | public static Date convertJavaDate(final double numValue, final boolean startDate1904) {
double utcDay;
if(startDate1904) {
// 1904年始まりの場合
// UTC(1970年基準に戻す)
utcDay = numValue + OFFSET_DAYS_1904;
} else {
... | [
"public",
"static",
"Date",
"convertJavaDate",
"(",
"final",
"double",
"numValue",
",",
"final",
"boolean",
"startDate1904",
")",
"{",
"double",
"utcDay",
";",
"if",
"(",
"startDate1904",
")",
"{",
"// 1904年始まりの場合\r",
"// UTC(1970年基準に戻す)\r",
"utcDay",
"=",
"numVal... | Excel表現上の数値をJavaの{@link Date}型(UTC形式)に変換する。
<p>1900年始まりの場合は以下の注意が必要。</p>
<ul>
<li>値{@literal 0.0}は、Excel上は1900年1月0日であるが、Date型へ変換した場合は1899年12月31日となります。</li>
<li>値{@literal 60.0}は、Excel上は1900年2月29日だが、グレゴリオ歴上は閏日ではあにため、1900年3月1日となります。</li>
</ul>
@param numValue 変換対象のExcel表現上の数値。
@param startDate1904 基準日が1904年始まりかどうか。
@ret... | [
"Excel表現上の数値をJavaの",
"{",
"@link",
"Date",
"}",
"型",
"(",
"UTC形式",
")",
"に変換する。",
"<p",
">",
"1900年始まりの場合は以下の注意が必要。<",
"/",
"p",
">",
"<ul",
">",
"<li",
">",
"値",
"{",
"@literal",
"0",
".",
"0",
"}",
"は、Excel上は1900年1月0日であるが、Date型へ変換した場合は1899年12月31日となります。<",
"/... | train | https://github.com/mygreen/excel-cellformatter/blob/e802af273d49889500591e03799c9262cbf29185/src/main/java/com/github/mygreen/cellformatter/lang/ExcelDateUtils.java#L86-L120 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/service/PooledService.java | PooledService.unsubscribeAndRetry | private void unsubscribeAndRetry(final Subscription subscription, final CouchbaseRequest request) {
"""
Helper method to unsubscribe from the subscription and send the request into retry.
"""
if (subscription != null && !subscription.isUnsubscribed()) {
subscription.unsubscribe();
}... | java | private void unsubscribeAndRetry(final Subscription subscription, final CouchbaseRequest request) {
if (subscription != null && !subscription.isUnsubscribed()) {
subscription.unsubscribe();
}
RetryHelper.retryOrCancel(env, request, responseBuffer);
} | [
"private",
"void",
"unsubscribeAndRetry",
"(",
"final",
"Subscription",
"subscription",
",",
"final",
"CouchbaseRequest",
"request",
")",
"{",
"if",
"(",
"subscription",
"!=",
"null",
"&&",
"!",
"subscription",
".",
"isUnsubscribed",
"(",
")",
")",
"{",
"subscri... | Helper method to unsubscribe from the subscription and send the request into retry. | [
"Helper",
"method",
"to",
"unsubscribe",
"from",
"the",
"subscription",
"and",
"send",
"the",
"request",
"into",
"retry",
"."
] | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/service/PooledService.java#L397-L402 |
GwtMaterialDesign/gwt-material-addins | src/main/java/gwt/material/design/addins/client/avatar/MaterialAvatar.java | MaterialAvatar.setDimension | public void setDimension(int width, int height) {
"""
Allowing to set the dimension of the Avatar component.
@param width - the width dimension of the avatar without any Unit suffix (e.i 100)
@param height - the height dimension of the avatar without any Unit suffix (e.i 100)
"""
setWidth(String.valu... | java | public void setDimension(int width, int height) {
setWidth(String.valueOf(width));
setHeight(String.valueOf(height));
reload();
} | [
"public",
"void",
"setDimension",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"setWidth",
"(",
"String",
".",
"valueOf",
"(",
"width",
")",
")",
";",
"setHeight",
"(",
"String",
".",
"valueOf",
"(",
"height",
")",
")",
";",
"reload",
"(",
")... | Allowing to set the dimension of the Avatar component.
@param width - the width dimension of the avatar without any Unit suffix (e.i 100)
@param height - the height dimension of the avatar without any Unit suffix (e.i 100) | [
"Allowing",
"to",
"set",
"the",
"dimension",
"of",
"the",
"Avatar",
"component",
"."
] | train | https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/avatar/MaterialAvatar.java#L160-L164 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/i18n/list/LinkListPanel.java | LinkListPanel.newItemLinkLabel | protected Label newItemLinkLabel(final String id, final LinkItem model) {
"""
Factory method for create a new item link {@link Label}. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a new item link {@link Label}.
@param id
th... | java | protected Label newItemLinkLabel(final String id, final LinkItem model)
{
final Label itemLinkLabel = ComponentFactory.newLabel(id,
ResourceModelFactory.newResourceModel(model.getResourceModelKey(), this));
// add css class to current page.
if ((model.getPageClass() != null) && model.getPageClass().equals(get... | [
"protected",
"Label",
"newItemLinkLabel",
"(",
"final",
"String",
"id",
",",
"final",
"LinkItem",
"model",
")",
"{",
"final",
"Label",
"itemLinkLabel",
"=",
"ComponentFactory",
".",
"newLabel",
"(",
"id",
",",
"ResourceModelFactory",
".",
"newResourceModel",
"(",
... | Factory method for create a new item link {@link Label}. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a new item link {@link Label}.
@param id
the id
@param model
the model
@return the new item link {@link Label}. | [
"Factory",
"method",
"for",
"create",
"a",
"new",
"item",
"link",
"{",
"@link",
"Label",
"}",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/i18n/list/LinkListPanel.java#L132-L142 |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/UNode.java | UNode.createValueNode | public static UNode createValueNode(String name, String value) {
"""
Create a VALUE UNode with the given node name and value.
@param name Node name.
@param value Node value.
@return New VALUE UNode.
"""
String nodeValue = value == null ? "" : value;
return new UNode(name, NodeType.... | java | public static UNode createValueNode(String name, String value) {
String nodeValue = value == null ? "" : value;
return new UNode(name, NodeType.VALUE, nodeValue, false, "");
} | [
"public",
"static",
"UNode",
"createValueNode",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"String",
"nodeValue",
"=",
"value",
"==",
"null",
"?",
"\"\"",
":",
"value",
";",
"return",
"new",
"UNode",
"(",
"name",
",",
"NodeType",
".",
"VALU... | Create a VALUE UNode with the given node name and value.
@param name Node name.
@param value Node value.
@return New VALUE UNode. | [
"Create",
"a",
"VALUE",
"UNode",
"with",
"the",
"given",
"node",
"name",
"and",
"value",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/UNode.java#L210-L213 |
ktoso/janbanery | janbanery-core/src/main/java/pl/project13/janbanery/core/JanbaneryFactory.java | JanbaneryFactory.connectUsing | public JanbaneryToWorkspace connectUsing(String user, String password) throws ServerCommunicationException {
"""
This method will connect to kanbanery via basic user/pass authentication
<strong>but will then switch to API Key Mode</strong> to increase the security of communication over the wire.
@param user ... | java | public JanbaneryToWorkspace connectUsing(String user, String password) throws ServerCommunicationException {
DefaultConfiguration conf = new DefaultConfiguration(user, password);
RestClient restClient = getRestClient(conf);
Janbanery janbanery = new Janbanery(conf, restClient);
// fetch and switch to a... | [
"public",
"JanbaneryToWorkspace",
"connectUsing",
"(",
"String",
"user",
",",
"String",
"password",
")",
"throws",
"ServerCommunicationException",
"{",
"DefaultConfiguration",
"conf",
"=",
"new",
"DefaultConfiguration",
"(",
"user",
",",
"password",
")",
";",
"RestCli... | This method will connect to kanbanery via basic user/pass authentication
<strong>but will then switch to API Key Mode</strong> to increase the security of communication over the wire.
@param user your kanbanery username (email)
@param password your kanbanery password for this user
@return an Janbanery instance set... | [
"This",
"method",
"will",
"connect",
"to",
"kanbanery",
"via",
"basic",
"user",
"/",
"pass",
"authentication",
"<strong",
">",
"but",
"will",
"then",
"switch",
"to",
"API",
"Key",
"Mode<",
"/",
"strong",
">",
"to",
"increase",
"the",
"security",
"of",
"com... | train | https://github.com/ktoso/janbanery/blob/cd77b774814c7fbb2a0c9c55d4c3f7e76affa636/janbanery-core/src/main/java/pl/project13/janbanery/core/JanbaneryFactory.java#L87-L97 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/model/perceptron/PerceptronClassifier.java | PerceptronClassifier.trainNaivePerceptron | private static LinearModel trainNaivePerceptron(Instance[] instanceList, FeatureMap featureMap, int maxIteration) {
"""
朴素感知机训练算法
@param instanceList 训练实例
@param featureMap 特征函数
@param maxIteration 训练迭代次数
"""
LinearModel model = new LinearModel(featureMap, new float[featureMap.size()]);
fo... | java | private static LinearModel trainNaivePerceptron(Instance[] instanceList, FeatureMap featureMap, int maxIteration)
{
LinearModel model = new LinearModel(featureMap, new float[featureMap.size()]);
for (int it = 0; it < maxIteration; ++it)
{
Utility.shuffleArray(instanceList);
... | [
"private",
"static",
"LinearModel",
"trainNaivePerceptron",
"(",
"Instance",
"[",
"]",
"instanceList",
",",
"FeatureMap",
"featureMap",
",",
"int",
"maxIteration",
")",
"{",
"LinearModel",
"model",
"=",
"new",
"LinearModel",
"(",
"featureMap",
",",
"new",
"float",... | 朴素感知机训练算法
@param instanceList 训练实例
@param featureMap 特征函数
@param maxIteration 训练迭代次数 | [
"朴素感知机训练算法"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/perceptron/PerceptronClassifier.java#L57-L71 |
tvesalainen/util | util/src/main/java/org/vesalainen/nio/file/attribute/UserAttrs.java | UserAttrs.getShortAttribute | public static final short getShortAttribute(Path path, String attribute, LinkOption... options) throws IOException {
"""
Returns user-defined-attribute -1 if not found.
@param path
@param attribute
@param options
@return
@throws IOException
"""
return getShortAttribute(path, attribute, (short)-1,... | java | public static final short getShortAttribute(Path path, String attribute, LinkOption... options) throws IOException
{
return getShortAttribute(path, attribute, (short)-1, options);
} | [
"public",
"static",
"final",
"short",
"getShortAttribute",
"(",
"Path",
"path",
",",
"String",
"attribute",
",",
"LinkOption",
"...",
"options",
")",
"throws",
"IOException",
"{",
"return",
"getShortAttribute",
"(",
"path",
",",
"attribute",
",",
"(",
"short",
... | Returns user-defined-attribute -1 if not found.
@param path
@param attribute
@param options
@return
@throws IOException | [
"Returns",
"user",
"-",
"defined",
"-",
"attribute",
"-",
"1",
"if",
"not",
"found",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/file/attribute/UserAttrs.java#L125-L128 |
powermock/powermock | powermock-core/src/main/java/org/powermock/mockpolicies/support/LogPolicySupport.java | LogPolicySupport.getType | public Class<?> getType(String name, String logFramework) throws Exception {
"""
Get the class type representing the fully-qualified name.
@param name
The fully-qualified name of a class to get.
@param logFramework
The log framework that should be printed if the class cannot
be found.
@return The class rep... | java | public Class<?> getType(String name, String logFramework) throws Exception {
final Class<?> loggerType;
try {
loggerType = Class.forName(name);
} catch (ClassNotFoundException e) {
final String message = String.format("Cannot find %s in the classpath which the %s policy requires.", logFramework, getClass()
... | [
"public",
"Class",
"<",
"?",
">",
"getType",
"(",
"String",
"name",
",",
"String",
"logFramework",
")",
"throws",
"Exception",
"{",
"final",
"Class",
"<",
"?",
">",
"loggerType",
";",
"try",
"{",
"loggerType",
"=",
"Class",
".",
"forName",
"(",
"name",
... | Get the class type representing the fully-qualified name.
@param name
The fully-qualified name of a class to get.
@param logFramework
The log framework that should be printed if the class cannot
be found.
@return The class representing the fully-qualified name.
@throws Exception
If something unexpected goes wrong, for... | [
"Get",
"the",
"class",
"type",
"representing",
"the",
"fully",
"-",
"qualified",
"name",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-core/src/main/java/org/powermock/mockpolicies/support/LogPolicySupport.java#L62-L72 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/db/databases/information/TableInformation.java | TableInformation.addForeignKey | public void addForeignKey(final String _fkName,
final String _colName,
final String _refTableName,
final String _refColName,
final boolean _cascade) {
"""
Fetches all foreign keys for this table.... | java | public void addForeignKey(final String _fkName,
final String _colName,
final String _refTableName,
final String _refColName,
final boolean _cascade)
{
this.fkMap.put(_fkName.toUpperCase(),... | [
"public",
"void",
"addForeignKey",
"(",
"final",
"String",
"_fkName",
",",
"final",
"String",
"_colName",
",",
"final",
"String",
"_refTableName",
",",
"final",
"String",
"_refColName",
",",
"final",
"boolean",
"_cascade",
")",
"{",
"this",
".",
"fkMap",
".",
... | Fetches all foreign keys for this table.
@param _fkName name of foreign key
@param _colName name of column name
@param _refTableName name of referenced SQL table
@param _refColName name of column within referenced SQL table
@param _cascade delete cascade activated
@see #fkMap | [
"Fetches",
"all",
"foreign",
"keys",
"for",
"this",
"table",
"."
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/databases/information/TableInformation.java#L156-L164 |
elastic/elasticsearch-hadoop | mr/src/main/java/org/elasticsearch/hadoop/util/encoding/HttpEncodingTools.java | HttpEncodingTools.encodeUri | @Deprecated
public static String encodeUri(String uri) {
"""
Splits the given string on the first '?' then encodes the first half as a path (ignoring slashes and colons)
and the second half as a query segment (ignoring questionmarks, equals signs, etc...).
@deprecated Prefer to use {@link HttpEncodingTools... | java | @Deprecated
public static String encodeUri(String uri) {
try {
return URIUtil.encodePathQuery(uri);
} catch (URIException ex) {
throw new EsHadoopIllegalArgumentException("Cannot escape uri [" + uri + "]", ex);
}
} | [
"@",
"Deprecated",
"public",
"static",
"String",
"encodeUri",
"(",
"String",
"uri",
")",
"{",
"try",
"{",
"return",
"URIUtil",
".",
"encodePathQuery",
"(",
"uri",
")",
";",
"}",
"catch",
"(",
"URIException",
"ex",
")",
"{",
"throw",
"new",
"EsHadoopIllegal... | Splits the given string on the first '?' then encodes the first half as a path (ignoring slashes and colons)
and the second half as a query segment (ignoring questionmarks, equals signs, etc...).
@deprecated Prefer to use {@link HttpEncodingTools#encode(String)} instead for encoding specific
pieces of the URI. This me... | [
"Splits",
"the",
"given",
"string",
"on",
"the",
"first",
"?",
"then",
"encodes",
"the",
"first",
"half",
"as",
"a",
"path",
"(",
"ignoring",
"slashes",
"and",
"colons",
")",
"and",
"the",
"second",
"half",
"as",
"a",
"query",
"segment",
"(",
"ignoring",... | train | https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/util/encoding/HttpEncodingTools.java#L52-L59 |
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckClassAdapter.java | CheckClassAdapter.checkIdentifier | private static int checkIdentifier(final String signature, int pos) {
"""
Checks an identifier.
@param signature
a string containing the signature that must be checked.
@param pos
index of first character to be checked.
@return the index of the first character after the checked part.
"""
if (!Ch... | java | private static int checkIdentifier(final String signature, int pos) {
if (!Character.isJavaIdentifierStart(getChar(signature, pos))) {
throw new IllegalArgumentException(signature
+ ": identifier expected at index " + pos);
}
++pos;
while (Character.isJava... | [
"private",
"static",
"int",
"checkIdentifier",
"(",
"final",
"String",
"signature",
",",
"int",
"pos",
")",
"{",
"if",
"(",
"!",
"Character",
".",
"isJavaIdentifierStart",
"(",
"getChar",
"(",
"signature",
",",
"pos",
")",
")",
")",
"{",
"throw",
"new",
... | Checks an identifier.
@param signature
a string containing the signature that must be checked.
@param pos
index of first character to be checked.
@return the index of the first character after the checked part. | [
"Checks",
"an",
"identifier",
"."
] | train | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckClassAdapter.java#L967-L977 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/content/documentlists/DocumentTreeUrl.java | DocumentTreeUrl.updateTreeDocumentContentUrl | public static MozuUrl updateTreeDocumentContentUrl(String documentListName, String documentName) {
"""
Get Resource Url for UpdateTreeDocumentContent
@param documentListName Name of content documentListName to delete
@param documentName The name of the document in the site.
@return String Resource Url
"""... | java | public static MozuUrl updateTreeDocumentContentUrl(String documentListName, String documentName)
{
UrlFormatter formatter = new UrlFormatter("/api/content/documentlists/{documentListName}/documentTree/{documentName}/content?folderPath={folderPath}&folderId={folderId}");
formatter.formatUrl("documentListName", d... | [
"public",
"static",
"MozuUrl",
"updateTreeDocumentContentUrl",
"(",
"String",
"documentListName",
",",
"String",
"documentName",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/content/documentlists/{documentListName}/documentTree/{documentName}/co... | Get Resource Url for UpdateTreeDocumentContent
@param documentListName Name of content documentListName to delete
@param documentName The name of the document in the site.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"UpdateTreeDocumentContent"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/content/documentlists/DocumentTreeUrl.java#L82-L88 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRTransform.java | GVRTransform.setRotationByAxis | public GVRTransform setRotationByAxis(float angle, float x, float y, float z) {
"""
Sets the absolute rotation in angle/axis terms.
Rotates using the right hand rule.
<p>
Contrast this with {@link #rotate(float, float, float, float) rotate()},
{@link #rotateByAxis(float, float, float, float) rotateByAxis()... | java | public GVRTransform setRotationByAxis(float angle, float x, float y, float z) {
NativeTransform.setRotationByAxis(getNative(), angle * TO_RADIANS, x, y, z);
return this;
} | [
"public",
"GVRTransform",
"setRotationByAxis",
"(",
"float",
"angle",
",",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"NativeTransform",
".",
"setRotationByAxis",
"(",
"getNative",
"(",
")",
",",
"angle",
"*",
"TO_RADIANS",
",",
"x",
","... | Sets the absolute rotation in angle/axis terms.
Rotates using the right hand rule.
<p>
Contrast this with {@link #rotate(float, float, float, float) rotate()},
{@link #rotateByAxis(float, float, float, float) rotateByAxis()}, or
{@link #rotateByAxisWithPivot(float, float, float, float, float, float, float)
rotateByAx... | [
"Sets",
"the",
"absolute",
"rotation",
"in",
"angle",
"/",
"axis",
"terms",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRTransform.java#L411-L414 |
likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java | AbstractParser.getInteger | protected Integer getInteger(final String key, final JSONObject jsonObject) {
"""
Check to make sure the JSONObject has the specified key and if so return
the value as a integer. If no key is found null is returned.
@param key name of the field to fetch from the json object
@param jsonObject object from which... | java | protected Integer getInteger(final String key, final JSONObject jsonObject) {
Integer value = null;
if(hasKey(key, jsonObject)) {
try {
value = jsonObject.getInt(key);
}
catch(JSONException e) {
LOGGER.error("Could not get Integer from JSONObject for key: " + key, e);
}
... | [
"protected",
"Integer",
"getInteger",
"(",
"final",
"String",
"key",
",",
"final",
"JSONObject",
"jsonObject",
")",
"{",
"Integer",
"value",
"=",
"null",
";",
"if",
"(",
"hasKey",
"(",
"key",
",",
"jsonObject",
")",
")",
"{",
"try",
"{",
"value",
"=",
... | Check to make sure the JSONObject has the specified key and if so return
the value as a integer. If no key is found null is returned.
@param key name of the field to fetch from the json object
@param jsonObject object from which to fetch the value
@return integer value corresponding to the key or null if key not foun... | [
"Check",
"to",
"make",
"sure",
"the",
"JSONObject",
"has",
"the",
"specified",
"key",
"and",
"if",
"so",
"return",
"the",
"value",
"as",
"a",
"integer",
".",
"If",
"no",
"key",
"is",
"found",
"null",
"is",
"returned",
"."
] | train | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java#L164-L175 |
agmip/agmip-common-functions | src/main/java/org/agmip/common/Functions.java | Functions.numericOffset | public static String numericOffset(String initial, String offset) {
"""
Offset a numeric string by another numeric string.
Any numeric string recognized by {@code BigDecimal} is supported.
@param initial A valid number string
@param offset A valid number string
@return a number string with the precision ... | java | public static String numericOffset(String initial, String offset) {
BigDecimal number;
BigDecimal dOffset;
try {
number = new BigDecimal(initial);
dOffset = new BigDecimal(offset);
} catch (Exception ex) {
return null;
}
return number.... | [
"public",
"static",
"String",
"numericOffset",
"(",
"String",
"initial",
",",
"String",
"offset",
")",
"{",
"BigDecimal",
"number",
";",
"BigDecimal",
"dOffset",
";",
"try",
"{",
"number",
"=",
"new",
"BigDecimal",
"(",
"initial",
")",
";",
"dOffset",
"=",
... | Offset a numeric string by another numeric string.
Any numeric string recognized by {@code BigDecimal} is supported.
@param initial A valid number string
@param offset A valid number string
@return a number string with the precision matching the highest precision
argument.
@see BigDecimal | [
"Offset",
"a",
"numeric",
"string",
"by",
"another",
"numeric",
"string",
"."
] | train | https://github.com/agmip/agmip-common-functions/blob/4efa3042178841b026ca6fba9c96da02fbfb9a8e/src/main/java/org/agmip/common/Functions.java#L211-L222 |
vkostyukov/la4j | src/main/java/org/la4j/Matrix.java | Matrix.eachInColumn | public void eachInColumn(int j, VectorProcedure procedure) {
"""
Applies given {@code procedure} to each element of specified column of this matrix.
@param j the column index
@param procedure the vector procedure
"""
VectorIterator it = iteratorOfColumn(j);
while (it.hasNext()) {
... | java | public void eachInColumn(int j, VectorProcedure procedure) {
VectorIterator it = iteratorOfColumn(j);
while (it.hasNext()) {
double x = it.next();
int i = it.index();
procedure.apply(i, x);
}
} | [
"public",
"void",
"eachInColumn",
"(",
"int",
"j",
",",
"VectorProcedure",
"procedure",
")",
"{",
"VectorIterator",
"it",
"=",
"iteratorOfColumn",
"(",
"j",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"double",
"x",
"=",
"it",
"."... | Applies given {@code procedure} to each element of specified column of this matrix.
@param j the column index
@param procedure the vector procedure | [
"Applies",
"given",
"{",
"@code",
"procedure",
"}",
"to",
"each",
"element",
"of",
"specified",
"column",
"of",
"this",
"matrix",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Matrix.java#L1400-L1408 |
jhg023/SimpleNet | src/main/java/simplenet/Server.java | Server.writeHelper | private void writeHelper(Consumer<Client> consumer, Collection<? extends Client> clients) {
"""
A helper method that eliminates code duplication in the {@link #writeToAllExcept(Packet, Collection)} and
{@link #writeAndFlushToAllExcept(Packet, Collection)} methods.
@param consumer The action to perform for each... | java | private void writeHelper(Consumer<Client> consumer, Collection<? extends Client> clients) {
var toExclude = Collections.newSetFromMap(new IdentityHashMap<>(clients.size()));
toExclude.addAll(clients);
connectedClients.stream().filter(Predicate.not(toExclude::contains)).forEach(consumer);
} | [
"private",
"void",
"writeHelper",
"(",
"Consumer",
"<",
"Client",
">",
"consumer",
",",
"Collection",
"<",
"?",
"extends",
"Client",
">",
"clients",
")",
"{",
"var",
"toExclude",
"=",
"Collections",
".",
"newSetFromMap",
"(",
"new",
"IdentityHashMap",
"<>",
... | A helper method that eliminates code duplication in the {@link #writeToAllExcept(Packet, Collection)} and
{@link #writeAndFlushToAllExcept(Packet, Collection)} methods.
@param consumer The action to perform for each {@link Client}.
@param clients A {@link Collection} of {@link Client}s to exclude from receiving the {@... | [
"A",
"helper",
"method",
"that",
"eliminates",
"code",
"duplication",
"in",
"the",
"{",
"@link",
"#writeToAllExcept",
"(",
"Packet",
"Collection",
")",
"}",
"and",
"{",
"@link",
"#writeAndFlushToAllExcept",
"(",
"Packet",
"Collection",
")",
"}",
"methods",
"."
] | train | https://github.com/jhg023/SimpleNet/blob/a5b55cbfe1768c6a28874f12adac3c748f2b509a/src/main/java/simplenet/Server.java#L224-L228 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/parser/lexparser/MLEDependencyGrammar.java | MLEDependencyGrammar.getCachedITW | private IntTaggedWord getCachedITW(short tag) {
"""
This maps from a tag to a cached IntTagWord that represents the
tag by having the wildcard word ANY_WORD_INT and the tag in the
reduced tag space.
The argument is in terms of the full tag space; internally this
function maps to the reduced space.
@param tag... | java | private IntTaggedWord getCachedITW(short tag) {
// The +2 below is because -1 and -2 are used with special meanings (see IntTaggedWord).
if (tagITWList == null) {
tagITWList = new ArrayList<IntTaggedWord>(numTagBins + 2);
for (int i=0; i<numTagBins + 2; i++) {
tagITWList.add(i, null);
... | [
"private",
"IntTaggedWord",
"getCachedITW",
"(",
"short",
"tag",
")",
"{",
"// The +2 below is because -1 and -2 are used with special meanings (see IntTaggedWord).\r",
"if",
"(",
"tagITWList",
"==",
"null",
")",
"{",
"tagITWList",
"=",
"new",
"ArrayList",
"<",
"IntTaggedWo... | This maps from a tag to a cached IntTagWord that represents the
tag by having the wildcard word ANY_WORD_INT and the tag in the
reduced tag space.
The argument is in terms of the full tag space; internally this
function maps to the reduced space.
@param tag short representation of tag in full tag space
@return an IntT... | [
"This",
"maps",
"from",
"a",
"tag",
"to",
"a",
"cached",
"IntTagWord",
"that",
"represents",
"the",
"tag",
"by",
"having",
"the",
"wildcard",
"word",
"ANY_WORD_INT",
"and",
"the",
"tag",
"in",
"the",
"reduced",
"tag",
"space",
".",
"The",
"argument",
"is",... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/parser/lexparser/MLEDependencyGrammar.java#L373-L387 |
Alluxio/alluxio | integration/checker/src/main/java/alluxio/checker/SparkIntegrationChecker.java | SparkIntegrationChecker.printConfigInfo | private void printConfigInfo(SparkConf conf, PrintWriter reportWriter) {
"""
Saves related Spark and Alluxio configuration information.
@param conf the current SparkConf
@param reportWriter save user-facing messages to a generated file
"""
// Get Spark configurations
if (conf.contains("spark.master... | java | private void printConfigInfo(SparkConf conf, PrintWriter reportWriter) {
// Get Spark configurations
if (conf.contains("spark.master")) {
reportWriter.printf("Spark master is: %s.%n%n", conf.get("spark.master"));
}
if (conf.contains("spark.submit.deployMode")) {
reportWriter.printf("spark-su... | [
"private",
"void",
"printConfigInfo",
"(",
"SparkConf",
"conf",
",",
"PrintWriter",
"reportWriter",
")",
"{",
"// Get Spark configurations",
"if",
"(",
"conf",
".",
"contains",
"(",
"\"spark.master\"",
")",
")",
"{",
"reportWriter",
".",
"printf",
"(",
"\"Spark ma... | Saves related Spark and Alluxio configuration information.
@param conf the current SparkConf
@param reportWriter save user-facing messages to a generated file | [
"Saves",
"related",
"Spark",
"and",
"Alluxio",
"configuration",
"information",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/checker/src/main/java/alluxio/checker/SparkIntegrationChecker.java#L144-L161 |
mikepenz/Materialize | library/src/main/java/com/mikepenz/materialize/util/UIUtils.java | UIUtils.getThemeColor | public static int getThemeColor(Context ctx, @AttrRes int attr) {
"""
a helper method to get the color from an attribute
@param ctx
@param attr
@return
"""
TypedValue tv = new TypedValue();
if (ctx.getTheme().resolveAttribute(attr, tv, true)) {
return tv.resourceId != 0 ? Conte... | java | public static int getThemeColor(Context ctx, @AttrRes int attr) {
TypedValue tv = new TypedValue();
if (ctx.getTheme().resolveAttribute(attr, tv, true)) {
return tv.resourceId != 0 ? ContextCompat.getColor(ctx, tv.resourceId) : tv.data;
}
return 0;
} | [
"public",
"static",
"int",
"getThemeColor",
"(",
"Context",
"ctx",
",",
"@",
"AttrRes",
"int",
"attr",
")",
"{",
"TypedValue",
"tv",
"=",
"new",
"TypedValue",
"(",
")",
";",
"if",
"(",
"ctx",
".",
"getTheme",
"(",
")",
".",
"resolveAttribute",
"(",
"at... | a helper method to get the color from an attribute
@param ctx
@param attr
@return | [
"a",
"helper",
"method",
"to",
"get",
"the",
"color",
"from",
"an",
"attribute"
] | train | https://github.com/mikepenz/Materialize/blob/2612c10c7570191a78d57f23620e945d61370e3d/library/src/main/java/com/mikepenz/materialize/util/UIUtils.java#L39-L45 |
Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/tools/DOMHelper.java | DOMHelper.getEventDocFromUrl | public static synchronized Document getEventDocFromUrl(String url) throws TvDbException {
"""
Get a DOM document from the supplied URL
@param url
@return
@throws com.omertron.thetvdbapi.TvDbException
"""
Document doc = null;
String webPage = getValidWebpage(url);
// If th... | java | public static synchronized Document getEventDocFromUrl(String url) throws TvDbException {
Document doc = null;
String webPage = getValidWebpage(url);
// If the webpage returned is null or empty, quit
if(StringUtils.isBlank(webPage)){
return null;
}
... | [
"public",
"static",
"synchronized",
"Document",
"getEventDocFromUrl",
"(",
"String",
"url",
")",
"throws",
"TvDbException",
"{",
"Document",
"doc",
"=",
"null",
";",
"String",
"webPage",
"=",
"getValidWebpage",
"(",
"url",
")",
";",
"// If the webpage returned is nu... | Get a DOM document from the supplied URL
@param url
@return
@throws com.omertron.thetvdbapi.TvDbException | [
"Get",
"a",
"DOM",
"document",
"from",
"the",
"supplied",
"URL"
] | train | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/tools/DOMHelper.java#L118-L140 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/sr/Attribute.java | Attribute.hasQName | protected boolean hasQName(String uri, String localName) {
"""
@param uri Namespace URI of the attribute, if any; MUST be
given as null if no namespace
@param localName Local name to match. Note: is NOT guaranteed
to have been interned
@return True if qualified name of this attribute is the same
as what arg... | java | protected boolean hasQName(String uri, String localName)
{
if (localName != mLocalName && !localName.equals(mLocalName)) {
return false;
}
if (mNamespaceURI == uri) {
return true;
}
if (uri == null) {
return (mNamespaceURI == null) || mName... | [
"protected",
"boolean",
"hasQName",
"(",
"String",
"uri",
",",
"String",
"localName",
")",
"{",
"if",
"(",
"localName",
"!=",
"mLocalName",
"&&",
"!",
"localName",
".",
"equals",
"(",
"mLocalName",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
... | @param uri Namespace URI of the attribute, if any; MUST be
given as null if no namespace
@param localName Local name to match. Note: is NOT guaranteed
to have been interned
@return True if qualified name of this attribute is the same
as what arguments describe | [
"@param",
"uri",
"Namespace",
"URI",
"of",
"the",
"attribute",
"if",
"any",
";",
"MUST",
"be",
"given",
"as",
"null",
"if",
"no",
"namespace",
"@param",
"localName",
"Local",
"name",
"to",
"match",
".",
"Note",
":",
"is",
"NOT",
"guaranteed",
"to",
"have... | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sr/Attribute.java#L103-L115 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/ShortExtensions.java | ShortExtensions.operator_multiply | @Pure
@Inline(value="($1 * $2)", constantExpression=true)
public static long operator_multiply(short a, long b) {
"""
The binary <code>multiply</code> operator. This is the equivalent to the Java <code>*</code> operator.
@param a a short.
@param b a long.
@return <code>a*b</code>
@since 2.3
"""
r... | java | @Pure
@Inline(value="($1 * $2)", constantExpression=true)
public static long operator_multiply(short a, long b) {
return a * b;
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"($1 * $2)\"",
",",
"constantExpression",
"=",
"true",
")",
"public",
"static",
"long",
"operator_multiply",
"(",
"short",
"a",
",",
"long",
"b",
")",
"{",
"return",
"a",
"*",
"b",
";",
"}"
] | The binary <code>multiply</code> operator. This is the equivalent to the Java <code>*</code> operator.
@param a a short.
@param b a long.
@return <code>a*b</code>
@since 2.3 | [
"The",
"binary",
"<code",
">",
"multiply<",
"/",
"code",
">",
"operator",
".",
"This",
"is",
"the",
"equivalent",
"to",
"the",
"Java",
"<code",
">",
"*",
"<",
"/",
"code",
">",
"operator",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/ShortExtensions.java#L513-L517 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DecimalFormat.java | DecimalFormat.skipPadding | private final int skipPadding(String text, int position) {
"""
Starting at position, advance past a run of pad characters, if any. Return the
index of the first character after position that is not a pad character. Result is
>= position.
"""
while (position < text.length() && text.charAt(position) ==... | java | private final int skipPadding(String text, int position) {
while (position < text.length() && text.charAt(position) == pad) {
++position;
}
return position;
} | [
"private",
"final",
"int",
"skipPadding",
"(",
"String",
"text",
",",
"int",
"position",
")",
"{",
"while",
"(",
"position",
"<",
"text",
".",
"length",
"(",
")",
"&&",
"text",
".",
"charAt",
"(",
"position",
")",
"==",
"pad",
")",
"{",
"++",
"positi... | Starting at position, advance past a run of pad characters, if any. Return the
index of the first character after position that is not a pad character. Result is
>= position. | [
"Starting",
"at",
"position",
"advance",
"past",
"a",
"run",
"of",
"pad",
"characters",
"if",
"any",
".",
"Return",
"the",
"index",
"of",
"the",
"first",
"character",
"after",
"position",
"that",
"is",
"not",
"a",
"pad",
"character",
".",
"Result",
"is",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DecimalFormat.java#L2847-L2852 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/io/FileUtils.java | FileUtils.createStorageDirPath | public static boolean createStorageDirPath(String path, String workerDataFolderPermissions)
throws IOException {
"""
Creates the storage directory path, including any necessary but nonexistent parent directories.
If the directory already exists, do nothing.
Also, appropriate directory permissions (w/ Sti... | java | public static boolean createStorageDirPath(String path, String workerDataFolderPermissions)
throws IOException {
if (Files.exists(Paths.get(path))) {
return false;
}
Path storagePath;
try {
storagePath = Files.createDirectories(Paths.get(path));
} catch (UnsupportedOperationExcepti... | [
"public",
"static",
"boolean",
"createStorageDirPath",
"(",
"String",
"path",
",",
"String",
"workerDataFolderPermissions",
")",
"throws",
"IOException",
"{",
"if",
"(",
"Files",
".",
"exists",
"(",
"Paths",
".",
"get",
"(",
"path",
")",
")",
")",
"{",
"retu... | Creates the storage directory path, including any necessary but nonexistent parent directories.
If the directory already exists, do nothing.
Also, appropriate directory permissions (w/ StickyBit) are set.
@param path storage directory path to create
@param workerDataFolderPermissions the permissions to set for the wo... | [
"Creates",
"the",
"storage",
"directory",
"path",
"including",
"any",
"necessary",
"but",
"nonexistent",
"parent",
"directories",
".",
"If",
"the",
"directory",
"already",
"exists",
"do",
"nothing",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/io/FileUtils.java#L262-L277 |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnDivisiveNormalizationForward | public static int cudnnDivisiveNormalizationForward(
cudnnHandle handle,
cudnnLRNDescriptor normDesc,
int mode,
Pointer alpha,
cudnnTensorDescriptor xDesc, /** same desc for means, temp, temp2 */
Pointer x,
Pointer means, /** if NULL, means are assumed to be ... | java | public static int cudnnDivisiveNormalizationForward(
cudnnHandle handle,
cudnnLRNDescriptor normDesc,
int mode,
Pointer alpha,
cudnnTensorDescriptor xDesc, /** same desc for means, temp, temp2 */
Pointer x,
Pointer means, /** if NULL, means are assumed to be ... | [
"public",
"static",
"int",
"cudnnDivisiveNormalizationForward",
"(",
"cudnnHandle",
"handle",
",",
"cudnnLRNDescriptor",
"normDesc",
",",
"int",
"mode",
",",
"Pointer",
"alpha",
",",
"cudnnTensorDescriptor",
"xDesc",
",",
"/** same desc for means, temp, temp2 */",
"Pointer"... | LCN/divisive normalization functions: y = alpha * normalize(x) + beta * y | [
"LCN",
"/",
"divisive",
"normalization",
"functions",
":",
"y",
"=",
"alpha",
"*",
"normalize",
"(",
"x",
")",
"+",
"beta",
"*",
"y"
] | train | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L2114-L2129 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/dispatching/delegates/Flipper.java | Flipper.apply | @Override
public R apply(T former, U latter) {
"""
Performs on the nested function swapping former and latter formal
parameters.
@param former the former formal parameter used as latter in the nested
function
@param latter the latter formal parameter used as former in the nested
function
@return the re... | java | @Override
public R apply(T former, U latter) {
return function.apply(latter, former);
} | [
"@",
"Override",
"public",
"R",
"apply",
"(",
"T",
"former",
",",
"U",
"latter",
")",
"{",
"return",
"function",
".",
"apply",
"(",
"latter",
",",
"former",
")",
";",
"}"
] | Performs on the nested function swapping former and latter formal
parameters.
@param former the former formal parameter used as latter in the nested
function
@param latter the latter formal parameter used as former in the nested
function
@return the result of the function | [
"Performs",
"on",
"the",
"nested",
"function",
"swapping",
"former",
"and",
"latter",
"formal",
"parameters",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/dispatching/delegates/Flipper.java#L36-L39 |
gallandarakhneorg/afc | core/text/src/main/java/org/arakhne/afc/text/TextUtil.java | TextUtil.formatHex | @Pure
@Inline(value = "$3.formatHex($1, $2)", imported = {
"""
Format the given int value to hexadecimal.
@param amount the value to convert.
@param digits the minimal number of digits.
@return a string representation of the given value.
@since 15.0
"""StringEscaper.class})
public static String formatH... | java | @Pure
@Inline(value = "$3.formatHex($1, $2)", imported = {StringEscaper.class})
public static String formatHex(int amount, int digits) {
return StringEscaper.formatHex(amount, digits);
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"$3.formatHex($1, $2)\"",
",",
"imported",
"=",
"{",
"StringEscaper",
".",
"class",
"}",
")",
"public",
"static",
"String",
"formatHex",
"(",
"int",
"amount",
",",
"int",
"digits",
")",
"{",
"return",
"Strin... | Format the given int value to hexadecimal.
@param amount the value to convert.
@param digits the minimal number of digits.
@return a string representation of the given value.
@since 15.0 | [
"Format",
"the",
"given",
"int",
"value",
"to",
"hexadecimal",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/text/src/main/java/org/arakhne/afc/text/TextUtil.java#L1627-L1631 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLSameIndividualAxiomImpl_CustomFieldSerializer.java | OWLSameIndividualAxiomImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLSameIndividualAxiomImpl instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLSameIndividualAxiomImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLSameIndividualAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLSameIndividualAxiomImpl_CustomFieldSerializer.java#L74-L77 |
soi-toolkit/soi-toolkit-mule | commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/sftp/SftpUtil.java | SftpUtil.getSftpClient | static protected SftpClient getSftpClient(MuleContext muleContext,
String endpointName) throws IOException {
"""
Returns a SftpClient that is logged in to the sftp server that the
endpoint is configured against.
@param muleContext
@param endpointName
@return
@throws IOException
"""
ImmutableEndpoin... | java | static protected SftpClient getSftpClient(MuleContext muleContext,
String endpointName) throws IOException {
ImmutableEndpoint endpoint = getImmutableEndpoint(muleContext,
endpointName);
try {
SftpClient sftpClient = SftpConnectionFactory.createClient(endpoint);
return sftpClient;
} catch (Excepti... | [
"static",
"protected",
"SftpClient",
"getSftpClient",
"(",
"MuleContext",
"muleContext",
",",
"String",
"endpointName",
")",
"throws",
"IOException",
"{",
"ImmutableEndpoint",
"endpoint",
"=",
"getImmutableEndpoint",
"(",
"muleContext",
",",
"endpointName",
")",
";",
... | Returns a SftpClient that is logged in to the sftp server that the
endpoint is configured against.
@param muleContext
@param endpointName
@return
@throws IOException | [
"Returns",
"a",
"SftpClient",
"that",
"is",
"logged",
"in",
"to",
"the",
"sftp",
"server",
"that",
"the",
"endpoint",
"is",
"configured",
"against",
"."
] | train | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/sftp/SftpUtil.java#L208-L244 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/ReflectionUtils.java | ReflectionUtils.getMethod | public static Method getMethod(String methodName, Class<?> clazz, Class<?>... parameterTypes) {
"""
Get a class' method by name. Return {@code null} if no such method found.
<p>
This method can get private and protected methods.
</p>
<p>
This method can get methods from super classes/interfaces.
</p>
... | java | public static Method getMethod(String methodName, Class<?> clazz, Class<?>... parameterTypes) {
if (clazz == null) {
return null;
}
Method m = getDeclaredMethod(methodName, clazz, parameterTypes);
if (m == null) {
List<Class<?>> interfacesAndSuperClasses = new Lin... | [
"public",
"static",
"Method",
"getMethod",
"(",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"clazz",
",",
"Class",
"<",
"?",
">",
"...",
"parameterTypes",
")",
"{",
"if",
"(",
"clazz",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Met... | Get a class' method by name. Return {@code null} if no such method found.
<p>
This method can get private and protected methods.
</p>
<p>
This method can get methods from super classes/interfaces.
</p>
@param methodName
@param clazz
@param parameterTypes
@return
@since 0.9.1.4 | [
"Get",
"a",
"class",
"method",
"by",
"name",
".",
"Return",
"{",
"@code",
"null",
"}",
"if",
"no",
"such",
"method",
"found",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/ReflectionUtils.java#L70-L91 |
AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/bluetooth/BluetoothCrashResolver.java | BluetoothCrashResolver.notifyScannedDevice | @TargetApi(18)
public void notifyScannedDevice(BluetoothDevice device, BluetoothAdapter.LeScanCallback scanner) {
"""
Call this method from your BluetoothAdapter.LeScanCallback method.
Doing so is optional, but if you do, this class will be able to count the number of
distinct Bluetooth devices scanned, and ... | java | @TargetApi(18)
public void notifyScannedDevice(BluetoothDevice device, BluetoothAdapter.LeScanCallback scanner) {
int oldSize, newSize;
oldSize = distinctBluetoothAddresses.size();
synchronized(distinctBluetoothAddresses) {
distinctBluetoothAddresses.add(device.getAddress());
... | [
"@",
"TargetApi",
"(",
"18",
")",
"public",
"void",
"notifyScannedDevice",
"(",
"BluetoothDevice",
"device",
",",
"BluetoothAdapter",
".",
"LeScanCallback",
"scanner",
")",
"{",
"int",
"oldSize",
",",
"newSize",
";",
"oldSize",
"=",
"distinctBluetoothAddresses",
"... | Call this method from your BluetoothAdapter.LeScanCallback method.
Doing so is optional, but if you do, this class will be able to count the number of
distinct Bluetooth devices scanned, and prevent crashes before they happen.
This works very well if the app containing this class is the only one running bluetooth
LE s... | [
"Call",
"this",
"method",
"from",
"your",
"BluetoothAdapter",
".",
"LeScanCallback",
"method",
".",
"Doing",
"so",
"is",
"optional",
"but",
"if",
"you",
"do",
"this",
"class",
"will",
"be",
"able",
"to",
"count",
"the",
"number",
"of",
"distinct",
"Bluetooth... | train | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/bluetooth/BluetoothCrashResolver.java#L175-L200 |
davidmoten/rxjava-extras | src/main/java/com/github/davidmoten/rx/Transformers.java | Transformers.orderedMergeWith | public static final <T> Transformer<T, T> orderedMergeWith(final Observable<T> other,
final Comparator<? super T> comparator, boolean delayErrors, int bufferSize) {
"""
<p>
Returns the source {@link Observable} merged with the <code>other</code>
observable using the given {@link Comparator} for order... | java | public static final <T> Transformer<T, T> orderedMergeWith(final Observable<T> other,
final Comparator<? super T> comparator, boolean delayErrors, int bufferSize) {
Preconditions.checkArgument(bufferSize > 0, "bufferSize must be greater than zero");
@SuppressWarnings("unchecked")
Col... | [
"public",
"static",
"final",
"<",
"T",
">",
"Transformer",
"<",
"T",
",",
"T",
">",
"orderedMergeWith",
"(",
"final",
"Observable",
"<",
"T",
">",
"other",
",",
"final",
"Comparator",
"<",
"?",
"super",
"T",
">",
"comparator",
",",
"boolean",
"delayError... | <p>
Returns the source {@link Observable} merged with the <code>other</code>
observable using the given {@link Comparator} for order. A precondition
is that the source and other are already ordered. This transformer
supports backpressure and its inputs must also support backpressure.
<p>
<img src=
"https://github.com/... | [
"<p",
">",
"Returns",
"the",
"source",
"{",
"@link",
"Observable",
"}",
"merged",
"with",
"the",
"<code",
">",
"other<",
"/",
"code",
">",
"observable",
"using",
"the",
"given",
"{",
"@link",
"Comparator",
"}",
"for",
"order",
".",
"A",
"precondition",
"... | train | https://github.com/davidmoten/rxjava-extras/blob/a91d2ba7d454843250e0b0fce36084f9fb02a551/src/main/java/com/github/davidmoten/rx/Transformers.java#L365-L371 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/util/HTMLEncoder.java | HTMLEncoder.percentEncode | private static String percentEncode(char c, String characterEncoding) {
"""
Encode a unicode char value in percentEncode, decoding its bytes using a specified
characterEncoding.
@param c
@param characterEncoding
@return
"""
String app = null;
if (c > (char)((short)0x007F))
{
... | java | private static String percentEncode(char c, String characterEncoding)
{
String app = null;
if (c > (char)((short)0x007F))
{
//percent encode in the proper encoding to be consistent
app = percentEncodeNonUsAsciiCharacter(c, characterEncoding);
}
else
... | [
"private",
"static",
"String",
"percentEncode",
"(",
"char",
"c",
",",
"String",
"characterEncoding",
")",
"{",
"String",
"app",
"=",
"null",
";",
"if",
"(",
"c",
">",
"(",
"char",
")",
"(",
"(",
"short",
")",
"0x007F",
")",
")",
"{",
"//percent encode... | Encode a unicode char value in percentEncode, decoding its bytes using a specified
characterEncoding.
@param c
@param characterEncoding
@return | [
"Encode",
"a",
"unicode",
"char",
"value",
"in",
"percentEncode",
"decoding",
"its",
"bytes",
"using",
"a",
"specified",
"characterEncoding",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/util/HTMLEncoder.java#L717-L731 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java | FilesImpl.listFromTaskAsync | public Observable<Page<NodeFile>> listFromTaskAsync(final String jobId, final String taskId, final Boolean recursive, final FileListFromTaskOptions fileListFromTaskOptions) {
"""
Lists the files in a task's directory on its compute node.
@param jobId The ID of the job that contains the task.
@param taskId The ... | java | public Observable<Page<NodeFile>> listFromTaskAsync(final String jobId, final String taskId, final Boolean recursive, final FileListFromTaskOptions fileListFromTaskOptions) {
return listFromTaskWithServiceResponseAsync(jobId, taskId, recursive, fileListFromTaskOptions)
.map(new Func1<ServiceResp... | [
"public",
"Observable",
"<",
"Page",
"<",
"NodeFile",
">",
">",
"listFromTaskAsync",
"(",
"final",
"String",
"jobId",
",",
"final",
"String",
"taskId",
",",
"final",
"Boolean",
"recursive",
",",
"final",
"FileListFromTaskOptions",
"fileListFromTaskOptions",
")",
"... | Lists the files in a task's directory on its compute node.
@param jobId The ID of the job that contains the task.
@param taskId The ID of the task whose files you want to list.
@param recursive Whether to list children of the task directory. This parameter can be used in combination with the filter parameter to list s... | [
"Lists",
"the",
"files",
"in",
"a",
"task",
"s",
"directory",
"on",
"its",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java#L1793-L1801 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.