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 |
|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.restoreSecretAsync | public ServiceFuture<SecretBundle> restoreSecretAsync(String vaultBaseUrl, byte[] secretBundleBackup, final ServiceCallback<SecretBundle> serviceCallback) {
"""
Restores a backed up secret to a vault.
Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permis... | java | public ServiceFuture<SecretBundle> restoreSecretAsync(String vaultBaseUrl, byte[] secretBundleBackup, final ServiceCallback<SecretBundle> serviceCallback) {
return ServiceFuture.fromResponse(restoreSecretWithServiceResponseAsync(vaultBaseUrl, secretBundleBackup), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"SecretBundle",
">",
"restoreSecretAsync",
"(",
"String",
"vaultBaseUrl",
",",
"byte",
"[",
"]",
"secretBundleBackup",
",",
"final",
"ServiceCallback",
"<",
"SecretBundle",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture",
... | Restores a backed up secret to a vault.
Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param secretBundleBackup The backup blob associated with a secret bundle.
@par... | [
"Restores",
"a",
"backed",
"up",
"secret",
"to",
"a",
"vault",
".",
"Restores",
"a",
"backed",
"up",
"secret",
"and",
"all",
"its",
"versions",
"to",
"a",
"vault",
".",
"This",
"operation",
"requires",
"the",
"secrets",
"/",
"restore",
"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#L5008-L5010 |
wkgcass/Style | src/main/java/net/cassite/style/aggregation/MapFuncSup.java | MapFuncSup.forEach | @SuppressWarnings("unchecked")
public <R> R forEach(VFunc3<K, V, IteratorInfo<R>> func) {
"""
define a function to deal with each entry in the map
@param func a function takes in each entry from map and iterator
info
@return return 'last loop value'.<br>
check
<a href="https://github.com/wkgcass/Sty... | java | @SuppressWarnings("unchecked")
public <R> R forEach(VFunc3<K, V, IteratorInfo<R>> func) {
return (R) forEach(Style.$(func));
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"R",
">",
"R",
"forEach",
"(",
"VFunc3",
"<",
"K",
",",
"V",
",",
"IteratorInfo",
"<",
"R",
">",
">",
"func",
")",
"{",
"return",
"(",
"R",
")",
"forEach",
"(",
"Style",
".",
"$",
... | define a function to deal with each entry in the map
@param func a function takes in each entry from map and iterator
info
@return return 'last loop value'.<br>
check
<a href="https://github.com/wkgcass/Style/">tutorial</a> for
more info about 'last loop value' | [
"define",
"a",
"function",
"to",
"deal",
"with",
"each",
"entry",
"in",
"the",
"map"
] | train | https://github.com/wkgcass/Style/blob/db3ea64337251f46f734279480e365293bececbd/src/main/java/net/cassite/style/aggregation/MapFuncSup.java#L52-L55 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/component/session/FileSessionDataStore.java | FileSessionDataStore.deleteFile | private boolean deleteFile(String filename) throws Exception {
"""
Delete the file associated with a session
@param filename name of the file containing the session's information
@return true if file was deleted, false otherwise
@throws Exception if the file associated with the session fails to be deleted
... | java | private boolean deleteFile(String filename) throws Exception {
if (filename == null) {
return false;
}
File file = new File(storeDir, filename);
return Files.deleteIfExists(file.toPath());
} | [
"private",
"boolean",
"deleteFile",
"(",
"String",
"filename",
")",
"throws",
"Exception",
"{",
"if",
"(",
"filename",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"File",
"file",
"=",
"new",
"File",
"(",
"storeDir",
",",
"filename",
")",
";",
... | Delete the file associated with a session
@param filename name of the file containing the session's information
@return true if file was deleted, false otherwise
@throws Exception if the file associated with the session fails to be deleted | [
"Delete",
"the",
"file",
"associated",
"with",
"a",
"session"
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/component/session/FileSessionDataStore.java#L101-L107 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/Block.java | Block.addCoinbaseTransaction | @VisibleForTesting
void addCoinbaseTransaction(byte[] pubKeyTo, Coin value, final int height) {
"""
Adds a coinbase transaction to the block. This exists for unit tests.
@param height block height, if known, or -1 otherwise.
"""
unCacheTransactions();
transactions = new ArrayList<>();
... | java | @VisibleForTesting
void addCoinbaseTransaction(byte[] pubKeyTo, Coin value, final int height) {
unCacheTransactions();
transactions = new ArrayList<>();
Transaction coinbase = new Transaction(params);
final ScriptBuilder inputBuilder = new ScriptBuilder();
if (height >= Bloc... | [
"@",
"VisibleForTesting",
"void",
"addCoinbaseTransaction",
"(",
"byte",
"[",
"]",
"pubKeyTo",
",",
"Coin",
"value",
",",
"final",
"int",
"height",
")",
"{",
"unCacheTransactions",
"(",
")",
";",
"transactions",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
... | Adds a coinbase transaction to the block. This exists for unit tests.
@param height block height, if known, or -1 otherwise. | [
"Adds",
"a",
"coinbase",
"transaction",
"to",
"the",
"block",
".",
"This",
"exists",
"for",
"unit",
"tests",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/Block.java#L910-L935 |
googlemaps/google-maps-services-java | src/main/java/com/google/maps/PlacesApi.java | PlacesApi.placeDetails | public static PlaceDetailsRequest placeDetails(GeoApiContext context, String placeId) {
"""
Requests the details of a Place.
<p>We are only enabling looking up Places by placeId as the older Place identifier, reference,
is deprecated. Please see the <a
href="https://web.archive.org/web/20170521070241/https://... | java | public static PlaceDetailsRequest placeDetails(GeoApiContext context, String placeId) {
PlaceDetailsRequest request = new PlaceDetailsRequest(context);
request.placeId(placeId);
return request;
} | [
"public",
"static",
"PlaceDetailsRequest",
"placeDetails",
"(",
"GeoApiContext",
"context",
",",
"String",
"placeId",
")",
"{",
"PlaceDetailsRequest",
"request",
"=",
"new",
"PlaceDetailsRequest",
"(",
"context",
")",
";",
"request",
".",
"placeId",
"(",
"placeId",
... | Requests the details of a Place.
<p>We are only enabling looking up Places by placeId as the older Place identifier, reference,
is deprecated. Please see the <a
href="https://web.archive.org/web/20170521070241/https://developers.google.com/places/web-service/details#deprecation">
deprecation warning</a>.
@param conte... | [
"Requests",
"the",
"details",
"of",
"a",
"Place",
"."
] | train | https://github.com/googlemaps/google-maps-services-java/blob/23d20d1930f80e310d856d2da51d72ee0db4476b/src/main/java/com/google/maps/PlacesApi.java#L124-L128 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/XMLCharacterRecognizer.java | XMLCharacterRecognizer.isWhiteSpace | public static boolean isWhiteSpace(char ch[], int start, int length) {
"""
Tell if the string is whitespace.
@param ch Character array to check as XML whitespace.
@param start Start index of characters in the array
@param length Number of characters in the array
@return True if the characters in the array ar... | java | public static boolean isWhiteSpace(char ch[], int start, int length)
{
int end = start + length;
for (int s = start; s < end; s++)
{
if (!isWhiteSpace(ch[s]))
return false;
}
return true;
} | [
"public",
"static",
"boolean",
"isWhiteSpace",
"(",
"char",
"ch",
"[",
"]",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"int",
"end",
"=",
"start",
"+",
"length",
";",
"for",
"(",
"int",
"s",
"=",
"start",
";",
"s",
"<",
"end",
";",
"s",... | Tell if the string is whitespace.
@param ch Character array to check as XML whitespace.
@param start Start index of characters in the array
@param length Number of characters in the array
@return True if the characters in the array are
XML whitespace; otherwise, false. | [
"Tell",
"if",
"the",
"string",
"is",
"whitespace",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/XMLCharacterRecognizer.java#L52-L64 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/utils/MonetaryFormat.java | MonetaryFormat.parseFiat | public Fiat parseFiat(String currencyCode, String str) throws NumberFormatException {
"""
Parse a human readable fiat value to a {@link Fiat} instance.
@throws NumberFormatException
if the string cannot be parsed for some reason
"""
return Fiat.valueOf(currencyCode, parseValue(str, Fiat.SMALLEST_UN... | java | public Fiat parseFiat(String currencyCode, String str) throws NumberFormatException {
return Fiat.valueOf(currencyCode, parseValue(str, Fiat.SMALLEST_UNIT_EXPONENT));
} | [
"public",
"Fiat",
"parseFiat",
"(",
"String",
"currencyCode",
",",
"String",
"str",
")",
"throws",
"NumberFormatException",
"{",
"return",
"Fiat",
".",
"valueOf",
"(",
"currencyCode",
",",
"parseValue",
"(",
"str",
",",
"Fiat",
".",
"SMALLEST_UNIT_EXPONENT",
")"... | Parse a human readable fiat value to a {@link Fiat} instance.
@throws NumberFormatException
if the string cannot be parsed for some reason | [
"Parse",
"a",
"human",
"readable",
"fiat",
"value",
"to",
"a",
"{",
"@link",
"Fiat",
"}",
"instance",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/utils/MonetaryFormat.java#L422-L424 |
VoltDB/voltdb | examples/windowing/procedures/windowing/DeleteOldestToTarget.java | DeleteOldestToTarget.run | public long run(String partitionValue, long maxTotalRows, long targetMaxRowsToDelete) {
"""
Procedure main logic.
@param partitionValue Partitioning key for this procedure.
@param maxTotalRows The desired number of rows per partition.
@param targetMaxRowsToDelete The upper limit on the number of rows to delet... | java | public long run(String partitionValue, long maxTotalRows, long targetMaxRowsToDelete) {
if (targetMaxRowsToDelete <= 0) {
throw new VoltAbortException("maxRowsToDeletePerProc must be > 0.");
}
if (maxTotalRows < 0) {
throw new VoltAbortException("maxTotalRows must be >= 0... | [
"public",
"long",
"run",
"(",
"String",
"partitionValue",
",",
"long",
"maxTotalRows",
",",
"long",
"targetMaxRowsToDelete",
")",
"{",
"if",
"(",
"targetMaxRowsToDelete",
"<=",
"0",
")",
"{",
"throw",
"new",
"VoltAbortException",
"(",
"\"maxRowsToDeletePerProc must ... | Procedure main logic.
@param partitionValue Partitioning key for this procedure.
@param maxTotalRows The desired number of rows per partition.
@param targetMaxRowsToDelete The upper limit on the number of rows to delete per transaction.
@return The number of rows deleted.
@throws VoltAbortException on bad input. | [
"Procedure",
"main",
"logic",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/examples/windowing/procedures/windowing/DeleteOldestToTarget.java#L72-L116 |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/SerDeserializers.java | SerDeserializers.register | public SerDeserializers register(Class<?> type, SerDeserializer deserializer) {
"""
Adds the deserializer to be used for the specified type.
@param type the type, not null
@param deserializer the deserializer, not null
@return this, for chaining, not null
"""
deserializers.put(type, deserializer... | java | public SerDeserializers register(Class<?> type, SerDeserializer deserializer) {
deserializers.put(type, deserializer);
return this;
} | [
"public",
"SerDeserializers",
"register",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"SerDeserializer",
"deserializer",
")",
"{",
"deserializers",
".",
"put",
"(",
"type",
",",
"deserializer",
")",
";",
"return",
"this",
";",
"}"
] | Adds the deserializer to be used for the specified type.
@param type the type, not null
@param deserializer the deserializer, not null
@return this, for chaining, not null | [
"Adds",
"the",
"deserializer",
"to",
"be",
"used",
"for",
"the",
"specified",
"type",
"."
] | train | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/SerDeserializers.java#L134-L137 |
bwkimmel/java-util | src/main/java/ca/eandb/util/sql/DbUtil.java | DbUtil.getTypeName | public static String getTypeName(int type, int length, DatabaseMetaData meta) throws SQLException {
"""
Gets the <code>String</code> denoting the specified SQL data type.
@param type The data type to get the name of. Valid type values
consist of the static fields of {@link java.sql.Types}.
@param length The le... | java | public static String getTypeName(int type, int length, DatabaseMetaData meta) throws SQLException {
ResultSet typeInfo = null;
try {
typeInfo = meta.getTypeInfo();
return getTypeName(type, length, typeInfo);
} finally {
close(typeInfo);
}
} | [
"public",
"static",
"String",
"getTypeName",
"(",
"int",
"type",
",",
"int",
"length",
",",
"DatabaseMetaData",
"meta",
")",
"throws",
"SQLException",
"{",
"ResultSet",
"typeInfo",
"=",
"null",
";",
"try",
"{",
"typeInfo",
"=",
"meta",
".",
"getTypeInfo",
"(... | Gets the <code>String</code> denoting the specified SQL data type.
@param type The data type to get the name of. Valid type values
consist of the static fields of {@link java.sql.Types}.
@param length The length to assign to data types for those types
that require a length (e.g., <code>VARCHAR(n)</code>), or zero
to i... | [
"Gets",
"the",
"<code",
">",
"String<",
"/",
"code",
">",
"denoting",
"the",
"specified",
"SQL",
"data",
"type",
"."
] | train | https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/sql/DbUtil.java#L494-L502 |
phax/ph-web | ph-servlet/src/main/java/com/helger/servlet/response/UnifiedResponseDefaultSettings.java | UnifiedResponseDefaultSettings.addResponseHeader | public static void addResponseHeader (@Nonnull @Nonempty final String sName, @Nonnull @Nonempty final String sValue) {
"""
Adds a response header to the response according to the passed name and
value. If an existing header with the same is present, the value is added to
the list so that the header is emitted mo... | java | public static void addResponseHeader (@Nonnull @Nonempty final String sName, @Nonnull @Nonempty final String sValue)
{
ValueEnforcer.notEmpty (sName, "Name");
ValueEnforcer.notEmpty (sValue, "Value");
s_aRWLock.writeLocked ( () -> s_aResponseHeaderMap.addHeader (sName, sValue));
} | [
"public",
"static",
"void",
"addResponseHeader",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sName",
",",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sValue",
")",
"{",
"ValueEnforcer",
".",
"notEmpty",
"(",
"sName",
",",
"\"Name\"",
"... | Adds a response header to the response according to the passed name and
value. If an existing header with the same is present, the value is added to
the list so that the header is emitted more than once.
@param sName
Name of the header. May neither be <code>null</code> nor empty.
@param sValue
Value of the header. May... | [
"Adds",
"a",
"response",
"header",
"to",
"the",
"response",
"according",
"to",
"the",
"passed",
"name",
"and",
"value",
".",
"If",
"an",
"existing",
"header",
"with",
"the",
"same",
"is",
"present",
"the",
"value",
"is",
"added",
"to",
"the",
"list",
"so... | train | https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-servlet/src/main/java/com/helger/servlet/response/UnifiedResponseDefaultSettings.java#L236-L242 |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageManager.java | ImageManager.getMirage | public Mirage getMirage (ImageKey key, Rectangle bounds) {
"""
Like {@link #getMirage(ImageKey)} but that only the specified subimage of the source image
is used to build the mirage.
"""
return getMirage(key, bounds, null);
} | java | public Mirage getMirage (ImageKey key, Rectangle bounds)
{
return getMirage(key, bounds, null);
} | [
"public",
"Mirage",
"getMirage",
"(",
"ImageKey",
"key",
",",
"Rectangle",
"bounds",
")",
"{",
"return",
"getMirage",
"(",
"key",
",",
"bounds",
",",
"null",
")",
";",
"}"
] | Like {@link #getMirage(ImageKey)} but that only the specified subimage of the source image
is used to build the mirage. | [
"Like",
"{"
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageManager.java#L338-L341 |
jamesagnew/hapi-fhir | hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/interceptor/JaxRsExceptionInterceptor.java | JaxRsExceptionInterceptor.convertException | public JaxRsResponseException convertException(final AbstractJaxRsProvider theServer, final Throwable theException) {
"""
This method convert an exception to a JaxRsResponseException
@param theServer the provider
@param theException the exception to convert
@return JaxRsResponseException
"""
if (the... | java | public JaxRsResponseException convertException(final AbstractJaxRsProvider theServer, final Throwable theException) {
if (theServer.withStackTrace()) {
exceptionHandler.setReturnStackTracesForExceptionTypes(Throwable.class);
}
final JaxRsRequest requestDetails = theServer.getRequest(... | [
"public",
"JaxRsResponseException",
"convertException",
"(",
"final",
"AbstractJaxRsProvider",
"theServer",
",",
"final",
"Throwable",
"theException",
")",
"{",
"if",
"(",
"theServer",
".",
"withStackTrace",
"(",
")",
")",
"{",
"exceptionHandler",
".",
"setReturnStack... | This method convert an exception to a JaxRsResponseException
@param theServer the provider
@param theException the exception to convert
@return JaxRsResponseException | [
"This",
"method",
"convert",
"an",
"exception",
"to",
"a",
"JaxRsResponseException"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/interceptor/JaxRsExceptionInterceptor.java#L85-L92 |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/MessageProcessor.java | MessageProcessor.sendWithBinaryData | public MessageId sendWithBinaryData(ProducerConnectionContext context, BasicMessage basicMessage, File file)
throws JMSException, FileNotFoundException {
"""
Same as {@link #sendWithBinaryData(ProducerConnectionContext, BasicMessage, File, Map)} with <code>null</code>
headers.
@throws FileNotFoundE... | java | public MessageId sendWithBinaryData(ProducerConnectionContext context, BasicMessage basicMessage, File file)
throws JMSException, FileNotFoundException {
return sendWithBinaryData(context, basicMessage, new FileInputStream(file), null);
} | [
"public",
"MessageId",
"sendWithBinaryData",
"(",
"ProducerConnectionContext",
"context",
",",
"BasicMessage",
"basicMessage",
",",
"File",
"file",
")",
"throws",
"JMSException",
",",
"FileNotFoundException",
"{",
"return",
"sendWithBinaryData",
"(",
"context",
",",
"ba... | Same as {@link #sendWithBinaryData(ProducerConnectionContext, BasicMessage, File, Map)} with <code>null</code>
headers.
@throws FileNotFoundException if the file does not exist | [
"Same",
"as",
"{",
"@link",
"#sendWithBinaryData",
"(",
"ProducerConnectionContext",
"BasicMessage",
"File",
"Map",
")",
"}",
"with",
"<code",
">",
"null<",
"/",
"code",
">",
"headers",
"."
] | train | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/MessageProcessor.java#L154-L157 |
Samsung/GearVRf | GVRf/Extensions/3DCursor/IODevices/gearwear/PhoneSide/gearwearlibrary/src/main/java/com/samsung/mpl/gearwearlibrary/EventManager.java | EventManager.registerReceiver | public static void registerReceiver(Context context, BroadcastReceiver receiver) {
"""
Register a receiver so it can receive input events.
<p>
You <b>must unregister the receiver</b> once you are done receiving events, otherwise a
memory leak will occur. If you wish to register the same receiver multiple times,... | java | public static void registerReceiver(Context context, BroadcastReceiver receiver) {
context.registerReceiver(receiver, new IntentFilter(ACTION_ACCESSORY_EVENT));
} | [
"public",
"static",
"void",
"registerReceiver",
"(",
"Context",
"context",
",",
"BroadcastReceiver",
"receiver",
")",
"{",
"context",
".",
"registerReceiver",
"(",
"receiver",
",",
"new",
"IntentFilter",
"(",
"ACTION_ACCESSORY_EVENT",
")",
")",
";",
"}"
] | Register a receiver so it can receive input events.
<p>
You <b>must unregister the receiver</b> once you are done receiving events, otherwise a
memory leak will occur. If you wish to register the same receiver multiple times, be sure
to unregister it first.
@param context context in which to register for events
@para... | [
"Register",
"a",
"receiver",
"so",
"it",
"can",
"receive",
"input",
"events",
".",
"<p",
">",
"You",
"<b",
">",
"must",
"unregister",
"the",
"receiver<",
"/",
"b",
">",
"once",
"you",
"are",
"done",
"receiving",
"events",
"otherwise",
"a",
"memory",
"lea... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/3DCursor/IODevices/gearwear/PhoneSide/gearwearlibrary/src/main/java/com/samsung/mpl/gearwearlibrary/EventManager.java#L48-L50 |
Netflix/astyanax | astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeColumnEntityMapper.java | CompositeColumnEntityMapper.fillColumnMutation | public void fillColumnMutation(ColumnListMutation<ByteBuffer> clm, Object entity) {
"""
Add a column based on the provided entity
@param clm
@param entity
"""
try {
ByteBuffer columnName = toColumnName(entity);
ByteBuffer value = valueMapper.toByteBuffer(entity);
... | java | public void fillColumnMutation(ColumnListMutation<ByteBuffer> clm, Object entity) {
try {
ByteBuffer columnName = toColumnName(entity);
ByteBuffer value = valueMapper.toByteBuffer(entity);
clm.putColumn(columnName, value);
} catch(Exception e) {
... | [
"public",
"void",
"fillColumnMutation",
"(",
"ColumnListMutation",
"<",
"ByteBuffer",
">",
"clm",
",",
"Object",
"entity",
")",
"{",
"try",
"{",
"ByteBuffer",
"columnName",
"=",
"toColumnName",
"(",
"entity",
")",
";",
"ByteBuffer",
"value",
"=",
"valueMapper",
... | Add a column based on the provided entity
@param clm
@param entity | [
"Add",
"a",
"column",
"based",
"on",
"the",
"provided",
"entity"
] | train | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeColumnEntityMapper.java#L138-L147 |
galenframework/galen | galen-core/src/main/java/com/galenframework/utils/GalenUtils.java | GalenUtils.resizeScreenshotIfNeeded | public static BufferedImage resizeScreenshotIfNeeded(WebDriver driver, BufferedImage screenshotImage) {
"""
Check the devicePixelRatio and adapts the size of the screenshot as if the ratio was 1.0
@param driver
@param screenshotImage
@return
"""
Double devicePixelRatio = 1.0;
try {
... | java | public static BufferedImage resizeScreenshotIfNeeded(WebDriver driver, BufferedImage screenshotImage) {
Double devicePixelRatio = 1.0;
try {
devicePixelRatio = ((Number) ((JavascriptExecutor) driver).executeScript(JS_RETRIEVE_DEVICE_PIXEL_RATIO)).doubleValue();
} catch (Exception ex... | [
"public",
"static",
"BufferedImage",
"resizeScreenshotIfNeeded",
"(",
"WebDriver",
"driver",
",",
"BufferedImage",
"screenshotImage",
")",
"{",
"Double",
"devicePixelRatio",
"=",
"1.0",
";",
"try",
"{",
"devicePixelRatio",
"=",
"(",
"(",
"Number",
")",
"(",
"(",
... | Check the devicePixelRatio and adapts the size of the screenshot as if the ratio was 1.0
@param driver
@param screenshotImage
@return | [
"Check",
"the",
"devicePixelRatio",
"and",
"adapts",
"the",
"size",
"of",
"the",
"screenshot",
"as",
"if",
"the",
"ratio",
"was",
"1",
".",
"0"
] | train | https://github.com/galenframework/galen/blob/6c7dc1f11d097e6aa49c45d6a77ee688741657a4/galen-core/src/main/java/com/galenframework/utils/GalenUtils.java#L187-L222 |
emfjson/emfjson-jackson | src/main/java/org/emfjson/jackson/utils/EObjects.java | EObjects.createEntry | @SuppressWarnings("unchecked")
public static EObject createEntry(String key, Object value, EClass type) {
"""
Creates a map entry of type string, string.
@param key of entry
@param value of entry
@return entry
"""
if (type == EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY) {
final EObject entr... | java | @SuppressWarnings("unchecked")
public static EObject createEntry(String key, Object value, EClass type) {
if (type == EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY) {
final EObject entry = EcoreUtil.create(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY);
entry.eSet(EcorePackage.Literals.ESTRING_TO_STRI... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"EObject",
"createEntry",
"(",
"String",
"key",
",",
"Object",
"value",
",",
"EClass",
"type",
")",
"{",
"if",
"(",
"type",
"==",
"EcorePackage",
".",
"Literals",
".",
"ESTRING_TO_STRING_M... | Creates a map entry of type string, string.
@param key of entry
@param value of entry
@return entry | [
"Creates",
"a",
"map",
"entry",
"of",
"type",
"string",
"string",
"."
] | train | https://github.com/emfjson/emfjson-jackson/blob/5f4488d1b07d499003351606cf76ee0c4ac39964/src/main/java/org/emfjson/jackson/utils/EObjects.java#L75-L95 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/MapTilePathModel.java | MapTilePathModel.isBlocked | private boolean isBlocked(Pathfindable mover, int tx, int ty) {
"""
Check if all objects id are non blocking.
@param mover The mover reference.
@param tx The horizontal tile to check.
@param ty The vertical tile to check.
@return <code>true</code> if blocked, <code>false</code> else.
"""
final Co... | java | private boolean isBlocked(Pathfindable mover, int tx, int ty)
{
final Collection<Integer> ids = getObjectsId(tx, ty);
int ignoredCount = 0;
for (final Integer id : ids)
{
if (mover.isIgnoredId(id))
{
ignoredCount++;
}
}
... | [
"private",
"boolean",
"isBlocked",
"(",
"Pathfindable",
"mover",
",",
"int",
"tx",
",",
"int",
"ty",
")",
"{",
"final",
"Collection",
"<",
"Integer",
">",
"ids",
"=",
"getObjectsId",
"(",
"tx",
",",
"ty",
")",
";",
"int",
"ignoredCount",
"=",
"0",
";",... | Check if all objects id are non blocking.
@param mover The mover reference.
@param tx The horizontal tile to check.
@param ty The vertical tile to check.
@return <code>true</code> if blocked, <code>false</code> else. | [
"Check",
"if",
"all",
"objects",
"id",
"are",
"non",
"blocking",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/MapTilePathModel.java#L108-L120 |
Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/configuration/ColumnPrinter.java | ColumnPrinter.addValue | void addValue(String columnName, String value) {
"""
Add a value to the first column with the given name
@param columnName name of the column to add to
@param value value to add
"""
addValue(columnNames.indexOf(columnName), value);
} | java | void addValue(String columnName, String value)
{
addValue(columnNames.indexOf(columnName), value);
} | [
"void",
"addValue",
"(",
"String",
"columnName",
",",
"String",
"value",
")",
"{",
"addValue",
"(",
"columnNames",
".",
"indexOf",
"(",
"columnName",
")",
",",
"value",
")",
";",
"}"
] | Add a value to the first column with the given name
@param columnName name of the column to add to
@param value value to add | [
"Add",
"a",
"value",
"to",
"the",
"first",
"column",
"with",
"the",
"given",
"name"
] | train | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/configuration/ColumnPrinter.java#L60-L63 |
dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/FamilyBuilderImpl.java | FamilyBuilderImpl.addWifeToFamily | public Wife addWifeToFamily(final Family family, final Person person) {
"""
Add a person as the wife in a family.
@param family the family
@param person the person
@return the wife object
"""
if (family == null || person == null) {
return new Wife();
}
final FamS famS =... | java | public Wife addWifeToFamily(final Family family, final Person person) {
if (family == null || person == null) {
return new Wife();
}
final FamS famS = new FamS(person, "FAMS",
new ObjectId(family.getString()));
final Wife wife = new Wife(family, "Wife",
... | [
"public",
"Wife",
"addWifeToFamily",
"(",
"final",
"Family",
"family",
",",
"final",
"Person",
"person",
")",
"{",
"if",
"(",
"family",
"==",
"null",
"||",
"person",
"==",
"null",
")",
"{",
"return",
"new",
"Wife",
"(",
")",
";",
"}",
"final",
"FamS",
... | Add a person as the wife in a family.
@param family the family
@param person the person
@return the wife object | [
"Add",
"a",
"person",
"as",
"the",
"wife",
"in",
"a",
"family",
"."
] | train | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/FamilyBuilderImpl.java#L121-L132 |
allure-framework/allure1 | allure-report-data/src/main/java/ru/yandex/qatools/allure/data/utils/AllureReportUtils.java | AllureReportUtils.createDirectory | public static File createDirectory(File parent, String name) {
"""
Create directory with given name in specified directory. Check created directory using
{@link #checkDirectory(java.io.File)}
@param parent specified parent directory
@param name given name for directory to create
@return created directory
... | java | public static File createDirectory(File parent, String name) {
File created = new File(parent, name);
checkDirectory(created);
return created;
} | [
"public",
"static",
"File",
"createDirectory",
"(",
"File",
"parent",
",",
"String",
"name",
")",
"{",
"File",
"created",
"=",
"new",
"File",
"(",
"parent",
",",
"name",
")",
";",
"checkDirectory",
"(",
"created",
")",
";",
"return",
"created",
";",
"}"
... | Create directory with given name in specified directory. Check created directory using
{@link #checkDirectory(java.io.File)}
@param parent specified parent directory
@param name given name for directory to create
@return created directory
@throws ReportGenerationException if can't create specified directory | [
"Create",
"directory",
"with",
"given",
"name",
"in",
"specified",
"directory",
".",
"Check",
"created",
"directory",
"using",
"{",
"@link",
"#checkDirectory",
"(",
"java",
".",
"io",
".",
"File",
")",
"}"
] | train | https://github.com/allure-framework/allure1/blob/9a816fa05d8b894a917b7ebb7fd1a4056dee4693/allure-report-data/src/main/java/ru/yandex/qatools/allure/data/utils/AllureReportUtils.java#L38-L42 |
zaproxy/zaproxy | src/org/zaproxy/zap/control/AddOn.java | AddOn.dependsOn | public boolean dependsOn(Extension extension, AddOn addOn) {
"""
Tells whether or not the given {@code extension} has a (direct) dependency on the given {@code addOn} (including
version).
@param extension the extension that will be checked
@param addOn the add-on that will be checked in the dependencies on th... | java | public boolean dependsOn(Extension extension, AddOn addOn) {
String classname = extension.getClass().getCanonicalName();
for (ExtensionWithDeps extensionWithDeps : extensionsWithDeps) {
if (extensionWithDeps.getClassname().equals(classname)) {
return dependsOn(extension... | [
"public",
"boolean",
"dependsOn",
"(",
"Extension",
"extension",
",",
"AddOn",
"addOn",
")",
"{",
"String",
"classname",
"=",
"extension",
".",
"getClass",
"(",
")",
".",
"getCanonicalName",
"(",
")",
";",
"for",
"(",
"ExtensionWithDeps",
"extensionWithDeps",
... | Tells whether or not the given {@code extension} has a (direct) dependency on the given {@code addOn} (including
version).
@param extension the extension that will be checked
@param addOn the add-on that will be checked in the dependencies on the extension
@return {@code true} if the extension depends on the given add... | [
"Tells",
"whether",
"or",
"not",
"the",
"given",
"{",
"@code",
"extension",
"}",
"has",
"a",
"(",
"direct",
")",
"dependency",
"on",
"the",
"given",
"{",
"@code",
"addOn",
"}",
"(",
"including",
"version",
")",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/control/AddOn.java#L1392-L1401 |
michel-kraemer/bson4jackson | src/main/java/de/undercouch/bson4jackson/BsonGenerator.java | BsonGenerator._writeStartObject | protected void _writeStartObject(boolean array) throws IOException {
"""
Creates a new embedded document or array
@param array true if the embedded object is an array
@throws IOException if the document could not be created
"""
_writeArrayFieldNameIfNeeded();
if (_currentDocument != null) {
//embedded... | java | protected void _writeStartObject(boolean array) throws IOException {
_writeArrayFieldNameIfNeeded();
if (_currentDocument != null) {
//embedded document/array
_buffer.putByte(_typeMarker, array ? BsonConstants.TYPE_ARRAY :
BsonConstants.TYPE_DOCUMENT);
}
_currentDocument = new DocumentInfo(_currentDoc... | [
"protected",
"void",
"_writeStartObject",
"(",
"boolean",
"array",
")",
"throws",
"IOException",
"{",
"_writeArrayFieldNameIfNeeded",
"(",
")",
";",
"if",
"(",
"_currentDocument",
"!=",
"null",
")",
"{",
"//embedded document/array",
"_buffer",
".",
"putByte",
"(",
... | Creates a new embedded document or array
@param array true if the embedded object is an array
@throws IOException if the document could not be created | [
"Creates",
"a",
"new",
"embedded",
"document",
"or",
"array"
] | train | https://github.com/michel-kraemer/bson4jackson/blob/32d2ab3c516b3c07490fdfcf0c5e4ed0a2ee3979/src/main/java/de/undercouch/bson4jackson/BsonGenerator.java#L337-L346 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Assert.java | Assert.notEmpty | public static Object[] notEmpty(Object[] array, String errorMsgTemplate, Object... params) throws IllegalArgumentException {
"""
断言给定数组是否包含元素,数组必须不为 {@code null} 且至少包含一个元素
<pre class="code">
Assert.notEmpty(array, "The array must have elements");
</pre>
@param array 被检查的数组
@param errorMsgTemplate 异常时的消息模板... | java | public static Object[] notEmpty(Object[] array, String errorMsgTemplate, Object... params) throws IllegalArgumentException {
if (ArrayUtil.isEmpty(array)) {
throw new IllegalArgumentException(StrUtil.format(errorMsgTemplate, params));
}
return array;
} | [
"public",
"static",
"Object",
"[",
"]",
"notEmpty",
"(",
"Object",
"[",
"]",
"array",
",",
"String",
"errorMsgTemplate",
",",
"Object",
"...",
"params",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"ArrayUtil",
".",
"isEmpty",
"(",
"array",
")"... | 断言给定数组是否包含元素,数组必须不为 {@code null} 且至少包含一个元素
<pre class="code">
Assert.notEmpty(array, "The array must have elements");
</pre>
@param array 被检查的数组
@param errorMsgTemplate 异常时的消息模板
@param params 参数列表
@return 被检查的数组
@throws IllegalArgumentException if the object array is {@code null} or has no elements | [
"断言给定数组是否包含元素,数组必须不为",
"{",
"@code",
"null",
"}",
"且至少包含一个元素"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Assert.java#L278-L283 |
fernandospr/java-wns | src/main/java/ar/com/fernandospr/wns/WnsService.java | WnsService.pushRaw | public List<WnsNotificationResponse> pushRaw(List<String> channelUris, WnsRaw raw) throws WnsException {
"""
Pushes a raw message to channelUris
@param channelUris
@param raw which should be built with {@link ar.com.fernandospr.wns.model.builders.WnsRawBuilder}
@return list of WnsNotificationResponse for each c... | java | public List<WnsNotificationResponse> pushRaw(List<String> channelUris, WnsRaw raw) throws WnsException {
return this.pushRaw(channelUris, null, raw);
} | [
"public",
"List",
"<",
"WnsNotificationResponse",
">",
"pushRaw",
"(",
"List",
"<",
"String",
">",
"channelUris",
",",
"WnsRaw",
"raw",
")",
"throws",
"WnsException",
"{",
"return",
"this",
".",
"pushRaw",
"(",
"channelUris",
",",
"null",
",",
"raw",
")",
... | Pushes a raw message to channelUris
@param channelUris
@param raw which should be built with {@link ar.com.fernandospr.wns.model.builders.WnsRawBuilder}
@return list of WnsNotificationResponse for each channelUri, please see response headers from <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465435.as... | [
"Pushes",
"a",
"raw",
"message",
"to",
"channelUris"
] | train | https://github.com/fernandospr/java-wns/blob/cd621b9c17d1e706f6284e0913531d834904a90d/src/main/java/ar/com/fernandospr/wns/WnsService.java#L237-L239 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cart_cartId_csp2_options_GET | public ArrayList<OvhGenericOptionDefinition> cart_cartId_csp2_options_GET(String cartId, String planCode) throws IOException {
"""
Get informations about SaaS CSP2 options
REST: GET /order/cart/{cartId}/csp2/options
@param cartId [required] Cart identifier
@param planCode [required] Identifier of a SaaS CSP2 ... | java | public ArrayList<OvhGenericOptionDefinition> cart_cartId_csp2_options_GET(String cartId, String planCode) throws IOException {
String qPath = "/order/cart/{cartId}/csp2/options";
StringBuilder sb = path(qPath, cartId);
query(sb, "planCode", planCode);
String resp = execN(qPath, "GET", sb.toString(), null);
re... | [
"public",
"ArrayList",
"<",
"OvhGenericOptionDefinition",
">",
"cart_cartId_csp2_options_GET",
"(",
"String",
"cartId",
",",
"String",
"planCode",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cart/{cartId}/csp2/options\"",
";",
"StringBuilder",
"sb... | Get informations about SaaS CSP2 options
REST: GET /order/cart/{cartId}/csp2/options
@param cartId [required] Cart identifier
@param planCode [required] Identifier of a SaaS CSP2 main offer | [
"Get",
"informations",
"about",
"SaaS",
"CSP2",
"options"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L10293-L10299 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/JMFileAppender.java | JMFileAppender.appendAndClose | public static Path appendAndClose(String filePath, Charset charset,
String writingString) {
"""
Append and close path.
@param filePath the file path
@param charset the charset
@param writingString the writing string
@return the path
"""
return new JMFileAppender(filePath, c... | java | public static Path appendAndClose(String filePath, Charset charset,
String writingString) {
return new JMFileAppender(filePath, charset).append(writingString)
.closeAndGetFilePath();
} | [
"public",
"static",
"Path",
"appendAndClose",
"(",
"String",
"filePath",
",",
"Charset",
"charset",
",",
"String",
"writingString",
")",
"{",
"return",
"new",
"JMFileAppender",
"(",
"filePath",
",",
"charset",
")",
".",
"append",
"(",
"writingString",
")",
"."... | Append and close path.
@param filePath the file path
@param charset the charset
@param writingString the writing string
@return the path | [
"Append",
"and",
"close",
"path",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/JMFileAppender.java#L99-L103 |
trustathsh/ifmapj | src/main/java/util/CanonicalXML.java | CanonicalXML.startPrefixMapping | @Override
public void startPrefixMapping(String prefix, String uri) throws SAXException {
"""
Receive notification of the start of a Namespace mapping.
<p/>
<p>By default, do nothing. Application writers may override this
method in a subclass to take specific actions at the start of
each Namespace prefix sco... | java | @Override
public void startPrefixMapping(String prefix, String uri) throws SAXException {
mNamespaces.addAttribute("", prefix, prefix.equals("") ? "xmlns" : "xmlns:" + prefix, "CDATA", uri);
if (!"".equals(uri)) {
try {
URI u = new URI(uri);
if (!u.isAbsolute()) {
System.err.println("*** (Canonical... | [
"@",
"Override",
"public",
"void",
"startPrefixMapping",
"(",
"String",
"prefix",
",",
"String",
"uri",
")",
"throws",
"SAXException",
"{",
"mNamespaces",
".",
"addAttribute",
"(",
"\"\"",
",",
"prefix",
",",
"prefix",
".",
"equals",
"(",
"\"\"",
")",
"?",
... | Receive notification of the start of a Namespace mapping.
<p/>
<p>By default, do nothing. Application writers may override this
method in a subclass to take specific actions at the start of
each Namespace prefix scope (such as storing the prefix mapping).</p>
@param prefix The Namespace prefix being declared.
@param ... | [
"Receive",
"notification",
"of",
"the",
"start",
"of",
"a",
"Namespace",
"mapping",
".",
"<p",
"/",
">",
"<p",
">",
"By",
"default",
"do",
"nothing",
".",
"Application",
"writers",
"may",
"override",
"this",
"method",
"in",
"a",
"subclass",
"to",
"take",
... | train | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/util/CanonicalXML.java#L173-L186 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java | EnvironmentSettingsInner.stopAsync | public Observable<Void> stopAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) {
"""
Starts a template by starting all resources inside the template. This operation can take a while to complete.
@param resourceGroupName The name of the resource group.
@param l... | java | public Observable<Void> stopAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) {
return stopWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
... | [
"public",
"Observable",
"<",
"Void",
">",
"stopAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"labName",
",",
"String",
"environmentSettingName",
")",
"{",
"return",
"stopWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Starts a template by starting all resources inside the template. This operation can take a while to complete.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@param environmentSettingName The name of the environment Setting... | [
"Starts",
"a",
"template",
"by",
"starting",
"all",
"resources",
"inside",
"the",
"template",
".",
"This",
"operation",
"can",
"take",
"a",
"while",
"to",
"complete",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java#L1614-L1621 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java | RegionDiskClient.insertRegionDisk | @BetaApi
public final Operation insertRegionDisk(ProjectRegionName region, Disk diskResource) {
"""
Creates a persistent regional disk in the specified project using the data included in the
request.
<p>Sample code:
<pre><code>
try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
Projec... | java | @BetaApi
public final Operation insertRegionDisk(ProjectRegionName region, Disk diskResource) {
InsertRegionDiskHttpRequest request =
InsertRegionDiskHttpRequest.newBuilder()
.setRegion(region == null ? null : region.toString())
.setDiskResource(diskResource)
.build();... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"insertRegionDisk",
"(",
"ProjectRegionName",
"region",
",",
"Disk",
"diskResource",
")",
"{",
"InsertRegionDiskHttpRequest",
"request",
"=",
"InsertRegionDiskHttpRequest",
".",
"newBuilder",
"(",
")",
".",
"setRegion",
... | Creates a persistent regional disk in the specified project using the data included in the
request.
<p>Sample code:
<pre><code>
try (RegionDiskClient regionDiskClient = RegionDiskClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
Disk diskResource = Disk.newBuilder().build();... | [
"Creates",
"a",
"persistent",
"regional",
"disk",
"in",
"the",
"specified",
"project",
"using",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/RegionDiskClient.java#L489-L498 |
UrielCh/ovh-java-sdk | ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java | ApiOvhPackxdsl.packName_migration_offers_POST | public OvhAsyncTask<OvhMigrationOfferResponse> packName_migration_offers_POST(String packName) throws IOException {
"""
Get the possibilities of migration offers available
REST: POST /pack/xdsl/{packName}/migration/offers
@param packName [required] The internal name of your pack
"""
String qPath = "/pack... | java | public OvhAsyncTask<OvhMigrationOfferResponse> packName_migration_offers_POST(String packName) throws IOException {
String qPath = "/pack/xdsl/{packName}/migration/offers";
StringBuilder sb = path(qPath, packName);
String resp = exec(qPath, "POST", sb.toString(), null);
return convertTo(resp, t11);
} | [
"public",
"OvhAsyncTask",
"<",
"OvhMigrationOfferResponse",
">",
"packName_migration_offers_POST",
"(",
"String",
"packName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/pack/xdsl/{packName}/migration/offers\"",
";",
"StringBuilder",
"sb",
"=",
"path",
... | Get the possibilities of migration offers available
REST: POST /pack/xdsl/{packName}/migration/offers
@param packName [required] The internal name of your pack | [
"Get",
"the",
"possibilities",
"of",
"migration",
"offers",
"available"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-packxdsl/src/main/java/net/minidev/ovh/api/ApiOvhPackxdsl.java#L957-L962 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeContext.java | BindTypeContext.getBindMapperName | public String getBindMapperName(BindTypeContext context, TypeName typeName) {
"""
Gets the bind mapper name.
@param context the context
@param typeName the type name
@return the bind mapper name
"""
Converter<String, String> format = CaseFormat.UPPER_CAMEL.converterTo(CaseFormat.LOWER_CAMEL);
TypeName... | java | public String getBindMapperName(BindTypeContext context, TypeName typeName) {
Converter<String, String> format = CaseFormat.UPPER_CAMEL.converterTo(CaseFormat.LOWER_CAMEL);
TypeName bindMapperName=TypeUtility.mergeTypeNameWithSuffix(typeName,BindTypeBuilder.SUFFIX);
String simpleName=format.convert(TypeUtility.si... | [
"public",
"String",
"getBindMapperName",
"(",
"BindTypeContext",
"context",
",",
"TypeName",
"typeName",
")",
"{",
"Converter",
"<",
"String",
",",
"String",
">",
"format",
"=",
"CaseFormat",
".",
"UPPER_CAMEL",
".",
"converterTo",
"(",
"CaseFormat",
".",
"LOWER... | Gets the bind mapper name.
@param context the context
@param typeName the type name
@return the bind mapper name | [
"Gets",
"the",
"bind",
"mapper",
"name",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeContext.java#L70-L93 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/indexing/BooleanIndexing.java | BooleanIndexing.firstIndex | public static INDArray firstIndex(INDArray array, Condition condition, int... dimension) {
"""
This method returns first index matching given condition along given dimensions
PLEASE NOTE: This method will return -1 values for missing conditions
@param array
@param condition
@param dimension
@return
""... | java | public static INDArray firstIndex(INDArray array, Condition condition, int... dimension) {
if (!(condition instanceof BaseCondition))
throw new UnsupportedOperationException("Only static Conditions are supported");
return Nd4j.getExecutioner().exec(new FirstIndex(array, condition, dimension... | [
"public",
"static",
"INDArray",
"firstIndex",
"(",
"INDArray",
"array",
",",
"Condition",
"condition",
",",
"int",
"...",
"dimension",
")",
"{",
"if",
"(",
"!",
"(",
"condition",
"instanceof",
"BaseCondition",
")",
")",
"throw",
"new",
"UnsupportedOperationExcep... | This method returns first index matching given condition along given dimensions
PLEASE NOTE: This method will return -1 values for missing conditions
@param array
@param condition
@param dimension
@return | [
"This",
"method",
"returns",
"first",
"index",
"matching",
"given",
"condition",
"along",
"given",
"dimensions"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/indexing/BooleanIndexing.java#L298-L303 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/tree/GISTreeSetUtil.java | GISTreeSetUtil.createNode | private static <P extends GISPrimitive, N extends AbstractGISTreeSetNode<P, N>>
N createNode(N parent, IcosepQuadTreeZone region, GISTreeSetNodeFactory<P, N> builder) {
"""
Create a child node that supports the specified region.
@param <P> is the type of the primitives.
@param parent is the node in which the... | java | private static <P extends GISPrimitive, N extends AbstractGISTreeSetNode<P, N>>
N createNode(N parent, IcosepQuadTreeZone region, GISTreeSetNodeFactory<P, N> builder) {
Rectangle2d area = parent.getAreaBounds();
if (region == IcosepQuadTreeZone.ICOSEP) {
return builder.newNode(
IcosepQuadTreeZone.ICOSEP... | [
"private",
"static",
"<",
"P",
"extends",
"GISPrimitive",
",",
"N",
"extends",
"AbstractGISTreeSetNode",
"<",
"P",
",",
"N",
">",
">",
"N",
"createNode",
"(",
"N",
"parent",
",",
"IcosepQuadTreeZone",
"region",
",",
"GISTreeSetNodeFactory",
"<",
"P",
",",
"N... | Create a child node that supports the specified region.
@param <P> is the type of the primitives.
@param parent is the node in which the new node will be inserted.
@param region is the region that must be covered by the new node.
@param element is the element to initially put inside the node.
@param builder permits to... | [
"Create",
"a",
"child",
"node",
"that",
"supports",
"the",
"specified",
"region",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/tree/GISTreeSetUtil.java#L435-L465 |
aws/aws-sdk-java | aws-java-sdk-config/src/main/java/com/amazonaws/services/config/model/RemediationConfiguration.java | RemediationConfiguration.withParameters | public RemediationConfiguration withParameters(java.util.Map<String, RemediationParameterValue> parameters) {
"""
<p>
An object of the RemediationParameterValue.
</p>
@param parameters
An object of the RemediationParameterValue.
@return Returns a reference to this object so that method calls can be chained ... | java | public RemediationConfiguration withParameters(java.util.Map<String, RemediationParameterValue> parameters) {
setParameters(parameters);
return this;
} | [
"public",
"RemediationConfiguration",
"withParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"RemediationParameterValue",
">",
"parameters",
")",
"{",
"setParameters",
"(",
"parameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
An object of the RemediationParameterValue.
</p>
@param parameters
An object of the RemediationParameterValue.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"An",
"object",
"of",
"the",
"RemediationParameterValue",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-config/src/main/java/com/amazonaws/services/config/model/RemediationConfiguration.java#L283-L286 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/search/bingimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/search/imagesearch/implementation/BingImagesImpl.java | BingImagesImpl.detailsWithServiceResponseAsync | public Observable<ServiceResponse<ImageInsights>> detailsWithServiceResponseAsync(String query, DetailsOptionalParameter detailsOptionalParameter) {
"""
The Image Detail Search API lets you search on Bing and get back insights about an image, such as webpages that include the image. This section provides technical... | java | public Observable<ServiceResponse<ImageInsights>> detailsWithServiceResponseAsync(String query, DetailsOptionalParameter detailsOptionalParameter) {
if (query == null) {
throw new IllegalArgumentException("Parameter query is required and cannot be null.");
}
final String acceptLangua... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"ImageInsights",
">",
">",
"detailsWithServiceResponseAsync",
"(",
"String",
"query",
",",
"DetailsOptionalParameter",
"detailsOptionalParameter",
")",
"{",
"if",
"(",
"query",
"==",
"null",
")",
"{",
"throw",
"ne... | The Image Detail Search API lets you search on Bing and get back insights about an image, such as webpages that include the image. This section provides technical details about the query parameters and headers that you use to request insights of images and the JSON response objects that contain them. For examples that ... | [
"The",
"Image",
"Detail",
"Search",
"API",
"lets",
"you",
"search",
"on",
"Bing",
"and",
"get",
"back",
"insights",
"about",
"an",
"image",
"such",
"as",
"webpages",
"that",
"include",
"the",
"image",
".",
"This",
"section",
"provides",
"technical",
"details... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/search/bingimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/search/imagesearch/implementation/BingImagesImpl.java#L519-L544 |
fabric8io/fabric8-forge | addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCatalogHelper.java | CamelCatalogHelper.isDefaultValue | public static boolean isDefaultValue(CamelCatalog camelCatalog, String scheme, String key, String value) {
"""
Checks whether the given value is matching the default value from the given component.
@param scheme the component name
@param key the option key
@param value the option value
@return <tt>true</... | java | public static boolean isDefaultValue(CamelCatalog camelCatalog, String scheme, String key, String value) {
// use the camel catalog
String json = camelCatalog.componentJSonSchema(scheme);
if (json == null) {
throw new IllegalArgumentException("Could not find catalog entry for compone... | [
"public",
"static",
"boolean",
"isDefaultValue",
"(",
"CamelCatalog",
"camelCatalog",
",",
"String",
"scheme",
",",
"String",
"key",
",",
"String",
"value",
")",
"{",
"// use the camel catalog",
"String",
"json",
"=",
"camelCatalog",
".",
"componentJSonSchema",
"(",... | Checks whether the given value is matching the default value from the given component.
@param scheme the component name
@param key the option key
@param value the option value
@return <tt>true</tt> if matching the default value, <tt>false</tt> otherwise | [
"Checks",
"whether",
"the",
"given",
"value",
"is",
"matching",
"the",
"default",
"value",
"from",
"the",
"given",
"component",
"."
] | train | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelCatalogHelper.java#L152-L170 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/internal/operators/observable/ObservableReplay.java | ObservableReplay.createFrom | @SuppressWarnings("unchecked")
public static <T> ConnectableObservable<T> createFrom(ObservableSource<? extends T> source) {
"""
Creates a replaying ConnectableObservable with an unbounded buffer.
@param <T> the value type
@param source the source observable
@return the new ConnectableObservable instance
... | java | @SuppressWarnings("unchecked")
public static <T> ConnectableObservable<T> createFrom(ObservableSource<? extends T> source) {
ObservableSource<T> sourceCast = (ObservableSource<T>) source;
return create(sourceCast, DEFAULT_UNBOUNDED_FACTORY);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"ConnectableObservable",
"<",
"T",
">",
"createFrom",
"(",
"ObservableSource",
"<",
"?",
"extends",
"T",
">",
"source",
")",
"{",
"ObservableSource",
"<",
"T",
">",
"sourc... | Creates a replaying ConnectableObservable with an unbounded buffer.
@param <T> the value type
@param source the source observable
@return the new ConnectableObservable instance | [
"Creates",
"a",
"replaying",
"ConnectableObservable",
"with",
"an",
"unbounded",
"buffer",
"."
] | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/internal/operators/observable/ObservableReplay.java#L85-L89 |
thelinmichael/spotify-web-api-java | src/main/java/com/wrapper/spotify/SpotifyApi.java | SpotifyApi.followArtistsOrUsers | public FollowArtistsOrUsersRequest.Builder followArtistsOrUsers(ModelObjectType type, String[] ids) {
"""
Add the current user as a follower of one or more artists or other Spotify users.
@param type The ID type: either artist or user.
@param ids A list of the artist or the user Spotify IDs. Maximum: 50 IDs.
... | java | public FollowArtistsOrUsersRequest.Builder followArtistsOrUsers(ModelObjectType type, String[] ids) {
return new FollowArtistsOrUsersRequest.Builder(accessToken)
.setDefaults(httpManager, scheme, host, port)
.type(type)
.ids(concat(ids, ','));
} | [
"public",
"FollowArtistsOrUsersRequest",
".",
"Builder",
"followArtistsOrUsers",
"(",
"ModelObjectType",
"type",
",",
"String",
"[",
"]",
"ids",
")",
"{",
"return",
"new",
"FollowArtistsOrUsersRequest",
".",
"Builder",
"(",
"accessToken",
")",
".",
"setDefaults",
"(... | Add the current user as a follower of one or more artists or other Spotify users.
@param type The ID type: either artist or user.
@param ids A list of the artist or the user Spotify IDs. Maximum: 50 IDs.
@return A {@link FollowArtistsOrUsersRequest.Builder}.
@see <a href="https://developer.spotify.com/web-api/user-gu... | [
"Add",
"the",
"current",
"user",
"as",
"a",
"follower",
"of",
"one",
"or",
"more",
"artists",
"or",
"other",
"Spotify",
"users",
"."
] | train | https://github.com/thelinmichael/spotify-web-api-java/blob/c06b8512344c0310d0c1df362fa267879021da2e/src/main/java/com/wrapper/spotify/SpotifyApi.java#L647-L652 |
RestComm/sip-servlets | sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/rfc5626/RFC5626Helper.java | RFC5626Helper.decodeFlowToken | private static HopImpl decodeFlowToken(String user) throws IncorrectFlowIdentifierException {
"""
/* Excerpt from RFC 5626 Section 5.3.1
Proxies that used the example algorithm described in Section 5.2 to
form a flow token follow the procedures below to determine the
correct flow. To decode the flow token, tak... | java | private static HopImpl decodeFlowToken(String user) throws IncorrectFlowIdentifierException {
if(logger.isDebugEnabled()) {
logger.debug("Decoding RFC 5626 Flow token " + user);
}
byte[] byteConcat = Base64.decodeBase64(user.getBytes());
if(logger.isDebugEnabled()) {
logger.debug("Decoding RFC 5626 Flow... | [
"private",
"static",
"HopImpl",
"decodeFlowToken",
"(",
"String",
"user",
")",
"throws",
"IncorrectFlowIdentifierException",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Decoding RFC 5626 Flow token \"",
"+",
... | /* Excerpt from RFC 5626 Section 5.3.1
Proxies that used the example algorithm described in Section 5.2 to
form a flow token follow the procedures below to determine the
correct flow. To decode the flow token, take the flow identifier in
the user portion of the URI and base64 decode it, then verify the
HMAC is correct... | [
"/",
"*",
"Excerpt",
"from",
"RFC",
"5626",
"Section",
"5",
".",
"3",
".",
"1",
"Proxies",
"that",
"used",
"the",
"example",
"algorithm",
"described",
"in",
"Section",
"5",
".",
"2",
"to",
"form",
"a",
"flow",
"token",
"follow",
"the",
"procedures",
"b... | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/rfc5626/RFC5626Helper.java#L231-L261 |
ag-gipp/MathMLTools | mathml-core/src/main/java/com/formulasearchengine/mathmltools/mml/MathDoc.java | MathDoc.highlightConsecutiveIdentifiers | public void highlightConsecutiveIdentifiers(List<Integer> hashes, boolean backward) {
"""
Highlights consecutive occurrences of identifiers.
@param hashes list of content identifier hashes to highlight
@param backward if true the first identifier is searched from the end of the expression
"""
fin... | java | public void highlightConsecutiveIdentifiers(List<Integer> hashes, boolean backward) {
final int startPos = highlightFirstIdentifier(hashes.get(0), backward);
if (startPos >= 0) {
highlightRemainingIdentifiers(hashes.subList(1, hashes.size()), startPos);
}
} | [
"public",
"void",
"highlightConsecutiveIdentifiers",
"(",
"List",
"<",
"Integer",
">",
"hashes",
",",
"boolean",
"backward",
")",
"{",
"final",
"int",
"startPos",
"=",
"highlightFirstIdentifier",
"(",
"hashes",
".",
"get",
"(",
"0",
")",
",",
"backward",
")",
... | Highlights consecutive occurrences of identifiers.
@param hashes list of content identifier hashes to highlight
@param backward if true the first identifier is searched from the end of the expression | [
"Highlights",
"consecutive",
"occurrences",
"of",
"identifiers",
"."
] | train | https://github.com/ag-gipp/MathMLTools/blob/77c69b6366a5b8720796d1cd9d155ba26c2f1b20/mathml-core/src/main/java/com/formulasearchengine/mathmltools/mml/MathDoc.java#L290-L295 |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/repository/download/RepositoryDownloadUtil.java | RepositoryDownloadUtil.isPublicAsset | public static boolean isPublicAsset(ResourceType resourceType, RepositoryResource installResource) {
"""
Checks if Feature or Addon has visibility public or install
OR checks if the resource is a Product sample or open source to see if it is a public asset.
@param resourceType - type of repository
@param inst... | java | public static boolean isPublicAsset(ResourceType resourceType, RepositoryResource installResource) {
if (resourceType.equals(ResourceType.FEATURE) || resourceType.equals(ResourceType.ADDON)) {
EsaResource esar = ((EsaResource) installResource);
if (esar.getVisibility().equals(Visibility.... | [
"public",
"static",
"boolean",
"isPublicAsset",
"(",
"ResourceType",
"resourceType",
",",
"RepositoryResource",
"installResource",
")",
"{",
"if",
"(",
"resourceType",
".",
"equals",
"(",
"ResourceType",
".",
"FEATURE",
")",
"||",
"resourceType",
".",
"equals",
"(... | Checks if Feature or Addon has visibility public or install
OR checks if the resource is a Product sample or open source to see if it is a public asset.
@param resourceType - type of repository
@param installResource - represents a resouce in a repository
@return - true if the resource is visible to the public | [
"Checks",
"if",
"Feature",
"or",
"Addon",
"has",
"visibility",
"public",
"or",
"install",
"OR",
"checks",
"if",
"the",
"resource",
"is",
"a",
"Product",
"sample",
"or",
"open",
"source",
"to",
"see",
"if",
"it",
"is",
"a",
"public",
"asset",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/repository/download/RepositoryDownloadUtil.java#L84-L95 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java | ClassUtil.invoke | public static <T> T invoke(String className, String methodName, boolean isSingleton, Object... args) {
"""
执行方法<br>
可执行Private方法,也可执行static方法<br>
执行非static方法时,必须满足对象有默认构造方法<br>
@param <T> 对象类型
@param className 类名,完整类路径
@param methodName 方法名
@param isSingleton 是否为单例对象,如果此参数为false,每次执行方法时创建一个新对象
@param args... | java | public static <T> T invoke(String className, String methodName, boolean isSingleton, Object... args) {
Class<Object> clazz = loadClass(className);
try {
final Method method = getDeclaredMethod(clazz, methodName, getClasses(args));
if (null == method) {
throw new NoSuchMethodException(StrUtil.format("... | [
"public",
"static",
"<",
"T",
">",
"T",
"invoke",
"(",
"String",
"className",
",",
"String",
"methodName",
",",
"boolean",
"isSingleton",
",",
"Object",
"...",
"args",
")",
"{",
"Class",
"<",
"Object",
">",
"clazz",
"=",
"loadClass",
"(",
"className",
")... | 执行方法<br>
可执行Private方法,也可执行static方法<br>
执行非static方法时,必须满足对象有默认构造方法<br>
@param <T> 对象类型
@param className 类名,完整类路径
@param methodName 方法名
@param isSingleton 是否为单例对象,如果此参数为false,每次执行方法时创建一个新对象
@param args 参数,必须严格对应指定方法的参数类型和数量
@return 返回结果 | [
"执行方法<br",
">",
"可执行Private方法,也可执行static方法<br",
">",
"执行非static方法时,必须满足对象有默认构造方法<br",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java#L681-L696 |
glyptodon/guacamole-client | extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/ModeledUser.java | ModeledUser.isActive | private boolean isActive(Calendar activeStart, Calendar inactiveStart) {
"""
Given a time when a particular state changes from inactive to active,
and a time when a particular state changes from active to inactive,
determines whether that state is currently active.
@param activeStart
The time at which the st... | java | private boolean isActive(Calendar activeStart, Calendar inactiveStart) {
// If end occurs before start, convert to equivalent case where start
// start is before end
if (inactiveStart != null && activeStart != null && inactiveStart.before(activeStart))
return !isActive(inactiveStart... | [
"private",
"boolean",
"isActive",
"(",
"Calendar",
"activeStart",
",",
"Calendar",
"inactiveStart",
")",
"{",
"// If end occurs before start, convert to equivalent case where start",
"// start is before end",
"if",
"(",
"inactiveStart",
"!=",
"null",
"&&",
"activeStart",
"!="... | Given a time when a particular state changes from inactive to active,
and a time when a particular state changes from active to inactive,
determines whether that state is currently active.
@param activeStart
The time at which the state changes from inactive to active.
@param inactiveStart
The time at which the state ... | [
"Given",
"a",
"time",
"when",
"a",
"particular",
"state",
"changes",
"from",
"inactive",
"to",
"active",
"and",
"a",
"time",
"when",
"a",
"particular",
"state",
"changes",
"from",
"active",
"to",
"inactive",
"determines",
"whether",
"that",
"state",
"is",
"c... | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/ModeledUser.java#L676-L690 |
NessComputing/components-ness-pg | src/main/java/com/nesscomputing/db/postgres/embedded/EmbeddedPostgreSQLController.java | EmbeddedPostgreSQLController.getTweakedConfig | public Config getTweakedConfig(Config config, String dbModuleName) {
"""
Override a {@link Config} to set <code>ness.db.[db-name].uri</code> to a unique
database in the cluster.
"""
return Config.getOverriddenConfig(config,
new MapConfiguration(getConfigurationTweak(dbModuleName)));
... | java | public Config getTweakedConfig(Config config, String dbModuleName)
{
return Config.getOverriddenConfig(config,
new MapConfiguration(getConfigurationTweak(dbModuleName)));
} | [
"public",
"Config",
"getTweakedConfig",
"(",
"Config",
"config",
",",
"String",
"dbModuleName",
")",
"{",
"return",
"Config",
".",
"getOverriddenConfig",
"(",
"config",
",",
"new",
"MapConfiguration",
"(",
"getConfigurationTweak",
"(",
"dbModuleName",
")",
")",
")... | Override a {@link Config} to set <code>ness.db.[db-name].uri</code> to a unique
database in the cluster. | [
"Override",
"a",
"{"
] | train | https://github.com/NessComputing/components-ness-pg/blob/e983d6075645ea1bf51cc5fc16901e5aab0f5c70/src/main/java/com/nesscomputing/db/postgres/embedded/EmbeddedPostgreSQLController.java#L111-L115 |
deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/writable/WritableFactory.java | WritableFactory.registerWritableType | public void registerWritableType(short writableTypeKey, @NonNull Class<? extends Writable> writableClass) {
"""
Register a writable class with a specific key (as a short). Note that key values must be unique for each type of
Writable, as they are used as type information in certain types of serialisation. Consequ... | java | public void registerWritableType(short writableTypeKey, @NonNull Class<? extends Writable> writableClass) {
if (map.containsKey(writableTypeKey)) {
throw new UnsupportedOperationException("Key " + writableTypeKey + " is already registered to type "
+ map.get(writableTypeK... | [
"public",
"void",
"registerWritableType",
"(",
"short",
"writableTypeKey",
",",
"@",
"NonNull",
"Class",
"<",
"?",
"extends",
"Writable",
">",
"writableClass",
")",
"{",
"if",
"(",
"map",
".",
"containsKey",
"(",
"writableTypeKey",
")",
")",
"{",
"throw",
"n... | Register a writable class with a specific key (as a short). Note that key values must be unique for each type of
Writable, as they are used as type information in certain types of serialisation. Consequently, an exception will
be thrown If the key value is not unique or is already assigned.<br>
Note that in general, th... | [
"Register",
"a",
"writable",
"class",
"with",
"a",
"specific",
"key",
"(",
"as",
"a",
"short",
")",
".",
"Note",
"that",
"key",
"values",
"must",
"be",
"unique",
"for",
"each",
"type",
"of",
"Writable",
"as",
"they",
"are",
"used",
"as",
"type",
"infor... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/writable/WritableFactory.java#L65-L80 |
wildfly/wildfly-core | logging/src/main/java/org/jboss/as/logging/handlers/HandlerOperations.java | HandlerOperations.isDisabledHandler | private static boolean isDisabledHandler(final LogContext logContext, final String handlerName) {
"""
Checks to see if a handler is disabled
@param handlerName the name of the handler to enable.
"""
final Map<String, String> disableHandlers = logContext.getAttachment(CommonAttributes.ROOT_LOGGER_NAM... | java | private static boolean isDisabledHandler(final LogContext logContext, final String handlerName) {
final Map<String, String> disableHandlers = logContext.getAttachment(CommonAttributes.ROOT_LOGGER_NAME, DISABLED_HANDLERS_KEY);
return disableHandlers != null && disableHandlers.containsKey(handlerName);
... | [
"private",
"static",
"boolean",
"isDisabledHandler",
"(",
"final",
"LogContext",
"logContext",
",",
"final",
"String",
"handlerName",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"disableHandlers",
"=",
"logContext",
".",
"getAttachment",
"(",
"C... | Checks to see if a handler is disabled
@param handlerName the name of the handler to enable. | [
"Checks",
"to",
"see",
"if",
"a",
"handler",
"is",
"disabled"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/logging/src/main/java/org/jboss/as/logging/handlers/HandlerOperations.java#L866-L869 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/ocr/OcrClient.java | OcrClient.bankcardRecognition | public BankcardRecognitionResponse bankcardRecognition(BankcardRecognitionRequest request) {
"""
Gets the bankcard recognition properties of specific image resource.
<p>
The caller <i>must</i> authenticate with a valid BCE Access Key / Private Key pair.
@param request The request wrapper object containing a... | java | public BankcardRecognitionResponse bankcardRecognition(BankcardRecognitionRequest request) {
checkNotNull(request, "request should not be null.");
checkStringNotEmpty(request.getImage(), "Image should not be null or empty!");
InternalRequest internalRequest =
createRequest(HttpM... | [
"public",
"BankcardRecognitionResponse",
"bankcardRecognition",
"(",
"BankcardRecognitionRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getImage",
"(",
")",
",",... | Gets the bankcard recognition properties of specific image resource.
<p>
The caller <i>must</i> authenticate with a valid BCE Access Key / Private Key pair.
@param request The request wrapper object containing all options.
@return The bankcard recognition properties of the image resource | [
"Gets",
"the",
"bankcard",
"recognition",
"properties",
"of",
"specific",
"image",
"resource",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/ocr/OcrClient.java#L103-L111 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/conf/Configuration.java | Configuration.setClass | public void setClass(String name, Class<?> theClass, Class<?> xface) {
"""
Set the value of the <code>name</code> property to the name of a
<code>theClass</code> implementing the given interface <code>xface</code>.
An exception is thrown if <code>theClass</code> does not implement the
interface <code>xface</c... | java | public void setClass(String name, Class<?> theClass, Class<?> xface) {
if (!xface.isAssignableFrom(theClass))
throw new RuntimeException(theClass + " does not implement " + xface.getName());
set(name, theClass.getName());
} | [
"public",
"void",
"setClass",
"(",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"theClass",
",",
"Class",
"<",
"?",
">",
"xface",
")",
"{",
"if",
"(",
"!",
"xface",
".",
"isAssignableFrom",
"(",
"theClass",
")",
")",
"throw",
"new",
"RuntimeException... | Set the value of the <code>name</code> property to the name of a
<code>theClass</code> implementing the given interface <code>xface</code>.
An exception is thrown if <code>theClass</code> does not implement the
interface <code>xface</code>.
@param name property name.
@param theClass property value.
@param xface the i... | [
"Set",
"the",
"value",
"of",
"the",
"<code",
">",
"name<",
"/",
"code",
">",
"property",
"to",
"the",
"name",
"of",
"a",
"<code",
">",
"theClass<",
"/",
"code",
">",
"implementing",
"the",
"given",
"interface",
"<code",
">",
"xface<",
"/",
"code",
">",... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/conf/Configuration.java#L945-L949 |
Impetus/Kundera | src/jpa-engine/fallback-impl/src/main/java/com/impetus/kundera/index/DocumentIndexer.java | DocumentIndexer.getKunderaId | protected String getKunderaId(EntityMetadata metadata, Object id) {
"""
Gets the kundera id.
@param metadata
the metadata
@param id
the id
@return the kundera id
"""
return metadata.getEntityClazz().getCanonicalName() + IndexingConstants.DELIMETER + id;
} | java | protected String getKunderaId(EntityMetadata metadata, Object id) {
return metadata.getEntityClazz().getCanonicalName() + IndexingConstants.DELIMETER + id;
} | [
"protected",
"String",
"getKunderaId",
"(",
"EntityMetadata",
"metadata",
",",
"Object",
"id",
")",
"{",
"return",
"metadata",
".",
"getEntityClazz",
"(",
")",
".",
"getCanonicalName",
"(",
")",
"+",
"IndexingConstants",
".",
"DELIMETER",
"+",
"id",
";",
"}"
] | Gets the kundera id.
@param metadata
the metadata
@param id
the id
@return the kundera id | [
"Gets",
"the",
"kundera",
"id",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/fallback-impl/src/main/java/com/impetus/kundera/index/DocumentIndexer.java#L464-L466 |
Metatavu/edelphi | rest/src/main/java/fi/metatavu/edelphi/permissions/PermissionController.java | PermissionController.hasPanelAccess | private boolean hasPanelAccess(Panel panel, DelfoiAction action, UserRole userRole) {
"""
Returns whether user role required action access
@param panel panel
@param action action
@param userRole role
@return whether user role required action access
"""
return panelUserRoleActionDAO.hasPanelActionAcce... | java | private boolean hasPanelAccess(Panel panel, DelfoiAction action, UserRole userRole) {
return panelUserRoleActionDAO.hasPanelActionAccess(panel, userRole, action);
} | [
"private",
"boolean",
"hasPanelAccess",
"(",
"Panel",
"panel",
",",
"DelfoiAction",
"action",
",",
"UserRole",
"userRole",
")",
"{",
"return",
"panelUserRoleActionDAO",
".",
"hasPanelActionAccess",
"(",
"panel",
",",
"userRole",
",",
"action",
")",
";",
"}"
] | Returns whether user role required action access
@param panel panel
@param action action
@param userRole role
@return whether user role required action access | [
"Returns",
"whether",
"user",
"role",
"required",
"action",
"access"
] | train | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/permissions/PermissionController.java#L188-L190 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspTagResourceLoad.java | CmsJspTagResourceLoad.getResourceName | protected static String getResourceName(CmsObject cms, I_CmsResourceContainer contentContainer) {
"""
Returns the resource name currently processed.<p>
@param cms the current OpenCms user context
@param contentContainer the current resource container
@return the resource name currently processed
"""
... | java | protected static String getResourceName(CmsObject cms, I_CmsResourceContainer contentContainer) {
if ((contentContainer != null) && (contentContainer.getResourceName() != null)) {
return contentContainer.getResourceName();
} else if (cms != null) {
return cms.getRequestContext()... | [
"protected",
"static",
"String",
"getResourceName",
"(",
"CmsObject",
"cms",
",",
"I_CmsResourceContainer",
"contentContainer",
")",
"{",
"if",
"(",
"(",
"contentContainer",
"!=",
"null",
")",
"&&",
"(",
"contentContainer",
".",
"getResourceName",
"(",
")",
"!=",
... | Returns the resource name currently processed.<p>
@param cms the current OpenCms user context
@param contentContainer the current resource container
@return the resource name currently processed | [
"Returns",
"the",
"resource",
"name",
"currently",
"processed",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspTagResourceLoad.java#L170-L179 |
pressgang-ccms/PressGangCCMSContentSpecProcessor | src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java | ContentSpecParser.processRelationshipList | private void processRelationshipList(final ParserType parserType, final SpecNodeWithRelationships tempNode,
final HashMap<ParserType, String[]> variableMap, final List<Relationship> relationships,
int lineNumber) throws ParsingException {
"""
Processes a list of relationships for a specific... | java | private void processRelationshipList(final ParserType parserType, final SpecNodeWithRelationships tempNode,
final HashMap<ParserType, String[]> variableMap, final List<Relationship> relationships,
int lineNumber) throws ParsingException {
final String uniqueId = tempNode.getUniqueId();
... | [
"private",
"void",
"processRelationshipList",
"(",
"final",
"ParserType",
"parserType",
",",
"final",
"SpecNodeWithRelationships",
"tempNode",
",",
"final",
"HashMap",
"<",
"ParserType",
",",
"String",
"[",
"]",
">",
"variableMap",
",",
"final",
"List",
"<",
"Rela... | Processes a list of relationships for a specific relationship type from some line processed variables.
@param relationshipType The relationship type to be processed.
@param tempNode The temporary node that will be turned into a full node once fully parsed.
@param variableMap The list of variables containi... | [
"Processes",
"a",
"list",
"of",
"relationships",
"for",
"a",
"specific",
"relationship",
"type",
"from",
"some",
"line",
"processed",
"variables",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java#L1184-L1233 |
xetorthio/jedis | src/main/java/redis/clients/jedis/BinaryJedis.java | BinaryJedis.zrem | @Override
public Long zrem(final byte[] key, final byte[]... members) {
"""
Remove the specified member from the sorted set value stored at key. If member was not a member
of the set no operation is performed. If key does not not hold a set value an error is
returned.
<p>
Time complexity O(log(N)) with N bei... | java | @Override
public Long zrem(final byte[] key, final byte[]... members) {
checkIsInMultiOrPipeline();
client.zrem(key, members);
return client.getIntegerReply();
} | [
"@",
"Override",
"public",
"Long",
"zrem",
"(",
"final",
"byte",
"[",
"]",
"key",
",",
"final",
"byte",
"[",
"]",
"...",
"members",
")",
"{",
"checkIsInMultiOrPipeline",
"(",
")",
";",
"client",
".",
"zrem",
"(",
"key",
",",
"members",
")",
";",
"ret... | Remove the specified member from the sorted set value stored at key. If member was not a member
of the set no operation is performed. If key does not not hold a set value an error is
returned.
<p>
Time complexity O(log(N)) with N being the number of elements in the sorted set
@param key
@param members
@return Integer r... | [
"Remove",
"the",
"specified",
"member",
"from",
"the",
"sorted",
"set",
"value",
"stored",
"at",
"key",
".",
"If",
"member",
"was",
"not",
"a",
"member",
"of",
"the",
"set",
"no",
"operation",
"is",
"performed",
".",
"If",
"key",
"does",
"not",
"not",
... | train | https://github.com/xetorthio/jedis/blob/ef4ab403f9d8fd88bd05092fea96de2e9db0bede/src/main/java/redis/clients/jedis/BinaryJedis.java#L1705-L1710 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/client/injection/ServiceRefObjectFactory.java | ServiceRefObjectFactory.getInstance | private Object getInstance(TransientWebServiceRefInfo tInfo, WebServiceRefInfo wsrInfo) throws Exception {
"""
This method will create an instance of a JAX-WS service ref, using the metadata supplied in the WebServiceRefInfo
object.
"""
Object instance = null;
// First, obtain an instance of... | java | private Object getInstance(TransientWebServiceRefInfo tInfo, WebServiceRefInfo wsrInfo) throws Exception {
Object instance = null;
// First, obtain an instance of the JAX-WS Service class.
Service svc = null;
List<WebServiceFeature> originalWsFeatureList = LibertyProviderImpl.getWebSe... | [
"private",
"Object",
"getInstance",
"(",
"TransientWebServiceRefInfo",
"tInfo",
",",
"WebServiceRefInfo",
"wsrInfo",
")",
"throws",
"Exception",
"{",
"Object",
"instance",
"=",
"null",
";",
"// First, obtain an instance of the JAX-WS Service class.",
"Service",
"svc",
"=",
... | This method will create an instance of a JAX-WS service ref, using the metadata supplied in the WebServiceRefInfo
object. | [
"This",
"method",
"will",
"create",
"an",
"instance",
"of",
"a",
"JAX",
"-",
"WS",
"service",
"ref",
"using",
"the",
"metadata",
"supplied",
"in",
"the",
"WebServiceRefInfo",
"object",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/client/injection/ServiceRefObjectFactory.java#L176-L222 |
mangstadt/biweekly | src/main/java/biweekly/io/chain/ChainingJsonWriter.java | ChainingJsonWriter.go | public void go(File file) throws IOException {
"""
Writes the iCalendar objects to a file.
@param file the file to write to
@throws IOException if there's a problem writing to the file
"""
JCalWriter writer = new JCalWriter(file, wrapInArray());
try {
go(writer);
} finally {
writer.close();
}
... | java | public void go(File file) throws IOException {
JCalWriter writer = new JCalWriter(file, wrapInArray());
try {
go(writer);
} finally {
writer.close();
}
} | [
"public",
"void",
"go",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"JCalWriter",
"writer",
"=",
"new",
"JCalWriter",
"(",
"file",
",",
"wrapInArray",
"(",
")",
")",
";",
"try",
"{",
"go",
"(",
"writer",
")",
";",
"}",
"finally",
"{",
"wr... | Writes the iCalendar objects to a file.
@param file the file to write to
@throws IOException if there's a problem writing to the file | [
"Writes",
"the",
"iCalendar",
"objects",
"to",
"a",
"file",
"."
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/chain/ChainingJsonWriter.java#L115-L122 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/WsMessageRouterImpl.java | WsMessageRouterImpl.routeToAll | protected boolean routeToAll(RoutedMessage routedMessage, Set<String> logHandlerIds) {
"""
Route the message to all LogHandlers in the set.
@return true if the set contained DEFAULT, which means the msg should be logged
normally as well. false otherwise.
"""
boolean logNormally = false;
f... | java | protected boolean routeToAll(RoutedMessage routedMessage, Set<String> logHandlerIds) {
boolean logNormally = false;
for (String logHandlerId : logHandlerIds) {
if (logHandlerId.equals("DEFAULT")) {
// DEFAULT is still in the list, so we should tell the caller to also log
... | [
"protected",
"boolean",
"routeToAll",
"(",
"RoutedMessage",
"routedMessage",
",",
"Set",
"<",
"String",
">",
"logHandlerIds",
")",
"{",
"boolean",
"logNormally",
"=",
"false",
";",
"for",
"(",
"String",
"logHandlerId",
":",
"logHandlerIds",
")",
"{",
"if",
"("... | Route the message to all LogHandlers in the set.
@return true if the set contained DEFAULT, which means the msg should be logged
normally as well. false otherwise. | [
"Route",
"the",
"message",
"to",
"all",
"LogHandlers",
"in",
"the",
"set",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/WsMessageRouterImpl.java#L205-L220 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/blockdata/BlockDataHandler.java | BlockDataHandler.removeData | public static <T> void removeData(String identifier, IBlockAccess world, BlockPos pos) {
"""
Removes the custom data stored at the {@link BlockPos} for the specified identifier.
@param <T> the generic type
@param identifier the identifier
@param world the world
@param pos the pos
"""
removeData(identif... | java | public static <T> void removeData(String identifier, IBlockAccess world, BlockPos pos)
{
removeData(identifier, world, pos, false);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"removeData",
"(",
"String",
"identifier",
",",
"IBlockAccess",
"world",
",",
"BlockPos",
"pos",
")",
"{",
"removeData",
"(",
"identifier",
",",
"world",
",",
"pos",
",",
"false",
")",
";",
"}"
] | Removes the custom data stored at the {@link BlockPos} for the specified identifier.
@param <T> the generic type
@param identifier the identifier
@param world the world
@param pos the pos | [
"Removes",
"the",
"custom",
"data",
"stored",
"at",
"the",
"{",
"@link",
"BlockPos",
"}",
"for",
"the",
"specified",
"identifier",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/blockdata/BlockDataHandler.java#L346-L349 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsFormatterConfiguration.java | CmsFormatterConfiguration.getAllMatchingFormatters | public List<I_CmsFormatterBean> getAllMatchingFormatters(String containerTypes, int containerWidth) {
"""
Gets the formatters which are available for the given container type and width.<p>
@param containerTypes the container types (comma separated)
@param containerWidth the container width
@return the list ... | java | public List<I_CmsFormatterBean> getAllMatchingFormatters(String containerTypes, int containerWidth) {
return new ArrayList<I_CmsFormatterBean>(
Collections2.filter(m_allFormatters, new MatchesTypeOrWidth(containerTypes, containerWidth)));
} | [
"public",
"List",
"<",
"I_CmsFormatterBean",
">",
"getAllMatchingFormatters",
"(",
"String",
"containerTypes",
",",
"int",
"containerWidth",
")",
"{",
"return",
"new",
"ArrayList",
"<",
"I_CmsFormatterBean",
">",
"(",
"Collections2",
".",
"filter",
"(",
"m_allFormat... | Gets the formatters which are available for the given container type and width.<p>
@param containerTypes the container types (comma separated)
@param containerWidth the container width
@return the list of available formatters | [
"Gets",
"the",
"formatters",
"which",
"are",
"available",
"for",
"the",
"given",
"container",
"type",
"and",
"width",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsFormatterConfiguration.java#L280-L285 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/metadata/Utils.java | Utils.compareStrings | public static boolean compareStrings(String s1, String s2) {
"""
Compares two strings for equality. Either or both of the values may be null.
@param s1
@param s2
@return true iff the two strings are equal
"""
if (s1 == s2)
return true;
if (s1 != null && s2 != null && s1.equals(... | java | public static boolean compareStrings(String s1, String s2) {
if (s1 == s2)
return true;
if (s1 != null && s2 != null && s1.equals(s2))
return true;
return false;
} | [
"public",
"static",
"boolean",
"compareStrings",
"(",
"String",
"s1",
",",
"String",
"s2",
")",
"{",
"if",
"(",
"s1",
"==",
"s2",
")",
"return",
"true",
";",
"if",
"(",
"s1",
"!=",
"null",
"&&",
"s2",
"!=",
"null",
"&&",
"s1",
".",
"equals",
"(",
... | Compares two strings for equality. Either or both of the values may be null.
@param s1
@param s2
@return true iff the two strings are equal | [
"Compares",
"two",
"strings",
"for",
"equality",
".",
"Either",
"or",
"both",
"of",
"the",
"values",
"may",
"be",
"null",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/metadata/Utils.java#L46-L52 |
google/closure-compiler | src/com/google/javascript/jscomp/deps/DepsFileParser.java | DepsFileParser.parseFile | public List<DependencyInfo> parseFile(String filePath) throws IOException {
"""
Parses the given file and returns a list of dependency information that it
contained.
@param filePath Path to the file to parse.
@return A list of DependencyInfo objects.
@throws IOException Thrown if the file could not be read.
... | java | public List<DependencyInfo> parseFile(String filePath) throws IOException {
return parseFileReader(filePath, Files.newReader(new File(filePath), StandardCharsets.UTF_8));
} | [
"public",
"List",
"<",
"DependencyInfo",
">",
"parseFile",
"(",
"String",
"filePath",
")",
"throws",
"IOException",
"{",
"return",
"parseFileReader",
"(",
"filePath",
",",
"Files",
".",
"newReader",
"(",
"new",
"File",
"(",
"filePath",
")",
",",
"StandardChars... | Parses the given file and returns a list of dependency information that it
contained.
@param filePath Path to the file to parse.
@return A list of DependencyInfo objects.
@throws IOException Thrown if the file could not be read. | [
"Parses",
"the",
"given",
"file",
"and",
"returns",
"a",
"list",
"of",
"dependency",
"information",
"that",
"it",
"contained",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/deps/DepsFileParser.java#L105-L107 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/DcosSpec.java | DcosSpec.jsonMatchesSchema | @Given("^json (.+?) matches schema (.+?)$")
public void jsonMatchesSchema(String json, String schema) throws Exception {
"""
Check if json is validated against a schema
@param json json to be validated against schema
@param schema schema to be validated against
@throws Exception exception *
"""
... | java | @Given("^json (.+?) matches schema (.+?)$")
public void jsonMatchesSchema(String json, String schema) throws Exception {
JSONObject jsonschema = new JSONObject(schema);
JSONObject jsondeploy = new JSONObject(json);
commonspec.matchJsonToSchema(jsonschema, jsondeploy);
} | [
"@",
"Given",
"(",
"\"^json (.+?) matches schema (.+?)$\"",
")",
"public",
"void",
"jsonMatchesSchema",
"(",
"String",
"json",
",",
"String",
"schema",
")",
"throws",
"Exception",
"{",
"JSONObject",
"jsonschema",
"=",
"new",
"JSONObject",
"(",
"schema",
")",
";",
... | Check if json is validated against a schema
@param json json to be validated against schema
@param schema schema to be validated against
@throws Exception exception * | [
"Check",
"if",
"json",
"is",
"validated",
"against",
"a",
"schema"
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DcosSpec.java#L320-L326 |
marklogic/java-client-api | marklogic-client-api/src/main/java/com/marklogic/client/DatabaseClientFactory.java | DatabaseClientFactory.newClient | static public DatabaseClient newClient(String host, int port) {
"""
Creates a client to access the database by means of a REST server
without any authentication. Such clients can be convenient for
experimentation but should not be used in production.
@param host the host with the REST server
@param port the ... | java | static public DatabaseClient newClient(String host, int port) {
return newClient(host, port, null, null, null, null, null, null);
} | [
"static",
"public",
"DatabaseClient",
"newClient",
"(",
"String",
"host",
",",
"int",
"port",
")",
"{",
"return",
"newClient",
"(",
"host",
",",
"port",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
")",
";",
"}"
] | Creates a client to access the database by means of a REST server
without any authentication. Such clients can be convenient for
experimentation but should not be used in production.
@param host the host with the REST server
@param port the port for the REST server
@return a new client for making database requests | [
"Creates",
"a",
"client",
"to",
"access",
"the",
"database",
"by",
"means",
"of",
"a",
"REST",
"server",
"without",
"any",
"authentication",
".",
"Such",
"clients",
"can",
"be",
"convenient",
"for",
"experimentation",
"but",
"should",
"not",
"be",
"used",
"i... | train | https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/DatabaseClientFactory.java#L1121-L1123 |
mapsforge/mapsforge | mapsforge-map/src/main/java/org/mapsforge/map/util/LayerUtil.java | LayerUtil.getLowerRight | public static Tile getLowerRight(BoundingBox boundingBox, byte zoomLevel, int tileSize) {
"""
Lower right tile for an area.
@param boundingBox the area boundingBox
@param zoomLevel the zoom level.
@param tileSize the tile size.
@return the tile at the lower right of the bbox.
"""
int tileRig... | java | public static Tile getLowerRight(BoundingBox boundingBox, byte zoomLevel, int tileSize) {
int tileRight = MercatorProjection.longitudeToTileX(boundingBox.maxLongitude, zoomLevel);
int tileBottom = MercatorProjection.latitudeToTileY(boundingBox.minLatitude, zoomLevel);
return new Tile(tileRight, ... | [
"public",
"static",
"Tile",
"getLowerRight",
"(",
"BoundingBox",
"boundingBox",
",",
"byte",
"zoomLevel",
",",
"int",
"tileSize",
")",
"{",
"int",
"tileRight",
"=",
"MercatorProjection",
".",
"longitudeToTileX",
"(",
"boundingBox",
".",
"maxLongitude",
",",
"zoomL... | Lower right tile for an area.
@param boundingBox the area boundingBox
@param zoomLevel the zoom level.
@param tileSize the tile size.
@return the tile at the lower right of the bbox. | [
"Lower",
"right",
"tile",
"for",
"an",
"area",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map/src/main/java/org/mapsforge/map/util/LayerUtil.java#L78-L82 |
kmi/iserve | iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/Util.java | Util.generateLabelPattern | public static String generateLabelPattern(String var, String labelVar) {
"""
Generate a pattern for binding to a label
@param var the name of the variable
@param labelVar the name of the label varible
@return
"""
return new StringBuilder()
.append("?").append(var).append(" ")
... | java | public static String generateLabelPattern(String var, String labelVar) {
return new StringBuilder()
.append("?").append(var).append(" ")
.append(sparqlWrapUri(RDFS.label.getURI())).append(" ")
.append("?").append(labelVar).append(". ")
.toString();... | [
"public",
"static",
"String",
"generateLabelPattern",
"(",
"String",
"var",
",",
"String",
"labelVar",
")",
"{",
"return",
"new",
"StringBuilder",
"(",
")",
".",
"append",
"(",
"\"?\"",
")",
".",
"append",
"(",
"var",
")",
".",
"append",
"(",
"\" \"",
")... | Generate a pattern for binding to a label
@param var the name of the variable
@param labelVar the name of the label varible
@return | [
"Generate",
"a",
"pattern",
"for",
"binding",
"to",
"a",
"label"
] | train | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/Util.java#L203-L209 |
Netflix/denominator | cli/src/main/java/denominator/cli/Denominator.java | Denominator.logModule | static Object logModule(boolean quiet, boolean verbose) {
"""
Returns a log configuration module or null if none is needed.
"""
checkArgument(!(quiet && verbose), "quiet and verbose flags cannot be used at the same time!");
Logger.Level logLevel;
if (quiet) {
return null;
} else if (verbo... | java | static Object logModule(boolean quiet, boolean verbose) {
checkArgument(!(quiet && verbose), "quiet and verbose flags cannot be used at the same time!");
Logger.Level logLevel;
if (quiet) {
return null;
} else if (verbose) {
logLevel = Logger.Level.FULL;
} else {
logLevel = Logger.... | [
"static",
"Object",
"logModule",
"(",
"boolean",
"quiet",
",",
"boolean",
"verbose",
")",
"{",
"checkArgument",
"(",
"!",
"(",
"quiet",
"&&",
"verbose",
")",
",",
"\"quiet and verbose flags cannot be used at the same time!\"",
")",
";",
"Logger",
".",
"Level",
"lo... | Returns a log configuration module or null if none is needed. | [
"Returns",
"a",
"log",
"configuration",
"module",
"or",
"null",
"if",
"none",
"is",
"needed",
"."
] | train | https://github.com/Netflix/denominator/blob/c565e3b8c6043051252e0947029511f9ac5d306f/cli/src/main/java/denominator/cli/Denominator.java#L179-L190 |
zamrokk/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/shim/Handler.java | Handler.afterCompleted | public void afterCompleted(Event event) {
"""
afterCompleted will need to handle COMPLETED event by sending message to the peer
"""
ChaincodeMessage message = messageHelper(event);
logger.debug(String.format("[%s]sending COMPLETED to validator for tid", shortID(message)));
try {
serialSend(message);
... | java | public void afterCompleted(Event event) {
ChaincodeMessage message = messageHelper(event);
logger.debug(String.format("[%s]sending COMPLETED to validator for tid", shortID(message)));
try {
serialSend(message);
} catch (Exception e) {
event.cancel(new Exception("send COMPLETED failed %s", e));
}
} | [
"public",
"void",
"afterCompleted",
"(",
"Event",
"event",
")",
"{",
"ChaincodeMessage",
"message",
"=",
"messageHelper",
"(",
"event",
")",
";",
"logger",
".",
"debug",
"(",
"String",
".",
"format",
"(",
"\"[%s]sending COMPLETED to validator for tid\"",
",",
"sho... | afterCompleted will need to handle COMPLETED event by sending message to the peer | [
"afterCompleted",
"will",
"need",
"to",
"handle",
"COMPLETED",
"event",
"by",
"sending",
"message",
"to",
"the",
"peer"
] | train | https://github.com/zamrokk/fabric-sdk-java/blob/d4993ca602f72d412cd682e1b92e805e48b27afa/src/main/java/org/hyperledger/fabric/sdk/shim/Handler.java#L425-L433 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/common/ProjectNodeSupport.java | ProjectNodeSupport.createCachingSource | public ResourceModelSource createCachingSource(
ResourceModelSource origin,
String ident,
String descr,
SourceFactory.CacheType type,
final boolean logging
) {
"""
@param logging
@param origin origin source
@param ident unique identity for this cac... | java | public ResourceModelSource createCachingSource(
ResourceModelSource origin,
String ident,
String descr,
SourceFactory.CacheType type,
final boolean logging
)
{
final File file = getResourceModelSourceFileCacheForType(ident);
final Resou... | [
"public",
"ResourceModelSource",
"createCachingSource",
"(",
"ResourceModelSource",
"origin",
",",
"String",
"ident",
",",
"String",
"descr",
",",
"SourceFactory",
".",
"CacheType",
"type",
",",
"final",
"boolean",
"logging",
")",
"{",
"final",
"File",
"file",
"="... | @param logging
@param origin origin source
@param ident unique identity for this cached source, used in filename
@param descr description of the source, used in logging
@param logging if true, log cache access
@return new source | [
"@param",
"logging",
"@param",
"origin",
"origin",
"source",
"@param",
"ident",
"unique",
"identity",
"for",
"this",
"cached",
"source",
"used",
"in",
"filename",
"@param",
"descr",
"description",
"of",
"the",
"source",
"used",
"in",
"logging",
"@param",
"loggin... | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/common/ProjectNodeSupport.java#L385-L427 |
geomajas/geomajas-project-client-gwt2 | plugin/editing/common/src/main/java/org/geomajas/plugin/editing/client/service/GeometryIndexService.java | GeometryIndexService.isAdjacent | public boolean isAdjacent(Geometry geometry, GeometryIndex one, GeometryIndex two) {
"""
Given a certain geometry and index (one), check if the the other index (two) is a neighbor.
@param geometry The geometry wherein to search if indices one and two are neighbors.
@param one One of the indices. Must point to ... | java | public boolean isAdjacent(Geometry geometry, GeometryIndex one, GeometryIndex two) {
return delegate.isAdjacent(geometry, toDelegate(one), toDelegate(two));
} | [
"public",
"boolean",
"isAdjacent",
"(",
"Geometry",
"geometry",
",",
"GeometryIndex",
"one",
",",
"GeometryIndex",
"two",
")",
"{",
"return",
"delegate",
".",
"isAdjacent",
"(",
"geometry",
",",
"toDelegate",
"(",
"one",
")",
",",
"toDelegate",
"(",
"two",
"... | Given a certain geometry and index (one), check if the the other index (two) is a neighbor.
@param geometry The geometry wherein to search if indices one and two are neighbors.
@param one One of the indices. Must point to either a vertex or and edge.
@param two Another one of the indices. Must point to either a vertex... | [
"Given",
"a",
"certain",
"geometry",
"and",
"index",
"(",
"one",
")",
"check",
"if",
"the",
"the",
"other",
"index",
"(",
"two",
")",
"is",
"a",
"neighbor",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/editing/common/src/main/java/org/geomajas/plugin/editing/client/service/GeometryIndexService.java#L308-L310 |
gallandarakhneorg/afc | core/util/src/main/java/org/arakhne/afc/progress/DefaultProgression.java | DefaultProgression.disconnectSubTask | void disconnectSubTask(SubProgressionModel subTask, double value, boolean overwriteComment) {
"""
Set the parent value and disconnect this subtask from its parent.
This method is invoked from a subtask.
@param subTask the subtask to disconnect.
@param value the value of the task.
@param overwriteComment indi... | java | void disconnectSubTask(SubProgressionModel subTask, double value, boolean overwriteComment) {
if (this.child == subTask) {
if (overwriteComment) {
final String cmt = subTask.getComment();
if (cmt != null) {
this.comment = cmt;
}
}
this.child = null;
setProperties(value, this.min, this.max... | [
"void",
"disconnectSubTask",
"(",
"SubProgressionModel",
"subTask",
",",
"double",
"value",
",",
"boolean",
"overwriteComment",
")",
"{",
"if",
"(",
"this",
".",
"child",
"==",
"subTask",
")",
"{",
"if",
"(",
"overwriteComment",
")",
"{",
"final",
"String",
... | Set the parent value and disconnect this subtask from its parent.
This method is invoked from a subtask.
@param subTask the subtask to disconnect.
@param value the value of the task.
@param overwriteComment indicates if the comment of this parent model may
be overwritten by the child's comment. | [
"Set",
"the",
"parent",
"value",
"and",
"disconnect",
"this",
"subtask",
"from",
"its",
"parent",
".",
"This",
"method",
"is",
"invoked",
"from",
"a",
"subtask",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/util/src/main/java/org/arakhne/afc/progress/DefaultProgression.java#L398-L409 |
googlegenomics/utils-java | src/main/java/com/google/cloud/genomics/utils/GenomicsFactory.java | GenomicsFactory.fromCredential | public <T extends AbstractGoogleJsonClient.Builder> T fromCredential(T builder, Credential credential) {
"""
Prepare an AbstractGoogleJsonClient.Builder using a credential.
@param builder The builder to be prepared.
@param credential The credential to be used for requests.
@return The passed in builder, for e... | java | public <T extends AbstractGoogleJsonClient.Builder> T fromCredential(T builder, Credential credential) {
Preconditions.checkNotNull(builder);
Preconditions.checkNotNull(credential);
return prepareBuilder(builder, credential, null);
} | [
"public",
"<",
"T",
"extends",
"AbstractGoogleJsonClient",
".",
"Builder",
">",
"T",
"fromCredential",
"(",
"T",
"builder",
",",
"Credential",
"credential",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"builder",
")",
";",
"Preconditions",
".",
"checkNot... | Prepare an AbstractGoogleJsonClient.Builder using a credential.
@param builder The builder to be prepared.
@param credential The credential to be used for requests.
@return The passed in builder, for easy chaining. | [
"Prepare",
"an",
"AbstractGoogleJsonClient",
".",
"Builder",
"using",
"a",
"credential",
"."
] | train | https://github.com/googlegenomics/utils-java/blob/7205d5b4e4f61fc6b93acb4bdd76b93df5b5f612/src/main/java/com/google/cloud/genomics/utils/GenomicsFactory.java#L405-L409 |
attribyte/wpdb | src/main/java/org/attribyte/wp/model/ShortcodeParser.java | ShortcodeParser.parseStart | static Shortcode parseStart(final String str) throws ParseException {
"""
Parse '[shortcode attr0="val0" attr1="val1"]
@param str The shortcode string.
@return The shortcode.
@throws ParseException on invalid shortcode.
"""
String exp = str.trim();
if(exp.length() < 3) {
throw new Pars... | java | static Shortcode parseStart(final String str) throws ParseException {
String exp = str.trim();
if(exp.length() < 3) {
throw new ParseException(String.format("Invalid shortcode ('%s')", str), 0);
}
if(exp.charAt(0) != '[') {
throw new ParseException("Expecting '['", 0);
... | [
"static",
"Shortcode",
"parseStart",
"(",
"final",
"String",
"str",
")",
"throws",
"ParseException",
"{",
"String",
"exp",
"=",
"str",
".",
"trim",
"(",
")",
";",
"if",
"(",
"exp",
".",
"length",
"(",
")",
"<",
"3",
")",
"{",
"throw",
"new",
"ParseEx... | Parse '[shortcode attr0="val0" attr1="val1"]
@param str The shortcode string.
@return The shortcode.
@throws ParseException on invalid shortcode. | [
"Parse",
"[",
"shortcode",
"attr0",
"=",
"val0",
"attr1",
"=",
"val1",
"]"
] | train | https://github.com/attribyte/wpdb/blob/b9adf6131dfb67899ebff770c9bfeb001cc42f30/src/main/java/org/attribyte/wp/model/ShortcodeParser.java#L76-L103 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/thrift/CQLTranslator.java | CQLTranslator.appendColumnName | public void appendColumnName(StringBuilder builder, String columnName, String dataType) {
"""
Appends column name and data type also ensures case sensitivity.
@param builder
string builder
@param columnName
column name
@param dataType
data type.
"""
ensureCase(builder, columnName, false);
... | java | public void appendColumnName(StringBuilder builder, String columnName, String dataType)
{
ensureCase(builder, columnName, false);
builder.append(" "); // because only key columns
builder.append(dataType);
} | [
"public",
"void",
"appendColumnName",
"(",
"StringBuilder",
"builder",
",",
"String",
"columnName",
",",
"String",
"dataType",
")",
"{",
"ensureCase",
"(",
"builder",
",",
"columnName",
",",
"false",
")",
";",
"builder",
".",
"append",
"(",
"\" \"",
")",
";"... | Appends column name and data type also ensures case sensitivity.
@param builder
string builder
@param columnName
column name
@param dataType
data type. | [
"Appends",
"column",
"name",
"and",
"data",
"type",
"also",
"ensures",
"case",
"sensitivity",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/thrift/CQLTranslator.java#L1335-L1340 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/redis/Cache.java | Cache.zrangeByScore | @SuppressWarnings("rawtypes")
public Set zrangeByScore(Object key, double min, double max) {
"""
返回有序集 key 中,所有 score 值介于 min 和 max 之间(包括等于 min 或 max )的成员。
有序集成员按 score 值递增(从小到大)次序排列。
"""
Jedis jedis = getJedis();
try {
Set<byte[]> data = jedis.zrangeByScore(keyToBytes(key), min, max);
Set<Obj... | java | @SuppressWarnings("rawtypes")
public Set zrangeByScore(Object key, double min, double max) {
Jedis jedis = getJedis();
try {
Set<byte[]> data = jedis.zrangeByScore(keyToBytes(key), min, max);
Set<Object> result = new LinkedHashSet<Object>(); // 有序集合必须 LinkedHashSet
valueSetFromBytesSet(data, result)... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"Set",
"zrangeByScore",
"(",
"Object",
"key",
",",
"double",
"min",
",",
"double",
"max",
")",
"{",
"Jedis",
"jedis",
"=",
"getJedis",
"(",
")",
";",
"try",
"{",
"Set",
"<",
"byte",
"[",
"]",... | 返回有序集 key 中,所有 score 值介于 min 和 max 之间(包括等于 min 或 max )的成员。
有序集成员按 score 值递增(从小到大)次序排列。 | [
"返回有序集",
"key",
"中,所有",
"score",
"值介于",
"min",
"和",
"max",
"之间",
"(",
"包括等于",
"min",
"或",
"max",
")",
"的成员。",
"有序集成员按",
"score",
"值递增",
"(",
"从小到大",
")",
"次序排列。"
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/redis/Cache.java#L1089-L1099 |
google/truth | core/src/main/java/com/google/common/truth/MultimapSubject.java | MultimapSubject.containsAtLeastEntriesIn | @CanIgnoreReturnValue
public Ordered containsAtLeastEntriesIn(Multimap<?, ?> expectedMultimap) {
"""
Fails if the {@link Multimap} does not contain at least the entries in the argument {@link
Multimap}.
<p>A subsequent call to {@link Ordered#inOrder} may be made if the caller wishes to verify that
the entri... | java | @CanIgnoreReturnValue
public Ordered containsAtLeastEntriesIn(Multimap<?, ?> expectedMultimap) {
checkNotNull(expectedMultimap, "expectedMultimap");
ListMultimap<?, ?> missing = difference(expectedMultimap, actual());
// TODO(kak): Possible enhancement: Include "[1 copy]" if the element does appear in
... | [
"@",
"CanIgnoreReturnValue",
"public",
"Ordered",
"containsAtLeastEntriesIn",
"(",
"Multimap",
"<",
"?",
",",
"?",
">",
"expectedMultimap",
")",
"{",
"checkNotNull",
"(",
"expectedMultimap",
",",
"\"expectedMultimap\"",
")",
";",
"ListMultimap",
"<",
"?",
",",
"?"... | Fails if the {@link Multimap} does not contain at least the entries in the argument {@link
Multimap}.
<p>A subsequent call to {@link Ordered#inOrder} may be made if the caller wishes to verify that
the entries are present in the same order as given. That is, the keys are present in the given
order in the key set, and ... | [
"Fails",
"if",
"the",
"{",
"@link",
"Multimap",
"}",
"does",
"not",
"contain",
"at",
"least",
"the",
"entries",
"in",
"the",
"argument",
"{",
"@link",
"Multimap",
"}",
"."
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/core/src/main/java/com/google/common/truth/MultimapSubject.java#L265-L282 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java | ComputerVisionImpl.analyzeImageByDomain | public DomainModelResults analyzeImageByDomain(String model, String url, AnalyzeImageByDomainOptionalParameter analyzeImageByDomainOptionalParameter) {
"""
This operation recognizes content within an image by applying a domain-specific model. The list of domain-specific models that are supported by the Computer V... | java | public DomainModelResults analyzeImageByDomain(String model, String url, AnalyzeImageByDomainOptionalParameter analyzeImageByDomainOptionalParameter) {
return analyzeImageByDomainWithServiceResponseAsync(model, url, analyzeImageByDomainOptionalParameter).toBlocking().single().body();
} | [
"public",
"DomainModelResults",
"analyzeImageByDomain",
"(",
"String",
"model",
",",
"String",
"url",
",",
"AnalyzeImageByDomainOptionalParameter",
"analyzeImageByDomainOptionalParameter",
")",
"{",
"return",
"analyzeImageByDomainWithServiceResponseAsync",
"(",
"model",
",",
"u... | This operation recognizes content within an image by applying a domain-specific model. The list of domain-specific models that are supported by the Computer Vision API can be retrieved using the /models GET request. Currently, the API only provides a single domain-specific model: celebrities. Two input methods are su... | [
"This",
"operation",
"recognizes",
"content",
"within",
"an",
"image",
"by",
"applying",
"a",
"domain",
"-",
"specific",
"model",
".",
"The",
"list",
"of",
"domain",
"-",
"specific",
"models",
"that",
"are",
"supported",
"by",
"the",
"Computer",
"Vision",
"A... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L1414-L1416 |
loldevs/riotapi | domain/src/main/java/net/boreeas/riotapi/rtmp/serialization/AmfWriter.java | AmfWriter.encodeAmf3 | public void encodeAmf3(Object obj, Amf3Type marker) throws IOException {
"""
Encodes an object in amf3 as an object of
the specified type
@param obj The object to encode
@param marker The type marker for this object
@throws IOException
"""
out.write(marker.ordinal());
if (marker == Amf3Typ... | java | public void encodeAmf3(Object obj, Amf3Type marker) throws IOException {
out.write(marker.ordinal());
if (marker == Amf3Type.NULL) {
return; // Null marker is enough
}
serializeAmf3(obj, marker);
} | [
"public",
"void",
"encodeAmf3",
"(",
"Object",
"obj",
",",
"Amf3Type",
"marker",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"marker",
".",
"ordinal",
"(",
")",
")",
";",
"if",
"(",
"marker",
"==",
"Amf3Type",
".",
"NULL",
")",
"{",
... | Encodes an object in amf3 as an object of
the specified type
@param obj The object to encode
@param marker The type marker for this object
@throws IOException | [
"Encodes",
"an",
"object",
"in",
"amf3",
"as",
"an",
"object",
"of",
"the",
"specified",
"type"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/domain/src/main/java/net/boreeas/riotapi/rtmp/serialization/AmfWriter.java#L222-L230 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/MiscSpec.java | MiscSpec.checkValue | @Then("^'(?s)(.+?)' ((?!.*with).+?) '(.+?)'$")
public void checkValue(String envVar, String operation, String value) throws Exception {
"""
/*
Check value stored in environment variable "is|matches|is higher than|is lower than|contains||does not contain|is different from" to value provided
@param envVar
@... | java | @Then("^'(?s)(.+?)' ((?!.*with).+?) '(.+?)'$")
public void checkValue(String envVar, String operation, String value) throws Exception {
switch (operation.toLowerCase()) {
case "is":
Assertions.assertThat(envVar).isEqualTo(value);
break;
case "matches":... | [
"@",
"Then",
"(",
"\"^'(?s)(.+?)' ((?!.*with).+?) '(.+?)'$\"",
")",
"public",
"void",
"checkValue",
"(",
"String",
"envVar",
",",
"String",
"operation",
",",
"String",
"value",
")",
"throws",
"Exception",
"{",
"switch",
"(",
"operation",
".",
"toLowerCase",
"(",
... | /*
Check value stored in environment variable "is|matches|is higher than|is lower than|contains||does not contain|is different from" to value provided
@param envVar
@param value | [
"/",
"*",
"Check",
"value",
"stored",
"in",
"environment",
"variable",
"is|matches|is",
"higher",
"than|is",
"lower",
"than|contains||does",
"not",
"contain|is",
"different",
"from",
"to",
"value",
"provided"
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/MiscSpec.java#L225-L260 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/utils/BtcFormat.java | BtcFormat.prefixUnitsIndicator | protected static void prefixUnitsIndicator(DecimalFormat numberFormat, int scale) {
"""
Set both the currency symbol and code of the underlying, mutable NumberFormat object
according to the given denominational units scale factor. This is for formatting, not parsing.
<p>Set back to zero when you're done forma... | java | protected static void prefixUnitsIndicator(DecimalFormat numberFormat, int scale) {
checkState(Thread.holdsLock(numberFormat)); // make sure caller intends to reset before changing
DecimalFormatSymbols fs = numberFormat.getDecimalFormatSymbols();
setSymbolAndCode(numberFormat,
prefix... | [
"protected",
"static",
"void",
"prefixUnitsIndicator",
"(",
"DecimalFormat",
"numberFormat",
",",
"int",
"scale",
")",
"{",
"checkState",
"(",
"Thread",
".",
"holdsLock",
"(",
"numberFormat",
")",
")",
";",
"// make sure caller intends to reset before changing",
"Decima... | Set both the currency symbol and code of the underlying, mutable NumberFormat object
according to the given denominational units scale factor. This is for formatting, not parsing.
<p>Set back to zero when you're done formatting otherwise immutability, equals() and
hashCode() will break!
@param scale Number of places... | [
"Set",
"both",
"the",
"currency",
"symbol",
"and",
"code",
"of",
"the",
"underlying",
"mutable",
"NumberFormat",
"object",
"according",
"to",
"the",
"given",
"denominational",
"units",
"scale",
"factor",
".",
"This",
"is",
"for",
"formatting",
"not",
"parsing",
... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/utils/BtcFormat.java#L1384-L1390 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkId.java | SubnetworkId.of | public static SubnetworkId of(RegionId regionId, String subnetwork) {
"""
Returns a subnetwork identity given the region identity and the subnetwork name. The subnetwork
name must be 1-63 characters long and comply with RFC1035. Specifically, the name must match
the regular expression {@code [a-z]([-a-z0-9]*[a-z... | java | public static SubnetworkId of(RegionId regionId, String subnetwork) {
return new SubnetworkId(regionId.getProject(), regionId.getRegion(), subnetwork);
} | [
"public",
"static",
"SubnetworkId",
"of",
"(",
"RegionId",
"regionId",
",",
"String",
"subnetwork",
")",
"{",
"return",
"new",
"SubnetworkId",
"(",
"regionId",
".",
"getProject",
"(",
")",
",",
"regionId",
".",
"getRegion",
"(",
")",
",",
"subnetwork",
")",
... | Returns a subnetwork identity given the region identity and the subnetwork name. The subnetwork
name must be 1-63 characters long and comply with RFC1035. Specifically, the name must match
the regular expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must
be a lowercase letter, and all follo... | [
"Returns",
"a",
"subnetwork",
"identity",
"given",
"the",
"region",
"identity",
"and",
"the",
"subnetwork",
"name",
".",
"The",
"subnetwork",
"name",
"must",
"be",
"1",
"-",
"63",
"characters",
"long",
"and",
"comply",
"with",
"RFC1035",
".",
"Specifically",
... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/SubnetworkId.java#L127-L129 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/NNStorage.java | NNStorage.isPreferred | static boolean isPreferred(StorageLocationType type, StorageDirectory sd) {
"""
Checks if we have information about this directory
that it is preferred.
@param type preferred type
@param sd storage directory
"""
if ((sd instanceof NNStorageDirectory)) {
return ((NNStorageDirectory) sd).type == typ... | java | static boolean isPreferred(StorageLocationType type, StorageDirectory sd) {
if ((sd instanceof NNStorageDirectory)) {
return ((NNStorageDirectory) sd).type == type;
}
// by default all are preferred
return true;
} | [
"static",
"boolean",
"isPreferred",
"(",
"StorageLocationType",
"type",
",",
"StorageDirectory",
"sd",
")",
"{",
"if",
"(",
"(",
"sd",
"instanceof",
"NNStorageDirectory",
")",
")",
"{",
"return",
"(",
"(",
"NNStorageDirectory",
")",
"sd",
")",
".",
"type",
"... | Checks if we have information about this directory
that it is preferred.
@param type preferred type
@param sd storage directory | [
"Checks",
"if",
"we",
"have",
"information",
"about",
"this",
"directory",
"that",
"it",
"is",
"preferred",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NNStorage.java#L818-L824 |
dropbox/dropbox-sdk-java | src/main/java/com/dropbox/core/android/DbxOfficialAppConnector.java | DbxOfficialAppConnector.getLoggedinState | private static int getLoggedinState(Context context, String uid) {
"""
Determine if user uid is logged in
@param context
@param uid
@return NO_USER if no users connected CORRECT_USER if uid connected WRONG_USER if uid not
connected
"""
Cursor cursor = context.getContentResolver().query(
... | java | private static int getLoggedinState(Context context, String uid) {
Cursor cursor = context.getContentResolver().query(
LOGGED_IN_URI.buildUpon().appendPath(uid).build(), null, // projection
null, // selection clause
null, // selection args
null); // sort order
... | [
"private",
"static",
"int",
"getLoggedinState",
"(",
"Context",
"context",
",",
"String",
"uid",
")",
"{",
"Cursor",
"cursor",
"=",
"context",
".",
"getContentResolver",
"(",
")",
".",
"query",
"(",
"LOGGED_IN_URI",
".",
"buildUpon",
"(",
")",
".",
"appendPa... | Determine if user uid is logged in
@param context
@param uid
@return NO_USER if no users connected CORRECT_USER if uid connected WRONG_USER if uid not
connected | [
"Determine",
"if",
"user",
"uid",
"is",
"logged",
"in"
] | train | https://github.com/dropbox/dropbox-sdk-java/blob/d86157005fad6233c18b4b0f10f00b8d9d56ae92/src/main/java/com/dropbox/core/android/DbxOfficialAppConnector.java#L154-L167 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/repository/index/util/ValidationIndexUtil.java | ValidationIndexUtil.addIndexData | public static void addIndexData(ValidationData data, ValidationDataIndex index) {
"""
Add index data.
@param data the data
@param index the index
"""
String key = index.getKey(data);
List<ValidationData> datas = index.get(key);
if (datas == null) {
datas = new ArrayList... | java | public static void addIndexData(ValidationData data, ValidationDataIndex index) {
String key = index.getKey(data);
List<ValidationData> datas = index.get(key);
if (datas == null) {
datas = new ArrayList<>();
}
datas.add(data);
index.getMap().put(key, datas);
... | [
"public",
"static",
"void",
"addIndexData",
"(",
"ValidationData",
"data",
",",
"ValidationDataIndex",
"index",
")",
"{",
"String",
"key",
"=",
"index",
".",
"getKey",
"(",
"data",
")",
";",
"List",
"<",
"ValidationData",
">",
"datas",
"=",
"index",
".",
"... | Add index data.
@param data the data
@param index the index | [
"Add",
"index",
"data",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/repository/index/util/ValidationIndexUtil.java#L21-L29 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryFileApi.java | RepositoryFileApi.createFile | public RepositoryFile createFile(Object projectIdOrPath, RepositoryFile file, String branchName, String commitMessage) throws GitLabApiException {
"""
Create new file in repository
<pre><code>GitLab Endpoint: POST /projects/:id/repository/files</code></pre>
file_path (required) - Full path to new file. Ex. l... | java | public RepositoryFile createFile(Object projectIdOrPath, RepositoryFile file, String branchName, String commitMessage) throws GitLabApiException {
Form formData = createForm(file, branchName, commitMessage);
Response response;
if (isApiVersion(ApiVersion.V3)) {
response = post(Respo... | [
"public",
"RepositoryFile",
"createFile",
"(",
"Object",
"projectIdOrPath",
",",
"RepositoryFile",
"file",
",",
"String",
"branchName",
",",
"String",
"commitMessage",
")",
"throws",
"GitLabApiException",
"{",
"Form",
"formData",
"=",
"createForm",
"(",
"file",
",",... | Create new file in repository
<pre><code>GitLab Endpoint: POST /projects/:id/repository/files</code></pre>
file_path (required) - Full path to new file. Ex. lib/class.rb
branch_name (required) - The name of branch
encoding (optional) - 'text' or 'base64'. Text is default.
content (required) - File content
commit_mess... | [
"Create",
"new",
"file",
"in",
"repository"
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryFileApi.java#L206-L219 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/admin/common/NumberGenerator.java | NumberGenerator.getNextVal | public String getNextVal(final Object... _args)
throws EFapsException {
"""
Method to get the next value for this sequence. Including additional
format information. To get the long value use {@link #getNextValAsLong()}
@param _args arguments for the formatter
@return next value for this sequence
@thr... | java | public String getNextVal(final Object... _args)
throws EFapsException
{
final Object[] args = new Object[_args.length + 1];
try {
final long val = Context.getDbType().nextSequence(Context.getThreadContext().getConnectionResource(),
getDBName());
... | [
"public",
"String",
"getNextVal",
"(",
"final",
"Object",
"...",
"_args",
")",
"throws",
"EFapsException",
"{",
"final",
"Object",
"[",
"]",
"args",
"=",
"new",
"Object",
"[",
"_args",
".",
"length",
"+",
"1",
"]",
";",
"try",
"{",
"final",
"long",
"va... | Method to get the next value for this sequence. Including additional
format information. To get the long value use {@link #getNextValAsLong()}
@param _args arguments for the formatter
@return next value for this sequence
@throws EFapsException on error | [
"Method",
"to",
"get",
"the",
"next",
"value",
"for",
"this",
"sequence",
".",
"Including",
"additional",
"format",
"information",
".",
"To",
"get",
"the",
"long",
"value",
"use",
"{",
"@link",
"#getNextValAsLong",
"()",
"}"
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/admin/common/NumberGenerator.java#L194-L214 |
mytechia/mytechia_commons | mytechia-commons-modelaction/src/main/java/com/mytechia/commons/framework/modelaction/action/async/AsyncActionPool.java | AsyncActionPool.addAction | public void addAction(ModelAction action, ModelActionListener listener) {
"""
Adds an action to the processing queue
@param action the action to execute
@param listener an optional listener object to be notified of the action end state
"""
synchronized(actionQueue) {
this.actio... | java | public void addAction(ModelAction action, ModelActionListener listener)
{
synchronized(actionQueue) {
this.actionQueue.add(new ModelActionEntry(action, listener));
}
wakeUp();
} | [
"public",
"void",
"addAction",
"(",
"ModelAction",
"action",
",",
"ModelActionListener",
"listener",
")",
"{",
"synchronized",
"(",
"actionQueue",
")",
"{",
"this",
".",
"actionQueue",
".",
"add",
"(",
"new",
"ModelActionEntry",
"(",
"action",
",",
"listener",
... | Adds an action to the processing queue
@param action the action to execute
@param listener an optional listener object to be notified of the action end state | [
"Adds",
"an",
"action",
"to",
"the",
"processing",
"queue"
] | train | https://github.com/mytechia/mytechia_commons/blob/02251879085f271a1fb51663a1c8eddc8be78ae7/mytechia-commons-modelaction/src/main/java/com/mytechia/commons/framework/modelaction/action/async/AsyncActionPool.java#L95-L104 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/protocol/protocolicmpv6_stats.java | protocolicmpv6_stats.get_nitro_response | protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
"""
<pre>
converts nitro response into object and returns the object array in case of get request.
</pre>
"""
protocolicmpv6_stats[] resources = new protocolicmpv6_stats[1];
protocolicmpv6_response res... | java | protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
protocolicmpv6_stats[] resources = new protocolicmpv6_stats[1];
protocolicmpv6_response result = (protocolicmpv6_response) service.get_payload_formatter().string_to_resource(protocolicmpv6_response.class, respons... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"protocolicmpv6_stats",
"[",
"]",
"resources",
"=",
"new",
"protocolicmpv6_stats",
"[",
"1",
"]",
";",
"proto... | <pre>
converts nitro response into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"converts",
"nitro",
"response",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/protocol/protocolicmpv6_stats.java#L442-L461 |
santhosh-tekuri/jlibs | xml/src/main/java/jlibs/xml/ClarkName.java | ClarkName.valueOf | public static String valueOf(String namespace, String localPart) {
"""
Returns string representation as <a href="http://jclark.com/xml/xmlns.htm">defined</a> by James Clark.
<p>
This is same as {@code String} returned by {@link javax.xml.namespace.QName#toString()}.
@param namespace namespace, can be null
@p... | java | public static String valueOf(String namespace, String localPart){
return StringUtil.isEmpty(namespace) ? localPart : '{'+namespace+'}'+localPart;
} | [
"public",
"static",
"String",
"valueOf",
"(",
"String",
"namespace",
",",
"String",
"localPart",
")",
"{",
"return",
"StringUtil",
".",
"isEmpty",
"(",
"namespace",
")",
"?",
"localPart",
":",
"'",
"'",
"+",
"namespace",
"+",
"'",
"'",
"+",
"localPart",
... | Returns string representation as <a href="http://jclark.com/xml/xmlns.htm">defined</a> by James Clark.
<p>
This is same as {@code String} returned by {@link javax.xml.namespace.QName#toString()}.
@param namespace namespace, can be null
@param localPart localpart
@return clarkName | [
"Returns",
"string",
"representation",
"as",
"<a",
"href",
"=",
"http",
":",
"//",
"jclark",
".",
"com",
"/",
"xml",
"/",
"xmlns",
".",
"htm",
">",
"defined<",
"/",
"a",
">",
"by",
"James",
"Clark",
".",
"<p",
">",
"This",
"is",
"same",
"as",
"{",
... | train | https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/xml/src/main/java/jlibs/xml/ClarkName.java#L78-L80 |
knowm/XChange | xchange-campbx/src/main/java/org/knowm/xchange/campbx/CampBXAdapters.java | CampBXAdapters.adaptOrders | public static OrderBook adaptOrders(CampBXOrderBook orderBook, CurrencyPair currencyPair) {
"""
CampBXOrderBook to a OrderBook Object
@param orderBook
@param currencyPair (e.g. BTC/USD)
@return
"""
List<LimitOrder> asks = createOrders(currencyPair, Order.OrderType.ASK, orderBook.getAsks());
List<... | java | public static OrderBook adaptOrders(CampBXOrderBook orderBook, CurrencyPair currencyPair) {
List<LimitOrder> asks = createOrders(currencyPair, Order.OrderType.ASK, orderBook.getAsks());
List<LimitOrder> bids = createOrders(currencyPair, Order.OrderType.BID, orderBook.getBids());
return new OrderBook(null, ... | [
"public",
"static",
"OrderBook",
"adaptOrders",
"(",
"CampBXOrderBook",
"orderBook",
",",
"CurrencyPair",
"currencyPair",
")",
"{",
"List",
"<",
"LimitOrder",
">",
"asks",
"=",
"createOrders",
"(",
"currencyPair",
",",
"Order",
".",
"OrderType",
".",
"ASK",
",",... | CampBXOrderBook to a OrderBook Object
@param orderBook
@param currencyPair (e.g. BTC/USD)
@return | [
"CampBXOrderBook",
"to",
"a",
"OrderBook",
"Object"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-campbx/src/main/java/org/knowm/xchange/campbx/CampBXAdapters.java#L25-L30 |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java | RestClientUtil.addDateMapDocument | public String addDateMapDocument(String indexName, Map bean) throws ElasticSearchException {
"""
创建或者更新索引文档
For Elasticsearch 7 and 7+
@param indexName
@param bean
@return
@throws ElasticSearchException
"""
return addDateMapDocument( indexName, _doc, bean);
} | java | public String addDateMapDocument(String indexName, Map bean) throws ElasticSearchException{
return addDateMapDocument( indexName, _doc, bean);
} | [
"public",
"String",
"addDateMapDocument",
"(",
"String",
"indexName",
",",
"Map",
"bean",
")",
"throws",
"ElasticSearchException",
"{",
"return",
"addDateMapDocument",
"(",
"indexName",
",",
"_doc",
",",
"bean",
")",
";",
"}"
] | 创建或者更新索引文档
For Elasticsearch 7 and 7+
@param indexName
@param bean
@return
@throws ElasticSearchException | [
"创建或者更新索引文档",
"For",
"Elasticsearch",
"7",
"and",
"7",
"+"
] | train | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java#L4427-L4429 |
qiniu/android-sdk | library/src/main/java/com/qiniu/android/storage/FormUploader.java | FormUploader.syncUpload | public static ResponseInfo syncUpload(Client client, Configuration config, byte[] data, String key, UpToken token, UploadOptions options) {
"""
上传数据,并以指定的key保存文件
@param client HTTP连接管理器
@param data 上传的数据
@param key 上传的数据保存的文件名
@param token 上传凭证
@param options 上传时的可选参数
@return 响应信息 ResponseInfo#re... | java | public static ResponseInfo syncUpload(Client client, Configuration config, byte[] data, String key, UpToken token, UploadOptions options) {
try {
return syncUpload0(client, config, data, null, key, token, options);
} catch (Exception e) {
return ResponseInfo.create(null, Respons... | [
"public",
"static",
"ResponseInfo",
"syncUpload",
"(",
"Client",
"client",
",",
"Configuration",
"config",
",",
"byte",
"[",
"]",
"data",
",",
"String",
"key",
",",
"UpToken",
"token",
",",
"UploadOptions",
"options",
")",
"{",
"try",
"{",
"return",
"syncUpl... | 上传数据,并以指定的key保存文件
@param client HTTP连接管理器
@param data 上传的数据
@param key 上传的数据保存的文件名
@param token 上传凭证
@param options 上传时的可选参数
@return 响应信息 ResponseInfo#response 响应体,序列化后 json 格式 | [
"上传数据,并以指定的key保存文件"
] | train | https://github.com/qiniu/android-sdk/blob/dbd2a01fb3bff7a5e75e8934bbf81713124d8466/library/src/main/java/com/qiniu/android/storage/FormUploader.java#L174-L182 |
citrusframework/citrus | modules/citrus-jms/src/main/java/com/consol/citrus/jms/endpoint/JmsSyncProducer.java | JmsSyncProducer.resolveDestination | private Destination resolveDestination(String destinationName) throws JMSException {
"""
Resolve destination from given name.
@param destinationName
@return
@throws JMSException
"""
if (log.isDebugEnabled()) {
log.debug("Sending JMS message to destination: '" + destinationName + "'");
... | java | private Destination resolveDestination(String destinationName) throws JMSException {
if (log.isDebugEnabled()) {
log.debug("Sending JMS message to destination: '" + destinationName + "'");
}
return resolveDestinationName(destinationName, session);
} | [
"private",
"Destination",
"resolveDestination",
"(",
"String",
"destinationName",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Sending JMS message to destination: '\"",
"+",
"destinatio... | Resolve destination from given name.
@param destinationName
@return
@throws JMSException | [
"Resolve",
"destination",
"from",
"given",
"name",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jms/src/main/java/com/consol/citrus/jms/endpoint/JmsSyncProducer.java#L303-L309 |
xebialabs/overcast | src/main/java/com/xebialabs/overcast/support/vagrant/VagrantDriver.java | VagrantDriver.doVagrant | public CommandResponse doVagrant(String vagrantVm, final String... vagrantCommand) {
"""
Executes vagrant command which means that arguments passed here will be prepended with "vagrant"
@param vagrantCommand arguments for <i>vagrant</i> command
@return vagrant response object
"""
CommandResponse resp... | java | public CommandResponse doVagrant(String vagrantVm, final String... vagrantCommand) {
CommandResponse response = commandProcessor.run(
aCommand("vagrant").withArguments(vagrantCommand).withOptions(vagrantVm)
);
if(!response.isSuccessful()) {
throw new RuntimeException... | [
"public",
"CommandResponse",
"doVagrant",
"(",
"String",
"vagrantVm",
",",
"final",
"String",
"...",
"vagrantCommand",
")",
"{",
"CommandResponse",
"response",
"=",
"commandProcessor",
".",
"run",
"(",
"aCommand",
"(",
"\"vagrant\"",
")",
".",
"withArguments",
"("... | Executes vagrant command which means that arguments passed here will be prepended with "vagrant"
@param vagrantCommand arguments for <i>vagrant</i> command
@return vagrant response object | [
"Executes",
"vagrant",
"command",
"which",
"means",
"that",
"arguments",
"passed",
"here",
"will",
"be",
"prepended",
"with",
"vagrant"
] | train | https://github.com/xebialabs/overcast/blob/716e57b66870c9afe51edc3b6045863a34fb0061/src/main/java/com/xebialabs/overcast/support/vagrant/VagrantDriver.java#L38-L56 |
alkacon/opencms-core | src-modules/org/opencms/workplace/CmsReport.java | CmsReport.dialogButtonsContinue | public String dialogButtonsContinue(String okAttrs, String cancelAttrs, String detailsAttrs) {
"""
Builds a button row with an "Ok", a "Cancel" and a "Details" button.<p>
This row is displayed when the first report is running.<p>
@param okAttrs optional attributes for the ok button
@param cancelAttrs option... | java | public String dialogButtonsContinue(String okAttrs, String cancelAttrs, String detailsAttrs) {
if (CmsStringUtil.isEmptyOrWhitespaceOnly(detailsAttrs)) {
detailsAttrs = "";
} else {
detailsAttrs += " ";
}
return dialogButtons(
new int[] {BUTTON_OK, BU... | [
"public",
"String",
"dialogButtonsContinue",
"(",
"String",
"okAttrs",
",",
"String",
"cancelAttrs",
",",
"String",
"detailsAttrs",
")",
"{",
"if",
"(",
"CmsStringUtil",
".",
"isEmptyOrWhitespaceOnly",
"(",
"detailsAttrs",
")",
")",
"{",
"detailsAttrs",
"=",
"\"\"... | Builds a button row with an "Ok", a "Cancel" and a "Details" button.<p>
This row is displayed when the first report is running.<p>
@param okAttrs optional attributes for the ok button
@param cancelAttrs optional attributes for the cancel button
@param detailsAttrs optional attributes for the details button
@return th... | [
"Builds",
"a",
"button",
"row",
"with",
"an",
"Ok",
"a",
"Cancel",
"and",
"a",
"Details",
"button",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/CmsReport.java#L262-L272 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/template/engine/velocity/VelocityUtil.java | VelocityUtil.toFile | public static void toFile(VelocityEngine ve, String templateFileName, VelocityContext context, String destPath) {
"""
生成文件
@param ve 模板引擎
@param templateFileName 模板文件名
@param context 上下文
@param destPath 目标路径(绝对)
"""
toFile(ve.getTemplate(templateFileName), context, destPath);
} | java | public static void toFile(VelocityEngine ve, String templateFileName, VelocityContext context, String destPath) {
toFile(ve.getTemplate(templateFileName), context, destPath);
} | [
"public",
"static",
"void",
"toFile",
"(",
"VelocityEngine",
"ve",
",",
"String",
"templateFileName",
",",
"VelocityContext",
"context",
",",
"String",
"destPath",
")",
"{",
"toFile",
"(",
"ve",
".",
"getTemplate",
"(",
"templateFileName",
")",
",",
"context",
... | 生成文件
@param ve 模板引擎
@param templateFileName 模板文件名
@param context 上下文
@param destPath 目标路径(绝对) | [
"生成文件"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/template/engine/velocity/VelocityUtil.java#L141-L143 |
OWASP/java-html-sanitizer | src/main/java/org/owasp/html/FilterUrlByProtocolAttributePolicy.java | FilterUrlByProtocolAttributePolicy.normalizeUri | static String normalizeUri(String s) {
"""
Percent encodes anything that looks like a colon, or a parenthesis.
"""
int n = s.length();
boolean colonsIrrelevant = false;
for (int i = 0; i < n; ++i) {
char ch = s.charAt(i);
switch (ch) {
case '/': case '#': case '?': case ':':
... | java | static String normalizeUri(String s) {
int n = s.length();
boolean colonsIrrelevant = false;
for (int i = 0; i < n; ++i) {
char ch = s.charAt(i);
switch (ch) {
case '/': case '#': case '?': case ':':
colonsIrrelevant = true;
break;
case '(': case ')':
... | [
"static",
"String",
"normalizeUri",
"(",
"String",
"s",
")",
"{",
"int",
"n",
"=",
"s",
".",
"length",
"(",
")",
";",
"boolean",
"colonsIrrelevant",
"=",
"false",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"n",
";",
"++",
"i",
")",
"... | Percent encodes anything that looks like a colon, or a parenthesis. | [
"Percent",
"encodes",
"anything",
"that",
"looks",
"like",
"a",
"colon",
"or",
"a",
"parenthesis",
"."
] | train | https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/FilterUrlByProtocolAttributePolicy.java#L97-L125 |
apache/flink | flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java | Configuration.addDeprecations | public static void addDeprecations(DeprecationDelta[] deltas) {
"""
Adds a set of deprecated keys to the global deprecations.
This method is lockless. It works by means of creating a new
DeprecationContext based on the old one, and then atomically swapping in
the new context. If someone else updated the con... | java | public static void addDeprecations(DeprecationDelta[] deltas) {
DeprecationContext prev, next;
do {
prev = deprecationContext.get();
next = new DeprecationContext(prev, deltas);
} while (!deprecationContext.compareAndSet(prev, next));
} | [
"public",
"static",
"void",
"addDeprecations",
"(",
"DeprecationDelta",
"[",
"]",
"deltas",
")",
"{",
"DeprecationContext",
"prev",
",",
"next",
";",
"do",
"{",
"prev",
"=",
"deprecationContext",
".",
"get",
"(",
")",
";",
"next",
"=",
"new",
"DeprecationCon... | Adds a set of deprecated keys to the global deprecations.
This method is lockless. It works by means of creating a new
DeprecationContext based on the old one, and then atomically swapping in
the new context. If someone else updated the context in between us reading
the old context and swapping in the new one, we tr... | [
"Adds",
"a",
"set",
"of",
"deprecated",
"keys",
"to",
"the",
"global",
"deprecations",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L456-L462 |
grpc/grpc-java | okhttp/src/main/java/io/grpc/okhttp/Headers.java | Headers.createRequestHeaders | public static List<Header> createRequestHeaders(
Metadata headers, String defaultPath, String authority, String userAgent, boolean useGet) {
"""
Serializes the given headers and creates a list of OkHttp {@link Header}s to be used when
creating a stream. Since this serializes the headers, this method should ... | java | public static List<Header> createRequestHeaders(
Metadata headers, String defaultPath, String authority, String userAgent, boolean useGet) {
Preconditions.checkNotNull(headers, "headers");
Preconditions.checkNotNull(defaultPath, "defaultPath");
Preconditions.checkNotNull(authority, "authority");
... | [
"public",
"static",
"List",
"<",
"Header",
">",
"createRequestHeaders",
"(",
"Metadata",
"headers",
",",
"String",
"defaultPath",
",",
"String",
"authority",
",",
"String",
"userAgent",
",",
"boolean",
"useGet",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(... | Serializes the given headers and creates a list of OkHttp {@link Header}s to be used when
creating a stream. Since this serializes the headers, this method should be called in the
application thread context. | [
"Serializes",
"the",
"given",
"headers",
"and",
"creates",
"a",
"list",
"of",
"OkHttp",
"{"
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/okhttp/src/main/java/io/grpc/okhttp/Headers.java#L49-L93 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/libs/modules/ModelsEngine.java | ModelsEngine.isSourcePixel | public static boolean isSourcePixel( RandomIter flowIter, int col, int row ) {
"""
Verifies if the point is a source pixel in the supplied flow raster.
@param flowIter the {@link RandomIter iterator} of the flowdirections.
@param col the col of the point to check.
@param row the row of the point to check.
@r... | java | public static boolean isSourcePixel( RandomIter flowIter, int col, int row ) {
double flowDirection = flowIter.getSampleDouble(col, row, 0);
if (flowDirection < 9.0 && flowDirection > 0.0) {
for( int k = 1; k <= 8; k++ ) {
if (flowIter.getSampleDouble(col + dirIn[k][1], row +... | [
"public",
"static",
"boolean",
"isSourcePixel",
"(",
"RandomIter",
"flowIter",
",",
"int",
"col",
",",
"int",
"row",
")",
"{",
"double",
"flowDirection",
"=",
"flowIter",
".",
"getSampleDouble",
"(",
"col",
",",
"row",
",",
"0",
")",
";",
"if",
"(",
"flo... | Verifies if the point is a source pixel in the supplied flow raster.
@param flowIter the {@link RandomIter iterator} of the flowdirections.
@param col the col of the point to check.
@param row the row of the point to check.
@return true if the point identified by col and row is a source pixel. | [
"Verifies",
"if",
"the",
"point",
"is",
"a",
"source",
"pixel",
"in",
"the",
"supplied",
"flow",
"raster",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/libs/modules/ModelsEngine.java#L954-L966 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.