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 |
|---|---|---|---|---|---|---|---|---|---|---|
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/storefront/ProductUrl.java | ProductUrl.getProductInventoryUrl | public static MozuUrl getProductInventoryUrl(String locationCodes, String productCode, String responseFields) {
"""
Get Resource Url for GetProductInventory
@param locationCodes Array of location codes for which to retrieve product inventory information.
@param productCode The unique, user-defined product code o... | java | public static MozuUrl getProductInventoryUrl(String locationCodes, String productCode, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/storefront/products/{productCode}/locationinventory?locationCodes={locationCodes}&responseFields={responseFields}");
formatter.formatUr... | [
"public",
"static",
"MozuUrl",
"getProductInventoryUrl",
"(",
"String",
"locationCodes",
",",
"String",
"productCode",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/storefront/products/{prod... | Get Resource Url for GetProductInventory
@param locationCodes Array of location codes for which to retrieve product inventory information.
@param productCode The unique, user-defined product code of a product, used throughout to reference and associate to a product.
@param responseFields Filtering syntax appended to a... | [
"Get",
"Resource",
"Url",
"for",
"GetProductInventory"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/catalog/storefront/ProductUrl.java#L49-L56 |
Azure/azure-sdk-for-java | storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountsInner.java | StorageAccountsInner.listServiceSASAsync | public Observable<ListServiceSasResponseInner> listServiceSASAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters) {
"""
List service SAS credentials of a specific resource.
@param resourceGroupName The name of the resource group within the user's subscription. The name is case in... | java | public Observable<ListServiceSasResponseInner> listServiceSASAsync(String resourceGroupName, String accountName, ServiceSasParameters parameters) {
return listServiceSASWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1<ServiceResponse<ListServiceSasResponseInner>, ListServiceSas... | [
"public",
"Observable",
"<",
"ListServiceSasResponseInner",
">",
"listServiceSASAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"ServiceSasParameters",
"parameters",
")",
"{",
"return",
"listServiceSASWithServiceResponseAsync",
"(",
"resourceGro... | List service SAS credentials of a specific resource.
@param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
@param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in... | [
"List",
"service",
"SAS",
"credentials",
"of",
"a",
"specific",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountsInner.java#L1136-L1143 |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java | HttpConversionUtil.toHttpRequest | public static HttpRequest toHttpRequest(int streamId, Http2Headers http2Headers, boolean validateHttpHeaders)
throws Http2Exception {
"""
Create a new object to contain the request data.
@param streamId The stream associated with the request
@param http2Headers The initial set of HTTP/2 hea... | java | public static HttpRequest toHttpRequest(int streamId, Http2Headers http2Headers, boolean validateHttpHeaders)
throws Http2Exception {
// HTTP/2 does not define a way to carry the version identifier that is included in the HTTP/1.1 request line.
final CharSequence method = checkNotNul... | [
"public",
"static",
"HttpRequest",
"toHttpRequest",
"(",
"int",
"streamId",
",",
"Http2Headers",
"http2Headers",
",",
"boolean",
"validateHttpHeaders",
")",
"throws",
"Http2Exception",
"{",
"// HTTP/2 does not define a way to carry the version identifier that is included in the HTT... | Create a new object to contain the request data.
@param streamId The stream associated with the request
@param http2Headers The initial set of HTTP/2 headers to create the request with
@param validateHttpHeaders <ul>
<li>{@code true} to validate HTTP headers in the http-codec</li>
<li>{@code false} not to validate HTT... | [
"Create",
"a",
"new",
"object",
"to",
"contain",
"the",
"request",
"data",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java#L280-L297 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java | HadoopUtils.renamePath | public static void renamePath(FileContext fc, Path oldName, Path newName, boolean overwrite)
throws IOException {
"""
A wrapper around {@link FileContext#rename(Path, Path, Options.Rename...)}}.
"""
Options.Rename renameOptions = (overwrite) ? Options.Rename.OVERWRITE : Options.Rename.NONE;
fc.re... | java | public static void renamePath(FileContext fc, Path oldName, Path newName, boolean overwrite)
throws IOException {
Options.Rename renameOptions = (overwrite) ? Options.Rename.OVERWRITE : Options.Rename.NONE;
fc.rename(oldName, newName, renameOptions);
} | [
"public",
"static",
"void",
"renamePath",
"(",
"FileContext",
"fc",
",",
"Path",
"oldName",
",",
"Path",
"newName",
",",
"boolean",
"overwrite",
")",
"throws",
"IOException",
"{",
"Options",
".",
"Rename",
"renameOptions",
"=",
"(",
"overwrite",
")",
"?",
"O... | A wrapper around {@link FileContext#rename(Path, Path, Options.Rename...)}}. | [
"A",
"wrapper",
"around",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java#L250-L254 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertNV21.java | ConvertNV21.nv21ToInterleaved | public static InterleavedU8 nv21ToInterleaved( byte[] data , int width , int height ,
InterleavedU8 output ) {
"""
Converts an NV21 image into a {@link InterleavedU8} RGB image.
@param data Input: NV21 image data
@param width Input: NV21 image width
@param height Input: NV21 image height
@para... | java | public static InterleavedU8 nv21ToInterleaved( byte[] data , int width , int height ,
InterleavedU8 output ) {
if( output == null ) {
output = new InterleavedU8(width,height,3);
} else {
output.reshape(width, height, 3);
}
if(BoofConcurrency.USE_CONCURRENT ) {
ImplConvertNV21_MT.nv21ToIn... | [
"public",
"static",
"InterleavedU8",
"nv21ToInterleaved",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"width",
",",
"int",
"height",
",",
"InterleavedU8",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"{",
"output",
"=",
"new",
"InterleavedU8"... | Converts an NV21 image into a {@link InterleavedU8} RGB image.
@param data Input: NV21 image data
@param width Input: NV21 image width
@param height Input: NV21 image height
@param output Output: Optional storage for output image. Can be null. | [
"Converts",
"an",
"NV21",
"image",
"into",
"a",
"{",
"@link",
"InterleavedU8",
"}",
"RGB",
"image",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertNV21.java#L231-L245 |
google/closure-templates | java/src/com/google/template/soy/parsepasses/contextautoesc/InferenceEngine.java | InferenceEngine.inferTemplateEndContext | public static Context inferTemplateEndContext(
TemplateNode templateNode,
Context startContext,
Inferences inferences,
ErrorReporter errorReporter) {
"""
Infer an end context for the given template and, if requested, choose escaping directives for
any <code>{print}</code>.
@param templa... | java | public static Context inferTemplateEndContext(
TemplateNode templateNode,
Context startContext,
Inferences inferences,
ErrorReporter errorReporter) {
InferenceEngine inferenceEngine = new InferenceEngine(inferences, errorReporter);
// Context started off as startContext and we have propa... | [
"public",
"static",
"Context",
"inferTemplateEndContext",
"(",
"TemplateNode",
"templateNode",
",",
"Context",
"startContext",
",",
"Inferences",
"inferences",
",",
"ErrorReporter",
"errorReporter",
")",
"{",
"InferenceEngine",
"inferenceEngine",
"=",
"new",
"InferenceEng... | Infer an end context for the given template and, if requested, choose escaping directives for
any <code>{print}</code>.
@param templateNode A template that is visited in {@code startContext} and no other. If a
template can be reached from multiple contexts, then it should be cloned. This class
automatically does that ... | [
"Infer",
"an",
"end",
"context",
"for",
"the",
"given",
"template",
"and",
"if",
"requested",
"choose",
"escaping",
"directives",
"for",
"any",
"<code",
">",
"{",
"print",
"}",
"<",
"/",
"code",
">",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/parsepasses/contextautoesc/InferenceEngine.java#L97-L106 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java | BinaryRowProtocol.getInternalTime | public Time getInternalTime(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone)
throws SQLException {
"""
Get time from raw binary format.
@param columnInfo column information
@param cal calendar
@param timeZone time zone
@return Time value
@throws SQLException if column cannot be ... | java | public Time getInternalTime(ColumnInformation columnInfo, Calendar cal, TimeZone timeZone)
throws SQLException {
if (lastValueWasNull()) {
return null;
}
switch (columnInfo.getColumnType()) {
case TIMESTAMP:
case DATETIME:
Timestamp ts = getInternalTimestamp(columnInfo, cal, ... | [
"public",
"Time",
"getInternalTime",
"(",
"ColumnInformation",
"columnInfo",
",",
"Calendar",
"cal",
",",
"TimeZone",
"timeZone",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"lastValueWasNull",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"switch",
"(",
... | Get time from raw binary format.
@param columnInfo column information
@param cal calendar
@param timeZone time zone
@return Time value
@throws SQLException if column cannot be converted to Time | [
"Get",
"time",
"from",
"raw",
"binary",
"format",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/rowprotocol/BinaryRowProtocol.java#L801-L851 |
apache/flink | flink-formats/flink-avro-confluent-registry/src/main/java/org/apache/flink/formats/avro/registry/confluent/ConfluentRegistryAvroDeserializationSchema.java | ConfluentRegistryAvroDeserializationSchema.forGeneric | public static ConfluentRegistryAvroDeserializationSchema<GenericRecord> forGeneric(Schema schema, String url) {
"""
Creates {@link ConfluentRegistryAvroDeserializationSchema} that produces {@link GenericRecord}
using provided reader schema and looks up writer schema in Confluent Schema Registry.
@param schema ... | java | public static ConfluentRegistryAvroDeserializationSchema<GenericRecord> forGeneric(Schema schema, String url) {
return forGeneric(schema, url, DEFAULT_IDENTITY_MAP_CAPACITY);
} | [
"public",
"static",
"ConfluentRegistryAvroDeserializationSchema",
"<",
"GenericRecord",
">",
"forGeneric",
"(",
"Schema",
"schema",
",",
"String",
"url",
")",
"{",
"return",
"forGeneric",
"(",
"schema",
",",
"url",
",",
"DEFAULT_IDENTITY_MAP_CAPACITY",
")",
";",
"}"... | Creates {@link ConfluentRegistryAvroDeserializationSchema} that produces {@link GenericRecord}
using provided reader schema and looks up writer schema in Confluent Schema Registry.
@param schema schema of produced records
@param url url of schema registry to connect
@return deserialized record in form of {@link Gen... | [
"Creates",
"{",
"@link",
"ConfluentRegistryAvroDeserializationSchema",
"}",
"that",
"produces",
"{",
"@link",
"GenericRecord",
"}",
"using",
"provided",
"reader",
"schema",
"and",
"looks",
"up",
"writer",
"schema",
"in",
"Confluent",
"Schema",
"Registry",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-formats/flink-avro-confluent-registry/src/main/java/org/apache/flink/formats/avro/registry/confluent/ConfluentRegistryAvroDeserializationSchema.java#L66-L68 |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java | DatatypeConverter.printDurationMandatory | public static final String printDurationMandatory(MSPDIWriter writer, Duration duration) {
"""
Print duration.
Note that Microsoft's xsd:duration parser implementation does not
appear to recognise durations other than those expressed in hours.
We use the compatibility flag to determine whether the output
is ... | java | public static final String printDurationMandatory(MSPDIWriter writer, Duration duration)
{
String result;
if (duration == null)
{
// SF-329: null default required to keep Powerproject happy when importing MSPDI files
result = "PT0H0M0S";
}
else
{
TimeUn... | [
"public",
"static",
"final",
"String",
"printDurationMandatory",
"(",
"MSPDIWriter",
"writer",
",",
"Duration",
"duration",
")",
"{",
"String",
"result",
";",
"if",
"(",
"duration",
"==",
"null",
")",
"{",
"// SF-329: null default required to keep Powerproject happy whe... | Print duration.
Note that Microsoft's xsd:duration parser implementation does not
appear to recognise durations other than those expressed in hours.
We use the compatibility flag to determine whether the output
is adjusted for the benefit of Microsoft Project.
@param writer parent MSPDIWriter instance
@param duration... | [
"Print",
"duration",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/DatatypeConverter.java#L960-L985 |
GeoLatte/geolatte-common | src/main/java/org/geolatte/common/dataformats/json/jackson/AbstractJsonDeserializer.java | AbstractJsonDeserializer.getBooleanParam | protected Boolean getBooleanParam(String paramName, String errorMessage) throws IOException {
"""
Convenience method for subclasses.
@param paramName the name of the parameter
@param errorMessage the errormessage to add to the exception if the param does not exist.
@return a stringparameter with given name... | java | protected Boolean getBooleanParam(String paramName, String errorMessage) throws IOException {
return getBooleanParam(paramName, errorMessage, (Map<String, Object>) inputParams.get());
} | [
"protected",
"Boolean",
"getBooleanParam",
"(",
"String",
"paramName",
",",
"String",
"errorMessage",
")",
"throws",
"IOException",
"{",
"return",
"getBooleanParam",
"(",
"paramName",
",",
"errorMessage",
",",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
... | Convenience method for subclasses.
@param paramName the name of the parameter
@param errorMessage the errormessage to add to the exception if the param does not exist.
@return a stringparameter with given name. If it does not exist and the errormessage is provided,
an IOException is thrown with that message. if the... | [
"Convenience",
"method",
"for",
"subclasses",
"."
] | train | https://github.com/GeoLatte/geolatte-common/blob/dc7f92b04d8c6cb706e78cb95e746d8f12089d95/src/main/java/org/geolatte/common/dataformats/json/jackson/AbstractJsonDeserializer.java#L258-L260 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.payment_thod_POST | public OvhValidationResult payment_thod_POST(Long billingContactId, OvhCallbackUrl callbackUrl, Boolean _default, String description, Long orderId, String paymentType, Boolean register) throws IOException {
"""
Pay an order and register a new payment method if necessary
REST: POST /me/payment/method
@param bil... | java | public OvhValidationResult payment_thod_POST(Long billingContactId, OvhCallbackUrl callbackUrl, Boolean _default, String description, Long orderId, String paymentType, Boolean register) throws IOException {
String qPath = "/me/payment/method";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap... | [
"public",
"OvhValidationResult",
"payment_thod_POST",
"(",
"Long",
"billingContactId",
",",
"OvhCallbackUrl",
"callbackUrl",
",",
"Boolean",
"_default",
",",
"String",
"description",
",",
"Long",
"orderId",
",",
"String",
"paymentType",
",",
"Boolean",
"register",
")"... | Pay an order and register a new payment method if necessary
REST: POST /me/payment/method
@param billingContactId [required] Billing contact id
@param callbackUrl [required] URL's necessary to register
@param _default [required] Is this payment method set as the default one
@param description [required] Customer perso... | [
"Pay",
"an",
"order",
"and",
"register",
"a",
"new",
"payment",
"method",
"if",
"necessary"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L1034-L1047 |
kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/monitoring/configuration/impl/MonitorFileWriterImpl.java | MonitorFileWriterImpl.initializeServiceRefMetadata | private void initializeServiceRefMetadata(int serviceLocationOffset, int serviceOffsetIndex) {
"""
Method initializing service ref metadata section data
@param serviceLocationOffset
@param serviceOffsetIndex
"""
metaDataBuffer.putInt(serviceLocationOffset, serviceRefSection + serviceOffsetIndex * Bit... | java | private void initializeServiceRefMetadata(int serviceLocationOffset, int serviceOffsetIndex) {
metaDataBuffer.putInt(serviceLocationOffset, serviceRefSection + serviceOffsetIndex * BitUtil.SIZE_OF_INT);
// service reference section
metaDataBuffer.putInt(serviceRefSection + serviceOffsetIndex * ... | [
"private",
"void",
"initializeServiceRefMetadata",
"(",
"int",
"serviceLocationOffset",
",",
"int",
"serviceOffsetIndex",
")",
"{",
"metaDataBuffer",
".",
"putInt",
"(",
"serviceLocationOffset",
",",
"serviceRefSection",
"+",
"serviceOffsetIndex",
"*",
"BitUtil",
".",
"... | Method initializing service ref metadata section data
@param serviceLocationOffset
@param serviceOffsetIndex | [
"Method",
"initializing",
"service",
"ref",
"metadata",
"section",
"data"
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/monitoring/configuration/impl/MonitorFileWriterImpl.java#L241-L251 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.setFloat | public static void setFloat(MemorySegment[] segments, int offset, float value) {
"""
set float from segments.
@param segments target segments.
@param offset value offset.
"""
if (inFirstSegment(segments, offset, 4)) {
segments[0].putFloat(offset, value);
} else {
setFloatMultiSegments(segments, o... | java | public static void setFloat(MemorySegment[] segments, int offset, float value) {
if (inFirstSegment(segments, offset, 4)) {
segments[0].putFloat(offset, value);
} else {
setFloatMultiSegments(segments, offset, value);
}
} | [
"public",
"static",
"void",
"setFloat",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
",",
"float",
"value",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"4",
")",
")",
"{",
"segments",
"[",
"0",
"]",
... | set float from segments.
@param segments target segments.
@param offset value offset. | [
"set",
"float",
"from",
"segments",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L878-L884 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.findMethod | @Deprecated
public static JavaClassAndMethod findMethod(JavaClass[] classList, String methodName, String methodSig) {
"""
Find a method in given list of classes, searching the classes in order.
@param classList
list of classes in which to search
@param methodName
the name of the method
@param methodSig
... | java | @Deprecated
public static JavaClassAndMethod findMethod(JavaClass[] classList, String methodName, String methodSig) {
return findMethod(classList, methodName, methodSig, ANY_METHOD);
} | [
"@",
"Deprecated",
"public",
"static",
"JavaClassAndMethod",
"findMethod",
"(",
"JavaClass",
"[",
"]",
"classList",
",",
"String",
"methodName",
",",
"String",
"methodSig",
")",
"{",
"return",
"findMethod",
"(",
"classList",
",",
"methodName",
",",
"methodSig",
... | Find a method in given list of classes, searching the classes in order.
@param classList
list of classes in which to search
@param methodName
the name of the method
@param methodSig
the signature of the method
@return the JavaClassAndMethod, or null if no such method exists in the
class | [
"Find",
"a",
"method",
"in",
"given",
"list",
"of",
"classes",
"searching",
"the",
"classes",
"in",
"order",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L622-L625 |
youngmonkeys/ezyfox-sfs2x | src/main/java/com/tvd12/ezyfox/sfs2x/command/impl/AddBuddyImpl.java | AddBuddyImpl.checkBuddyManagerIsActive | private void checkBuddyManagerIsActive(BuddyListManager buddyListManager, User sfsOwner) {
"""
Check whether buddy manager is active
@param buddyListManager manager object
@param sfsOwner buddy's owner
"""
if (!buddyListManager.isActive()) {
throw new IllegalStateException(
... | java | private void checkBuddyManagerIsActive(BuddyListManager buddyListManager, User sfsOwner) {
if (!buddyListManager.isActive()) {
throw new IllegalStateException(
String.format("BuddyList operation failure. BuddyListManager is not active. Zone: %s, Sender: %s", new Object[] { sfsOwn... | [
"private",
"void",
"checkBuddyManagerIsActive",
"(",
"BuddyListManager",
"buddyListManager",
",",
"User",
"sfsOwner",
")",
"{",
"if",
"(",
"!",
"buddyListManager",
".",
"isActive",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"String",
".",
... | Check whether buddy manager is active
@param buddyListManager manager object
@param sfsOwner buddy's owner | [
"Check",
"whether",
"buddy",
"manager",
"is",
"active"
] | train | https://github.com/youngmonkeys/ezyfox-sfs2x/blob/7e004033a3b551c3ae970a0c8f45db7b1ec144de/src/main/java/com/tvd12/ezyfox/sfs2x/command/impl/AddBuddyImpl.java#L174-L179 |
lightblueseas/swing-components | src/main/java/de/alpharogroup/swing/menu/MenuExtensions.java | MenuExtensions.setAccelerator | public static void setAccelerator(final JMenuItem jmi, final String parsableKeystrokeString) {
"""
Sets the accelerator for the given menuitem and the given parsable keystroke string.
@param jmi
The JMenuItem.
@param parsableKeystrokeString
the parsable keystroke string
"""
jmi.setAccelerator(KeyStrok... | java | public static void setAccelerator(final JMenuItem jmi, final String parsableKeystrokeString)
{
jmi.setAccelerator(KeyStroke.getKeyStroke(parsableKeystrokeString));
} | [
"public",
"static",
"void",
"setAccelerator",
"(",
"final",
"JMenuItem",
"jmi",
",",
"final",
"String",
"parsableKeystrokeString",
")",
"{",
"jmi",
".",
"setAccelerator",
"(",
"KeyStroke",
".",
"getKeyStroke",
"(",
"parsableKeystrokeString",
")",
")",
";",
"}"
] | Sets the accelerator for the given menuitem and the given parsable keystroke string.
@param jmi
The JMenuItem.
@param parsableKeystrokeString
the parsable keystroke string | [
"Sets",
"the",
"accelerator",
"for",
"the",
"given",
"menuitem",
"and",
"the",
"given",
"parsable",
"keystroke",
"string",
"."
] | train | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/swing/menu/MenuExtensions.java#L108-L111 |
tzaeschke/zoodb | src/org/zoodb/internal/util/FormattedStringBuilder.java | FormattedStringBuilder.fill | public FormattedStringBuilder fill(int newLength, char c) {
"""
Attempts to append <tt>c</tt> until the current line gets the length <tt>
newLength</tt>. If the line is already as long or longer than <tt>
newLength</tt>, then nothing is appended.
@param newLength Minimal new length of the last line.
@param c C... | java | public FormattedStringBuilder fill(int newLength, char c) {
int lineStart = _delegate.lastIndexOf(NL);
if (lineStart == -1) {
return fillBuffer(newLength, c);
}
lineStart += NL.length();
return fillBuffer(lineStart + newLength, c);
} | [
"public",
"FormattedStringBuilder",
"fill",
"(",
"int",
"newLength",
",",
"char",
"c",
")",
"{",
"int",
"lineStart",
"=",
"_delegate",
".",
"lastIndexOf",
"(",
"NL",
")",
";",
"if",
"(",
"lineStart",
"==",
"-",
"1",
")",
"{",
"return",
"fillBuffer",
"(",... | Attempts to append <tt>c</tt> until the current line gets the length <tt>
newLength</tt>. If the line is already as long or longer than <tt>
newLength</tt>, then nothing is appended.
@param newLength Minimal new length of the last line.
@param c Character to append.
@return The updated instance of FormattedStringBuilde... | [
"Attempts",
"to",
"append",
"<tt",
">",
"c<",
"/",
"tt",
">",
"until",
"the",
"current",
"line",
"gets",
"the",
"length",
"<tt",
">",
"newLength<",
"/",
"tt",
">",
".",
"If",
"the",
"line",
"is",
"already",
"as",
"long",
"or",
"longer",
"than",
"<tt"... | train | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/util/FormattedStringBuilder.java#L191-L198 |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.copResourcesFromJarToDir | public static void copResourcesFromJarToDir(String sourceClassPath, File dest) {
"""
Cop resources from jar to dir.
@param sourceClassPath the source class path
@param dest the dest
"""
try {
List<File> resourcesInnPackage = getResourcesInnPackage(sourceClassPath);
for (File file : re... | java | public static void copResourcesFromJarToDir(String sourceClassPath, File dest) {
try {
List<File> resourcesInnPackage = getResourcesInnPackage(sourceClassPath);
for (File file : resourcesInnPackage) {
JK.printBlock("Copying file: " + file.getName() + " to folder " + dest.getAbsolutePath());
FileUti... | [
"public",
"static",
"void",
"copResourcesFromJarToDir",
"(",
"String",
"sourceClassPath",
",",
"File",
"dest",
")",
"{",
"try",
"{",
"List",
"<",
"File",
">",
"resourcesInnPackage",
"=",
"getResourcesInnPackage",
"(",
"sourceClassPath",
")",
";",
"for",
"(",
"Fi... | Cop resources from jar to dir.
@param sourceClassPath the source class path
@param dest the dest | [
"Cop",
"resources",
"from",
"jar",
"to",
"dir",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L745-L756 |
igniterealtime/Smack | smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java | Roster.createGroup | public RosterGroup createGroup(String name) {
"""
Creates a new group.
<p>
Note: you must add at least one entry to the group for the group to be kept
after a logout/login. This is due to the way that XMPP stores group information.
</p>
@param name the name of the group.
@return a new group, or null if the... | java | public RosterGroup createGroup(String name) {
final XMPPConnection connection = connection();
if (groups.containsKey(name)) {
return groups.get(name);
}
RosterGroup group = new RosterGroup(name, connection);
groups.put(name, group);
return group;
} | [
"public",
"RosterGroup",
"createGroup",
"(",
"String",
"name",
")",
"{",
"final",
"XMPPConnection",
"connection",
"=",
"connection",
"(",
")",
";",
"if",
"(",
"groups",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"return",
"groups",
".",
"get",
"(",
... | Creates a new group.
<p>
Note: you must add at least one entry to the group for the group to be kept
after a logout/login. This is due to the way that XMPP stores group information.
</p>
@param name the name of the group.
@return a new group, or null if the group already exists | [
"Creates",
"a",
"new",
"group",
".",
"<p",
">",
"Note",
":",
"you",
"must",
"add",
"at",
"least",
"one",
"entry",
"to",
"the",
"group",
"for",
"the",
"group",
"to",
"be",
"kept",
"after",
"a",
"logout",
"/",
"login",
".",
"This",
"is",
"due",
"to",... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java#L623-L632 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsPreferences.java | CmsPreferences.buildSelectPublishSiblings | public String buildSelectPublishSiblings(String htmlAttributes) {
"""
Builds the html for the default publish siblings mode select box.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@return the html for the default publish siblings mode select box
"""
List<String> o... | java | public String buildSelectPublishSiblings(String htmlAttributes) {
List<String> options = new ArrayList<String>(2);
options.add(key(Messages.GUI_PREF_PUBLISH_SIBLINGS_0));
options.add(key(Messages.GUI_PREF_PUBLISH_ONLY_SELECTED_0));
List<String> values = new ArrayList<String>(2);
... | [
"public",
"String",
"buildSelectPublishSiblings",
"(",
"String",
"htmlAttributes",
")",
"{",
"List",
"<",
"String",
">",
"options",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"2",
")",
";",
"options",
".",
"add",
"(",
"key",
"(",
"Messages",
".",
... | Builds the html for the default publish siblings mode select box.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@return the html for the default publish siblings mode select box | [
"Builds",
"the",
"html",
"for",
"the",
"default",
"publish",
"siblings",
"mode",
"select",
"box",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsPreferences.java#L810-L820 |
btrplace/scheduler | api/src/main/java/org/btrplace/model/view/network/Network.java | Network.newSwitch | public Switch newSwitch(int id, int capacity) {
"""
Create a new switch with a specific identifier and a given maximal capacity
@param id the switch identifier
@param capacity the switch maximal capacity (put a nul or negative number for non-blocking switch)
@return the switch
"""
Switch s =... | java | public Switch newSwitch(int id, int capacity) {
Switch s = swBuilder.newSwitch(id, capacity);
switches.add(s);
return s;
} | [
"public",
"Switch",
"newSwitch",
"(",
"int",
"id",
",",
"int",
"capacity",
")",
"{",
"Switch",
"s",
"=",
"swBuilder",
".",
"newSwitch",
"(",
"id",
",",
"capacity",
")",
";",
"switches",
".",
"add",
"(",
"s",
")",
";",
"return",
"s",
";",
"}"
] | Create a new switch with a specific identifier and a given maximal capacity
@param id the switch identifier
@param capacity the switch maximal capacity (put a nul or negative number for non-blocking switch)
@return the switch | [
"Create",
"a",
"new",
"switch",
"with",
"a",
"specific",
"identifier",
"and",
"a",
"given",
"maximal",
"capacity"
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/model/view/network/Network.java#L140-L144 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/ConditionalFunctions.java | ConditionalFunctions.negInfIf | public static Expression negInfIf(Expression expression1, Expression expression2) {
"""
Returned expression results in NegInf if expression1 = expression2, otherwise returns expression1.
Returns MISSING or NULL if either input is MISSING or NULL.
"""
return x("NEGINFIF(" + expression1.toString() + ", ... | java | public static Expression negInfIf(Expression expression1, Expression expression2) {
return x("NEGINFIF(" + expression1.toString() + ", " + expression2.toString() + ")");
} | [
"public",
"static",
"Expression",
"negInfIf",
"(",
"Expression",
"expression1",
",",
"Expression",
"expression2",
")",
"{",
"return",
"x",
"(",
"\"NEGINFIF(\"",
"+",
"expression1",
".",
"toString",
"(",
")",
"+",
"\", \"",
"+",
"expression2",
".",
"toString",
... | Returned expression results in NegInf if expression1 = expression2, otherwise returns expression1.
Returns MISSING or NULL if either input is MISSING or NULL. | [
"Returned",
"expression",
"results",
"in",
"NegInf",
"if",
"expression1",
"=",
"expression2",
"otherwise",
"returns",
"expression1",
".",
"Returns",
"MISSING",
"or",
"NULL",
"if",
"either",
"input",
"is",
"MISSING",
"or",
"NULL",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/ConditionalFunctions.java#L132-L134 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/RouteTablesInner.java | RouteTablesInner.getByResourceGroupAsync | public Observable<RouteTableInner> getByResourceGroupAsync(String resourceGroupName, String routeTableName, String expand) {
"""
Gets the specified route table.
@param resourceGroupName The name of the resource group.
@param routeTableName The name of the route table.
@param expand Expands referenced resource... | java | public Observable<RouteTableInner> getByResourceGroupAsync(String resourceGroupName, String routeTableName, String expand) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, routeTableName, expand).map(new Func1<ServiceResponse<RouteTableInner>, RouteTableInner>() {
@Override
... | [
"public",
"Observable",
"<",
"RouteTableInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"routeTableName",
",",
"String",
"expand",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"... | Gets the specified route table.
@param resourceGroupName The name of the resource group.
@param routeTableName The name of the route table.
@param expand Expands referenced resources.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the RouteTableInner object | [
"Gets",
"the",
"specified",
"route",
"table",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/RouteTablesInner.java#L383-L390 |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java | ImageLoading.loadReuse | public static ReuseResult loadReuse(Uri uri, Context context, Bitmap dest) throws ImageLoadException {
"""
Loading bitmap with using reuse bitmap with the different size of source image.
If it is unable to load with reuse method tries to load without it.
Reuse works only for Android 4.4+
@param uri conten... | java | public static ReuseResult loadReuse(Uri uri, Context context, Bitmap dest) throws ImageLoadException {
return loadBitmapReuse(new UriSource(uri, context), dest);
} | [
"public",
"static",
"ReuseResult",
"loadReuse",
"(",
"Uri",
"uri",
",",
"Context",
"context",
",",
"Bitmap",
"dest",
")",
"throws",
"ImageLoadException",
"{",
"return",
"loadBitmapReuse",
"(",
"new",
"UriSource",
"(",
"uri",
",",
"context",
")",
",",
"dest",
... | Loading bitmap with using reuse bitmap with the different size of source image.
If it is unable to load with reuse method tries to load without it.
Reuse works only for Android 4.4+
@param uri content uri for bitmap
@param dest destination bitmap
@param context Application Context
@return result of loading
@thr... | [
"Loading",
"bitmap",
"with",
"using",
"reuse",
"bitmap",
"with",
"the",
"different",
"size",
"of",
"source",
"image",
".",
"If",
"it",
"is",
"unable",
"to",
"load",
"with",
"reuse",
"method",
"tries",
"to",
"load",
"without",
"it",
".",
"Reuse",
"works",
... | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java#L231-L233 |
likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/parser/json/ConceptParser.java | ConceptParser.isValidConcept | private boolean isValidConcept(final String concept, final Double score) {
"""
Return true if at least one of the values is not null/empty.
@param concept the sentiment concept
@param score the sentiment score
@return true if at least one of the values is not null/empty
"""
return !StringUtils.isBla... | java | private boolean isValidConcept(final String concept, final Double score) {
return !StringUtils.isBlank(concept)
|| score != null;
} | [
"private",
"boolean",
"isValidConcept",
"(",
"final",
"String",
"concept",
",",
"final",
"Double",
"score",
")",
"{",
"return",
"!",
"StringUtils",
".",
"isBlank",
"(",
"concept",
")",
"||",
"score",
"!=",
"null",
";",
"}"
] | Return true if at least one of the values is not null/empty.
@param concept the sentiment concept
@param score the sentiment score
@return true if at least one of the values is not null/empty | [
"Return",
"true",
"if",
"at",
"least",
"one",
"of",
"the",
"values",
"is",
"not",
"null",
"/",
"empty",
"."
] | train | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/ConceptParser.java#L96-L99 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/internal/DefaultJobProgressStep.java | DefaultJobProgressStep.addLevel | public DefaultJobProgressStep addLevel(int steps, Object newLevelSource, boolean levelStep) {
"""
Add children to the step and return the first one.
@param steps the number of step
@param newLevelSource who asked to create this new level
@param levelStep the new level can contains only one step
@return the n... | java | public DefaultJobProgressStep addLevel(int steps, Object newLevelSource, boolean levelStep)
{
assertModifiable();
this.maximumChildren = steps;
this.levelSource = newLevelSource;
if (steps > 0) {
this.childSize = 1.0D / steps;
}
if (this.maximumChildren... | [
"public",
"DefaultJobProgressStep",
"addLevel",
"(",
"int",
"steps",
",",
"Object",
"newLevelSource",
",",
"boolean",
"levelStep",
")",
"{",
"assertModifiable",
"(",
")",
";",
"this",
".",
"maximumChildren",
"=",
"steps",
";",
"this",
".",
"levelSource",
"=",
... | Add children to the step and return the first one.
@param steps the number of step
@param newLevelSource who asked to create this new level
@param levelStep the new level can contains only one step
@return the new step | [
"Add",
"children",
"to",
"the",
"step",
"and",
"return",
"the",
"first",
"one",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-job/src/main/java/org/xwiki/job/internal/DefaultJobProgressStep.java#L183-L204 |
cycorp/api-suite | core-api/src/main/java/com/cyc/session/exception/SessionCommunicationException.java | SessionCommunicationException.fromThrowable | public static SessionCommunicationException fromThrowable(String message, Throwable cause) {
"""
Converts a Throwable to a SessionCommunicationException with the specified detail message. If the
Throwable is a SessionCommunicationException and if the Throwable's message is identical to the
one supplied, the Thro... | java | public static SessionCommunicationException fromThrowable(String message, Throwable cause) {
return (cause instanceof SessionCommunicationException && Objects.equals(message, cause.getMessage()))
? (SessionCommunicationException) cause
: new SessionCommunicationException(messag... | [
"public",
"static",
"SessionCommunicationException",
"fromThrowable",
"(",
"String",
"message",
",",
"Throwable",
"cause",
")",
"{",
"return",
"(",
"cause",
"instanceof",
"SessionCommunicationException",
"&&",
"Objects",
".",
"equals",
"(",
"message",
",",
"cause",
... | Converts a Throwable to a SessionCommunicationException with the specified detail message. If the
Throwable is a SessionCommunicationException and if the Throwable's message is identical to the
one supplied, the Throwable will be passed through unmodified; otherwise, it will be wrapped in
a new SessionCommunicationExce... | [
"Converts",
"a",
"Throwable",
"to",
"a",
"SessionCommunicationException",
"with",
"the",
"specified",
"detail",
"message",
".",
"If",
"the",
"Throwable",
"is",
"a",
"SessionCommunicationException",
"and",
"if",
"the",
"Throwable",
"s",
"message",
"is",
"identical",
... | train | https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/session/exception/SessionCommunicationException.java#L62-L66 |
james-hu/jabb-core | src/main/java/net/sf/jabb/util/db/ConnectionUtility.java | ConnectionUtility.createDataSource | public static DataSource createDataSource(String source, String type, String config) {
"""
Create a data source
@param source name of the data source, can be anything
@param type type of the data source
@param config configurations, normally path to configuration files
@return the newly created data source
... | java | public static DataSource createDataSource(String source, String type, String config){
DataSourceProvider dsp = dataSourceProviders.get(type);
if (dsp == null){
log.error("Unknown data source type for '" + source + "': " + type);
return null;
}
DataSource ds = null;
ds = dsp.createDataSource(s... | [
"public",
"static",
"DataSource",
"createDataSource",
"(",
"String",
"source",
",",
"String",
"type",
",",
"String",
"config",
")",
"{",
"DataSourceProvider",
"dsp",
"=",
"dataSourceProviders",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"dsp",
"==",
"null... | Create a data source
@param source name of the data source, can be anything
@param type type of the data source
@param config configurations, normally path to configuration files
@return the newly created data source | [
"Create",
"a",
"data",
"source"
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/db/ConnectionUtility.java#L178-L194 |
google/closure-compiler | src/com/google/javascript/jscomp/FunctionToBlockMutator.java | FunctionToBlockMutator.createAssignStatementNode | private static Node createAssignStatementNode(String name, Node expression) {
"""
Create a valid statement Node containing an assignment to name of the
given expression.
"""
// Create 'name = result-expression;' statement.
// EXPR (ASSIGN (NAME, EXPRESSION))
Node nameNode = IR.name(name);
Node... | java | private static Node createAssignStatementNode(String name, Node expression) {
// Create 'name = result-expression;' statement.
// EXPR (ASSIGN (NAME, EXPRESSION))
Node nameNode = IR.name(name);
Node assign = IR.assign(nameNode, expression);
return NodeUtil.newExpr(assign);
} | [
"private",
"static",
"Node",
"createAssignStatementNode",
"(",
"String",
"name",
",",
"Node",
"expression",
")",
"{",
"// Create 'name = result-expression;' statement.",
"// EXPR (ASSIGN (NAME, EXPRESSION))",
"Node",
"nameNode",
"=",
"IR",
".",
"name",
"(",
"name",
")",
... | Create a valid statement Node containing an assignment to name of the
given expression. | [
"Create",
"a",
"valid",
"statement",
"Node",
"containing",
"an",
"assignment",
"to",
"name",
"of",
"the",
"given",
"expression",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/FunctionToBlockMutator.java#L496-L502 |
skuzzle/semantic-version | src/main/java/de/skuzzle/semantic/Version.java | Version.compareWithBuildMetaData | public static int compareWithBuildMetaData(Version v1, Version v2) {
"""
Compares two Versions with additionally considering the build meta data field if
all other parts are equal. Note: This is <em>not</em> part of the semantic version
specification.
<p>
Comparison of the build meta data parts happens exact... | java | public static int compareWithBuildMetaData(Version v1, Version v2) {
// throw NPE to comply with Comparable specification
if (v1 == null) {
throw new NullPointerException("v1 is null");
} else if (v2 == null) {
throw new NullPointerException("v2 is null");
}
... | [
"public",
"static",
"int",
"compareWithBuildMetaData",
"(",
"Version",
"v1",
",",
"Version",
"v2",
")",
"{",
"// throw NPE to comply with Comparable specification",
"if",
"(",
"v1",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"v1 is null\"",... | Compares two Versions with additionally considering the build meta data field if
all other parts are equal. Note: This is <em>not</em> part of the semantic version
specification.
<p>
Comparison of the build meta data parts happens exactly as for pre release
identifiers. Considering of build meta data first kicks in if... | [
"Compares",
"two",
"Versions",
"with",
"additionally",
"considering",
"the",
"build",
"meta",
"data",
"field",
"if",
"all",
"other",
"parts",
"are",
"equal",
".",
"Note",
":",
"This",
"is",
"<em",
">",
"not<",
"/",
"em",
">",
"part",
"of",
"the",
"semant... | train | https://github.com/skuzzle/semantic-version/blob/2ddb66fb80244cd7f67c77ed5f8072d1132ad933/src/main/java/de/skuzzle/semantic/Version.java#L1144-L1152 |
phax/ph-masterdata | ph-masterdata/src/main/java/com/helger/masterdata/swift/IBANCountryData.java | IBANCountryData.createFromString | @Nonnull
public static IBANCountryData createFromString (@Nonnull @Nonempty final String sCountryCode,
@Nonnegative final int nExpectedLength,
@Nullable final String sLayout,
... | java | @Nonnull
public static IBANCountryData createFromString (@Nonnull @Nonempty final String sCountryCode,
@Nonnegative final int nExpectedLength,
@Nullable final String sLayout,
... | [
"@",
"Nonnull",
"public",
"static",
"IBANCountryData",
"createFromString",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sCountryCode",
",",
"@",
"Nonnegative",
"final",
"int",
"nExpectedLength",
",",
"@",
"Nullable",
"final",
"String",
"sLayout",
",",... | This method is used to create an instance of this class from a string
representation.
@param sCountryCode
Country code to use. Neither <code>null</code> nor empty.
@param nExpectedLength
The expected length having only validation purpose.
@param sLayout
<code>null</code> or the layout descriptor
@param sFixedCheckDigi... | [
"This",
"method",
"is",
"used",
"to",
"create",
"an",
"instance",
"of",
"this",
"class",
"from",
"a",
"string",
"representation",
"."
] | train | https://github.com/phax/ph-masterdata/blob/ca5e0b03c735b30b47930c018bfb5e71f00d0ff4/ph-masterdata/src/main/java/com/helger/masterdata/swift/IBANCountryData.java#L319-L345 |
paypal/SeLion | dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/XmlDataProviderImpl.java | XmlDataProviderImpl.loadDataFromXml | private List<?> loadDataFromXml(String xml, Class<?> cls) {
"""
Generates a list of the declared type after parsing the XML data string.
@param xml
String containing the XML data.
@param cls
The declared type modeled by the XML content.
@return A {@link List} of object of declared type {@link XmlFileSystemR... | java | private List<?> loadDataFromXml(String xml, Class<?> cls) {
logger.entering(new Object[] { xml, cls });
Preconditions.checkArgument(cls != null, "Please provide a valid type.");
List<?> returned;
try {
JAXBContext context = JAXBContext.newInstance(Wrapper.class, cls);
... | [
"private",
"List",
"<",
"?",
">",
"loadDataFromXml",
"(",
"String",
"xml",
",",
"Class",
"<",
"?",
">",
"cls",
")",
"{",
"logger",
".",
"entering",
"(",
"new",
"Object",
"[",
"]",
"{",
"xml",
",",
"cls",
"}",
")",
";",
"Preconditions",
".",
"checkA... | Generates a list of the declared type after parsing the XML data string.
@param xml
String containing the XML data.
@param cls
The declared type modeled by the XML content.
@return A {@link List} of object of declared type {@link XmlFileSystemResource#getCls()}. | [
"Generates",
"a",
"list",
"of",
"the",
"declared",
"type",
"after",
"parsing",
"the",
"XML",
"data",
"string",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/XmlDataProviderImpl.java#L372-L391 |
kmi/iserve | iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/Util.java | Util.generateSubclassPattern | public static String generateSubclassPattern(URI origin, URI destination) {
"""
Generate a pattern for checking if destination is a subclass of origin
@param origin
@param destination
@return
"""
return new StringBuilder()
.append(sparqlWrapUri(destination)).append(" ")
... | java | public static String generateSubclassPattern(URI origin, URI destination) {
return new StringBuilder()
.append(sparqlWrapUri(destination)).append(" ")
.append(sparqlWrapUri(RDFS.subClassOf.getURI())).append("+ ")
.append(sparqlWrapUri(origin)).append(" .")
... | [
"public",
"static",
"String",
"generateSubclassPattern",
"(",
"URI",
"origin",
",",
"URI",
"destination",
")",
"{",
"return",
"new",
"StringBuilder",
"(",
")",
".",
"append",
"(",
"sparqlWrapUri",
"(",
"destination",
")",
")",
".",
"append",
"(",
"\" \"",
")... | Generate a pattern for checking if destination is a subclass of origin
@param origin
@param destination
@return | [
"Generate",
"a",
"pattern",
"for",
"checking",
"if",
"destination",
"is",
"a",
"subclass",
"of",
"origin"
] | train | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/Util.java#L233-L239 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/watch/WatchMonitor.java | WatchMonitor.create | public static WatchMonitor create(Path path, int maxDepth, WatchEvent.Kind<?>... events) {
"""
创建并初始化监听
@param path 路径
@param events 监听事件列表
@param maxDepth 当监听目录时,监听目录的最大深度,当设置值为1(或小于1)时,表示不递归监听子目录
@return 监听对象
"""
return new WatchMonitor(path, maxDepth, events);
} | java | public static WatchMonitor create(Path path, int maxDepth, WatchEvent.Kind<?>... events){
return new WatchMonitor(path, maxDepth, events);
} | [
"public",
"static",
"WatchMonitor",
"create",
"(",
"Path",
"path",
",",
"int",
"maxDepth",
",",
"WatchEvent",
".",
"Kind",
"<",
"?",
">",
"...",
"events",
")",
"{",
"return",
"new",
"WatchMonitor",
"(",
"path",
",",
"maxDepth",
",",
"events",
")",
";",
... | 创建并初始化监听
@param path 路径
@param events 监听事件列表
@param maxDepth 当监听目录时,监听目录的最大深度,当设置值为1(或小于1)时,表示不递归监听子目录
@return 监听对象 | [
"创建并初始化监听"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/watch/WatchMonitor.java#L183-L185 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsPropertyCustom.java | CmsPropertyCustom.dialogButtonsOkCancelAdvanced | @Override
public String dialogButtonsOkCancelAdvanced(
String okAttributes,
String cancelAttributes,
String advancedAttributes) {
"""
Builds a button row with an "ok", a "cancel" and an "advanced" button.<p>
@param okAttributes additional attributes for the "ok" button
@param cancel... | java | @Override
public String dialogButtonsOkCancelAdvanced(
String okAttributes,
String cancelAttributes,
String advancedAttributes) {
if (isEditable()) {
int okButton = BUTTON_OK;
if ((getParamDialogmode() != null) && getParamDialogmode().startsWith(MODE_WIZARD))... | [
"@",
"Override",
"public",
"String",
"dialogButtonsOkCancelAdvanced",
"(",
"String",
"okAttributes",
",",
"String",
"cancelAttributes",
",",
"String",
"advancedAttributes",
")",
"{",
"if",
"(",
"isEditable",
"(",
")",
")",
"{",
"int",
"okButton",
"=",
"BUTTON_OK",... | Builds a button row with an "ok", a "cancel" and an "advanced" button.<p>
@param okAttributes additional attributes for the "ok" button
@param cancelAttributes additional attributes for the "cancel" button
@param advancedAttributes additional attributes for the "advanced" button
@return the button row | [
"Builds",
"a",
"button",
"row",
"with",
"an",
"ok",
"a",
"cancel",
"and",
"an",
"advanced",
"button",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsPropertyCustom.java#L233-L265 |
pushbit/sprockets | src/main/java/net/sf/sprockets/sql/SQLite.java | SQLite.groupConcat | public static String groupConcat(String column, String separator) {
"""
Get an {@link #aliased(String) aliased} group_concat(column) with the separator.
@since 2.4.0
"""
return groupConcat(column, separator, aliased(column));
} | java | public static String groupConcat(String column, String separator) {
return groupConcat(column, separator, aliased(column));
} | [
"public",
"static",
"String",
"groupConcat",
"(",
"String",
"column",
",",
"String",
"separator",
")",
"{",
"return",
"groupConcat",
"(",
"column",
",",
"separator",
",",
"aliased",
"(",
"column",
")",
")",
";",
"}"
] | Get an {@link #aliased(String) aliased} group_concat(column) with the separator.
@since 2.4.0 | [
"Get",
"an",
"{",
"@link",
"#aliased",
"(",
"String",
")",
"aliased",
"}",
"group_concat",
"(",
"column",
")",
"with",
"the",
"separator",
"."
] | train | https://github.com/pushbit/sprockets/blob/5d967317cbb2374c69d33271d3c7b7311e1ea4ac/src/main/java/net/sf/sprockets/sql/SQLite.java#L212-L214 |
vekexasia/android-edittext-validator | library/src/com/andreabaccega/widget/FormAutoCompleteTextView.java | FormAutoCompleteTextView.setError | @Override
public void setError(CharSequence error, Drawable icon) {
"""
Resolve an issue where the error icon is hidden under some cases in JB
due to a bug http://code.google.com/p/android/issues/detail?id=40417
"""
super.setError(error, icon);
lastErrorIcon = icon;
// if the erro... | java | @Override
public void setError(CharSequence error, Drawable icon) {
super.setError(error, icon);
lastErrorIcon = icon;
// if the error is not null, and we are in JB, force
// the error to show
if (error != null /* !isFocused() && */) {
showErrorIconHax(icon);
... | [
"@",
"Override",
"public",
"void",
"setError",
"(",
"CharSequence",
"error",
",",
"Drawable",
"icon",
")",
"{",
"super",
".",
"setError",
"(",
"error",
",",
"icon",
")",
";",
"lastErrorIcon",
"=",
"icon",
";",
"// if the error is not null, and we are in JB, force"... | Resolve an issue where the error icon is hidden under some cases in JB
due to a bug http://code.google.com/p/android/issues/detail?id=40417 | [
"Resolve",
"an",
"issue",
"where",
"the",
"error",
"icon",
"is",
"hidden",
"under",
"some",
"cases",
"in",
"JB",
"due",
"to",
"a",
"bug",
"http",
":",
"//",
"code",
".",
"google",
".",
"com",
"/",
"p",
"/",
"android",
"/",
"issues",
"/",
"detail?id",... | train | https://github.com/vekexasia/android-edittext-validator/blob/4a100e3d708b232133f4dd8ceb37ad7447fc7a1b/library/src/com/andreabaccega/widget/FormAutoCompleteTextView.java#L92-L102 |
cdk/cdk | app/depict/src/main/java/org/openscience/cdk/depict/DepictionGenerator.java | DepictionGenerator.withAtomValues | public DepictionGenerator withAtomValues() {
"""
Display atom values on the molecule or reaction. The values need to be assigned by
<pre>{@code
atom.setProperty(CDKConstants.COMMENT, myValueToBeDisplayedNextToAtom);
}</pre>
Note: A depiction can not have both atom numbers and atom maps visible
(but this c... | java | public DepictionGenerator withAtomValues() {
if (annotateAtomNum || annotateAtomMap)
throw new IllegalArgumentException("Can not annotated atom values, atom numbers or maps are already annotated");
DepictionGenerator copy = new DepictionGenerator(this);
copy.annotateAtomVal = true;
... | [
"public",
"DepictionGenerator",
"withAtomValues",
"(",
")",
"{",
"if",
"(",
"annotateAtomNum",
"||",
"annotateAtomMap",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Can not annotated atom values, atom numbers or maps are already annotated\"",
")",
";",
"DepictionGen... | Display atom values on the molecule or reaction. The values need to be assigned by
<pre>{@code
atom.setProperty(CDKConstants.COMMENT, myValueToBeDisplayedNextToAtom);
}</pre>
Note: A depiction can not have both atom numbers and atom maps visible
(but this can be achieved by manually setting the annotation).
@return ... | [
"Display",
"atom",
"values",
"on",
"the",
"molecule",
"or",
"reaction",
".",
"The",
"values",
"need",
"to",
"be",
"assigned",
"by"
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/DepictionGenerator.java#L793-L799 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/IdentityHashMap.java | IdentityHashMap.putForCreate | private void putForCreate(K key, V value)
throws java.io.StreamCorruptedException {
"""
The put method for readObject. It does not resize the table,
update modCount, etc.
"""
Object k = maskNull(key);
Object[] tab = table;
int len = tab.length;
int i = hash(k, len);
... | java | private void putForCreate(K key, V value)
throws java.io.StreamCorruptedException
{
Object k = maskNull(key);
Object[] tab = table;
int len = tab.length;
int i = hash(k, len);
Object item;
while ( (item = tab[i]) != null) {
if (item == k)
... | [
"private",
"void",
"putForCreate",
"(",
"K",
"key",
",",
"V",
"value",
")",
"throws",
"java",
".",
"io",
".",
"StreamCorruptedException",
"{",
"Object",
"k",
"=",
"maskNull",
"(",
"key",
")",
";",
"Object",
"[",
"]",
"tab",
"=",
"table",
";",
"int",
... | The put method for readObject. It does not resize the table,
update modCount, etc. | [
"The",
"put",
"method",
"for",
"readObject",
".",
"It",
"does",
"not",
"resize",
"the",
"table",
"update",
"modCount",
"etc",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/IdentityHashMap.java#L1342-L1358 |
graphql-java/graphql-java | src/main/java/graphql/execution/ExecutionStrategy.java | ExecutionStrategy.fetchField | protected CompletableFuture<FetchedValue> fetchField(ExecutionContext executionContext, ExecutionStrategyParameters parameters) {
"""
Called to fetch a value for a field from the {@link DataFetcher} associated with the field
{@link GraphQLFieldDefinition}.
<p>
Graphql fragments mean that for any give logical fi... | java | protected CompletableFuture<FetchedValue> fetchField(ExecutionContext executionContext, ExecutionStrategyParameters parameters) {
MergedField field = parameters.getField();
GraphQLObjectType parentType = (GraphQLObjectType) parameters.getExecutionStepInfo().getUnwrappedNonNullType();
GraphQLFiel... | [
"protected",
"CompletableFuture",
"<",
"FetchedValue",
">",
"fetchField",
"(",
"ExecutionContext",
"executionContext",
",",
"ExecutionStrategyParameters",
"parameters",
")",
"{",
"MergedField",
"field",
"=",
"parameters",
".",
"getField",
"(",
")",
";",
"GraphQLObjectTy... | Called to fetch a value for a field from the {@link DataFetcher} associated with the field
{@link GraphQLFieldDefinition}.
<p>
Graphql fragments mean that for any give logical field can have one or more {@link Field} values associated with it
in the query, hence the fieldList. However the first entry is representative... | [
"Called",
"to",
"fetch",
"a",
"value",
"for",
"a",
"field",
"from",
"the",
"{",
"@link",
"DataFetcher",
"}",
"associated",
"with",
"the",
"field",
"{",
"@link",
"GraphQLFieldDefinition",
"}",
".",
"<p",
">",
"Graphql",
"fragments",
"mean",
"that",
"for",
"... | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/execution/ExecutionStrategy.java#L222-L280 |
febit/wit | wit-core/src/main/java/org/febit/wit/loaders/AbstractLoader.java | AbstractLoader.concat | @Override
public String concat(final String parent, final String name) {
"""
get child template name by parent template name and relative name.
<pre>
example:
/path/to/tmpl1.wit , tmpl2.wit => /path/to/tmpl2.wit
/path/to/tmpl1.wit , /tmpl2.wit => /tmpl2.wit
/path/to/tmpl1.wit , ./tmpl2.wit => /... | java | @Override
public String concat(final String parent, final String name) {
return parent != null
? FileNameUtil.concat(FileNameUtil.getPath(parent), name)
: name;
} | [
"@",
"Override",
"public",
"String",
"concat",
"(",
"final",
"String",
"parent",
",",
"final",
"String",
"name",
")",
"{",
"return",
"parent",
"!=",
"null",
"?",
"FileNameUtil",
".",
"concat",
"(",
"FileNameUtil",
".",
"getPath",
"(",
"parent",
")",
",",
... | get child template name by parent template name and relative name.
<pre>
example:
/path/to/tmpl1.wit , tmpl2.wit => /path/to/tmpl2.wit
/path/to/tmpl1.wit , /tmpl2.wit => /tmpl2.wit
/path/to/tmpl1.wit , ./tmpl2.wit => /path/to/tmpl2.wit
/path/to/tmpl1.wit , ../tmpl2.wit => /path/tmpl2.wit
</pre>
@param par... | [
"get",
"child",
"template",
"name",
"by",
"parent",
"template",
"name",
"and",
"relative",
"name",
"."
] | train | https://github.com/febit/wit/blob/89ee29efbc5633b79c30c3c7b953c9f4130575af/wit-core/src/main/java/org/febit/wit/loaders/AbstractLoader.java#L43-L48 |
spotify/async-google-pubsub-client | src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java | Pubsub.deleteSubscription | public PubsubFuture<Void> deleteSubscription(final String project,
final String subscription) {
"""
Delete a Pub/Sub subscription.
@param project The Google Cloud project.
@param subscription The name of the subscription to delete.
@return A future that is c... | java | public PubsubFuture<Void> deleteSubscription(final String project,
final String subscription) {
return deleteSubscription(canonicalSubscription(project, subscription));
} | [
"public",
"PubsubFuture",
"<",
"Void",
">",
"deleteSubscription",
"(",
"final",
"String",
"project",
",",
"final",
"String",
"subscription",
")",
"{",
"return",
"deleteSubscription",
"(",
"canonicalSubscription",
"(",
"project",
",",
"subscription",
")",
")",
";",... | Delete a Pub/Sub subscription.
@param project The Google Cloud project.
@param subscription The name of the subscription to delete.
@return A future that is completed when this request is completed. The future will be completed with {@code null}
if the response is 404. | [
"Delete",
"a",
"Pub",
"/",
"Sub",
"subscription",
"."
] | train | https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L456-L459 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/model/RuntimeModelIo.java | RuntimeModelIo.loadApplicationFlexibly | public static ApplicationLoadResult loadApplicationFlexibly( File projectDirectory ) {
"""
Loads an application from a directory.
<p>
This method allows to load an application which does not have a descriptor.
If it has one, it will be read. Otherwise, a default one will be generated.
This is convenient for re... | java | public static ApplicationLoadResult loadApplicationFlexibly( File projectDirectory ) {
File descDirectory = new File( projectDirectory, Constants.PROJECT_DIR_DESC );
ApplicationLoadResult result;
if( descDirectory.exists()) {
result = loadApplication( projectDirectory );
} else {
ApplicationTemplateDesc... | [
"public",
"static",
"ApplicationLoadResult",
"loadApplicationFlexibly",
"(",
"File",
"projectDirectory",
")",
"{",
"File",
"descDirectory",
"=",
"new",
"File",
"(",
"projectDirectory",
",",
"Constants",
".",
"PROJECT_DIR_DESC",
")",
";",
"ApplicationLoadResult",
"result... | Loads an application from a directory.
<p>
This method allows to load an application which does not have a descriptor.
If it has one, it will be read. Otherwise, a default one will be generated.
This is convenient for reusable recipes.
</p>
@param projectDirectory the project directory
@return a load result (never nul... | [
"Loads",
"an",
"application",
"from",
"a",
"directory",
".",
"<p",
">",
"This",
"method",
"allows",
"to",
"load",
"an",
"application",
"which",
"does",
"not",
"have",
"a",
"descriptor",
".",
"If",
"it",
"has",
"one",
"it",
"will",
"be",
"read",
".",
"O... | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/RuntimeModelIo.java#L153-L178 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/Duration.java | Duration.create | private static Duration create(long seconds, int nanoAdjustment) {
"""
Obtains an instance of {@code Duration} using seconds and nanoseconds.
@param seconds the length of the duration in seconds, positive or negative
@param nanoAdjustment the nanosecond adjustment within the second, from 0 to 999,999,999
... | java | private static Duration create(long seconds, int nanoAdjustment) {
if ((seconds | nanoAdjustment) == 0) {
return ZERO;
}
return new Duration(seconds, nanoAdjustment);
} | [
"private",
"static",
"Duration",
"create",
"(",
"long",
"seconds",
",",
"int",
"nanoAdjustment",
")",
"{",
"if",
"(",
"(",
"seconds",
"|",
"nanoAdjustment",
")",
"==",
"0",
")",
"{",
"return",
"ZERO",
";",
"}",
"return",
"new",
"Duration",
"(",
"seconds"... | Obtains an instance of {@code Duration} using seconds and nanoseconds.
@param seconds the length of the duration in seconds, positive or negative
@param nanoAdjustment the nanosecond adjustment within the second, from 0 to 999,999,999 | [
"Obtains",
"an",
"instance",
"of",
"{",
"@code",
"Duration",
"}",
"using",
"seconds",
"and",
"nanoseconds",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/Duration.java#L492-L497 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/activity/AdviceActivity.java | AdviceActivity.putAdviceResult | protected void putAdviceResult(AspectAdviceRule aspectAdviceRule, Object adviceActionResult) {
"""
Puts the result of the advice.
@param aspectAdviceRule the aspect advice rule
@param adviceActionResult the advice action result
"""
if (aspectAdviceResult == null) {
aspectAdviceResult = ... | java | protected void putAdviceResult(AspectAdviceRule aspectAdviceRule, Object adviceActionResult) {
if (aspectAdviceResult == null) {
aspectAdviceResult = new AspectAdviceResult();
}
aspectAdviceResult.putAdviceResult(aspectAdviceRule, adviceActionResult);
} | [
"protected",
"void",
"putAdviceResult",
"(",
"AspectAdviceRule",
"aspectAdviceRule",
",",
"Object",
"adviceActionResult",
")",
"{",
"if",
"(",
"aspectAdviceResult",
"==",
"null",
")",
"{",
"aspectAdviceResult",
"=",
"new",
"AspectAdviceResult",
"(",
")",
";",
"}",
... | Puts the result of the advice.
@param aspectAdviceRule the aspect advice rule
@param adviceActionResult the advice action result | [
"Puts",
"the",
"result",
"of",
"the",
"advice",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/activity/AdviceActivity.java#L522-L527 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Matth.java | Matth.subtractExact | public static int subtractExact(int a, int b) {
"""
Returns the difference of {@code a} and {@code b}, provided it does not overflow.
@throws ArithmeticException if {@code a - b} overflows in signed {@code int} arithmetic
"""
long result = (long) a - b;
checkNoOverflow(result == (int) resu... | java | public static int subtractExact(int a, int b) {
long result = (long) a - b;
checkNoOverflow(result == (int) result);
return (int) result;
} | [
"public",
"static",
"int",
"subtractExact",
"(",
"int",
"a",
",",
"int",
"b",
")",
"{",
"long",
"result",
"=",
"(",
"long",
")",
"a",
"-",
"b",
";",
"checkNoOverflow",
"(",
"result",
"==",
"(",
"int",
")",
"result",
")",
";",
"return",
"(",
"int",
... | Returns the difference of {@code a} and {@code b}, provided it does not overflow.
@throws ArithmeticException if {@code a - b} overflows in signed {@code int} arithmetic | [
"Returns",
"the",
"difference",
"of",
"{",
"@code",
"a",
"}",
"and",
"{",
"@code",
"b",
"}",
"provided",
"it",
"does",
"not",
"overflow",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Matth.java#L1393-L1397 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/HubVirtualNetworkConnectionsInner.java | HubVirtualNetworkConnectionsInner.listAsync | public Observable<Page<HubVirtualNetworkConnectionInner>> listAsync(final String resourceGroupName, final String virtualHubName) {
"""
Retrieves the details of all HubVirtualNetworkConnections.
@param resourceGroupName The resource group name of the VirtualHub.
@param virtualHubName The name of the VirtualHub.... | java | public Observable<Page<HubVirtualNetworkConnectionInner>> listAsync(final String resourceGroupName, final String virtualHubName) {
return listWithServiceResponseAsync(resourceGroupName, virtualHubName)
.map(new Func1<ServiceResponse<Page<HubVirtualNetworkConnectionInner>>, Page<HubVirtualNetworkConn... | [
"public",
"Observable",
"<",
"Page",
"<",
"HubVirtualNetworkConnectionInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"virtualHubName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",... | Retrieves the details of all HubVirtualNetworkConnections.
@param resourceGroupName The resource group name of the VirtualHub.
@param virtualHubName The name of the VirtualHub.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<HubVirtualNetworkConnecti... | [
"Retrieves",
"the",
"details",
"of",
"all",
"HubVirtualNetworkConnections",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/HubVirtualNetworkConnectionsInner.java#L214-L222 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/Record.java | Record.makeRecordFromClassName | public static Record makeRecordFromClassName(String strClassName, RecordOwner recordOwner) {
"""
Create and initialize the record that has this class name.
@param strClassName Full class name.
@param recordOwner The recordowner to add this record to.
@return The new record.
"""
return Record.makeRec... | java | public static Record makeRecordFromClassName(String strClassName, RecordOwner recordOwner)
{
return Record.makeRecordFromClassName(strClassName, recordOwner, true, true);
} | [
"public",
"static",
"Record",
"makeRecordFromClassName",
"(",
"String",
"strClassName",
",",
"RecordOwner",
"recordOwner",
")",
"{",
"return",
"Record",
".",
"makeRecordFromClassName",
"(",
"strClassName",
",",
"recordOwner",
",",
"true",
",",
"true",
")",
";",
"}... | Create and initialize the record that has this class name.
@param strClassName Full class name.
@param recordOwner The recordowner to add this record to.
@return The new record. | [
"Create",
"and",
"initialize",
"the",
"record",
"that",
"has",
"this",
"class",
"name",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L2614-L2617 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.unescapeUriPathSegment | public static void unescapeUriPathSegment(final String text, final Writer writer)
throws IOException {
"""
<p>
Perform am URI path segment <strong>unescape</strong> operation
on a <tt>String</tt> input using <tt>UTF-8</tt> as encoding, writing results to a <tt>Writer</tt>.
</p>
<p>
This method wil... | java | public static void unescapeUriPathSegment(final String text, final Writer writer)
throws IOException {
unescapeUriPathSegment(text, writer, DEFAULT_ENCODING);
} | [
"public",
"static",
"void",
"unescapeUriPathSegment",
"(",
"final",
"String",
"text",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"unescapeUriPathSegment",
"(",
"text",
",",
"writer",
",",
"DEFAULT_ENCODING",
")",
";",
"}"
] | <p>
Perform am URI path segment <strong>unescape</strong> operation
on a <tt>String</tt> input using <tt>UTF-8</tt> as encoding, writing results to a <tt>Writer</tt>.
</p>
<p>
This method will unescape every percent-encoded (<tt>%HH</tt>) sequences present in input,
even for those characters that do not need to be perc... | [
"<p",
">",
"Perform",
"am",
"URI",
"path",
"segment",
"<strong",
">",
"unescape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
"using",
"<tt",
">",
"UTF",
"-",
"8<",
"/",
"tt",
">",
"as",
"encoding",
... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L1878-L1881 |
apptik/jus | jus-java/src/main/java/io/apptik/comm/jus/http/HttpUrl.java | HttpUrl.queryParameterValues | public List<String> queryParameterValues(String name) {
"""
Returns all values for the query parameter {@code name} ordered by their appearance in this
URL. For example this returns {@code ["banana"]} for {@code queryParameterValue("b")} on {@code
http://host/?a=apple&b=banana}.
<p><table summary="">
<tr><th... | java | public List<String> queryParameterValues(String name) {
if (queryNamesAndValues == null) return Collections.emptyList();
List<String> result = new ArrayList<>();
for (int i = 0, size = queryNamesAndValues.size(); i < size; i += 2) {
if (name.equals(queryNamesAndValues.get(i))) {
... | [
"public",
"List",
"<",
"String",
">",
"queryParameterValues",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"queryNamesAndValues",
"==",
"null",
")",
"return",
"Collections",
".",
"emptyList",
"(",
")",
";",
"List",
"<",
"String",
">",
"result",
"=",
"new",
... | Returns all values for the query parameter {@code name} ordered by their appearance in this
URL. For example this returns {@code ["banana"]} for {@code queryParameterValue("b")} on {@code
http://host/?a=apple&b=banana}.
<p><table summary="">
<tr><th>URL</th><th>{@code queryParameterValues("a")}</th><th>{@code
queryPar... | [
"Returns",
"all",
"values",
"for",
"the",
"query",
"parameter",
"{",
"@code",
"name",
"}",
"ordered",
"by",
"their",
"appearance",
"in",
"this",
"URL",
".",
"For",
"example",
"this",
"returns",
"{",
"@code",
"[",
"banana",
"]",
"}",
"for",
"{",
"@code",
... | train | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/jus-java/src/main/java/io/apptik/comm/jus/http/HttpUrl.java#L757-L766 |
ansell/restlet-utils | src/main/java/com/github/ansell/restletutils/FixedRedirectCookieAuthenticator.java | FixedRedirectCookieAuthenticator.isLoggingOut | protected boolean isLoggingOut(final Request request, final Response response) {
"""
Indicates if the request is an attempt to log out and should be intercepted.
@param request
The current request.
@param response
The current response.
@return True if the request is an attempt to log out and should be inter... | java | protected boolean isLoggingOut(final Request request, final Response response)
{
return this.isInterceptingLogout()
&& this.getLogoutPath().equals(request.getResourceRef().getRemainingPart(false, false))
&& (Method.GET.equals(request.getMethod()) || Method.POST.equals(request... | [
"protected",
"boolean",
"isLoggingOut",
"(",
"final",
"Request",
"request",
",",
"final",
"Response",
"response",
")",
"{",
"return",
"this",
".",
"isInterceptingLogout",
"(",
")",
"&&",
"this",
".",
"getLogoutPath",
"(",
")",
".",
"equals",
"(",
"request",
... | Indicates if the request is an attempt to log out and should be intercepted.
@param request
The current request.
@param response
The current response.
@return True if the request is an attempt to log out and should be intercepted. | [
"Indicates",
"if",
"the",
"request",
"is",
"an",
"attempt",
"to",
"log",
"out",
"and",
"should",
"be",
"intercepted",
"."
] | train | https://github.com/ansell/restlet-utils/blob/6c39a3e91aa8295936af1dbfccd6ba27230c40a9/src/main/java/com/github/ansell/restletutils/FixedRedirectCookieAuthenticator.java#L608-L613 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_ovhPabx_serviceName_menu_menuId_GET | public OvhOvhPabxMenu billingAccount_ovhPabx_serviceName_menu_menuId_GET(String billingAccount, String serviceName, Long menuId) throws IOException {
"""
Get this object properties
REST: GET /telephony/{billingAccount}/ovhPabx/{serviceName}/menu/{menuId}
@param billingAccount [required] The name of your billin... | java | public OvhOvhPabxMenu billingAccount_ovhPabx_serviceName_menu_menuId_GET(String billingAccount, String serviceName, Long menuId) throws IOException {
String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/menu/{menuId}";
StringBuilder sb = path(qPath, billingAccount, serviceName, menuId);
String resp =... | [
"public",
"OvhOvhPabxMenu",
"billingAccount_ovhPabx_serviceName_menu_menuId_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"menuId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/ovhPabx/{serviceName... | Get this object properties
REST: GET /telephony/{billingAccount}/ovhPabx/{serviceName}/menu/{menuId}
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param menuId [required] | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L7538-L7543 |
actorapp/actor-platform | actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java | ImageLoading.loadBitmap | public static Bitmap loadBitmap(String fileName, int scale) throws ImageLoadException {
"""
Loading bitmap with scaling
@param fileName Image file name
@param scale divider of size, might be factor of two
@return loaded bitmap (always not null)
@throws ImageLoadException if it is unable to load file
"... | java | public static Bitmap loadBitmap(String fileName, int scale) throws ImageLoadException {
return loadBitmap(new FileSource(fileName), scale);
} | [
"public",
"static",
"Bitmap",
"loadBitmap",
"(",
"String",
"fileName",
",",
"int",
"scale",
")",
"throws",
"ImageLoadException",
"{",
"return",
"loadBitmap",
"(",
"new",
"FileSource",
"(",
"fileName",
")",
",",
"scale",
")",
";",
"}"
] | Loading bitmap with scaling
@param fileName Image file name
@param scale divider of size, might be factor of two
@return loaded bitmap (always not null)
@throws ImageLoadException if it is unable to load file | [
"Loading",
"bitmap",
"with",
"scaling"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-sdk/src/main/java/im/actor/sdk/util/images/ops/ImageLoading.java#L72-L74 |
redkale/redkale | src/org/redkale/convert/ConvertFactory.java | ConvertFactory.registerIgnoreAll | public final void registerIgnoreAll(final Class type, String... excludeColumns) {
"""
屏蔽指定类所有字段,仅仅保留指定字段 <br>
<b>注意: 该配置优先级高于skipAllIgnore和ConvertColumnEntry配置</b>
@param type 指定的类
@param excludeColumns 需要排除的字段名
"""
Set<String> set = ignoreAlls.get(type);
if (set == null) {
... | java | public final void registerIgnoreAll(final Class type, String... excludeColumns) {
Set<String> set = ignoreAlls.get(type);
if (set == null) {
ignoreAlls.put(type, new HashSet<>(Arrays.asList(excludeColumns)));
} else {
set.addAll(Arrays.asList(excludeColumns));
... | [
"public",
"final",
"void",
"registerIgnoreAll",
"(",
"final",
"Class",
"type",
",",
"String",
"...",
"excludeColumns",
")",
"{",
"Set",
"<",
"String",
">",
"set",
"=",
"ignoreAlls",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"set",
"==",
"null",
")"... | 屏蔽指定类所有字段,仅仅保留指定字段 <br>
<b>注意: 该配置优先级高于skipAllIgnore和ConvertColumnEntry配置</b>
@param type 指定的类
@param excludeColumns 需要排除的字段名 | [
"屏蔽指定类所有字段,仅仅保留指定字段",
"<br",
">",
"<b",
">",
"注意",
":",
"该配置优先级高于skipAllIgnore和ConvertColumnEntry配置<",
"/",
"b",
">"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/convert/ConvertFactory.java#L400-L407 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/SheetRowResourcesImpl.java | SheetRowResourcesImpl.getRow | public Row getRow(long sheetId, long rowId, EnumSet<RowInclusion> includes, EnumSet<ObjectExclusion> excludes) throws SmartsheetException {
"""
Get a row.
It mirrors to the following Smartsheet REST API method: GET /sheets/{sheetId}/rows/{rowId}
Exceptions:
- InvalidRequestException : if there is any proble... | java | public Row getRow(long sheetId, long rowId, EnumSet<RowInclusion> includes, EnumSet<ObjectExclusion> excludes) throws SmartsheetException {
String path = "sheets/" + sheetId + "/rows/" + rowId;
HashMap<String, Object> parameters = new HashMap<String, Object>();
parameters.put("include", QueryU... | [
"public",
"Row",
"getRow",
"(",
"long",
"sheetId",
",",
"long",
"rowId",
",",
"EnumSet",
"<",
"RowInclusion",
">",
"includes",
",",
"EnumSet",
"<",
"ObjectExclusion",
">",
"excludes",
")",
"throws",
"SmartsheetException",
"{",
"String",
"path",
"=",
"\"sheets/... | Get a row.
It mirrors to the following Smartsheet REST API method: GET /sheets/{sheetId}/rows/{rowId}
Exceptions:
- InvalidRequestException : if there is any problem with the REST API request
- AuthorizationException : if there is any problem with the REST API authorization(access token)
- ResourceNotFoundException :... | [
"Get",
"a",
"row",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/SheetRowResourcesImpl.java#L116-L126 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/isomorphism/mcss/RGraph.java | RGraph.mustContinue | private boolean mustContinue(BitSet potentialNode) {
"""
Determine if there are potential solution remaining.
@param potentialNode set of remaining potential nodes
@return true if it is worse to continue the search
"""
boolean result = true;
boolean cancel = false;
BitSet ... | java | private boolean mustContinue(BitSet potentialNode) {
boolean result = true;
boolean cancel = false;
BitSet projG1 = projectG1(potentialNode);
BitSet projG2 = projectG2(potentialNode);
// if we reached the maximum number of
// search iterations than do not continue
... | [
"private",
"boolean",
"mustContinue",
"(",
"BitSet",
"potentialNode",
")",
"{",
"boolean",
"result",
"=",
"true",
";",
"boolean",
"cancel",
"=",
"false",
";",
"BitSet",
"projG1",
"=",
"projectG1",
"(",
"potentialNode",
")",
";",
"BitSet",
"projG2",
"=",
"pro... | Determine if there are potential solution remaining.
@param potentialNode set of remaining potential nodes
@return true if it is worse to continue the search | [
"Determine",
"if",
"there",
"are",
"potential",
"solution",
"remaining",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/isomorphism/mcss/RGraph.java#L375-L409 |
wildfly-extras/wildfly-camel | subsystem/core/src/main/java/org/wildfly/extension/camel/service/CamelEndpointDeployerService.java | CamelEndpointDeployerService.doDeploy | void doDeploy(URI uri, Consumer<EndpointServlet> endpointServletConsumer, Consumer<DeploymentInfo> deploymentInfoConsumer, Consumer<DeploymentImpl> deploymentConsumer) {
"""
The stuff common for {@link #deploy(URI, EndpointHttpHandler)} and {@link #deploy(URI, HttpHandler)}.
@param uri
@param endpointServletCo... | java | void doDeploy(URI uri, Consumer<EndpointServlet> endpointServletConsumer, Consumer<DeploymentInfo> deploymentInfoConsumer, Consumer<DeploymentImpl> deploymentConsumer) {
final ServletInfo servletInfo = Servlets.servlet(EndpointServlet.NAME, EndpointServlet.class).addMapping("/*")
.setAsyncSuppo... | [
"void",
"doDeploy",
"(",
"URI",
"uri",
",",
"Consumer",
"<",
"EndpointServlet",
">",
"endpointServletConsumer",
",",
"Consumer",
"<",
"DeploymentInfo",
">",
"deploymentInfoConsumer",
",",
"Consumer",
"<",
"DeploymentImpl",
">",
"deploymentConsumer",
")",
"{",
"final... | The stuff common for {@link #deploy(URI, EndpointHttpHandler)} and {@link #deploy(URI, HttpHandler)}.
@param uri
@param endpointServletConsumer customize the {@link EndpointServlet}
@param deploymentInfoConsumer customize the {@link DeploymentInfo}
@param deploymentConsumer customize the {@link DeploymentImpl} | [
"The",
"stuff",
"common",
"for",
"{",
"@link",
"#deploy",
"(",
"URI",
"EndpointHttpHandler",
")",
"}",
"and",
"{",
"@link",
"#deploy",
"(",
"URI",
"HttpHandler",
")",
"}",
"."
] | train | https://github.com/wildfly-extras/wildfly-camel/blob/9ebd7e28574f277a6d5b583e8a4c357e1538c370/subsystem/core/src/main/java/org/wildfly/extension/camel/service/CamelEndpointDeployerService.java#L465-L501 |
bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/scanner/control/ScanPlan.java | ScanPlan.toScanStatus | public ScanStatus toScanStatus() {
"""
Creates a ScanStatus based on the current state of the plan. All scan ranges are added as pending tasks.
"""
List<ScanRangeStatus> pendingRangeStatuses = Lists.newArrayList();
// Unique identifier for each scan task
int taskId = 0;
// Uni... | java | public ScanStatus toScanStatus() {
List<ScanRangeStatus> pendingRangeStatuses = Lists.newArrayList();
// Unique identifier for each scan task
int taskId = 0;
// Unique identifier for each batch
int batchId = 0;
// Unique identifier which identifies all tasks which affect... | [
"public",
"ScanStatus",
"toScanStatus",
"(",
")",
"{",
"List",
"<",
"ScanRangeStatus",
">",
"pendingRangeStatuses",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"// Unique identifier for each scan task",
"int",
"taskId",
"=",
"0",
";",
"// Unique identifier for e... | Creates a ScanStatus based on the current state of the plan. All scan ranges are added as pending tasks. | [
"Creates",
"a",
"ScanStatus",
"based",
"on",
"the",
"current",
"state",
"of",
"the",
"plan",
".",
"All",
"scan",
"ranges",
"are",
"added",
"as",
"pending",
"tasks",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/scanner/control/ScanPlan.java#L94-L133 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/HttpUtils.java | HttpUtils.executePost | public static HttpResponse executePost(final String url,
final String entity,
final Map<String, Object> parameters) {
"""
Execute post http response.
@param url the url
@param entity the json entity
@param paramet... | java | public static HttpResponse executePost(final String url,
final String entity,
final Map<String, Object> parameters) {
return executePost(url, null, null, entity, parameters);
} | [
"public",
"static",
"HttpResponse",
"executePost",
"(",
"final",
"String",
"url",
",",
"final",
"String",
"entity",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
")",
"{",
"return",
"executePost",
"(",
"url",
",",
"null",
",",
"null... | Execute post http response.
@param url the url
@param entity the json entity
@param parameters the parameters
@return the http response | [
"Execute",
"post",
"http",
"response",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/HttpUtils.java#L324-L328 |
looly/hutool | hutool-socket/src/main/java/cn/hutool/socket/nio/NioServer.java | NioServer.registerChannel | private void registerChannel(Selector selector, SelectableChannel channel, Operation ops) {
"""
注册通道到指定Selector上
@param selector Selector
@param channel 通道
@param ops 注册的通道监听类型
"""
if (channel == null) {
return;
}
try {
channel.configureBlocking(false);
// 注册通道
channel.register(... | java | private void registerChannel(Selector selector, SelectableChannel channel, Operation ops) {
if (channel == null) {
return;
}
try {
channel.configureBlocking(false);
// 注册通道
channel.register(selector, ops.getValue());
} catch (IOException e) {
throw new IORuntimeException(e);
}
} | [
"private",
"void",
"registerChannel",
"(",
"Selector",
"selector",
",",
"SelectableChannel",
"channel",
",",
"Operation",
"ops",
")",
"{",
"if",
"(",
"channel",
"==",
"null",
")",
"{",
"return",
";",
"}",
"try",
"{",
"channel",
".",
"configureBlocking",
"(",... | 注册通道到指定Selector上
@param selector Selector
@param channel 通道
@param ops 注册的通道监听类型 | [
"注册通道到指定Selector上"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-socket/src/main/java/cn/hutool/socket/nio/NioServer.java#L161-L173 |
deeplearning4j/deeplearning4j | datavec/datavec-spark/src/main/java/org/datavec/spark/transform/AnalyzeSpark.java | AnalyzeSpark.analyzeQualitySequence | public static DataQualityAnalysis analyzeQualitySequence(Schema schema, JavaRDD<List<List<Writable>>> data) {
"""
Analyze the data quality of sequence data - provides a report on missing values, values that don't comply with schema, etc
@param schema Schema for data
@param data Data to analyze
@return DataQua... | java | public static DataQualityAnalysis analyzeQualitySequence(Schema schema, JavaRDD<List<List<Writable>>> data) {
JavaRDD<List<Writable>> fmSeq = data.flatMap(new SequenceFlatMapFunction());
return analyzeQuality(schema, fmSeq);
} | [
"public",
"static",
"DataQualityAnalysis",
"analyzeQualitySequence",
"(",
"Schema",
"schema",
",",
"JavaRDD",
"<",
"List",
"<",
"List",
"<",
"Writable",
">",
">",
">",
"data",
")",
"{",
"JavaRDD",
"<",
"List",
"<",
"Writable",
">>",
"fmSeq",
"=",
"data",
"... | Analyze the data quality of sequence data - provides a report on missing values, values that don't comply with schema, etc
@param schema Schema for data
@param data Data to analyze
@return DataQualityAnalysis object | [
"Analyze",
"the",
"data",
"quality",
"of",
"sequence",
"data",
"-",
"provides",
"a",
"report",
"on",
"missing",
"values",
"values",
"that",
"don",
"t",
"comply",
"with",
"schema",
"etc"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/AnalyzeSpark.java#L277-L280 |
jakenjarvis/Android-OrmLiteContentProvider | ormlite-content-provider-library/src/com/tojc/ormlite/android/framework/MatcherController.java | MatcherController.add | public MatcherController add(Class<?> tableClassType, SubType subType, String pattern, int patternCode) {
"""
Register a class for table. And registers a pattern for UriMatcher.
@param tableClassType
Register a class for table.
@param subType
Contents to be registered in the pattern, specify single or multiple... | java | public MatcherController add(Class<?> tableClassType, SubType subType, String pattern, int patternCode) {
this.addTableClass(tableClassType);
this.addMatcherPattern(subType, pattern, patternCode);
return this;
} | [
"public",
"MatcherController",
"add",
"(",
"Class",
"<",
"?",
">",
"tableClassType",
",",
"SubType",
"subType",
",",
"String",
"pattern",
",",
"int",
"patternCode",
")",
"{",
"this",
".",
"addTableClass",
"(",
"tableClassType",
")",
";",
"this",
".",
"addMat... | Register a class for table. And registers a pattern for UriMatcher.
@param tableClassType
Register a class for table.
@param subType
Contents to be registered in the pattern, specify single or multiple. This is used
in the MIME types. * ITEM : If the URI pattern is for a single row :
vnd.android.cursor.item/ * DIRECTOR... | [
"Register",
"a",
"class",
"for",
"table",
".",
"And",
"registers",
"a",
"pattern",
"for",
"UriMatcher",
"."
] | train | https://github.com/jakenjarvis/Android-OrmLiteContentProvider/blob/8f102f0743b308c9f58d43639e98f832fd951985/ormlite-content-provider-library/src/com/tojc/ormlite/android/framework/MatcherController.java#L86-L90 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/JobOperations.java | JobOperations.patchJob | public void patchJob(String jobId, JobPatchParameter jobPatchParameter) throws BatchErrorException, IOException {
"""
Updates the specified job.
This method only replaces the properties specified with non-null values.
@param jobId The ID of the job.
@param jobPatchParameter The set of changes to be made to a ... | java | public void patchJob(String jobId, JobPatchParameter jobPatchParameter) throws BatchErrorException, IOException {
patchJob(jobId, jobPatchParameter, null);
} | [
"public",
"void",
"patchJob",
"(",
"String",
"jobId",
",",
"JobPatchParameter",
"jobPatchParameter",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"patchJob",
"(",
"jobId",
",",
"jobPatchParameter",
",",
"null",
")",
";",
"}"
] | Updates the specified job.
This method only replaces the properties specified with non-null values.
@param jobId The ID of the job.
@param jobPatchParameter The set of changes to be made to a job.
@throws BatchErrorException Exception thrown when an error response is received from the Batch service.
@throws IOExceptio... | [
"Updates",
"the",
"specified",
"job",
".",
"This",
"method",
"only",
"replaces",
"the",
"properties",
"specified",
"with",
"non",
"-",
"null",
"values",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/JobOperations.java#L574-L576 |
terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/UserService.java | UserService.registerUser | public E registerUser(E user, HttpServletRequest request) throws Exception {
"""
Registers a new user. Initially, the user will be inactive. An email with
an activation link will be sent to the user.
@param user A user with an UNencrypted password (!)
@param request
@throws Exception
"""
Stri... | java | public E registerUser(E user, HttpServletRequest request) throws Exception {
String email = user.getEmail();
// check if a user with the email already exists
E existingUser = dao.findByEmail(email);
if (existingUser != null) {
final String errorMessage = "User with eMail '... | [
"public",
"E",
"registerUser",
"(",
"E",
"user",
",",
"HttpServletRequest",
"request",
")",
"throws",
"Exception",
"{",
"String",
"email",
"=",
"user",
".",
"getEmail",
"(",
")",
";",
"// check if a user with the email already exists",
"E",
"existingUser",
"=",
"d... | Registers a new user. Initially, the user will be inactive. An email with
an activation link will be sent to the user.
@param user A user with an UNencrypted password (!)
@param request
@throws Exception | [
"Registers",
"a",
"new",
"user",
".",
"Initially",
"the",
"user",
"will",
"be",
"inactive",
".",
"An",
"email",
"with",
"an",
"activation",
"link",
"will",
"be",
"sent",
"to",
"the",
"user",
"."
] | train | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/UserService.java#L122-L141 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxGroup.java | BoxGroup.getMemberships | public Collection<BoxGroupMembership.Info> getMemberships() {
"""
Gets information about all of the group memberships for this group.
Does not support paging.
@return a collection of information about the group memberships for this group.
"""
final BoxAPIConnection api = this.getAPI();
final ... | java | public Collection<BoxGroupMembership.Info> getMemberships() {
final BoxAPIConnection api = this.getAPI();
final String groupID = this.getID();
Iterable<BoxGroupMembership.Info> iter = new Iterable<BoxGroupMembership.Info>() {
public Iterator<BoxGroupMembership.Info> iterator() {
... | [
"public",
"Collection",
"<",
"BoxGroupMembership",
".",
"Info",
">",
"getMemberships",
"(",
")",
"{",
"final",
"BoxAPIConnection",
"api",
"=",
"this",
".",
"getAPI",
"(",
")",
";",
"final",
"String",
"groupID",
"=",
"this",
".",
"getID",
"(",
")",
";",
"... | Gets information about all of the group memberships for this group.
Does not support paging.
@return a collection of information about the group memberships for this group. | [
"Gets",
"information",
"about",
"all",
"of",
"the",
"group",
"memberships",
"for",
"this",
"group",
".",
"Does",
"not",
"support",
"paging",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxGroup.java#L200-L218 |
Azure/azure-sdk-for-java | authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleAssignmentsInner.java | RoleAssignmentsInner.createAsync | public Observable<RoleAssignmentInner> createAsync(String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters) {
"""
Creates a role assignment.
@param scope The scope of the role assignment to create. The scope can be any REST resource instance. For example, use '/subscriptions/{subscrip... | java | public Observable<RoleAssignmentInner> createAsync(String scope, String roleAssignmentName, RoleAssignmentCreateParameters parameters) {
return createWithServiceResponseAsync(scope, roleAssignmentName, parameters).map(new Func1<ServiceResponse<RoleAssignmentInner>, RoleAssignmentInner>() {
@Override... | [
"public",
"Observable",
"<",
"RoleAssignmentInner",
">",
"createAsync",
"(",
"String",
"scope",
",",
"String",
"roleAssignmentName",
",",
"RoleAssignmentCreateParameters",
"parameters",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"scope",
",",
"roleAssignme... | Creates a role assignment.
@param scope The scope of the role assignment to create. The scope can be any REST resource instance. For example, use '/subscriptions/{subscription-id}/' for a subscription, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for a resource group, and '/subscriptions/{su... | [
"Creates",
"a",
"role",
"assignment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/RoleAssignmentsInner.java#L758-L765 |
alkacon/opencms-core | src/org/opencms/ui/apps/user/CmsImportExportUserDialog.java | CmsImportExportUserDialog.getExportUserDialogForOU | public static CmsImportExportUserDialog getExportUserDialogForOU(
String ou,
Window window,
boolean allowTechnicalFieldsExport) {
"""
Gets an dialog instance for fixed group.<p>
@param ou ou name
@param window window
@param allowTechnicalFieldsExport flag indicates if technical field e... | java | public static CmsImportExportUserDialog getExportUserDialogForOU(
String ou,
Window window,
boolean allowTechnicalFieldsExport) {
CmsImportExportUserDialog res = new CmsImportExportUserDialog(ou, null, window, allowTechnicalFieldsExport);
return res;
} | [
"public",
"static",
"CmsImportExportUserDialog",
"getExportUserDialogForOU",
"(",
"String",
"ou",
",",
"Window",
"window",
",",
"boolean",
"allowTechnicalFieldsExport",
")",
"{",
"CmsImportExportUserDialog",
"res",
"=",
"new",
"CmsImportExportUserDialog",
"(",
"ou",
",",
... | Gets an dialog instance for fixed group.<p>
@param ou ou name
@param window window
@param allowTechnicalFieldsExport flag indicates if technical field export option should be available
@return an instance of this class | [
"Gets",
"an",
"dialog",
"instance",
"for",
"fixed",
"group",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/user/CmsImportExportUserDialog.java#L471-L478 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxItem.java | BoxItem.getSharedItem | public static BoxItem.Info getSharedItem(BoxAPIConnection api, String sharedLink, String password) {
"""
Gets an item that was shared with a password-protected shared link.
@param api the API connection to be used by the shared item.
@param sharedLink the shared link to the item.
@param password the... | java | public static BoxItem.Info getSharedItem(BoxAPIConnection api, String sharedLink, String password) {
BoxAPIConnection newAPI = new SharedLinkAPIConnection(api, sharedLink, password);
URL url = SHARED_ITEM_URL_TEMPLATE.build(newAPI.getBaseURL());
BoxAPIRequest request = new BoxAPIRequest(newAPI, ... | [
"public",
"static",
"BoxItem",
".",
"Info",
"getSharedItem",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"sharedLink",
",",
"String",
"password",
")",
"{",
"BoxAPIConnection",
"newAPI",
"=",
"new",
"SharedLinkAPIConnection",
"(",
"api",
",",
"sharedLink",
",",
... | Gets an item that was shared with a password-protected shared link.
@param api the API connection to be used by the shared item.
@param sharedLink the shared link to the item.
@param password the password for the shared link.
@return info about the shared item. | [
"Gets",
"an",
"item",
"that",
"was",
"shared",
"with",
"a",
"password",
"-",
"protected",
"shared",
"link",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxItem.java#L71-L78 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/ConfusingArrayAsList.java | ConfusingArrayAsList.sawOpcode | @Override
public void sawOpcode(int seen) {
"""
implements the visitor to find calls to Arrays.asList with a primitive array
@param seen
the currently visitor opcode
"""
try {
stack.precomputation(this);
if (seen == Const.INVOKESTATIC) {
String clsName =... | java | @Override
public void sawOpcode(int seen) {
try {
stack.precomputation(this);
if (seen == Const.INVOKESTATIC) {
String clsName = getClassConstantOperand();
if ("java/util/Arrays".equals(clsName)) {
String methodName = getNameConsta... | [
"@",
"Override",
"public",
"void",
"sawOpcode",
"(",
"int",
"seen",
")",
"{",
"try",
"{",
"stack",
".",
"precomputation",
"(",
"this",
")",
";",
"if",
"(",
"seen",
"==",
"Const",
".",
"INVOKESTATIC",
")",
"{",
"String",
"clsName",
"=",
"getClassConstantO... | implements the visitor to find calls to Arrays.asList with a primitive array
@param seen
the currently visitor opcode | [
"implements",
"the",
"visitor",
"to",
"find",
"calls",
"to",
"Arrays",
".",
"asList",
"with",
"a",
"primitive",
"array"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/ConfusingArrayAsList.java#L97-L122 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/matrix/AtomicGrowingMatrix.java | AtomicGrowingMatrix.getRow | private AtomicVector getRow(int row, int col, boolean createIfAbsent) {
"""
Gets the {@code AtomicVector} associated with the index, or {@code null}
if no row entry is present, or if {@code createIfAbsent} is {@code true},
creates the missing row and returns that.
@param row the row to get
@param col the col... | java | private AtomicVector getRow(int row, int col, boolean createIfAbsent) {
rowReadLock.lock();
AtomicVector rowEntry = sparseMatrix.get(row);
rowReadLock.unlock();
// If no row existed, create one
if (rowEntry == null && createIfAbsent) {
rowWriteLock.lock();
... | [
"private",
"AtomicVector",
"getRow",
"(",
"int",
"row",
",",
"int",
"col",
",",
"boolean",
"createIfAbsent",
")",
"{",
"rowReadLock",
".",
"lock",
"(",
")",
";",
"AtomicVector",
"rowEntry",
"=",
"sparseMatrix",
".",
"get",
"(",
"row",
")",
";",
"rowReadLoc... | Gets the {@code AtomicVector} associated with the index, or {@code null}
if no row entry is present, or if {@code createIfAbsent} is {@code true},
creates the missing row and returns that.
@param row the row to get
@param col the column in the row that will be accessed or {@code -1} if
the entire row is needed. This ... | [
"Gets",
"the",
"{",
"@code",
"AtomicVector",
"}",
"associated",
"with",
"the",
"index",
"or",
"{",
"@code",
"null",
"}",
"if",
"no",
"row",
"entry",
"is",
"present",
"or",
"if",
"{",
"@code",
"createIfAbsent",
"}",
"is",
"{",
"@code",
"true",
"}",
"cre... | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/AtomicGrowingMatrix.java#L231-L257 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.getCertificateOperationAsync | public Observable<CertificateOperation> getCertificateOperationAsync(String vaultBaseUrl, String certificateName) {
"""
Gets the creation operation of a certificate.
Gets the creation operation associated with a specified certificate. This operation requires the certificates/get permission.
@param vaultBaseUrl... | java | public Observable<CertificateOperation> getCertificateOperationAsync(String vaultBaseUrl, String certificateName) {
return getCertificateOperationWithServiceResponseAsync(vaultBaseUrl, certificateName).map(new Func1<ServiceResponse<CertificateOperation>, CertificateOperation>() {
@Override
... | [
"public",
"Observable",
"<",
"CertificateOperation",
">",
"getCertificateOperationAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
")",
"{",
"return",
"getCertificateOperationWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"certificateName",
")",
... | Gets the creation operation of a certificate.
Gets the creation operation associated with a specified certificate. This operation requires the certificates/get permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param certificateName The name of the certificate.
@throws Illega... | [
"Gets",
"the",
"creation",
"operation",
"of",
"a",
"certificate",
".",
"Gets",
"the",
"creation",
"operation",
"associated",
"with",
"a",
"specified",
"certificate",
".",
"This",
"operation",
"requires",
"the",
"certificates",
"/",
"get",
"permission",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L7761-L7768 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java | XmlUtil.xmlToMap | public static Map<String, Object> xmlToMap(String xmlStr, Map<String, Object> result) {
"""
XML格式字符串转换为Map<br>
只支持第一级别的XML,不支持多级XML
@param xmlStr XML字符串
@param result 结果Map类型
@return XML数据转换后的Map
@since 4.0.8
"""
final Document doc = parseXml(xmlStr);
final Element root = getRootElement(doc);
r... | java | public static Map<String, Object> xmlToMap(String xmlStr, Map<String, Object> result) {
final Document doc = parseXml(xmlStr);
final Element root = getRootElement(doc);
root.normalize();
return xmlToMap(root, result);
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"xmlToMap",
"(",
"String",
"xmlStr",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"result",
")",
"{",
"final",
"Document",
"doc",
"=",
"parseXml",
"(",
"xmlStr",
")",
";",
"final",
"Elemen... | XML格式字符串转换为Map<br>
只支持第一级别的XML,不支持多级XML
@param xmlStr XML字符串
@param result 结果Map类型
@return XML数据转换后的Map
@since 4.0.8 | [
"XML格式字符串转换为Map<br",
">",
"只支持第一级别的XML,不支持多级XML"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/XmlUtil.java#L697-L703 |
joniles/mpxj | src/main/java/net/sf/mpxj/explorer/ProjectTreeController.java | ProjectTreeController.saveFile | public void saveFile(File file, String type) {
"""
Save the current file as the given type.
@param file target file
@param type file type
"""
try
{
Class<? extends ProjectWriter> fileClass = WRITER_MAP.get(type);
if (fileClass == null)
{
throw new IllegalA... | java | public void saveFile(File file, String type)
{
try
{
Class<? extends ProjectWriter> fileClass = WRITER_MAP.get(type);
if (fileClass == null)
{
throw new IllegalArgumentException("Cannot write files of type: " + type);
}
ProjectWriter writer = file... | [
"public",
"void",
"saveFile",
"(",
"File",
"file",
",",
"String",
"type",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
"extends",
"ProjectWriter",
">",
"fileClass",
"=",
"WRITER_MAP",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"fileClass",
"==",
"null",... | Save the current file as the given type.
@param file target file
@param type file type | [
"Save",
"the",
"current",
"file",
"as",
"the",
"given",
"type",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/explorer/ProjectTreeController.java#L514-L532 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/miner/MinerAdapter.java | MinerAdapter.getGeneSymbol | protected String getGeneSymbol(Match m, String label) {
"""
Searches for the gene symbol of the given EntityReference.
@param m current match
@param label label of the related EntityReference in the pattern
@return symbol
"""
ProteinReference pr = (ProteinReference) m.get(label, getPattern());
return ge... | java | protected String getGeneSymbol(Match m, String label)
{
ProteinReference pr = (ProteinReference) m.get(label, getPattern());
return getGeneSymbol(pr);
} | [
"protected",
"String",
"getGeneSymbol",
"(",
"Match",
"m",
",",
"String",
"label",
")",
"{",
"ProteinReference",
"pr",
"=",
"(",
"ProteinReference",
")",
"m",
".",
"get",
"(",
"label",
",",
"getPattern",
"(",
")",
")",
";",
"return",
"getGeneSymbol",
"(",
... | Searches for the gene symbol of the given EntityReference.
@param m current match
@param label label of the related EntityReference in the pattern
@return symbol | [
"Searches",
"for",
"the",
"gene",
"symbol",
"of",
"the",
"given",
"EntityReference",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/miner/MinerAdapter.java#L208-L212 |
Domo42/saga-lib | saga-lib/src/main/java/com/codebullets/sagalib/processing/SagaKeyReaderExtractor.java | SagaKeyReaderExtractor.tryGetKeyReader | private KeyReader tryGetKeyReader(final Class<? extends Saga> sagaClazz, final Object message) {
"""
Does not throw an exception when accessing the loading cache for key readers.
"""
KeyReader reader;
try {
Optional<KeyReader> cachedReader = knownReaders.get(
Sa... | java | private KeyReader tryGetKeyReader(final Class<? extends Saga> sagaClazz, final Object message) {
KeyReader reader;
try {
Optional<KeyReader> cachedReader = knownReaders.get(
SagaMessageKey.forMessage(sagaClazz, message),
() -> {
... | [
"private",
"KeyReader",
"tryGetKeyReader",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Saga",
">",
"sagaClazz",
",",
"final",
"Object",
"message",
")",
"{",
"KeyReader",
"reader",
";",
"try",
"{",
"Optional",
"<",
"KeyReader",
">",
"cachedReader",
"=",
"kno... | Does not throw an exception when accessing the loading cache for key readers. | [
"Does",
"not",
"throw",
"an",
"exception",
"when",
"accessing",
"the",
"loading",
"cache",
"for",
"key",
"readers",
"."
] | train | https://github.com/Domo42/saga-lib/blob/c8f232e2a51fcb6a3fe0082cfbf105c1e6bf90ef/saga-lib/src/main/java/com/codebullets/sagalib/processing/SagaKeyReaderExtractor.java#L71-L88 |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/GraphPath.java | GraphPath.splitAtLast | public GP splitAtLast(ST obj, PT startPoint) {
"""
Split this path and retains the first part of the
part in this object and reply the second part.
The last occurence of the specified element
will be in the second part.
<p>This function removes until the <i>last occurence</i>
of the given object.
@param ... | java | public GP splitAtLast(ST obj, PT startPoint) {
return splitAt(lastIndexOf(obj, startPoint), true);
} | [
"public",
"GP",
"splitAtLast",
"(",
"ST",
"obj",
",",
"PT",
"startPoint",
")",
"{",
"return",
"splitAt",
"(",
"lastIndexOf",
"(",
"obj",
",",
"startPoint",
")",
",",
"true",
")",
";",
"}"
] | Split this path and retains the first part of the
part in this object and reply the second part.
The last occurence of the specified element
will be in the second part.
<p>This function removes until the <i>last occurence</i>
of the given object.
@param obj the reference segment.
@param startPoint is the starting poi... | [
"Split",
"this",
"path",
"and",
"retains",
"the",
"first",
"part",
"of",
"the",
"part",
"in",
"this",
"object",
"and",
"reply",
"the",
"second",
"part",
".",
"The",
"last",
"occurence",
"of",
"the",
"specified",
"element",
"will",
"be",
"in",
"the",
"sec... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/GraphPath.java#L1188-L1190 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java | SqlQueryStatement.appendParameter | private void appendParameter(Object value, StringBuffer buf) {
"""
Append the Parameter
Add the place holder ? or the SubQuery
@param value the value of the criteria
"""
if (value instanceof Query)
{
appendSubQuery((Query) value, buf);
}
else
{
... | java | private void appendParameter(Object value, StringBuffer buf)
{
if (value instanceof Query)
{
appendSubQuery((Query) value, buf);
}
else
{
buf.append("?");
}
} | [
"private",
"void",
"appendParameter",
"(",
"Object",
"value",
",",
"StringBuffer",
"buf",
")",
"{",
"if",
"(",
"value",
"instanceof",
"Query",
")",
"{",
"appendSubQuery",
"(",
"(",
"Query",
")",
"value",
",",
"buf",
")",
";",
"}",
"else",
"{",
"buf",
"... | Append the Parameter
Add the place holder ? or the SubQuery
@param value the value of the criteria | [
"Append",
"the",
"Parameter",
"Add",
"the",
"place",
"holder",
"?",
"or",
"the",
"SubQuery"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java#L955-L965 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/chatroom/ChatRoomClient.java | ChatRoomClient.addChatRoomMember | public ResponseWrapper addChatRoomMember(long roomId, String... members)
throws APIConnectionException, APIRequestException {
"""
Add members to chat room
@param roomId chat room id
@param members username array
@return No content
@throws APIConnectionException connect exception
@throws APIRequ... | java | public ResponseWrapper addChatRoomMember(long roomId, String... members)
throws APIConnectionException, APIRequestException {
Preconditions.checkArgument(roomId > 0, "room id is invalid");
Preconditions.checkArgument(members != null && members.length > 0, "member should not be empty");
... | [
"public",
"ResponseWrapper",
"addChatRoomMember",
"(",
"long",
"roomId",
",",
"String",
"...",
"members",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"roomId",
">",
"0",
",",
"\"room id is inval... | Add members to chat room
@param roomId chat room id
@param members username array
@return No content
@throws APIConnectionException connect exception
@throws APIRequestException request exception | [
"Add",
"members",
"to",
"chat",
"room"
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/chatroom/ChatRoomClient.java#L190-L199 |
zaproxy/zaproxy | src/org/parosproxy/paros/extension/ExtensionLoader.java | ExtensionLoader.startLifeCycle | public void startLifeCycle(Extension ext) throws DatabaseException, DatabaseUnsupportedException {
"""
Initialize a specific Extension
@param ext the Extension that need to be initialized
@throws DatabaseUnsupportedException
@throws DatabaseException
"""
ext.init();
ext.databaseOpen(model.... | java | public void startLifeCycle(Extension ext) throws DatabaseException, DatabaseUnsupportedException {
ext.init();
ext.databaseOpen(model.getDb());
ext.initModel(model);
ext.initXML(model.getSession(), model.getOptionsParam());
ext.initView(view);
ExtensionHoo... | [
"public",
"void",
"startLifeCycle",
"(",
"Extension",
"ext",
")",
"throws",
"DatabaseException",
",",
"DatabaseUnsupportedException",
"{",
"ext",
".",
"init",
"(",
")",
";",
"ext",
".",
"databaseOpen",
"(",
"model",
".",
"getDb",
"(",
")",
")",
";",
"ext",
... | Initialize a specific Extension
@param ext the Extension that need to be initialized
@throws DatabaseUnsupportedException
@throws DatabaseException | [
"Initialize",
"a",
"specific",
"Extension"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/extension/ExtensionLoader.java#L759-L799 |
ngageoint/geopackage-java | src/main/java/mil/nga/geopackage/tiles/ImageUtils.java | ImageUtils.isTransparent | public static boolean isTransparent(BufferedImage image, int x, int y) {
"""
Check if the pixel in the image at the x and y is transparent
@param image
image
@param x
x location
@param y
y location
@return true if transparent
"""
int pixel = image.getRGB(x, y);
boolean transparent = (pixel >> 24) ... | java | public static boolean isTransparent(BufferedImage image, int x, int y) {
int pixel = image.getRGB(x, y);
boolean transparent = (pixel >> 24) == 0x00;
return transparent;
} | [
"public",
"static",
"boolean",
"isTransparent",
"(",
"BufferedImage",
"image",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"int",
"pixel",
"=",
"image",
".",
"getRGB",
"(",
"x",
",",
"y",
")",
";",
"boolean",
"transparent",
"=",
"(",
"pixel",
">>",
"... | Check if the pixel in the image at the x and y is transparent
@param image
image
@param x
x location
@param y
y location
@return true if transparent | [
"Check",
"if",
"the",
"pixel",
"in",
"the",
"image",
"at",
"the",
"x",
"and",
"y",
"is",
"transparent"
] | train | https://github.com/ngageoint/geopackage-java/blob/889bffb5d18330a3f4bd89443acf7959ebe3a376/src/main/java/mil/nga/geopackage/tiles/ImageUtils.java#L112-L116 |
stephanenicolas/robospice | robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java | SpiceServiceListenerNotifier.notifyObserversOfRequestAggregated | public void notifyObserversOfRequestAggregated(CachedSpiceRequest<?> request, Set<RequestListener<?>> requestListeners) {
"""
Inform the observers of a request. The observers can optionally observe
the new request if required.
@param request the request that has been aggregated.
"""
RequestProcessing... | java | public void notifyObserversOfRequestAggregated(CachedSpiceRequest<?> request, Set<RequestListener<?>> requestListeners) {
RequestProcessingContext requestProcessingContext = new RequestProcessingContext();
requestProcessingContext.setExecutionThread(Thread.currentThread());
requestProcessingCont... | [
"public",
"void",
"notifyObserversOfRequestAggregated",
"(",
"CachedSpiceRequest",
"<",
"?",
">",
"request",
",",
"Set",
"<",
"RequestListener",
"<",
"?",
">",
">",
"requestListeners",
")",
"{",
"RequestProcessingContext",
"requestProcessingContext",
"=",
"new",
"Requ... | Inform the observers of a request. The observers can optionally observe
the new request if required.
@param request the request that has been aggregated. | [
"Inform",
"the",
"observers",
"of",
"a",
"request",
".",
"The",
"observers",
"can",
"optionally",
"observe",
"the",
"new",
"request",
"if",
"required",
"."
] | train | https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/request/notifier/SpiceServiceListenerNotifier.java#L79-L84 |
grpc/grpc-java | core/src/main/java/io/grpc/internal/TransportFrameUtil.java | TransportFrameUtil.toRawSerializedHeaders | @CheckReturnValue
public static byte[][] toRawSerializedHeaders(byte[][] http2Headers) {
"""
Transform HTTP/2-compliant headers to the raw serialized format which can be deserialized by
metadata marshallers. It decodes the Base64-encoded binary headers.
<p>Warning: This function may partially modify the head... | java | @CheckReturnValue
public static byte[][] toRawSerializedHeaders(byte[][] http2Headers) {
for (int i = 0; i < http2Headers.length; i += 2) {
byte[] key = http2Headers[i];
byte[] value = http2Headers[i + 1];
if (endsWith(key, binaryHeaderSuffixBytes)) {
// Binary header
for (int id... | [
"@",
"CheckReturnValue",
"public",
"static",
"byte",
"[",
"]",
"[",
"]",
"toRawSerializedHeaders",
"(",
"byte",
"[",
"]",
"[",
"]",
"http2Headers",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"http2Headers",
".",
"length",
";",
"i",
"+... | Transform HTTP/2-compliant headers to the raw serialized format which can be deserialized by
metadata marshallers. It decodes the Base64-encoded binary headers.
<p>Warning: This function may partially modify the headers in place by modifying the input
array (but not modifying any single byte), so the input reference {... | [
"Transform",
"HTTP",
"/",
"2",
"-",
"compliant",
"headers",
"to",
"the",
"raw",
"serialized",
"format",
"which",
"can",
"be",
"deserialized",
"by",
"metadata",
"marshallers",
".",
"It",
"decodes",
"the",
"Base64",
"-",
"encoded",
"binary",
"headers",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/core/src/main/java/io/grpc/internal/TransportFrameUtil.java#L99-L119 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/MetaClass.java | MetaClass.createInstance | @SuppressWarnings("unchecked")
public <E,F extends E> F createInstance(Class<E> type, Object... params) {
"""
Creates an instance of the class, forcing a cast to a certain type and
given an array of objects as constructor parameters NOTE: the resulting
instance will [unlike java] invoke the most narrow constr... | java | @SuppressWarnings("unchecked")
public <E,F extends E> F createInstance(Class<E> type, Object... params) {
Object obj = createInstance(params);
if (type.isInstance(obj)) {
return (F) obj;
} else {
throw new ClassCreationException("Cannot cast " + classname
+ " into " + type.get... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"E",
",",
"F",
"extends",
"E",
">",
"F",
"createInstance",
"(",
"Class",
"<",
"E",
">",
"type",
",",
"Object",
"...",
"params",
")",
"{",
"Object",
"obj",
"=",
"createInstance",
"(",
"p... | Creates an instance of the class, forcing a cast to a certain type and
given an array of objects as constructor parameters NOTE: the resulting
instance will [unlike java] invoke the most narrow constructor rather
than the one which matches the signature passed to this function
@param <E>
The type of the object returne... | [
"Creates",
"an",
"instance",
"of",
"the",
"class",
"forcing",
"a",
"cast",
"to",
"a",
"certain",
"type",
"and",
"given",
"an",
"array",
"of",
"objects",
"as",
"constructor",
"parameters",
"NOTE",
":",
"the",
"resulting",
"instance",
"will",
"[",
"unlike",
... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/MetaClass.java#L388-L397 |
spring-projects/spring-retry | src/main/java/org/springframework/classify/util/MethodInvokerUtils.java | MethodInvokerUtils.getMethodInvokerByAnnotation | public static MethodInvoker getMethodInvokerByAnnotation(
final Class<? extends Annotation> annotationType, final Object target) {
"""
Create {@link MethodInvoker} for the method with the provided annotation on the
provided object. Annotations that cannot be applied to methods (i.e. that aren't
annotated with... | java | public static MethodInvoker getMethodInvokerByAnnotation(
final Class<? extends Annotation> annotationType, final Object target) {
Assert.notNull(target, "Target must not be null");
Assert.notNull(annotationType, "AnnotationType must not be null");
Assert.isTrue(ObjectUtils.containsElement(
annotationType.... | [
"public",
"static",
"MethodInvoker",
"getMethodInvokerByAnnotation",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationType",
",",
"final",
"Object",
"target",
")",
"{",
"Assert",
".",
"notNull",
"(",
"target",
",",
"\"Target must not be null... | Create {@link MethodInvoker} for the method with the provided annotation on the
provided object. Annotations that cannot be applied to methods (i.e. that aren't
annotated with an element type of METHOD) will cause an exception to be thrown.
@param annotationType to be searched for
@param target to be invoked
@return Me... | [
"Create",
"{"
] | train | https://github.com/spring-projects/spring-retry/blob/e2b0555f96594c2321990d0deeac45fc44d4f123/src/main/java/org/springframework/classify/util/MethodInvokerUtils.java#L166-L203 |
GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.copyInternal | private void copyInternal(Map<FileInfo, URI> srcToDstItemNames) throws IOException {
"""
Copies items in given map that maps source items to destination items.
"""
if (srcToDstItemNames.isEmpty()) {
return;
}
String srcBucketName = null;
String dstBucketName = null;
List<String> srcO... | java | private void copyInternal(Map<FileInfo, URI> srcToDstItemNames) throws IOException {
if (srcToDstItemNames.isEmpty()) {
return;
}
String srcBucketName = null;
String dstBucketName = null;
List<String> srcObjectNames = new ArrayList<>(srcToDstItemNames.size());
List<String> dstObjectNames ... | [
"private",
"void",
"copyInternal",
"(",
"Map",
"<",
"FileInfo",
",",
"URI",
">",
"srcToDstItemNames",
")",
"throws",
"IOException",
"{",
"if",
"(",
"srcToDstItemNames",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"String",
"srcBucketName",
"=",
... | Copies items in given map that maps source items to destination items. | [
"Copies",
"items",
"in",
"given",
"map",
"that",
"maps",
"source",
"items",
"to",
"destination",
"items",
"."
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L836-L862 |
orbisgis/poly2tri.java | poly2tri-core/src/main/java/org/poly2tri/triangulation/TriangulationPoint.java | TriangulationPoint.mergeInstances | public static void mergeInstances(Map<TriangulationPoint, TriangulationPoint> uniquePts, List<TriangulationPoint> ptList) {
"""
Replace points in ptList for all equals object in uniquePts.
@param uniquePts Map of triangulation points
@param ptList Point list, updated, but always the same size.
"""
f... | java | public static void mergeInstances(Map<TriangulationPoint, TriangulationPoint> uniquePts, List<TriangulationPoint> ptList) {
for(int idPoint = 0; idPoint < ptList.size(); idPoint++) {
TriangulationPoint pt = ptList.get(idPoint);
TriangulationPoint uniquePt = uniquePts.get(pt);
... | [
"public",
"static",
"void",
"mergeInstances",
"(",
"Map",
"<",
"TriangulationPoint",
",",
"TriangulationPoint",
">",
"uniquePts",
",",
"List",
"<",
"TriangulationPoint",
">",
"ptList",
")",
"{",
"for",
"(",
"int",
"idPoint",
"=",
"0",
";",
"idPoint",
"<",
"p... | Replace points in ptList for all equals object in uniquePts.
@param uniquePts Map of triangulation points
@param ptList Point list, updated, but always the same size. | [
"Replace",
"points",
"in",
"ptList",
"for",
"all",
"equals",
"object",
"in",
"uniquePts",
"."
] | train | https://github.com/orbisgis/poly2tri.java/blob/8b312c8d5fc23c52ffbacb3a7b66afae328fa827/poly2tri-core/src/main/java/org/poly2tri/triangulation/TriangulationPoint.java#L120-L131 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/jboss/logging/Logger.java | Logger.logf | public void logf(String loggerFqcn, Level level, Throwable t, String format, Object... params) {
"""
Log a message at the given level.
@param loggerFqcn the logger class name
@param level the level
@param t the throwable cause
@param format the format string as per {@link String#format(String, Object...)} or... | java | public void logf(String loggerFqcn, Level level, Throwable t, String format, Object... params) {
doLogf(level, loggerFqcn, format, params, t);
} | [
"public",
"void",
"logf",
"(",
"String",
"loggerFqcn",
",",
"Level",
"level",
",",
"Throwable",
"t",
",",
"String",
"format",
",",
"Object",
"...",
"params",
")",
"{",
"doLogf",
"(",
"level",
",",
"loggerFqcn",
",",
"format",
",",
"params",
",",
"t",
"... | Log a message at the given level.
@param loggerFqcn the logger class name
@param level the level
@param t the throwable cause
@param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor
@param params the message parameters | [
"Log",
"a",
"message",
"at",
"the",
"given",
"level",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L2444-L2446 |
jblas-project/jblas | src/main/java/org/jblas/Solve.java | Solve.solveLeastSquares | public static DoubleMatrix solveLeastSquares(DoubleMatrix A, DoubleMatrix B) {
"""
Computes the Least Squares solution for over or underdetermined
linear equations A*X = B
In the overdetermined case, when m > n, that is, there are more equations than
variables, it computes the least squares solution of X -> |... | java | public static DoubleMatrix solveLeastSquares(DoubleMatrix A, DoubleMatrix B) {
if (B.rows < A.columns) {
DoubleMatrix X = DoubleMatrix.concatVertically(B, new DoubleMatrix(A.columns - B.rows, B.columns));
SimpleBlas.gelsd(A.dup(), X);
return X;
} else {
DoubleMatrix X = B.dup();
Si... | [
"public",
"static",
"DoubleMatrix",
"solveLeastSquares",
"(",
"DoubleMatrix",
"A",
",",
"DoubleMatrix",
"B",
")",
"{",
"if",
"(",
"B",
".",
"rows",
"<",
"A",
".",
"columns",
")",
"{",
"DoubleMatrix",
"X",
"=",
"DoubleMatrix",
".",
"concatVertically",
"(",
... | Computes the Least Squares solution for over or underdetermined
linear equations A*X = B
In the overdetermined case, when m > n, that is, there are more equations than
variables, it computes the least squares solution of X -> ||A*X - B ||_2.
In the underdetermined case, when m < n (less equations than variables), the... | [
"Computes",
"the",
"Least",
"Squares",
"solution",
"for",
"over",
"or",
"underdetermined",
"linear",
"equations",
"A",
"*",
"X",
"=",
"B"
] | train | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/Solve.java#L83-L93 |
mapsforge/mapsforge | mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/util/PolyLabel.java | PolyLabel.pointToPolygonDist | private static float pointToPolygonDist(double x, double y, Polygon polygon) {
"""
Signed distance from point to polygon outline (negative if point is outside)
"""
boolean inside = false;
double minDistSq = Double.POSITIVE_INFINITY;
// External ring
LineString exterior = polygo... | java | private static float pointToPolygonDist(double x, double y, Polygon polygon) {
boolean inside = false;
double minDistSq = Double.POSITIVE_INFINITY;
// External ring
LineString exterior = polygon.getExteriorRing();
for (int i = 0, n = exterior.getNumPoints() - 1, j = n - 1; i < n... | [
"private",
"static",
"float",
"pointToPolygonDist",
"(",
"double",
"x",
",",
"double",
"y",
",",
"Polygon",
"polygon",
")",
"{",
"boolean",
"inside",
"=",
"false",
";",
"double",
"minDistSq",
"=",
"Double",
".",
"POSITIVE_INFINITY",
";",
"// External ring",
"L... | Signed distance from point to polygon outline (negative if point is outside) | [
"Signed",
"distance",
"from",
"point",
"to",
"polygon",
"outline",
"(",
"negative",
"if",
"point",
"is",
"outside",
")"
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/util/PolyLabel.java#L155-L188 |
mnlipp/jgrapes | org.jgrapes.util/src/org/jgrapes/util/events/KeyValueStoreUpdate.java | KeyValueStoreUpdate.clearAll | public KeyValueStoreUpdate clearAll(String... segments) {
"""
Adds a new deletion action that clears all keys with the given
path prefix.
@param segments the path segments
@return the event for easy chaining
"""
actions.add(new Deletion("/" + String.join("/", segments)));
return this;
} | java | public KeyValueStoreUpdate clearAll(String... segments) {
actions.add(new Deletion("/" + String.join("/", segments)));
return this;
} | [
"public",
"KeyValueStoreUpdate",
"clearAll",
"(",
"String",
"...",
"segments",
")",
"{",
"actions",
".",
"add",
"(",
"new",
"Deletion",
"(",
"\"/\"",
"+",
"String",
".",
"join",
"(",
"\"/\"",
",",
"segments",
")",
")",
")",
";",
"return",
"this",
";",
... | Adds a new deletion action that clears all keys with the given
path prefix.
@param segments the path segments
@return the event for easy chaining | [
"Adds",
"a",
"new",
"deletion",
"action",
"that",
"clears",
"all",
"keys",
"with",
"the",
"given",
"path",
"prefix",
"."
] | train | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.util/src/org/jgrapes/util/events/KeyValueStoreUpdate.java#L78-L81 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/data/Cluster.java | Cluster.writeToText | @Override
public void writeToText(TextWriterStream out, String label) {
"""
Write to a textual representation. Writing the actual group data will be
handled by the caller, this is only meant to write the meta information.
@param out output writer stream
@param label Label to prefix
"""
String name =... | java | @Override
public void writeToText(TextWriterStream out, String label) {
String name = getNameAutomatic();
if(name != null) {
out.commentPrintLn("Cluster name: " + name);
}
out.commentPrintLn("Cluster noise flag: " + isNoise());
out.commentPrintLn("Cluster size: " + ids.size());
// also p... | [
"@",
"Override",
"public",
"void",
"writeToText",
"(",
"TextWriterStream",
"out",
",",
"String",
"label",
")",
"{",
"String",
"name",
"=",
"getNameAutomatic",
"(",
")",
";",
"if",
"(",
"name",
"!=",
"null",
")",
"{",
"out",
".",
"commentPrintLn",
"(",
"\... | Write to a textual representation. Writing the actual group data will be
handled by the caller, this is only meant to write the meta information.
@param out output writer stream
@param label Label to prefix | [
"Write",
"to",
"a",
"textual",
"representation",
".",
"Writing",
"the",
"actual",
"group",
"data",
"will",
"be",
"handled",
"by",
"the",
"caller",
"this",
"is",
"only",
"meant",
"to",
"write",
"the",
"meta",
"information",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/data/Cluster.java#L247-L259 |
JavaMoney/jsr354-ri-bp | src/main/java/org/javamoney/moneta/spi/base/BaseMonetaryRoundingsSingletonSpi.java | BaseMonetaryRoundingsSingletonSpi.getRounding | public MonetaryRounding getRounding(CurrencyUnit currencyUnit, String... providers) {
"""
Access a {@link javax.money.MonetaryRounding} for rounding {@link javax.money.MonetaryAmount}
instances given a currency.
@param currencyUnit The currency, which determines the required precision. As
{@link java.math.Rou... | java | public MonetaryRounding getRounding(CurrencyUnit currencyUnit, String... providers) {
MonetaryRounding op =
getRounding(RoundingQueryBuilder.of().setProviderNames(providers).setCurrency(currencyUnit).build());
if(op==null) {
throw new MonetaryException(
"N... | [
"public",
"MonetaryRounding",
"getRounding",
"(",
"CurrencyUnit",
"currencyUnit",
",",
"String",
"...",
"providers",
")",
"{",
"MonetaryRounding",
"op",
"=",
"getRounding",
"(",
"RoundingQueryBuilder",
".",
"of",
"(",
")",
".",
"setProviderNames",
"(",
"providers",
... | Access a {@link javax.money.MonetaryRounding} for rounding {@link javax.money.MonetaryAmount}
instances given a currency.
@param currencyUnit The currency, which determines the required precision. As
{@link java.math.RoundingMode}, by default, {@link java.math.RoundingMode#HALF_UP}
is sued.
@param providers the opt... | [
"Access",
"a",
"{",
"@link",
"javax",
".",
"money",
".",
"MonetaryRounding",
"}",
"for",
"rounding",
"{",
"@link",
"javax",
".",
"money",
".",
"MonetaryAmount",
"}",
"instances",
"given",
"a",
"currency",
"."
] | train | https://github.com/JavaMoney/jsr354-ri-bp/blob/9c147ef5623d8032a6dc4c0e5eefdfb41641a9a2/src/main/java/org/javamoney/moneta/spi/base/BaseMonetaryRoundingsSingletonSpi.java#L44-L52 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Single.java | Single.concatEager | @BackpressureSupport(BackpressureKind.FULL)
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Flowable<T> concatEager(Publisher<? extends SingleSource<? extends T>> sources) {
"""
Concatenates a Publisher sequence of SingleSources eagerly into a single stream of values.
<p>
... | java | @BackpressureSupport(BackpressureKind.FULL)
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Flowable<T> concatEager(Publisher<? extends SingleSource<? extends T>> sources) {
return Flowable.fromPublisher(sources).concatMapEager(SingleInternalHelper.<T>toFlowable());
... | [
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"FULL",
")",
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"static",
"<",
"T",
">",
"Flowable",
"<",
"T",
">",
"concatEager",
"(",
"Publisher",
"... | Concatenates a Publisher sequence of SingleSources eagerly into a single stream of values.
<p>
<img width="640" height="307" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Single.concatEager.p.png" alt="">
<p>
Eager concatenation means that once a subscriber subscribes, this operator subscribes t... | [
"Concatenates",
"a",
"Publisher",
"sequence",
"of",
"SingleSources",
"eagerly",
"into",
"a",
"single",
"stream",
"of",
"values",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"height",
"=",
"307",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",... | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Single.java#L434-L439 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/reporter/Reporter.java | Reporter.reportResultsToConsole | private void reportResultsToConsole() {
"""
If there is a FB console opened, report results and statistics to it.
"""
if (!isStreamReportingEnabled()) {
return;
}
printToStream("Finished, found: " + bugCount + " bugs");
ConfigurableXmlOutputStream xmlStream = new Con... | java | private void reportResultsToConsole() {
if (!isStreamReportingEnabled()) {
return;
}
printToStream("Finished, found: " + bugCount + " bugs");
ConfigurableXmlOutputStream xmlStream = new ConfigurableXmlOutputStream(stream, true);
ProjectStats stats = bugCollection.getP... | [
"private",
"void",
"reportResultsToConsole",
"(",
")",
"{",
"if",
"(",
"!",
"isStreamReportingEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"printToStream",
"(",
"\"Finished, found: \"",
"+",
"bugCount",
"+",
"\" bugs\"",
")",
";",
"ConfigurableXmlOutputStream... | If there is a FB console opened, report results and statistics to it. | [
"If",
"there",
"is",
"a",
"FB",
"console",
"opened",
"report",
"results",
"and",
"statistics",
"to",
"it",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/reporter/Reporter.java#L184-L221 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/sch/util/ScheduleUtils.java | ScheduleUtils.buildTriggers | public static IntDiGraph buildTriggers(IntDiGraph g, Schedule s) {
"""
return a DAG, G' = V', E' such that vertecies correspond to indexes in
the schedule and there is an edge (i,j) \in E' if s_i triggered s_j
"""
// return trigger DAG
IntDiGraph d = new IntDiGraph();
// map from node... | java | public static IntDiGraph buildTriggers(IntDiGraph g, Schedule s) {
// return trigger DAG
IntDiGraph d = new IntDiGraph();
// map from node to triggering indexes
DefaultDict<Integer, List<Integer>> currentTriggers = new DefaultDict<>(i -> new LinkedList<Integer>());
for (Indexed<... | [
"public",
"static",
"IntDiGraph",
"buildTriggers",
"(",
"IntDiGraph",
"g",
",",
"Schedule",
"s",
")",
"{",
"// return trigger DAG",
"IntDiGraph",
"d",
"=",
"new",
"IntDiGraph",
"(",
")",
";",
"// map from node to triggering indexes",
"DefaultDict",
"<",
"Integer",
"... | return a DAG, G' = V', E' such that vertecies correspond to indexes in
the schedule and there is an edge (i,j) \in E' if s_i triggered s_j | [
"return",
"a",
"DAG",
"G",
"=",
"V",
"E",
"such",
"that",
"vertecies",
"correspond",
"to",
"indexes",
"in",
"the",
"schedule",
"and",
"there",
"is",
"an",
"edge",
"(",
"i",
"j",
")",
"\\",
"in",
"E",
"if",
"s_i",
"triggered",
"s_j"
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/sch/util/ScheduleUtils.java#L33-L62 |
Bedework/bw-util | bw-util-config/src/main/java/org/bedework/util/config/ConfigBase.java | ConfigBase.setListProperty | @SuppressWarnings("unchecked")
public <L extends List> L setListProperty(final L list,
final String name,
final String val) {
"""
Set a property
@param list the list - possibly null
@param name of property
@param val of ... | java | @SuppressWarnings("unchecked")
public <L extends List> L setListProperty(final L list,
final String name,
final String val) {
removeProperty(list, name);
return addListProperty(list, name, val);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"L",
"extends",
"List",
">",
"L",
"setListProperty",
"(",
"final",
"L",
"list",
",",
"final",
"String",
"name",
",",
"final",
"String",
"val",
")",
"{",
"removeProperty",
"(",
"list",
",",
... | Set a property
@param list the list - possibly null
@param name of property
@param val of property
@return possibly newly created list | [
"Set",
"a",
"property"
] | train | https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-config/src/main/java/org/bedework/util/config/ConfigBase.java#L246-L252 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/util/AbstractLog.java | AbstractLog.mandatoryNote | public void mandatoryNote(final JavaFileObject file, String key, Object ... args) {
"""
Provide a non-fatal notification, unless suppressed by the -nowarn option.
@param key The key for the localized notification message.
@param args Fields of the notification message.
"""
report(diags.mandatory... | java | public void mandatoryNote(final JavaFileObject file, String key, Object ... args) {
report(diags.mandatoryNote(getSource(file), key, args));
} | [
"public",
"void",
"mandatoryNote",
"(",
"final",
"JavaFileObject",
"file",
",",
"String",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"report",
"(",
"diags",
".",
"mandatoryNote",
"(",
"getSource",
"(",
"file",
")",
",",
"key",
",",
"args",
")",
")",
... | Provide a non-fatal notification, unless suppressed by the -nowarn option.
@param key The key for the localized notification message.
@param args Fields of the notification message. | [
"Provide",
"a",
"non",
"-",
"fatal",
"notification",
"unless",
"suppressed",
"by",
"the",
"-",
"nowarn",
"option",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/util/AbstractLog.java#L238-L240 |
azkaban/azkaban | azkaban-common/src/main/java/azkaban/utils/RestfulApiClient.java | RestfulApiClient.httpPost | public T httpPost(final URI uri, final List<Pair<String, String>> params) throws IOException {
"""
function to perform a Post http request.
@param uri the URI of the request.
@param params the form params to be posted, optional.
@return the response object type of which is specified by user.
@throws Unsuppor... | java | public T httpPost(final URI uri, final List<Pair<String, String>> params) throws IOException {
// shortcut if the passed url is invalid.
if (null == uri) {
logger.error(" unable to perform httpPost as the passed uri is null.");
return null;
}
final HttpPost post = new HttpPost(uri);
ret... | [
"public",
"T",
"httpPost",
"(",
"final",
"URI",
"uri",
",",
"final",
"List",
"<",
"Pair",
"<",
"String",
",",
"String",
">",
">",
"params",
")",
"throws",
"IOException",
"{",
"// shortcut if the passed url is invalid.",
"if",
"(",
"null",
"==",
"uri",
")",
... | function to perform a Post http request.
@param uri the URI of the request.
@param params the form params to be posted, optional.
@return the response object type of which is specified by user.
@throws UnsupportedEncodingException, IOException | [
"function",
"to",
"perform",
"a",
"Post",
"http",
"request",
"."
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/utils/RestfulApiClient.java#L117-L126 |
raphw/byte-buddy | byte-buddy-maven-plugin/src/main/java/net/bytebuddy/build/maven/AbstractUserConfiguration.java | AbstractUserConfiguration.asCoordinate | public MavenCoordinate asCoordinate(String groupId, String artifactId, String version, String packaging) {
"""
Resolves this transformation to a Maven coordinate.
@param groupId The current project's build id.
@param artifactId The current project's artifact id.
@param version The current project's vers... | java | public MavenCoordinate asCoordinate(String groupId, String artifactId, String version, String packaging) {
return new MavenCoordinate(getGroupId(groupId), getArtifactId(artifactId), getVersion(version), getPackaging(packaging));
} | [
"public",
"MavenCoordinate",
"asCoordinate",
"(",
"String",
"groupId",
",",
"String",
"artifactId",
",",
"String",
"version",
",",
"String",
"packaging",
")",
"{",
"return",
"new",
"MavenCoordinate",
"(",
"getGroupId",
"(",
"groupId",
")",
",",
"getArtifactId",
... | Resolves this transformation to a Maven coordinate.
@param groupId The current project's build id.
@param artifactId The current project's artifact id.
@param version The current project's version.
@param packaging The current project's packaging
@return The resolved Maven coordinate. | [
"Resolves",
"this",
"transformation",
"to",
"a",
"Maven",
"coordinate",
"."
] | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-maven-plugin/src/main/java/net/bytebuddy/build/maven/AbstractUserConfiguration.java#L104-L106 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java | TypeUtility.parameterizedTypeName | public static TypeName parameterizedTypeName(ClassName rawClass, TypeName paramClass) {
"""
Parameterized type name.
@param rawClass
the raw class
@param paramClass
the param class
@return the type name
"""
return ParameterizedTypeName.get(rawClass, paramClass);
} | java | public static TypeName parameterizedTypeName(ClassName rawClass, TypeName paramClass) {
return ParameterizedTypeName.get(rawClass, paramClass);
} | [
"public",
"static",
"TypeName",
"parameterizedTypeName",
"(",
"ClassName",
"rawClass",
",",
"TypeName",
"paramClass",
")",
"{",
"return",
"ParameterizedTypeName",
".",
"get",
"(",
"rawClass",
",",
"paramClass",
")",
";",
"}"
] | Parameterized type name.
@param rawClass
the raw class
@param paramClass
the param class
@return the type name | [
"Parameterized",
"type",
"name",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/TypeUtility.java#L521-L523 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.