repo stringlengths 7 59 | path stringlengths 17 234 | func_name stringlengths 3 117 | original_string stringlengths 63 281k | language stringclasses 1
value | code stringlengths 63 281k | code_tokens listlengths 20 16.3k | docstring stringlengths 1 34k | docstring_tokens listlengths 1 3.44k | sha stringlengths 40 40 | url stringlengths 106 339 | partition stringclasses 3
values | summary stringlengths 3 248 | output stringlengths 142 281k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
artclarke/humble-video | humble-video-noarch/src/main/java/io/humble/video/Encoder.java | Encoder.make | public static Encoder make(Coder src) {
long cPtr = VideoJNI.Encoder_make__SWIG_1(Coder.getCPtr(src), src);
return (cPtr == 0) ? null : new Encoder(cPtr, false);
} | java | public static Encoder make(Coder src) {
long cPtr = VideoJNI.Encoder_make__SWIG_1(Coder.getCPtr(src), src);
return (cPtr == 0) ? null : new Encoder(cPtr, false);
} | [
"public",
"static",
"Encoder",
"make",
"(",
"Coder",
"src",
")",
"{",
"long",
"cPtr",
"=",
"VideoJNI",
".",
"Encoder_make__SWIG_1",
"(",
"Coder",
".",
"getCPtr",
"(",
"src",
")",
",",
"src",
")",
";",
"return",
"(",
"cPtr",
"==",
"0",
")",
"?",
"null... | Creates a Encoder from a given Encoder<br>
@return a Encoder<br>
@throws InvalidArgument if src is null | [
"Creates",
"a",
"Encoder",
"from",
"a",
"given",
"Encoder<br",
">"
] | aa349ae2d7ef74160b7074feac8d298cf90394d1 | https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/Encoder.java#L141-L144 | test | Create a new encoder from a given Coder. | Of course, here is the Java code you requested:
```java
public static Encoder make(Coder src) {
long cPtr = VideoJNI.Encoder_make__SWIG_1(Coder.getCPtr(src), src);
return (cPtr == 0) ? null : new Encoder(cPtr, false);
}
```
Hope this helps! |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/dom3/DOM3TreeWalker.java | DOM3TreeWalker.isTextWellFormed | protected void isTextWellFormed(Text node) {
// Does the data valid XML character data
Character invalidChar = isWFXMLChar(node.getData());
if (invalidChar != null) {
String msg =
Utils.messages.createMessage(
MsgKey.ER_WF_INVALID_CHARACTER_IN_TE... | java | protected void isTextWellFormed(Text node) {
// Does the data valid XML character data
Character invalidChar = isWFXMLChar(node.getData());
if (invalidChar != null) {
String msg =
Utils.messages.createMessage(
MsgKey.ER_WF_INVALID_CHARACTER_IN_TE... | [
"protected",
"void",
"isTextWellFormed",
"(",
"Text",
"node",
")",
"{",
"// Does the data valid XML character data ",
"Character",
"invalidChar",
"=",
"isWFXMLChar",
"(",
"node",
".",
"getData",
"(",
")",
")",
";",
"if",
"(",
"invalidChar",
"!=",
"null",
")... | Checks if an Text node is well-formed, by checking if it contains invalid
XML characters.
@param data The contents of the comment node | [
"Checks",
"if",
"an",
"Text",
"node",
"is",
"well",
"-",
"formed",
"by",
"checking",
"if",
"it",
"contains",
"invalid",
"XML",
"characters",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/dom3/DOM3TreeWalker.java#L1610-L1630 | train | isTextWellFormed This method checks if the text is well - formed. | Of course, here is the Java code you requested:
```java
protected void isTextWellFormed(Text node) {
// Does the data valid XML character data
Character invalidChar = isWFXMLChar(node.getData());
if (invalidChar != null) {
String msg =
Utils.messages.createMessage(... |
gallandarakhneorg/afc | core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/GraphPath.java | GraphPath.removeUntil | public boolean removeUntil(ST obj, PT pt) {
return removeUntil(indexOf(obj, pt), true);
} | java | public boolean removeUntil(ST obj, PT pt) {
return removeUntil(indexOf(obj, pt), true);
} | [
"public",
"boolean",
"removeUntil",
"(",
"ST",
"obj",
",",
"PT",
"pt",
")",
"{",
"return",
"removeUntil",
"(",
"indexOf",
"(",
"obj",
",",
"pt",
")",
",",
"true",
")",
";",
"}"
] | Remove the path's elements before the
specified one which is starting
at the specified point. The specified element will
be removed.
<p>This function removes until the <i>first occurence</i>
of the given object.
@param obj is the segment to remove
@param pt is the point on which the segment was connected
as its first... | [
"Remove",
"the",
"path",
"s",
"elements",
"before",
"the",
"specified",
"one",
"which",
"is",
"starting",
"at",
"the",
"specified",
"point",
".",
"The",
"specified",
"element",
"will",
"be",
"removed",
"."
] | 0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgraph/src/main/java/org/arakhne/afc/math/graph/GraphPath.java#L611-L613 | train | Remove the elements from the list until the specified point is found. | Of course, here is the Java code you requested:
```java
public boolean removeUntil(ST obj, PT pt) {
return removeUntil(indexOf(obj, pt), true);
}
```
Hope this helps! |
alibaba/canal | client-adapter/rdb/src/main/java/com/alibaba/otter/canal/client/adapter/rdb/service/RdbSyncService.java | RdbSyncService.truncate | private void truncate(BatchExecutor batchExecutor, MappingConfig config) throws SQLException {
DbMapping dbMapping = config.getDbMapping();
StringBuilder sql = new StringBuilder();
sql.append("TRUNCATE TABLE ").append(SyncUtil.getDbTableName(dbMapping));
batchExecutor.execute(sql.toStrin... | java | private void truncate(BatchExecutor batchExecutor, MappingConfig config) throws SQLException {
DbMapping dbMapping = config.getDbMapping();
StringBuilder sql = new StringBuilder();
sql.append("TRUNCATE TABLE ").append(SyncUtil.getDbTableName(dbMapping));
batchExecutor.execute(sql.toStrin... | [
"private",
"void",
"truncate",
"(",
"BatchExecutor",
"batchExecutor",
",",
"MappingConfig",
"config",
")",
"throws",
"SQLException",
"{",
"DbMapping",
"dbMapping",
"=",
"config",
".",
"getDbMapping",
"(",
")",
";",
"StringBuilder",
"sql",
"=",
"new",
"StringBuilde... | truncate操作
@param config | [
"truncate操作"
] | 8f088cddc0755f4350c5aaae95c6e4002d90a40f | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/client-adapter/rdb/src/main/java/com/alibaba/otter/canal/client/adapter/rdb/service/RdbSyncService.java#L382-L390 | train | Truncate the table. | Of course, here is the Java code you requested:
```java
private void truncate(BatchExecutor batchExecutor, MappingConfig config) throws SQLException {
DbMapping dbMapping = config.getDbMapping();
StringBuilder sql = new StringBuilder();
sql.append("TRUNCATE TABLE ").append(SyncUtil.getDbTableNa... |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceRequest.java | AmazonWebServiceRequest.withSdkRequestTimeout | public <T extends AmazonWebServiceRequest> T withSdkRequestTimeout(int sdkRequestTimeout) {
setSdkRequestTimeout(sdkRequestTimeout);
@SuppressWarnings("unchecked")
T t = (T) this;
return t;
} | java | public <T extends AmazonWebServiceRequest> T withSdkRequestTimeout(int sdkRequestTimeout) {
setSdkRequestTimeout(sdkRequestTimeout);
@SuppressWarnings("unchecked")
T t = (T) this;
return t;
} | [
"public",
"<",
"T",
"extends",
"AmazonWebServiceRequest",
">",
"T",
"withSdkRequestTimeout",
"(",
"int",
"sdkRequestTimeout",
")",
"{",
"setSdkRequestTimeout",
"(",
"sdkRequestTimeout",
")",
";",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"T",
"t",
"=",
"... | Sets the amount of time to wait (in milliseconds) for the request to complete before giving
up and timing out. A non-positive value disables this feature. Returns the updated
AmazonWebServiceRequest object so that additional method calls may be chained together.
<p>
This feature requires buffering the entire response (... | [
"Sets",
"the",
"amount",
"of",
"time",
"to",
"wait",
"(",
"in",
"milliseconds",
")",
"for",
"the",
"request",
"to",
"complete",
"before",
"giving",
"up",
"and",
"timing",
"out",
".",
"A",
"non",
"-",
"positive",
"value",
"disables",
"this",
"feature",
".... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/AmazonWebServiceRequest.java#L438-L443 | train | Sets the SDK Request Timeout. | Of course, here is the Java code you requested:
```java
public <T extends AmazonWebServiceRequest> T withSdkRequestTimeout(int sdkRequestTimeout) {
setSdkRequestTimeout(sdkRequestTimeout);
@SuppressWarnings("unchecked")
T t = (T) this;
return t;
}
```
Hope this helps! |
lucee/Lucee | core/src/main/java/lucee/commons/lang/ParserString.java | ParserString.isCurrentSpecial | public boolean isCurrentSpecial() {
if (!isValidIndex()) return false;
return lcText[pos] == '_' || lcText[pos] == '$' || lcText[pos] == SystemUtil.SYMBOL_EURO || lcText[pos] == SystemUtil.SYMBOL_POUND;
} | java | public boolean isCurrentSpecial() {
if (!isValidIndex()) return false;
return lcText[pos] == '_' || lcText[pos] == '$' || lcText[pos] == SystemUtil.SYMBOL_EURO || lcText[pos] == SystemUtil.SYMBOL_POUND;
} | [
"public",
"boolean",
"isCurrentSpecial",
"(",
")",
"{",
"if",
"(",
"!",
"isValidIndex",
"(",
")",
")",
"return",
"false",
";",
"return",
"lcText",
"[",
"pos",
"]",
"==",
"'",
"'",
"||",
"lcText",
"[",
"pos",
"]",
"==",
"'",
"'",
"||",
"lcText",
"["... | Gibt zurueck ob das aktuelle Zeichen ein Special Buchstabe ist (_,<euro>,$,<pound>).
@return Gibt zurueck ob das aktuelle Zeichen ein Buchstabe ist. | [
"Gibt",
"zurueck",
"ob",
"das",
"aktuelle",
"Zeichen",
"ein",
"Special",
"Buchstabe",
"ist",
"(",
"_",
"<euro",
">",
"$",
"<pound",
">",
")",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/lang/ParserString.java#L322-L325 | train | Returns true if the current character is a special character. | Of course, here is the Java code you requested:
```java
public boolean isCurrentSpecial() {
if (!isValidIndex()) return false;
return lcText[pos] == '_' || lcText[pos] == '$' || lcText[pos] == SystemUtil.SYMBOL_EURO || lcText[pos] == SystemUtil.SYMBOL_POUND;
}
```
Hope this helps! |
stapler/stapler | groovy/src/main/java/org/kohsuke/stapler/jelly/groovy/JellyBuilder.java | JellyBuilder.getValue | private Object getValue(Entry entry, Class type) {
Object value = entry.getValue();
if (type== Expression.class)
value = new ConstantExpression(entry.getValue());
return value;
} | java | private Object getValue(Entry entry, Class type) {
Object value = entry.getValue();
if (type== Expression.class)
value = new ConstantExpression(entry.getValue());
return value;
} | [
"private",
"Object",
"getValue",
"(",
"Entry",
"entry",
",",
"Class",
"type",
")",
"{",
"Object",
"value",
"=",
"entry",
".",
"getValue",
"(",
")",
";",
"if",
"(",
"type",
"==",
"Expression",
".",
"class",
")",
"value",
"=",
"new",
"ConstantExpression",
... | Obtains the value from the map entry in the right type. | [
"Obtains",
"the",
"value",
"from",
"the",
"map",
"entry",
"in",
"the",
"right",
"type",
"."
] | 11ad5af185e062fb46e01bf9fbed66f3ebf2a8f7 | https://github.com/stapler/stapler/blob/11ad5af185e062fb46e01bf9fbed66f3ebf2a8f7/groovy/src/main/java/org/kohsuke/stapler/jelly/groovy/JellyBuilder.java#L392-L397 | train | Get the value of the entry. | Of course, here is the Java code you requested:
```java
private Object getValue(Entry entry, Class type) {
Object value = entry.getValue();
if (type== Expression.class)
value = new ConstantExpression(entry.getValue());
return value;
}
```
Hope this helps! |
Alluxio/alluxio | core/transport/src/main/java/alluxio/grpc/RegisterMasterPRequest.java | RegisterMasterPRequest.getOptions | public alluxio.grpc.RegisterMasterPOptions getOptions() {
return options_ == null ? alluxio.grpc.RegisterMasterPOptions.getDefaultInstance() : options_;
} | java | public alluxio.grpc.RegisterMasterPOptions getOptions() {
return options_ == null ? alluxio.grpc.RegisterMasterPOptions.getDefaultInstance() : options_;
} | [
"public",
"alluxio",
".",
"grpc",
".",
"RegisterMasterPOptions",
"getOptions",
"(",
")",
"{",
"return",
"options_",
"==",
"null",
"?",
"alluxio",
".",
"grpc",
".",
"RegisterMasterPOptions",
".",
"getDefaultInstance",
"(",
")",
":",
"options_",
";",
"}"
] | <code>optional .alluxio.grpc.meta.RegisterMasterPOptions options = 2;</code> | [
"<code",
">",
"optional",
".",
"alluxio",
".",
"grpc",
".",
"meta",
".",
"RegisterMasterPOptions",
"options",
"=",
"2",
";",
"<",
"/",
"code",
">"
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/transport/src/main/java/alluxio/grpc/RegisterMasterPRequest.java#L122-L124 | train | Gets the options. | Of course, here is the Java code you requested:
```java
public alluxio.grpc.RegisterMasterPOptions getOptions() {
return options_ == null ? alluxio.grpc.RegisterMasterPOptions.getDefaultInstance() : options_;
}
```
Hope this helps! |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnvserver_staserver_binding.java | vpnvserver_staserver_binding.get | public static vpnvserver_staserver_binding[] get(nitro_service service, String name) throws Exception{
vpnvserver_staserver_binding obj = new vpnvserver_staserver_binding();
obj.set_name(name);
vpnvserver_staserver_binding response[] = (vpnvserver_staserver_binding[]) obj.get_resources(service);
return response... | java | public static vpnvserver_staserver_binding[] get(nitro_service service, String name) throws Exception{
vpnvserver_staserver_binding obj = new vpnvserver_staserver_binding();
obj.set_name(name);
vpnvserver_staserver_binding response[] = (vpnvserver_staserver_binding[]) obj.get_resources(service);
return response... | [
"public",
"static",
"vpnvserver_staserver_binding",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"vpnvserver_staserver_binding",
"obj",
"=",
"new",
"vpnvserver_staserver_binding",
"(",
")",
";",
"obj",
"."... | Use this API to fetch vpnvserver_staserver_binding resources of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"vpnvserver_staserver_binding",
"resources",
"of",
"given",
"name",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnvserver_staserver_binding.java#L174-L179 | train | Use this API to fetch vpnvserver_staserver_binding resources of given name. | Of course, here is the Java code you requested:
```java
public static vpnvserver_staserver_binding[] get(nitro_service service, String name) throws Exception{
vpnvserver_staserver_binding obj = new vpnvserver_staserver_binding();
obj.set_name(name);
vpnvserver_staserver_binding response[] = (vpnvserver_staserver... |
ehcache/ehcache3 | core/src/main/java/org/ehcache/core/events/CacheEvents.java | CacheEvents.removal | public static <K, V> CacheEvent<K, V> removal(K removedKey, V removedValue, Cache<K, V> source) {
return new RemovalEvent<>(removedKey, removedValue, source);
} | java | public static <K, V> CacheEvent<K, V> removal(K removedKey, V removedValue, Cache<K, V> source) {
return new RemovalEvent<>(removedKey, removedValue, source);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"CacheEvent",
"<",
"K",
",",
"V",
">",
"removal",
"(",
"K",
"removedKey",
",",
"V",
"removedValue",
",",
"Cache",
"<",
"K",
",",
"V",
">",
"source",
")",
"{",
"return",
"new",
"RemovalEvent",
"<>",
"(",
... | Creates a {@link EventType#REMOVED removed} {@link CacheEvent}.
@param removedKey the removed key
@param removedValue the removed value
@param source the event source
@param <K> the key type
@param <V> the value type
@return a removed cache event | [
"Creates",
"a",
"{",
"@link",
"EventType#REMOVED",
"removed",
"}",
"{",
"@link",
"CacheEvent",
"}",
"."
] | 3cceda57185e522f8d241ddb75146d67ee2af898 | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/core/src/main/java/org/ehcache/core/events/CacheEvents.java#L85-L87 | train | Creates a CacheRemovalEvent. | Of course, here is the Java code you requested:
```java
public static <K, V> CacheEvent<K, V> removal(K removedKey, V removedValue, Cache<K, V> source) {
return new RemovalEvent<>(removedKey, removedValue, source);
}
```
Hope this helps! |
spring-projects/spring-android | spring-android-core/src/main/java/org/springframework/util/ReflectionUtils.java | ReflectionUtils.declaresException | public static boolean declaresException(Method method, Class<?> exceptionType) {
Assert.notNull(method, "Method must not be null");
Class<?>[] declaredExceptions = method.getExceptionTypes();
for (Class<?> declaredException : declaredExceptions) {
if (declaredException.isAssignableFrom(exceptionType)) {
re... | java | public static boolean declaresException(Method method, Class<?> exceptionType) {
Assert.notNull(method, "Method must not be null");
Class<?>[] declaredExceptions = method.getExceptionTypes();
for (Class<?> declaredException : declaredExceptions) {
if (declaredException.isAssignableFrom(exceptionType)) {
re... | [
"public",
"static",
"boolean",
"declaresException",
"(",
"Method",
"method",
",",
"Class",
"<",
"?",
">",
"exceptionType",
")",
"{",
"Assert",
".",
"notNull",
"(",
"method",
",",
"\"Method must not be null\"",
")",
";",
"Class",
"<",
"?",
">",
"[",
"]",
"d... | Determine whether the given method explicitly declares the given
exception or one of its superclasses, which means that an exception of
that type can be propagated as-is within a reflective invocation.
@param method the declaring method
@param exceptionType the exception to throw
@return {@code true} if the exception c... | [
"Determine",
"whether",
"the",
"given",
"method",
"explicitly",
"declares",
"the",
"given",
"exception",
"or",
"one",
"of",
"its",
"superclasses",
"which",
"means",
"that",
"an",
"exception",
"of",
"that",
"type",
"can",
"be",
"propagated",
"as",
"-",
"is",
... | 941296e152d49a40e0745a3e81628a974f72b7e4 | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-core/src/main/java/org/springframework/util/ReflectionUtils.java#L330-L339 | train | Checks if the given method declares an exception of the given type. | Of course, here is the Java code you requested:
```java
public static boolean declaresException(Method method, Class<?> exceptionType) {
Assert.notNull(method, "Method must not be null");
Class<?>[] declaredExceptions = method.getExceptionTypes();
for (Class<?> declaredException : declaredExceptions) {
if (de... |
Azure/azure-sdk-for-java | cognitiveservices/resource-manager/v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CheckSkuAvailabilitysInner.java | CheckSkuAvailabilitysInner.listAsync | public ServiceFuture<CheckSkuAvailabilityResultListInner> listAsync(String location, List<SkuName> skus, Kind kind, String type, final ServiceCallback<CheckSkuAvailabilityResultListInner> serviceCallback) {
return ServiceFuture.fromResponse(listWithServiceResponseAsync(location, skus, kind, type), serviceCallba... | java | public ServiceFuture<CheckSkuAvailabilityResultListInner> listAsync(String location, List<SkuName> skus, Kind kind, String type, final ServiceCallback<CheckSkuAvailabilityResultListInner> serviceCallback) {
return ServiceFuture.fromResponse(listWithServiceResponseAsync(location, skus, kind, type), serviceCallba... | [
"public",
"ServiceFuture",
"<",
"CheckSkuAvailabilityResultListInner",
">",
"listAsync",
"(",
"String",
"location",
",",
"List",
"<",
"SkuName",
">",
"skus",
",",
"Kind",
"kind",
",",
"String",
"type",
",",
"final",
"ServiceCallback",
"<",
"CheckSkuAvailabilityResul... | Check available SKUs.
@param location Resource location.
@param skus The SKU of the resource.
@param kind The Kind of the resource. Possible values include: 'Bing.Autosuggest.v7', 'Bing.CustomSearch', 'Bing.Search.v7', 'Bing.Speech', 'Bing.SpellCheck.v7', 'ComputerVision', 'ContentModerator', 'CustomSpeech', 'CustomVi... | [
"Check",
"available",
"SKUs",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/resource-manager/v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/CheckSkuAvailabilitysInner.java#L93-L95 | train | Gets a list of Sku Ids. | Of course, here is the Java code you requested:
```java
public ServiceFuture<CheckSkuAvailabilityResultListInner> listAsync(String location, List<SkuName> skus, Kind kind, String type, final ServiceCallback<CheckSkuAvailabilityResultListInner> serviceCallback) {
return ServiceFuture.fromResponse(listWithServic... |
amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/EncodedElement.java | EncodedElement.packInt | private static void packInt(int[] inputArray, int bitSize, int startPosIn,
int start, int skip, int countA, byte[] dest) {
if(DEBUG_LEV > 30)
System.err.println("EncodedElement::packInt : Begin");
for(int valI = 0; valI < countA; valI++) {
//int input = inputArray[valI];
int input = inpu... | java | private static void packInt(int[] inputArray, int bitSize, int startPosIn,
int start, int skip, int countA, byte[] dest) {
if(DEBUG_LEV > 30)
System.err.println("EncodedElement::packInt : Begin");
for(int valI = 0; valI < countA; valI++) {
//int input = inputArray[valI];
int input = inpu... | [
"private",
"static",
"void",
"packInt",
"(",
"int",
"[",
"]",
"inputArray",
",",
"int",
"bitSize",
",",
"int",
"startPosIn",
",",
"int",
"start",
",",
"int",
"skip",
",",
"int",
"countA",
",",
"byte",
"[",
"]",
"dest",
")",
"{",
"if",
"(",
"DEBUG_LEV... | Append an equal number of bits from each int in an array within given
limits to the given byte array.
@param inputArray Array storing input values.
@param bitSize number of bits to store from each value.
@param start index of first usable index.
@param skip number of indices to skip between values(in case input data
i... | [
"Append",
"an",
"equal",
"number",
"of",
"bits",
"from",
"each",
"int",
"in",
"an",
"array",
"within",
"given",
"limits",
"to",
"the",
"given",
"byte",
"array",
"."
] | 3d536b877dee2a3fd4ab2e0d9569e292cae93bc9 | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/EncodedElement.java#L689-L744 | train | Pack an integer array into a byte array. | Of course, here is the Java code you requested:
```java
private static void packInt(int[] inputArray, int bitSize, int startPosIn,
int start, int skip, int countA, byte[] dest) {
if(DEBUG_LEV > 30)
System.err.println("EncodedElement::packInt : Begin");
for(int valI = 0; valI < countA; valI++) {
... |
groupon/odo | proxyui/src/main/java/com/groupon/odo/controllers/ControllerUtils.java | ControllerUtils.convertProfileAndPathIdentifier | public static Identifiers convertProfileAndPathIdentifier(String profileIdentifier, String pathIdentifier) throws Exception {
Identifiers id = new Identifiers();
Integer profileId = null;
try {
profileId = ControllerUtils.convertProfileIdentifier(profileIdentifier);
} catch ... | java | public static Identifiers convertProfileAndPathIdentifier(String profileIdentifier, String pathIdentifier) throws Exception {
Identifiers id = new Identifiers();
Integer profileId = null;
try {
profileId = ControllerUtils.convertProfileIdentifier(profileIdentifier);
} catch ... | [
"public",
"static",
"Identifiers",
"convertProfileAndPathIdentifier",
"(",
"String",
"profileIdentifier",
",",
"String",
"pathIdentifier",
")",
"throws",
"Exception",
"{",
"Identifiers",
"id",
"=",
"new",
"Identifiers",
"(",
")",
";",
"Integer",
"profileId",
"=",
"n... | Obtain the IDs of profile and path as Identifiers
@param profileIdentifier actual ID or friendly name of profile
@param pathIdentifier actual ID or friendly name of path
@return
@throws Exception | [
"Obtain",
"the",
"IDs",
"of",
"profile",
"and",
"path",
"as",
"Identifiers"
] | 3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1 | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/ControllerUtils.java#L122-L137 | train | Convert profile and path identifiers to Identifiers | Of course, here is the Java code you requested:
```java
public static Identifiers convertProfileAndPathIdentifier(String profileIdentifier, String pathIdentifier) throws Exception {
Identifiers id = new Identifiers();
Integer profileId = null;
try {
profileId = ControllerUtils.conv... |
colin-lee/mybatis-spring-support | src/main/java/com/github/mybatis/util/EntityUtil.java | EntityUtil.scanJpaAnnotations | private static PersistMeta scanJpaAnnotations(Class<?> clazz) {
//扫描名字处理策略
boolean mapCamelCaseToUnderscore = true;
NameMappingPolicy mapping = clazz.getAnnotation(NameMappingPolicy.class);
if (null != mapping) {
mapCamelCaseToUnderscore = "mapCamelCaseToUnderscore".equals(mapping.value());
}
... | java | private static PersistMeta scanJpaAnnotations(Class<?> clazz) {
//扫描名字处理策略
boolean mapCamelCaseToUnderscore = true;
NameMappingPolicy mapping = clazz.getAnnotation(NameMappingPolicy.class);
if (null != mapping) {
mapCamelCaseToUnderscore = "mapCamelCaseToUnderscore".equals(mapping.value());
}
... | [
"private",
"static",
"PersistMeta",
"scanJpaAnnotations",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"//扫描名字处理策略",
"boolean",
"mapCamelCaseToUnderscore",
"=",
"true",
";",
"NameMappingPolicy",
"mapping",
"=",
"clazz",
".",
"getAnnotation",
"(",
"NameMappingPoli... | 扫描类注解信息
@param clazz
@return | [
"扫描类注解信息"
] | de412e98d00e9a012c0619778fa1a61832863b82 | https://github.com/colin-lee/mybatis-spring-support/blob/de412e98d00e9a012c0619778fa1a61832863b82/src/main/java/com/github/mybatis/util/EntityUtil.java#L53-L116 | train | Scan JPA annotations. | Of course, here is the Java code you requested:
```java
private static PersistMeta scanJpaAnnotations(Class<?> clazz) {
//扫描名字处理策略
boolean mapCamelCaseToUnderscore = true;
NameMappingPolicy mapping = clazz.getAnnotation(NameMappingPolicy.class);
if (null != mapping) {
mapCamelCaseToUnderscore = "... |
Azure/azure-sdk-for-java | mixedreality/resource-manager/v2019_02_28_preview/src/main/java/com/microsoft/azure/management/mixedreality/v2019_02_28_preview/implementation/SpatialAnchorsAccountsInner.java | SpatialAnchorsAccountsInner.regenerateKeys | public SpatialAnchorsAccountKeysInner regenerateKeys(String resourceGroupName, String spatialAnchorsAccountName, Integer serial) {
return regenerateKeysWithServiceResponseAsync(resourceGroupName, spatialAnchorsAccountName, serial).toBlocking().single().body();
} | java | public SpatialAnchorsAccountKeysInner regenerateKeys(String resourceGroupName, String spatialAnchorsAccountName, Integer serial) {
return regenerateKeysWithServiceResponseAsync(resourceGroupName, spatialAnchorsAccountName, serial).toBlocking().single().body();
} | [
"public",
"SpatialAnchorsAccountKeysInner",
"regenerateKeys",
"(",
"String",
"resourceGroupName",
",",
"String",
"spatialAnchorsAccountName",
",",
"Integer",
"serial",
")",
"{",
"return",
"regenerateKeysWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"spatialAnchorsAc... | Regenerate 1 Key of a Spatial Anchors Account.
@param resourceGroupName Name of an Azure resource group.
@param spatialAnchorsAccountName Name of an Mixed Reality Spatial Anchors Account.
@param serial serial of key to be regenerated
@throws IllegalArgumentException thrown if parameters fail the validation
@throws Err... | [
"Regenerate",
"1",
"Key",
"of",
"a",
"Spatial",
"Anchors",
"Account",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mixedreality/resource-manager/v2019_02_28_preview/src/main/java/com/microsoft/azure/management/mixedreality/v2019_02_28_preview/implementation/SpatialAnchorsAccountsInner.java#L874-L876 | train | Regenerate keys for a Spatial Anchors Account. | Of course, here is the Java code you requested:
```java
public SpatialAnchorsAccountKeysInner regenerateKeys(String resourceGroupName, String spatialAnchorsAccountName, Integer serial) {
return regenerateKeysWithServiceResponseAsync(resourceGroupName, spatialAnchorsAccountName, serial).toBlocking().single().bo... |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/KeyStore.java | KeyStore.load | public final void load(InputStream stream, char[] password)
throws IOException, NoSuchAlgorithmException, CertificateException
{
keyStoreSpi.engineLoad(stream, password);
initialized = true;
} | java | public final void load(InputStream stream, char[] password)
throws IOException, NoSuchAlgorithmException, CertificateException
{
keyStoreSpi.engineLoad(stream, password);
initialized = true;
} | [
"public",
"final",
"void",
"load",
"(",
"InputStream",
"stream",
",",
"char",
"[",
"]",
"password",
")",
"throws",
"IOException",
",",
"NoSuchAlgorithmException",
",",
"CertificateException",
"{",
"keyStoreSpi",
".",
"engineLoad",
"(",
"stream",
",",
"password",
... | Loads this KeyStore from the given input stream.
<p>A password may be given to unlock the keystore
(e.g. the keystore resides on a hardware token device),
or to check the integrity of the keystore data.
If a password is not given for integrity checking,
then integrity checking is not performed.
<p>In order to create ... | [
"Loads",
"this",
"KeyStore",
"from",
"the",
"given",
"input",
"stream",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/security/KeyStore.java#L1253-L1258 | train | Load the KeyStore from the specified input stream. | Of course, here is the Java code you requested:
```java
public final void load(InputStream stream, char[] password)
throws IOException, NoSuchAlgorithmException, CertificateException
{
keyStoreSpi.engineLoad(stream, password);
initialized = true;
}
```
Hope this helps! |
landawn/AbacusUtil | src/com/landawn/abacus/util/stream/IntStream.java | IntStream.of | public static IntStream of(final Supplier<IntList> supplier) {
final IntIterator iter = new IntIteratorEx() {
private IntIterator iterator = null;
@Override
public boolean hasNext() {
if (iterator == null) {
init();
... | java | public static IntStream of(final Supplier<IntList> supplier) {
final IntIterator iter = new IntIteratorEx() {
private IntIterator iterator = null;
@Override
public boolean hasNext() {
if (iterator == null) {
init();
... | [
"public",
"static",
"IntStream",
"of",
"(",
"final",
"Supplier",
"<",
"IntList",
">",
"supplier",
")",
"{",
"final",
"IntIterator",
"iter",
"=",
"new",
"IntIteratorEx",
"(",
")",
"{",
"private",
"IntIterator",
"iterator",
"=",
"null",
";",
"@",
"Override",
... | Lazy evaluation.
@param supplier
@return | [
"Lazy",
"evaluation",
"."
] | 544b7720175d15e9329f83dd22a8cc5fa4515e12 | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/IntStream.java#L415-L449 | train | Creates an IntStream backed by the supplied IntList supplier. | Of course, here is the Java code you requested:
```java
public static IntStream of(final Supplier<IntList> supplier) {
final IntIterator iter = new IntIteratorEx() {
private IntIterator iterator = null;
@Override
public boolean hasNext() {
if (iterator... |
aws/aws-sdk-java | aws-java-sdk-pinpointsmsvoice/src/main/java/com/amazonaws/services/pinpointsmsvoice/model/ListConfigurationSetsResult.java | ListConfigurationSetsResult.withConfigurationSets | public ListConfigurationSetsResult withConfigurationSets(String... configurationSets) {
if (this.configurationSets == null) {
setConfigurationSets(new java.util.ArrayList<String>(configurationSets.length));
}
for (String ele : configurationSets) {
this.configurationSets.a... | java | public ListConfigurationSetsResult withConfigurationSets(String... configurationSets) {
if (this.configurationSets == null) {
setConfigurationSets(new java.util.ArrayList<String>(configurationSets.length));
}
for (String ele : configurationSets) {
this.configurationSets.a... | [
"public",
"ListConfigurationSetsResult",
"withConfigurationSets",
"(",
"String",
"...",
"configurationSets",
")",
"{",
"if",
"(",
"this",
".",
"configurationSets",
"==",
"null",
")",
"{",
"setConfigurationSets",
"(",
"new",
"java",
".",
"util",
".",
"ArrayList",
"... | An object that contains a list of configuration sets for your account in the current region.
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setConfigurationSets(java.util.Collection)} or {@link #withConfigurationSets(java.util.Collection)} if
you want to override the existing... | [
"An",
"object",
"that",
"contains",
"a",
"list",
"of",
"configuration",
"sets",
"for",
"your",
"account",
"in",
"the",
"current",
"region",
".",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"This",
"method",
"appends",
"the",
"values",
"to",
... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpointsmsvoice/src/main/java/com/amazonaws/services/pinpointsmsvoice/model/ListConfigurationSetsResult.java#L74-L82 | train | A list of the ID of the configuration sets. | Of course, here is the Java code you requested:
```java
public ListConfigurationSetsResult withConfigurationSets(String... configurationSets) {
if (this.configurationSets == null) {
setConfigurationSets(new java.util.ArrayList<String>(configurationSets.length));
}
for (String ele : ... |
actframework/actframework | src/main/java/act/sys/Env.java | Env.matches | public static boolean matches(AnnotatedElement annotatedElement) {
Annotation[] annotations = annotatedElement.getDeclaredAnnotations();
for (Annotation anno : annotations) {
if (anno instanceof RequireProfile) {
RequireProfile profile = (RequireProfile) anno;
... | java | public static boolean matches(AnnotatedElement annotatedElement) {
Annotation[] annotations = annotatedElement.getDeclaredAnnotations();
for (Annotation anno : annotations) {
if (anno instanceof RequireProfile) {
RequireProfile profile = (RequireProfile) anno;
... | [
"public",
"static",
"boolean",
"matches",
"(",
"AnnotatedElement",
"annotatedElement",
")",
"{",
"Annotation",
"[",
"]",
"annotations",
"=",
"annotatedElement",
".",
"getDeclaredAnnotations",
"(",
")",
";",
"for",
"(",
"Annotation",
"anno",
":",
"annotations",
")"... | Determine if an {@link AnnotatedElement} has environment annotations and if it has then check
if all environment annotations matches the current executing environment
@param annotatedElement an annotated element
@return `true` if the element does not have environment annotations or all environment annotations matches | [
"Determine",
"if",
"an",
"{"
] | 55a8f8b45e71159a79ec6e157c02f71700f8cd54 | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/sys/Env.java#L301-L337 | train | Checks if the annotated element matches the rules. | Of course, here is the Java code you requested:
```java
public static boolean matches(AnnotatedElement annotatedElement) {
Annotation[] annotations = annotatedElement.getDeclaredAnnotations();
for (Annotation anno : annotations) {
if (anno instanceof RequireProfile) {
Requir... |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Client.java | GrafeasV1Beta1Client.updateNote | public final Note updateNote(NoteName name, Note note, FieldMask updateMask) {
UpdateNoteRequest request =
UpdateNoteRequest.newBuilder()
.setName(name == null ? null : name.toString())
.setNote(note)
.setUpdateMask(updateMask)
.build();
return updateNote... | java | public final Note updateNote(NoteName name, Note note, FieldMask updateMask) {
UpdateNoteRequest request =
UpdateNoteRequest.newBuilder()
.setName(name == null ? null : name.toString())
.setNote(note)
.setUpdateMask(updateMask)
.build();
return updateNote... | [
"public",
"final",
"Note",
"updateNote",
"(",
"NoteName",
"name",
",",
"Note",
"note",
",",
"FieldMask",
"updateMask",
")",
"{",
"UpdateNoteRequest",
"request",
"=",
"UpdateNoteRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"name",
"==",
"null",
... | Updates the specified note.
<p>Sample code:
<pre><code>
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
NoteName name = NoteName.of("[PROJECT]", "[NOTE]");
Note note = Note.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Note response = grafeasV1Beta1Clie... | [
"Updates",
"the",
"specified",
"note",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Client.java#L1505-L1514 | train | Update a single note in the NCBI language. | Of course, here is the Java code you requested:
```java
public final Note updateNote(NoteName name, Note note, FieldMask updateMask) {
UpdateNoteRequest request =
UpdateNoteRequest.newBuilder()
.setName(name == null ? null : name.toString())
.setNote(note)
.setUpdateMas... |
google/closure-compiler | src/com/google/javascript/jscomp/CheckJSDoc.java | CheckJSDoc.validateDefinesDeclaration | private void validateDefinesDeclaration(Node n, JSDocInfo info) {
if (info != null && info.isDefine() && n.isLet()) {
report(n, INVALID_DEFINE_ON_LET);
}
} | java | private void validateDefinesDeclaration(Node n, JSDocInfo info) {
if (info != null && info.isDefine() && n.isLet()) {
report(n, INVALID_DEFINE_ON_LET);
}
} | [
"private",
"void",
"validateDefinesDeclaration",
"(",
"Node",
"n",
",",
"JSDocInfo",
"info",
")",
"{",
"if",
"(",
"info",
"!=",
"null",
"&&",
"info",
".",
"isDefine",
"(",
")",
"&&",
"n",
".",
"isLet",
"(",
")",
")",
"{",
"report",
"(",
"n",
",",
"... | Check that a let declaration is not used with {@defines} | [
"Check",
"that",
"a",
"let",
"declaration",
"is",
"not",
"used",
"with",
"{"
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CheckJSDoc.java#L678-L682 | train | Validate define declaration. | Of course, here is the Java code you requested:
```java
private void validateDefinesDeclaration(Node n, JSDocInfo info) {
if (info != null && info.isDefine() && n.isLet()) {
report(n, INVALID_DEFINE_ON_LET);
}
}
```
Hope this helps! |
xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/context/GenericsInfo.java | GenericsInfo.findContextByDeclarationType | public Class<?> findContextByDeclarationType(final Class<?> declarationType) {
Class<?> res = null;
final Set<Class<?>> composingTypes = types.keySet();
if (composingTypes.contains(declarationType)) {
res = declarationType;
} else {
for (Class type : composingType... | java | public Class<?> findContextByDeclarationType(final Class<?> declarationType) {
Class<?> res = null;
final Set<Class<?>> composingTypes = types.keySet();
if (composingTypes.contains(declarationType)) {
res = declarationType;
} else {
for (Class type : composingType... | [
"public",
"Class",
"<",
"?",
">",
"findContextByDeclarationType",
"(",
"final",
"Class",
"<",
"?",
">",
"declarationType",
")",
"{",
"Class",
"<",
"?",
">",
"res",
"=",
"null",
";",
"final",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"composingTypes",
"=... | Search class in current hierarchy, containing declaration type. Used to find appropriate context
when generic could be correctly resolved (knowing generic declaration type).
<p>
There are to situations: either class is directly in hierarchy or it is outer class for some class
in hierarchy (in this case inner class is c... | [
"Search",
"class",
"in",
"current",
"hierarchy",
"containing",
"declaration",
"type",
".",
"Used",
"to",
"find",
"appropriate",
"context",
"when",
"generic",
"could",
"be",
"correctly",
"resolved",
"(",
"knowing",
"generic",
"declaration",
"type",
")",
".",
"<p"... | d7d9d2783265df1178230e8f0b7cb6d853b67a7b | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/context/GenericsInfo.java#L98-L115 | train | Find context by declaration type. | Of course, here is the Java code you requested:
```java
public Class<?> findContextByDeclarationType(final Class<?> declarationType) {
Class<?> res = null;
final Set<Class<?>> composingTypes = types.keySet();
if (composingTypes.contains(declarationType)) {
res = declarationType;
... |
konmik/satellite | satellite/src/main/java/satellite/Restartable.java | Restartable.launch | public void launch(Object arg) {
ReconnectableMap.INSTANCE.dismiss(key);
out.put("restore", true);
out.put("arg", arg);
launches.onNext(arg);
} | java | public void launch(Object arg) {
ReconnectableMap.INSTANCE.dismiss(key);
out.put("restore", true);
out.put("arg", arg);
launches.onNext(arg);
} | [
"public",
"void",
"launch",
"(",
"Object",
"arg",
")",
"{",
"ReconnectableMap",
".",
"INSTANCE",
".",
"dismiss",
"(",
"key",
")",
";",
"out",
".",
"put",
"(",
"\"restore\"",
",",
"true",
")",
";",
"out",
".",
"put",
"(",
"\"arg\"",
",",
"arg",
")",
... | Launches an observable providing an argument.
Dismisses the previous observable instance if it is not completed yet.
Note that to make use of arguments, both
{@link #channel(DeliveryMethod, ObservableFactory)} and
{@link #launch(Object)} variants should be used.
@param arg an argument for the new observable.
It must ... | [
"Launches",
"an",
"observable",
"providing",
"an",
"argument",
".",
"Dismisses",
"the",
"previous",
"observable",
"instance",
"if",
"it",
"is",
"not",
"completed",
"yet",
"."
] | 7b0d3194bf84b3db4c233a131890a23e2d5825b9 | https://github.com/konmik/satellite/blob/7b0d3194bf84b3db4c233a131890a23e2d5825b9/satellite/src/main/java/satellite/Restartable.java#L123-L128 | train | Launches a new instance of the class. | Of course, here is the Java code you requested:
```java
public void launch(Object arg) {
ReconnectableMap.INSTANCE.dismiss(key);
out.put("restore", true);
out.put("arg", arg);
launches.onNext(arg);
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-organizations/src/main/java/com/amazonaws/services/organizations/model/ListTargetsForPolicyResult.java | ListTargetsForPolicyResult.setTargets | public void setTargets(java.util.Collection<PolicyTargetSummary> targets) {
if (targets == null) {
this.targets = null;
return;
}
this.targets = new java.util.ArrayList<PolicyTargetSummary>(targets);
} | java | public void setTargets(java.util.Collection<PolicyTargetSummary> targets) {
if (targets == null) {
this.targets = null;
return;
}
this.targets = new java.util.ArrayList<PolicyTargetSummary>(targets);
} | [
"public",
"void",
"setTargets",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"PolicyTargetSummary",
">",
"targets",
")",
"{",
"if",
"(",
"targets",
"==",
"null",
")",
"{",
"this",
".",
"targets",
"=",
"null",
";",
"return",
";",
"}",
"this",
".",
... | <p>
A list of structures, each of which contains details about one of the entities to which the specified policy is
attached.
</p>
@param targets
A list of structures, each of which contains details about one of the entities to which the specified
policy is attached. | [
"<p",
">",
"A",
"list",
"of",
"structures",
"each",
"of",
"which",
"contains",
"details",
"about",
"one",
"of",
"the",
"entities",
"to",
"which",
"the",
"specified",
"policy",
"is",
"attached",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-organizations/src/main/java/com/amazonaws/services/organizations/model/ListTargetsForPolicyResult.java#L68-L75 | train | Sets the value of the targets property. | Of course, here is the Java code you requested:
```java
public void setTargets(java.util.Collection<PolicyTargetSummary> targets) {
if (targets == null) {
this.targets = null;
return;
}
this.targets = new java.util.ArrayList<PolicyTargetSummary>(targets);
}
```
Hop... |
spring-projects/spring-ldap | ldif/ldif-core/src/main/java/org/springframework/ldap/ldif/support/DefaultAttributeValidationPolicy.java | DefaultAttributeValidationPolicy.parse | public Attribute parse(String buffer) {
log.trace("Parsing --> [" + buffer + "]");
Matcher matcher = ATTRIBUTE_PATTERN.matcher(buffer);
if (matcher.matches()) {
//Is a regular attribute...
return parseStringAttribute(matcher);
}
matcher = BASE64_ATTRIBUTE_PATTERN.matcher(buffer);
if (ma... | java | public Attribute parse(String buffer) {
log.trace("Parsing --> [" + buffer + "]");
Matcher matcher = ATTRIBUTE_PATTERN.matcher(buffer);
if (matcher.matches()) {
//Is a regular attribute...
return parseStringAttribute(matcher);
}
matcher = BASE64_ATTRIBUTE_PATTERN.matcher(buffer);
if (ma... | [
"public",
"Attribute",
"parse",
"(",
"String",
"buffer",
")",
"{",
"log",
".",
"trace",
"(",
"\"Parsing --> [\"",
"+",
"buffer",
"+",
"\"]\"",
")",
";",
"Matcher",
"matcher",
"=",
"ATTRIBUTE_PATTERN",
".",
"matcher",
"(",
"buffer",
")",
";",
"if",
"(",
"... | Validates attribute contained in the buffer and returns an LdapAttribute.
<p>
Ensures attributes meets one of four prescribed patterns for valid attributes:
<ol>
<li>A standard attribute pattern of the form: ATTR_ID[;options]: VALUE</li>
<li>A Base64 attribute pattern of the form: ATTR_ID[;options]:: BASE64_VALUE</li>
... | [
"Validates",
"attribute",
"contained",
"in",
"the",
"buffer",
"and",
"returns",
"an",
"LdapAttribute",
".",
"<p",
">",
"Ensures",
"attributes",
"meets",
"one",
"of",
"four",
"prescribed",
"patterns",
"for",
"valid",
"attributes",
":",
"<ol",
">",
"<li",
">",
... | 15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0 | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/ldif/ldif-core/src/main/java/org/springframework/ldap/ldif/support/DefaultAttributeValidationPolicy.java#L306-L335 | train | Parses the attribute from the given string. | Of course, here is the Java code you requested:
```java
public Attribute parse(String buffer) {
log.trace("Parsing --> [" + buffer + "]");
Matcher matcher = ATTRIBUTE_PATTERN.matcher(buffer);
if (matcher.matches()) {
//Is a regular attribute...
return parseStringAttribute(matcher);
}
match... |
ingwarsw/arquillian-suite-extension | src/main/java/org/eu/ingwar/tools/arquillian/extension/deployment/EarDescriptorBuilder.java | EarDescriptorBuilder.writeEjbModule | private void writeEjbModule(String filename) {
Element element = writeModule();
Element ejb = doc.createElement("ejb");
element.appendChild(ejb);
ejb.setTextContent(filename);
} | java | private void writeEjbModule(String filename) {
Element element = writeModule();
Element ejb = doc.createElement("ejb");
element.appendChild(ejb);
ejb.setTextContent(filename);
} | [
"private",
"void",
"writeEjbModule",
"(",
"String",
"filename",
")",
"{",
"Element",
"element",
"=",
"writeModule",
"(",
")",
";",
"Element",
"ejb",
"=",
"doc",
".",
"createElement",
"(",
"\"ejb\"",
")",
";",
"element",
".",
"appendChild",
"(",
"ejb",
")",... | Writes WEB part to application.xml.
@param filename name of module | [
"Writes",
"WEB",
"part",
"to",
"application",
".",
"xml",
"."
] | 93c9e542ead1d52f45e87b0632bb02ac11f693c8 | https://github.com/ingwarsw/arquillian-suite-extension/blob/93c9e542ead1d52f45e87b0632bb02ac11f693c8/src/main/java/org/eu/ingwar/tools/arquillian/extension/deployment/EarDescriptorBuilder.java#L208-L213 | train | Write the ejb module. | Of course, here is the Java code you requested:
```java
private void writeEjbModule(String filename) {
Element element = writeModule();
Element ejb = doc.createElement("ejb");
element.appendChild(ejb);
ejb.setTextContent(filename);
}
```
Hope this helps! |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java | MessageItem.xmlWriteOn | @Override
public void xmlWriteOn(FormattedWriter writer) throws IOException
{
// Restore an un-cached message to we can dump its state
if (msg == null)
getJSMessage(true);
try
{
if (msg != null)
{
writer.newLine();
... | java | @Override
public void xmlWriteOn(FormattedWriter writer) throws IOException
{
// Restore an un-cached message to we can dump its state
if (msg == null)
getJSMessage(true);
try
{
if (msg != null)
{
writer.newLine();
... | [
"@",
"Override",
"public",
"void",
"xmlWriteOn",
"(",
"FormattedWriter",
"writer",
")",
"throws",
"IOException",
"{",
"// Restore an un-cached message to we can dump its state",
"if",
"(",
"msg",
"==",
"null",
")",
"getJSMessage",
"(",
"true",
")",
";",
"try",
"{",
... | Prints the Message Details to the xml output. | [
"Prints",
"the",
"Message",
"Details",
"to",
"the",
"xml",
"output",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java#L2442-L2549 | train | Override XML writeOn to write the message to a formatted writer. | Of course, here is the Java code you requested:
```java
@Override
public void xmlWriteOn(FormattedWriter writer) throws IOException
{
// Restore an un-cached message to we can dump its state
if (msg == null)
getJSMessage(true);
try
{
if (msg != null)
... |
samskivert/samskivert | src/main/java/com/samskivert/util/Config.java | Config.getValue | public String getValue (String name, String defval)
{
return _props.getProperty(name, defval);
} | java | public String getValue (String name, String defval)
{
return _props.getProperty(name, defval);
} | [
"public",
"String",
"getValue",
"(",
"String",
"name",
",",
"String",
"defval",
")",
"{",
"return",
"_props",
".",
"getProperty",
"(",
"name",
",",
"defval",
")",
";",
"}"
] | Fetches and returns the value for the specified configuration property. If the value is not
specified in the associated properties file, the supplied default value is returned instead.
@param name the name of the property to be fetched.
@param defval the value to return if the property is not specified in the config f... | [
"Fetches",
"and",
"returns",
"the",
"value",
"for",
"the",
"specified",
"configuration",
"property",
".",
"If",
"the",
"value",
"is",
"not",
"specified",
"in",
"the",
"associated",
"properties",
"file",
"the",
"supplied",
"default",
"value",
"is",
"returned",
... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Config.java#L202-L205 | train | Returns the value of the property with the given name. | Of course, here is the Java code you requested:
```java
public String getValue (String name, String defval)
{
return _props.getProperty(name, defval);
}
```
Hope this helps! |
alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/transition/ViewsTransitionAnimator.java | ViewsTransitionAnimator.exit | public void exit(boolean withAnimation) {
if (getRequestedId() == null) {
throw new IllegalStateException("You should call enter(...) before calling exit(...)");
}
if (GestureDebug.isDebugAnimator()) {
Log.d(TAG, "Exit requested from " + getRequestedId()
... | java | public void exit(boolean withAnimation) {
if (getRequestedId() == null) {
throw new IllegalStateException("You should call enter(...) before calling exit(...)");
}
if (GestureDebug.isDebugAnimator()) {
Log.d(TAG, "Exit requested from " + getRequestedId()
... | [
"public",
"void",
"exit",
"(",
"boolean",
"withAnimation",
")",
"{",
"if",
"(",
"getRequestedId",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"You should call enter(...) before calling exit(...)\"",
")",
";",
"}",
"if",
"(",
... | Plays exit animation, should only be called after corresponding call to
{@link #enter(Object, boolean)}.
@param withAnimation Whether to animate exiting or immediately jump to initial state
@see #isLeaving() | [
"Plays",
"exit",
"animation",
"should",
"only",
"be",
"called",
"after",
"corresponding",
"call",
"to",
"{",
"@link",
"#enter",
"(",
"Object",
"boolean",
")",
"}",
"."
] | f0a4c266e31dcad23bd0d9013531bc1c501b9c9f | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/transition/ViewsTransitionAnimator.java#L98-L111 | train | Exit the application. | Of course, here is the Java code you requested:
```java
public void exit(boolean withAnimation) {
if (getRequestedId() == null) {
throw new IllegalStateException("You should call enter(...) before calling exit(...)");
}
if (GestureDebug.isDebugAnimator()) {
Log.d(TAG, "... |
apache/spark | examples/src/main/java/org/apache/spark/examples/sql/JavaUserDefinedUntypedAggregation.java | JavaUserDefinedUntypedAggregation.main | public static void main(String[] args) {
SparkSession spark = SparkSession
.builder()
.appName("Java Spark SQL user-defined DataFrames aggregation example")
.getOrCreate();
// $example on:untyped_custom_aggregation$
// Register the function to access it
spark.udf().register("myAverage... | java | public static void main(String[] args) {
SparkSession spark = SparkSession
.builder()
.appName("Java Spark SQL user-defined DataFrames aggregation example")
.getOrCreate();
// $example on:untyped_custom_aggregation$
// Register the function to access it
spark.udf().register("myAverage... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"SparkSession",
"spark",
"=",
"SparkSession",
".",
"builder",
"(",
")",
".",
"appName",
"(",
"\"Java Spark SQL user-defined DataFrames aggregation example\"",
")",
".",
"getOrCreate",
"... | $example off:untyped_custom_aggregation$ | [
"$example",
"off",
":",
"untyped_custom_aggregation$"
] | 25ee0474f47d9c30d6f553a7892d9549f91071cf | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/examples/src/main/java/org/apache/spark/examples/sql/JavaUserDefinedUntypedAggregation.java#L99-L131 | train | Example of creating or updating a new Spark session. | Of course, here is the Java code you requested:
```java
public static void main(String[] args) {
SparkSession spark = SparkSession
.builder()
.appName("Java Spark SQL user-defined DataFrames aggregation example")
.getOrCreate();
// $example on:untyped_custom_aggregation$
// Register the ... |
Waikato/moa | moa/src/main/java/com/yahoo/labs/samoa/instances/Range.java | Range.setRange | public void setRange(String range) {
String single = range.trim();
int hyphenIndex = range.indexOf('-');
if (hyphenIndex > 0) {
this.start = rangeSingle(range.substring(0, hyphenIndex));
this.end = rangeSingle(range.substring(hyphenIndex + 1));
} else {
... | java | public void setRange(String range) {
String single = range.trim();
int hyphenIndex = range.indexOf('-');
if (hyphenIndex > 0) {
this.start = rangeSingle(range.substring(0, hyphenIndex));
this.end = rangeSingle(range.substring(hyphenIndex + 1));
} else {
... | [
"public",
"void",
"setRange",
"(",
"String",
"range",
")",
"{",
"String",
"single",
"=",
"range",
".",
"trim",
"(",
")",
";",
"int",
"hyphenIndex",
"=",
"range",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"hyphenIndex",
">",
"0",
")",
"{",... | Sets the range from a string representation.
@param range the start and end string | [
"Sets",
"the",
"range",
"from",
"a",
"string",
"representation",
"."
] | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/com/yahoo/labs/samoa/instances/Range.java#L39-L56 | train | Sets the range of the attribute. | Of course, here is the Java code you requested:
```java
public void setRange(String range) {
String single = range.trim();
int hyphenIndex = range.indexOf('-');
if (hyphenIndex > 0) {
this.start = rangeSingle(range.substring(0, hyphenIndex));
this.end = rangeSingle(rang... |
kuujo/vertigo | core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultOutputConnection.java | DefaultOutputConnection.doGroupSend | void doGroupSend(String group, Object value) {
checkOpen();
JsonObject message = createMessage(value)
.putString("action", "group")
.putString("group", group);
if (open && !paused) {
if (log.isDebugEnabled()) {
log.debug(String.format("%s - Group send: Group[group=%s, id=%d, me... | java | void doGroupSend(String group, Object value) {
checkOpen();
JsonObject message = createMessage(value)
.putString("action", "group")
.putString("group", group);
if (open && !paused) {
if (log.isDebugEnabled()) {
log.debug(String.format("%s - Group send: Group[group=%s, id=%d, me... | [
"void",
"doGroupSend",
"(",
"String",
"group",
",",
"Object",
"value",
")",
"{",
"checkOpen",
"(",
")",
";",
"JsonObject",
"message",
"=",
"createMessage",
"(",
"value",
")",
".",
"putString",
"(",
"\"action\"",
",",
"\"group\"",
")",
".",
"putString",
"("... | Sends a group message. | [
"Sends",
"a",
"group",
"message",
"."
] | c5869dbc5fff89eb5262e83f7a81719b01a5ba6f | https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultOutputConnection.java#L471-L486 | train | Send a group message to the server. | Of course, here is the Java code you requested:
```java
void doGroupSend(String group, Object value) {
checkOpen();
JsonObject message = createMessage(value)
.putString("action", "group")
.putString("group", group);
if (open && !paused) {
if (log.isDebugEnabled()) {
log.debug(... |
alkacon/opencms-core | src/org/opencms/main/OpenCmsCore.java | OpenCmsCore.getLoginFormURL | private String getLoginFormURL(HttpServletRequest req, HttpServletResponse res) throws IOException {
CmsHttpAuthenticationSettings httpAuthenticationSettings = OpenCms.getSystemInfo().getHttpAuthenticationSettings();
String loginFormURL = null;
// this will create an admin user with the "right... | java | private String getLoginFormURL(HttpServletRequest req, HttpServletResponse res) throws IOException {
CmsHttpAuthenticationSettings httpAuthenticationSettings = OpenCms.getSystemInfo().getHttpAuthenticationSettings();
String loginFormURL = null;
// this will create an admin user with the "right... | [
"private",
"String",
"getLoginFormURL",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"throws",
"IOException",
"{",
"CmsHttpAuthenticationSettings",
"httpAuthenticationSettings",
"=",
"OpenCms",
".",
"getSystemInfo",
"(",
")",
".",
"getHttpAuth... | Reads the login form which should be used for authenticating the current request.<p>
@param req current request
@param res current response
@return the URL of the login form or <code>null</code> if not set
@throws IOException in case of IO errors | [
"Reads",
"the",
"login",
"form",
"which",
"should",
"be",
"used",
"for",
"authenticating",
"the",
"current",
"request",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/OpenCmsCore.java#L2582-L2666 | train | Gets the login form URL. | Of course, here is the Java code you requested:
```java
private String getLoginFormURL(HttpServletRequest req, HttpServletResponse res) throws IOException {
CmsHttpAuthenticationSettings httpAuthenticationSettings = OpenCms.getSystemInfo().getHttpAuthenticationSettings();
String loginFormURL = null;
... |
aerogear/java-mpns | src/main/java/org/jboss/aerogear/windows/mpns/notifications/AbstractNotificationBuilder.java | AbstractNotificationBuilder.callbackUri | public A callbackUri(String callbackUri) {
this.headers.add(Pair.of("X-CallbackURI", callbackUri));
return (A)this;
} | java | public A callbackUri(String callbackUri) {
this.headers.add(Pair.of("X-CallbackURI", callbackUri));
return (A)this;
} | [
"public",
"A",
"callbackUri",
"(",
"String",
"callbackUri",
")",
"{",
"this",
".",
"headers",
".",
"add",
"(",
"Pair",
".",
"of",
"(",
"\"X-CallbackURI\"",
",",
"callbackUri",
")",
")",
";",
"return",
"(",
"A",
")",
"this",
";",
"}"
] | Sets the notification channel URI that the registered callback message
will be sent to.
When using an authenticated web service, this parameter is required.
@param callbackUri the notification channel URI
@return this | [
"Sets",
"the",
"notification",
"channel",
"URI",
"that",
"the",
"registered",
"callback",
"message",
"will",
"be",
"sent",
"to",
"."
] | d743734578827320eeead7368c50fd2d7b1d14cb | https://github.com/aerogear/java-mpns/blob/d743734578827320eeead7368c50fd2d7b1d14cb/src/main/java/org/jboss/aerogear/windows/mpns/notifications/AbstractNotificationBuilder.java#L115-L118 | train | Sets the value callbackUri. | Of course, here is the Java code you requested:
```java
public A callbackUri(String callbackUri) {
this.headers.add(Pair.of("X-CallbackURI", callbackUri));
return (A)this;
}
```
Hope this helps! |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/ShareResourcesImpl.java | ShareResourcesImpl.getShare | public Share getShare(long objectId, String shareId) throws SmartsheetException{
return this.getResource(getMasterResourceType() + "/" + objectId + "/shares/" + shareId, Share.class);
} | java | public Share getShare(long objectId, String shareId) throws SmartsheetException{
return this.getResource(getMasterResourceType() + "/" + objectId + "/shares/" + shareId, Share.class);
} | [
"public",
"Share",
"getShare",
"(",
"long",
"objectId",
",",
"String",
"shareId",
")",
"throws",
"SmartsheetException",
"{",
"return",
"this",
".",
"getResource",
"(",
"getMasterResourceType",
"(",
")",
"+",
"\"/\"",
"+",
"objectId",
"+",
"\"/shares/\"",
"+",
... | Get a Share.
It mirrors to the following Smartsheet REST API method:
GET /workspaces/{workspaceId}/shares/{shareId}
GET /sheets/{sheetId}/shares/{shareId}
GET /sights/{sightId}/shares
GET /reports/{reportId}/shares
Exceptions:
InvalidRequestException : if there is any problem with the REST API request
AuthorizationEx... | [
"Get",
"a",
"Share",
"."
] | f60e264412076271f83b65889ef9b891fad83df8 | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/ShareResourcesImpl.java#L117-L119 | train | Get a Share object. | Of course, here is the Java code you requested:
```java
public Share getShare(long objectId, String shareId) throws SmartsheetException{
return this.getResource(getMasterResourceType() + "/" + objectId + "/shares/" + shareId, Share.class);
}
```
Hope this helps! |
teatrove/teatrove | teaapps/src/main/java/org/teatrove/teaapps/contexts/StringContext.java | StringContext.substring | public String substring(String str, int startIndex, int endIndex) {
return (str == null) ? null : str.substring(startIndex, endIndex);
} | java | public String substring(String str, int startIndex, int endIndex) {
return (str == null) ? null : str.substring(startIndex, endIndex);
} | [
"public",
"String",
"substring",
"(",
"String",
"str",
",",
"int",
"startIndex",
",",
"int",
"endIndex",
")",
"{",
"return",
"(",
"str",
"==",
"null",
")",
"?",
"null",
":",
"str",
".",
"substring",
"(",
"startIndex",
",",
"endIndex",
")",
";",
"}"
] | Returns a sub-portion of the given string for the characters that are at
or after the starting index, and are before the end index.
@param str the source string
@param startIndex the start index, inclusive
@param endIndex the ending index, exclusive
@return the specified substring. | [
"Returns",
"a",
"sub",
"-",
"portion",
"of",
"the",
"given",
"string",
"for",
"the",
"characters",
"that",
"are",
"at",
"or",
"after",
"the",
"starting",
"index",
"and",
"are",
"before",
"the",
"end",
"index",
"."
] | 7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaapps/src/main/java/org/teatrove/teaapps/contexts/StringContext.java#L197-L199 | train | Returns substring of the specified string. | Of course, here is the Java code you requested:
```java
public String substring(String str, int startIndex, int endIndex) {
return (str == null) ? null : str.substring(startIndex, endIndex);
}
```
Hope this helps! |
evernote/android-job | library/src/main/java/com/evernote/android/job/JobManager.java | JobManager.schedule | public synchronized void schedule(@NonNull JobRequest request) {
// call must be synchronized, otherwise with isUpdateCurrent() true it's possible to end up in a race condition with multiple jobs scheduled
if (mJobCreatorHolder.isEmpty()) {
CAT.w("you haven't registered a JobCreator with ad... | java | public synchronized void schedule(@NonNull JobRequest request) {
// call must be synchronized, otherwise with isUpdateCurrent() true it's possible to end up in a race condition with multiple jobs scheduled
if (mJobCreatorHolder.isEmpty()) {
CAT.w("you haven't registered a JobCreator with ad... | [
"public",
"synchronized",
"void",
"schedule",
"(",
"@",
"NonNull",
"JobRequest",
"request",
")",
"{",
"// call must be synchronized, otherwise with isUpdateCurrent() true it's possible to end up in a race condition with multiple jobs scheduled",
"if",
"(",
"mJobCreatorHolder",
".",
"... | Schedule a request which will be executed in the future. If you want to update an existing
{@link JobRequest}, call {@link JobRequest#cancelAndEdit()}, update your parameters and call
this method again. Calling this method with the same request multiple times without cancelling
it is idempotent.
@param request The {@l... | [
"Schedule",
"a",
"request",
"which",
"will",
"be",
"executed",
"in",
"the",
"future",
".",
"If",
"you",
"want",
"to",
"update",
"an",
"existing",
"{",
"@link",
"JobRequest",
"}",
"call",
"{",
"@link",
"JobRequest#cancelAndEdit",
"()",
"}",
"update",
"your",
... | 5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf | https://github.com/evernote/android-job/blob/5ae3d776ad9d80b5b7f60ae3e382d44d0d193faf/library/src/main/java/com/evernote/android/job/JobManager.java#L173-L233 | train | Schedule a job. | Of course, here is the Java code you requested:
```java
public synchronized void schedule(@NonNull JobRequest request) {
// call must be synchronized, otherwise with isUpdateCurrent() true it's possible to end up in a race condition with multiple jobs scheduled
if (mJobCreatorHolder.isEmpty()) {
... |
jmeetsma/Iglu-Util | src/main/java/org/ijsberg/iglu/util/misc/StringSupport.java | StringSupport.removeAll | public static String removeAll(String haystack, String ... needles) {
return replaceAll(haystack, needles, ArraySupport.getFilledArray(new String[needles.length], ""));
} | java | public static String removeAll(String haystack, String ... needles) {
return replaceAll(haystack, needles, ArraySupport.getFilledArray(new String[needles.length], ""));
} | [
"public",
"static",
"String",
"removeAll",
"(",
"String",
"haystack",
",",
"String",
"...",
"needles",
")",
"{",
"return",
"replaceAll",
"(",
"haystack",
",",
"needles",
",",
"ArraySupport",
".",
"getFilledArray",
"(",
"new",
"String",
"[",
"needles",
".",
"... | removes all occurrences of needle in haystack
@param haystack input string
@param needles strings to remove | [
"removes",
"all",
"occurrences",
"of",
"needle",
"in",
"haystack"
] | 971eb022115247b1e34dc26dd02e7e621e29e910 | https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/misc/StringSupport.java#L250-L252 | train | Removes all occurrences of haystack from haystack with needles | Of course, here is the Java code you requested:
```java
public static String removeAll(String haystack, String ... needles) {
return replaceAll(haystack, needles, ArraySupport.getFilledArray(new String[needles.length], ""));
}
```
Hope this helps! |
reactor/reactor-core | reactor-core/src/main/java/reactor/core/publisher/Flux.java | Flux.convertToMono | static <T> Mono<T> convertToMono(Callable<T> supplier) {
if (supplier instanceof Fuseable.ScalarCallable) {
Fuseable.ScalarCallable<T> scalarCallable = (Fuseable.ScalarCallable<T>) supplier;
T v;
try {
v = scalarCallable.call();
}
catch (Exception e) {
return Mono.error(e);
}
if (v == nu... | java | static <T> Mono<T> convertToMono(Callable<T> supplier) {
if (supplier instanceof Fuseable.ScalarCallable) {
Fuseable.ScalarCallable<T> scalarCallable = (Fuseable.ScalarCallable<T>) supplier;
T v;
try {
v = scalarCallable.call();
}
catch (Exception e) {
return Mono.error(e);
}
if (v == nu... | [
"static",
"<",
"T",
">",
"Mono",
"<",
"T",
">",
"convertToMono",
"(",
"Callable",
"<",
"T",
">",
"supplier",
")",
"{",
"if",
"(",
"supplier",
"instanceof",
"Fuseable",
".",
"ScalarCallable",
")",
"{",
"Fuseable",
".",
"ScalarCallable",
"<",
"T",
">",
"... | Returns the appropriate Mono instance for a known Supplier Flux.
@param supplier the supplier Flux
@return the mono representing that Flux | [
"Returns",
"the",
"appropriate",
"Mono",
"instance",
"for",
"a",
"known",
"Supplier",
"Flux",
"."
] | df2eba4ab7d2393e1a942ce972c3307fbbd47ff9 | https://github.com/reactor/reactor-core/blob/df2eba4ab7d2393e1a942ce972c3307fbbd47ff9/reactor-core/src/main/java/reactor/core/publisher/Flux.java#L9315-L9332 | valid | Convert a Callable to Mono | Of course, here is the Java code you requested:
```java
static <T> Mono<T> convertToMono(Callable<T> supplier) {
if (supplier instanceof Fuseable.ScalarCallable) {
Fuseable.ScalarCallable<T> scalarCallable = (Fuseable.ScalarCallable<T>) supplier;
T v;
try {
v = scalarCallable.call();
}
catch (Exc... |
wildfly/wildfly | clustering/common/src/main/java/org/jboss/as/clustering/controller/transform/SimpleOperationTransformer.java | SimpleOperationTransformer.transformOperation | @Override
public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) {
return new TransformedOperation(this.operationTransformer.transformOperation(operation), this.resultTransformer);
} | java | @Override
public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) {
return new TransformedOperation(this.operationTransformer.transformOperation(operation), this.resultTransformer);
} | [
"@",
"Override",
"public",
"TransformedOperation",
"transformOperation",
"(",
"TransformationContext",
"context",
",",
"PathAddress",
"address",
",",
"ModelNode",
"operation",
")",
"{",
"return",
"new",
"TransformedOperation",
"(",
"this",
".",
"operationTransformer",
"... | {@inheritDoc} | [
"{"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/clustering/common/src/main/java/org/jboss/as/clustering/controller/transform/SimpleOperationTransformer.java#L50-L53 | test | Transform an operation. | Of course, here is the Java code you requested:
```java
@Override
public TransformedOperation transformOperation(TransformationContext context, PathAddress address, ModelNode operation) {
return new TransformedOperation(this.operationTransformer.transformOperation(operation), this.resultTransformer);
}... |
loldevs/riotapi | rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/LcdsChampionTradeService.java | LcdsChampionTradeService.attemptTrade | public Object attemptTrade(String summonerInternalName, int championId) {
return client.sendRpcAndWait(SERVICE, "attemptTrade", summonerInternalName, championId, false);
} | java | public Object attemptTrade(String summonerInternalName, int championId) {
return client.sendRpcAndWait(SERVICE, "attemptTrade", summonerInternalName, championId, false);
} | [
"public",
"Object",
"attemptTrade",
"(",
"String",
"summonerInternalName",
",",
"int",
"championId",
")",
"{",
"return",
"client",
".",
"sendRpcAndWait",
"(",
"SERVICE",
",",
"\"attemptTrade\"",
",",
"summonerInternalName",
",",
"championId",
",",
"false",
")",
";... | Attempt to trade with the target player
@param summonerInternalName The summoner's internal name, as sent by {@link #getPotentialTraders()}
@param championId Unknown - id of sent champion? id of trade?
@return unknown | [
"Attempt",
"to",
"trade",
"with",
"the",
"target",
"player"
] | 0b8aac407aa5289845f249024f9732332855544f | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/LcdsChampionTradeService.java#L45-L47 | train | Attempt a trade to a summoner. | Of course, here is the Java code you requested:
```java
public Object attemptTrade(String summonerInternalName, int championId) {
return client.sendRpcAndWait(SERVICE, "attemptTrade", summonerInternalName, championId, false);
}
```
Hope this helps! |
wildfly/wildfly-core | protocol/src/main/java/org/jboss/as/protocol/mgmt/ManagementChannelHandler.java | ManagementChannelHandler.executeRequest | @Override
public <T, A> ActiveOperation<T, A> executeRequest(ManagementRequest<T, A> request, A attachment, ActiveOperation.CompletedCallback<T> callback) throws IOException {
final ActiveOperation<T, A> operation = super.registerActiveOperation(attachment, callback);
executeRequest(operation, reque... | java | @Override
public <T, A> ActiveOperation<T, A> executeRequest(ManagementRequest<T, A> request, A attachment, ActiveOperation.CompletedCallback<T> callback) throws IOException {
final ActiveOperation<T, A> operation = super.registerActiveOperation(attachment, callback);
executeRequest(operation, reque... | [
"@",
"Override",
"public",
"<",
"T",
",",
"A",
">",
"ActiveOperation",
"<",
"T",
",",
"A",
">",
"executeRequest",
"(",
"ManagementRequest",
"<",
"T",
",",
"A",
">",
"request",
",",
"A",
"attachment",
",",
"ActiveOperation",
".",
"CompletedCallback",
"<",
... | {@inheritDoc} | [
"{"
] | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/protocol/src/main/java/org/jboss/as/protocol/mgmt/ManagementChannelHandler.java#L107-L112 | train | Override to register an ActiveOperation. | Of course, here is the Java code you requested:
```java
@Override
public <T, A> ActiveOperation<T, A> executeRequest(ManagementRequest<T, A> request, A attachment, ActiveOperation.CompletedCallback<T> callback) throws IOException {
final ActiveOperation<T, A> operation = super.registerActiveOperation(attac... |
classgraph/classgraph | src/main/java/io/github/classgraph/ScanResultObject.java | ScanResultObject.findReferencedClassNames | Set<String> findReferencedClassNames() {
final Set<String> allReferencedClassNames = new LinkedHashSet<>();
findReferencedClassNames(allReferencedClassNames);
// Remove references to java.lang.Object
allReferencedClassNames.remove("java.lang.Object");
return allReferencedClassNam... | java | Set<String> findReferencedClassNames() {
final Set<String> allReferencedClassNames = new LinkedHashSet<>();
findReferencedClassNames(allReferencedClassNames);
// Remove references to java.lang.Object
allReferencedClassNames.remove("java.lang.Object");
return allReferencedClassNam... | [
"Set",
"<",
"String",
">",
"findReferencedClassNames",
"(",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"allReferencedClassNames",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"findReferencedClassNames",
"(",
"allReferencedClassNames",
")",
";",
"// Remove ... | Get the names of all referenced classes.
@return the referenced class names | [
"Get",
"the",
"names",
"of",
"all",
"referenced",
"classes",
"."
] | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ScanResultObject.java#L63-L69 | train | Find all classes referenced by this class. | Of course, here is the Java code you requested:
```java
Set<String> findReferencedClassNames() {
final Set<String> allReferencedClassNames = new LinkedHashSet<>();
findReferencedClassNames(allReferencedClassNames);
// Remove references to java.lang.Object
allReferencedClassNames.remove(... |
tzaeschke/zoodb | examples/org/zoodb/jdo/ex2/Example2Main.java | Example2Main.queryForCoursesWithMaxStudentCount | private void queryForCoursesWithMaxStudentCount() {
//TODO `MAX` in queries doesn't work yet, so we use navigation
Extent<Course> courses = pm.getExtent(Course.class);
Course maxCourse = null;
int maxStudents = -1;
for (Course c: courses) {
if (c.getStudents().size() > maxStudents) {
maxStudents = c.ge... | java | private void queryForCoursesWithMaxStudentCount() {
//TODO `MAX` in queries doesn't work yet, so we use navigation
Extent<Course> courses = pm.getExtent(Course.class);
Course maxCourse = null;
int maxStudents = -1;
for (Course c: courses) {
if (c.getStudents().size() > maxStudents) {
maxStudents = c.ge... | [
"private",
"void",
"queryForCoursesWithMaxStudentCount",
"(",
")",
"{",
"//TODO `MAX` in queries doesn't work yet, so we use navigation",
"Extent",
"<",
"Course",
">",
"courses",
"=",
"pm",
".",
"getExtent",
"(",
"Course",
".",
"class",
")",
";",
"Course",
"maxCourse",
... | This example demonstrates that using 'navigation'may often be a good alternative
for queries, especially if the term in question (collection.size()) cannot be indexed yet. | [
"This",
"example",
"demonstrates",
"that",
"using",
"navigation",
"may",
"often",
"be",
"a",
"good",
"alternative",
"for",
"queries",
"especially",
"if",
"the",
"term",
"in",
"question",
"(",
"collection",
".",
"size",
"()",
")",
"cannot",
"be",
"indexed",
"... | 058d0ff161a8ee9d53244c433aca97ee9c654410 | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/examples/org/zoodb/jdo/ex2/Example2Main.java#L153-L170 | train | Query for courses with max number of students. | Of course, here is the Java code you requested:
```java
private void queryForCoursesWithMaxStudentCount() {
//TODO `MAX` in queries doesn't work yet, so we use navigation
Extent<Course> courses = pm.getExtent(Course.class);
Course maxCourse = null;
int maxStudents = -1;
for (Course c: courses) {
if (c.get... |
boonproject/boon | boon/src/main/java/org/boon/cache/FastConcurrentReadLruLfuFifoCache.java | FastConcurrentReadLruLfuFifoCache.get | public VALUE get( KEY key ) {
CacheEntry<KEY, VALUE> cacheEntry = map.get( key );
if ( cacheEntry != null ) {
cacheEntry.readCount.incrementAndGet();
return cacheEntry.value;
} else {
return null;
}
} | java | public VALUE get( KEY key ) {
CacheEntry<KEY, VALUE> cacheEntry = map.get( key );
if ( cacheEntry != null ) {
cacheEntry.readCount.incrementAndGet();
return cacheEntry.value;
} else {
return null;
}
} | [
"public",
"VALUE",
"get",
"(",
"KEY",
"key",
")",
"{",
"CacheEntry",
"<",
"KEY",
",",
"VALUE",
">",
"cacheEntry",
"=",
"map",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"cacheEntry",
"!=",
"null",
")",
"{",
"cacheEntry",
".",
"readCount",
".",
"i... | Get the value from the cache. It does not touch the lock so
reads are fast.
This does not touch the order list so it is fast.
@param key the key
@return value | [
"Get",
"the",
"value",
"from",
"the",
"cache",
".",
"It",
"does",
"not",
"touch",
"the",
"lock",
"so",
"reads",
"are",
"fast",
".",
"This",
"does",
"not",
"touch",
"the",
"order",
"list",
"so",
"it",
"is",
"fast",
"."
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/cache/FastConcurrentReadLruLfuFifoCache.java#L151-L160 | test | Gets the value of the specified key. | Of course, here is the Java code you requested:
```java
public VALUE get( KEY key ) {
CacheEntry<KEY, VALUE> cacheEntry = map.get( key );
if ( cacheEntry != null ) {
cacheEntry.readCount.incrementAndGet();
return cacheEntry.value;
} else {
return null;
... |
kiegroup/drools | drools-model/drools-model-compiler/src/main/java/org/drools/modelcompiler/CanonicalKieModule.java | CanonicalKieModule.cacheKnowledgeBuilderForKieBase | @Override
public void cacheKnowledgeBuilderForKieBase( String kieBaseName, KnowledgeBuilder kbuilder ) {
internalKieModule.cacheKnowledgeBuilderForKieBase( kieBaseName, kbuilder );
} | java | @Override
public void cacheKnowledgeBuilderForKieBase( String kieBaseName, KnowledgeBuilder kbuilder ) {
internalKieModule.cacheKnowledgeBuilderForKieBase( kieBaseName, kbuilder );
} | [
"@",
"Override",
"public",
"void",
"cacheKnowledgeBuilderForKieBase",
"(",
"String",
"kieBaseName",
",",
"KnowledgeBuilder",
"kbuilder",
")",
"{",
"internalKieModule",
".",
"cacheKnowledgeBuilderForKieBase",
"(",
"kieBaseName",
",",
"kbuilder",
")",
";",
"}"
] | Delegate methods | [
"Delegate",
"methods"
] | 22b0275d6dbe93070b8090948502cf46eda543c4 | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-model/drools-model-compiler/src/main/java/org/drools/modelcompiler/CanonicalKieModule.java#L540-L543 | train | Cache a KnowledgeBuilder for a KnowledgeBase. | Of course, here is the Java code you requested:
```java
@Override
public void cacheKnowledgeBuilderForKieBase( String kieBaseName, KnowledgeBuilder kbuilder ) {
internalKieModule.cacheKnowledgeBuilderForKieBase( kieBaseName, kbuilder );
}
```
Hope this helps! |
biojava/biojava | biojava-structure-gui/src/main/java/org/biojava/nbio/structure/symmetry/jmolScript/JmolSymmetryScriptGeneratorPointGroup.java | JmolSymmetryScriptGeneratorPointGroup.getOrientationWithZoom | @Override
public String getOrientationWithZoom(int index) {
StringBuilder s = new StringBuilder();
s.append(getOrientation(index));
s.insert(s.length()-1, getZoom());
return s.toString();
} | java | @Override
public String getOrientationWithZoom(int index) {
StringBuilder s = new StringBuilder();
s.append(getOrientation(index));
s.insert(s.length()-1, getZoom());
return s.toString();
} | [
"@",
"Override",
"public",
"String",
"getOrientationWithZoom",
"(",
"int",
"index",
")",
"{",
"StringBuilder",
"s",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"s",
".",
"append",
"(",
"getOrientation",
"(",
"index",
")",
")",
";",
"s",
".",
"insert",
"(... | /* (non-Javadoc)
@see org.biojava.nbio.structure.quaternary.jmolScript.JMolSymmetryScriptInterface#getOrientationWithZoom(int) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | a1c71a8e3d40cc32104b1d387a3d3b560b43356e | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure-gui/src/main/java/org/biojava/nbio/structure/symmetry/jmolScript/JmolSymmetryScriptGeneratorPointGroup.java#L147-L154 | train | Get the orientation with the zoom. | Of course, here is the Java code you requested:
```java
@Override
public String getOrientationWithZoom(int index) {
StringBuilder s = new StringBuilder();
s.append(getOrientation(index));
s.insert(s.length()-1, getZoom());
return s.toString();
}
```
Hope this helps! |
googleapis/api-client-staging | generated/java/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLog.java | AuditLog.getResponse | public com.google.protobuf.Struct getResponse() {
return response_ == null ? com.google.protobuf.Struct.getDefaultInstance() : response_;
} | java | public com.google.protobuf.Struct getResponse() {
return response_ == null ? com.google.protobuf.Struct.getDefaultInstance() : response_;
} | [
"public",
"com",
".",
"google",
".",
"protobuf",
".",
"Struct",
"getResponse",
"(",
")",
"{",
"return",
"response_",
"==",
"null",
"?",
"com",
".",
"google",
".",
"protobuf",
".",
"Struct",
".",
"getDefaultInstance",
"(",
")",
":",
"response_",
";",
"}"
... | <pre>
The operation response. This may not include all response elements,
such as those that are too large, privacy-sensitive, or duplicated
elsewhere in the log record.
It should never include user-generated data, such as file contents.
When the JSON object represented here has a proto equivalent, the proto
name will ... | [
"<pre",
">",
"The",
"operation",
"response",
".",
"This",
"may",
"not",
"include",
"all",
"response",
"elements",
"such",
"as",
"those",
"that",
"are",
"too",
"large",
"privacy",
"-",
"sensitive",
"or",
"duplicated",
"elsewhere",
"in",
"the",
"log",
"record"... | 126aee68401977b5dc2b1b4be48decd0e9759db7 | https://github.com/googleapis/api-client-staging/blob/126aee68401977b5dc2b1b4be48decd0e9759db7/generated/java/proto-google-common-protos/src/main/java/com/google/cloud/audit/AuditLog.java#L599-L601 | train | Gets the value of the response property. | Of course, here is the Java code you requested:
```java
public com.google.protobuf.Struct getResponse() {
return response_ == null ? com.google.protobuf.Struct.getDefaultInstance() : response_;
}
```
Hope this helps! |
jcuda/jcublas | JCublasJava/src/main/java/jcuda/jcublas/JCublas.java | JCublas.cublasSspr | public static void cublasSspr(char uplo, int n, float alpha, Pointer x, int incx, Pointer AP)
{
cublasSsprNative(uplo, n, alpha, x, incx, AP);
checkResultBLAS();
} | java | public static void cublasSspr(char uplo, int n, float alpha, Pointer x, int incx, Pointer AP)
{
cublasSsprNative(uplo, n, alpha, x, incx, AP);
checkResultBLAS();
} | [
"public",
"static",
"void",
"cublasSspr",
"(",
"char",
"uplo",
",",
"int",
"n",
",",
"float",
"alpha",
",",
"Pointer",
"x",
",",
"int",
"incx",
",",
"Pointer",
"AP",
")",
"{",
"cublasSsprNative",
"(",
"uplo",
",",
"n",
",",
"alpha",
",",
"x",
",",
... | <pre>
void
cublasSspr (char uplo, int n, float alpha, const float *x, int incx,
float *AP)
performs the symmetric rank 1 operation
A = alpha * x * transpose(x) + A,
where alpha is a single precision scalar and x is an n element single
precision vector. A is a symmetric n x n matrix consisting of single
precision ele... | [
"<pre",
">",
"void",
"cublasSspr",
"(",
"char",
"uplo",
"int",
"n",
"float",
"alpha",
"const",
"float",
"*",
"x",
"int",
"incx",
"float",
"*",
"AP",
")"
] | 80875235d24562073f4d66651dd17263f306427d | https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L3276-L3280 | test | Cublas Sspr for symmetric matrix. | Of course, here is the Java code you requested:
```java
public static void cublasSspr(char uplo, int n, float alpha, Pointer x, int incx, Pointer AP)
{
cublasSsprNative(uplo, n, alpha, x, incx, AP);
checkResultBLAS();
}
```
Hope this helps! |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java | ULocale.isRightToLeft | public boolean isRightToLeft() {
String script = getScript();
if (script.length() == 0) {
// Fastpath: We know the likely scripts and their writing direction
// for some common languages.
String lang = getLanguage();
if (lang.length() == 0) {
... | java | public boolean isRightToLeft() {
String script = getScript();
if (script.length() == 0) {
// Fastpath: We know the likely scripts and their writing direction
// for some common languages.
String lang = getLanguage();
if (lang.length() == 0) {
... | [
"public",
"boolean",
"isRightToLeft",
"(",
")",
"{",
"String",
"script",
"=",
"getScript",
"(",
")",
";",
"if",
"(",
"script",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"// Fastpath: We know the likely scripts and their writing direction",
"// for some common la... | <strong>[icu]</strong> Returns whether this locale's script is written right-to-left.
If there is no script subtag, then the likely script is used,
see {@link #addLikelySubtags(ULocale)}.
If no likely script is known, then false is returned.
<p>A script is right-to-left according to the CLDR script metadata
which corr... | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Returns",
"whether",
"this",
"locale",
"s",
"script",
"is",
"written",
"right",
"-",
"to",
"-",
"left",
".",
"If",
"there",
"is",
"no",
"script",
"subtag",
"then",
"the",
"likely",
"script",
... | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L1338-L1364 | train | Checks if the script is right to left. | Of course, here is the Java code you requested:
```java
public boolean isRightToLeft() {
String script = getScript();
if (script.length() == 0) {
// Fastpath: We know the likely scripts and their writing direction
// for some common languages.
String lang = getLangua... |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/graph/CompactSparseTypedEdgeSet.java | CompactSparseTypedEdgeSet.disconnect | public int disconnect(int v) {
BitSet b = edges.remove(v);
if (b != null) {
int edges = b.cardinality();
size -= edges;
return edges;
}
return 0;
} | java | public int disconnect(int v) {
BitSet b = edges.remove(v);
if (b != null) {
int edges = b.cardinality();
size -= edges;
return edges;
}
return 0;
} | [
"public",
"int",
"disconnect",
"(",
"int",
"v",
")",
"{",
"BitSet",
"b",
"=",
"edges",
".",
"remove",
"(",
"v",
")",
";",
"if",
"(",
"b",
"!=",
"null",
")",
"{",
"int",
"edges",
"=",
"b",
".",
"cardinality",
"(",
")",
";",
"size",
"-=",
"edges"... | {@inheritDoc} | [
"{"
] | a608102737dfd3d59038a9ead33fe60356bc6029 | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/graph/CompactSparseTypedEdgeSet.java#L283-L291 | train | Disconnect from a single entry. | Of course, here is the Java code you requested:
```java
public int disconnect(int v) {
BitSet b = edges.remove(v);
if (b != null) {
int edges = b.cardinality();
size -= edges;
return edges;
}
return 0;
}
```
Hope this helps! |
Azure/azure-storage-android | microsoft-azure-storage/src/com/microsoft/azure/storage/file/CloudFileDirectory.java | CloudFileDirectory.create | @DoesServiceRequest
public void create(FileRequestOptions options, OperationContext opContext) throws StorageException, URISyntaxException {
if (opContext == null) {
opContext = new OperationContext();
}
this.getShare().assertNoSnapshot();
opContext.initialize();
... | java | @DoesServiceRequest
public void create(FileRequestOptions options, OperationContext opContext) throws StorageException, URISyntaxException {
if (opContext == null) {
opContext = new OperationContext();
}
this.getShare().assertNoSnapshot();
opContext.initialize();
... | [
"@",
"DoesServiceRequest",
"public",
"void",
"create",
"(",
"FileRequestOptions",
"options",
",",
"OperationContext",
"opContext",
")",
"throws",
"StorageException",
",",
"URISyntaxException",
"{",
"if",
"(",
"opContext",
"==",
"null",
")",
"{",
"opContext",
"=",
... | Creates the directory using the specified options and operation context.
@param options
A {@link FileRequestOptions} object that specifies any additional options for the request. Specifying
<code>null</code> will use the default request options from the associated service client (
{@link CloudFileClient}).
@param opCo... | [
"Creates",
"the",
"directory",
"using",
"the",
"specified",
"options",
"and",
"operation",
"context",
"."
] | 2c643c37c6b8c9081058add284c601a2393afc93 | https://github.com/Azure/azure-storage-android/blob/2c643c37c6b8c9081058add284c601a2393afc93/microsoft-azure-storage/src/com/microsoft/azure/storage/file/CloudFileDirectory.java#L198-L211 | valid | Creates a new file in the directory system. | Of course, here is the Java code you requested:
```java
@DoesServiceRequest
public void create(FileRequestOptions options, OperationContext opContext) throws StorageException, URISyntaxException {
if (opContext == null) {
opContext = new OperationContext();
}
this.getShare().as... |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnstxtrec.java | dnstxtrec.get | public static dnstxtrec[] get(nitro_service service, String domain[]) throws Exception{
if (domain !=null && domain.length>0) {
dnstxtrec response[] = new dnstxtrec[domain.length];
dnstxtrec obj[] = new dnstxtrec[domain.length];
for (int i=0;i<domain.length;i++) {
obj[i] = new dnstxtrec();
obj[i].set... | java | public static dnstxtrec[] get(nitro_service service, String domain[]) throws Exception{
if (domain !=null && domain.length>0) {
dnstxtrec response[] = new dnstxtrec[domain.length];
dnstxtrec obj[] = new dnstxtrec[domain.length];
for (int i=0;i<domain.length;i++) {
obj[i] = new dnstxtrec();
obj[i].set... | [
"public",
"static",
"dnstxtrec",
"[",
"]",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"domain",
"[",
"]",
")",
"throws",
"Exception",
"{",
"if",
"(",
"domain",
"!=",
"null",
"&&",
"domain",
".",
"length",
">",
"0",
")",
"{",
"dnstxtrec",
"r... | Use this API to fetch dnstxtrec resources of given names . | [
"Use",
"this",
"API",
"to",
"fetch",
"dnstxtrec",
"resources",
"of",
"given",
"names",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/dns/dnstxtrec.java#L327-L339 | train | Use this API to fetch dnstxtrec resources of given names. | Of course, here is the Java code you requested:
```java
public static dnstxtrec[] get(nitro_service service, String domain[]) throws Exception{
if (domain !=null && domain.length>0) {
dnstxtrec response[] = new dnstxtrec[domain.length];
dnstxtrec obj[] = new dnstxtrec[domain.length];
for (int i=0;i<domain.l... |
devnied/Bit-lib4j | src/main/java/fr/devnied/bitlib/BytesUtils.java | BytesUtils.toBinary | public static String toBinary(final byte[] pBytes) {
String ret = null;
if (pBytes != null && pBytes.length > 0) {
BigInteger val = new BigInteger(bytesToStringNoSpace(pBytes), HEXA);
StringBuilder build = new StringBuilder(val.toString(2));
// left pad with 0 to fit byte size
for (int i = build.l... | java | public static String toBinary(final byte[] pBytes) {
String ret = null;
if (pBytes != null && pBytes.length > 0) {
BigInteger val = new BigInteger(bytesToStringNoSpace(pBytes), HEXA);
StringBuilder build = new StringBuilder(val.toString(2));
// left pad with 0 to fit byte size
for (int i = build.l... | [
"public",
"static",
"String",
"toBinary",
"(",
"final",
"byte",
"[",
"]",
"pBytes",
")",
"{",
"String",
"ret",
"=",
"null",
";",
"if",
"(",
"pBytes",
"!=",
"null",
"&&",
"pBytes",
".",
"length",
">",
"0",
")",
"{",
"BigInteger",
"val",
"=",
"new",
... | Convert byte array to binary String
@param pBytes
byte array to convert
@return a binary representation of the byte array | [
"Convert",
"byte",
"array",
"to",
"binary",
"String"
] | bdfa79fd12e7e3d5cf1196291825ef1bb12a1ee0 | https://github.com/devnied/Bit-lib4j/blob/bdfa79fd12e7e3d5cf1196291825ef1bb12a1ee0/src/main/java/fr/devnied/bitlib/BytesUtils.java#L285-L297 | train | Converts a byte array to a binary string. | Of course, here is the Java code you requested:
```java
public static String toBinary(final byte[] pBytes) {
String ret = null;
if (pBytes != null && pBytes.length > 0) {
BigInteger val = new BigInteger(bytesToStringNoSpace(pBytes), HEXA);
StringBuilder build = new StringBuilder(val.toString(2));
// ... |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/projects/CmsPublishProjectReport.java | CmsPublishProjectReport.startValidationThread | private void startValidationThread(CmsPublishList publishList) throws JspException {
try {
CmsRelationsValidatorThread thread = new CmsRelationsValidatorThread(getCms(), publishList, getSettings());
thread.start();
setParamThread(thread.getUUID().toString());
se... | java | private void startValidationThread(CmsPublishList publishList) throws JspException {
try {
CmsRelationsValidatorThread thread = new CmsRelationsValidatorThread(getCms(), publishList, getSettings());
thread.start();
setParamThread(thread.getUUID().toString());
se... | [
"private",
"void",
"startValidationThread",
"(",
"CmsPublishList",
"publishList",
")",
"throws",
"JspException",
"{",
"try",
"{",
"CmsRelationsValidatorThread",
"thread",
"=",
"new",
"CmsRelationsValidatorThread",
"(",
"getCms",
"(",
")",
",",
"publishList",
",",
"get... | Starts the link validation thread for the project.<p>
@param publishList the list of resources to publish
@throws JspException if something goes wrong | [
"Starts",
"the",
"link",
"validation",
"thread",
"for",
"the",
"project",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/projects/CmsPublishProjectReport.java#L215-L232 | train | Start validation thread. | Of course, here is the Java code you requested:
```java
private void startValidationThread(CmsPublishList publishList) throws JspException {
try {
CmsRelationsValidatorThread thread = new CmsRelationsValidatorThread(getCms(), publishList, getSettings());
thread.start();
se... |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/GeometryEngine.java | GeometryEngine.intersect | public static Geometry intersect(Geometry geometry1, Geometry intersector,
SpatialReference spatialReference) {
OperatorIntersection op = (OperatorIntersection) factory
.getOperator(Operator.Type.Intersection);
Geometry result = op.execute(geometry1, intersector, spatialReference,
null);
return result;... | java | public static Geometry intersect(Geometry geometry1, Geometry intersector,
SpatialReference spatialReference) {
OperatorIntersection op = (OperatorIntersection) factory
.getOperator(Operator.Type.Intersection);
Geometry result = op.execute(geometry1, intersector, spatialReference,
null);
return result;... | [
"public",
"static",
"Geometry",
"intersect",
"(",
"Geometry",
"geometry1",
",",
"Geometry",
"intersector",
",",
"SpatialReference",
"spatialReference",
")",
"{",
"OperatorIntersection",
"op",
"=",
"(",
"OperatorIntersection",
")",
"factory",
".",
"getOperator",
"(",
... | Creates a geometry through intersection between two geometries.
See OperatorIntersection.
@param geometry1
The first geometry.
@param intersector
The geometry to intersect the first geometry.
@param spatialReference
The spatial reference of the geometries.
@return The geometry created through intersection. | [
"Creates",
"a",
"geometry",
"through",
"intersection",
"between",
"two",
"geometries",
"."
] | 494da8ec953d76e7c6072afbc081abfe48ff07cf | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/GeometryEngine.java#L427-L434 | train | Intersects two geometries. | Of course, here is the Java code you requested:
```java
public static Geometry intersect(Geometry geometry1, Geometry intersector,
SpatialReference spatialReference) {
OperatorIntersection op = (OperatorIntersection) factory
.getOperator(Operator.Type.Intersection);
Geometry result = op.execute(geometry1, i... |
js-lib-com/tiny-container | src/main/java/js/http/encoder/QueryParametersParser.java | QueryParametersParser.isObject | private static boolean isObject(Type[] formalParameters) {
if (formalParameters.length != 1) {
return false;
}
final Type type = formalParameters[0];
if (!(type instanceof Class)) {
return false;
}
if (Types.isPrimitive(type)) {
return false;
}
if (Types.isArrayLike(type)) {
retu... | java | private static boolean isObject(Type[] formalParameters) {
if (formalParameters.length != 1) {
return false;
}
final Type type = formalParameters[0];
if (!(type instanceof Class)) {
return false;
}
if (Types.isPrimitive(type)) {
return false;
}
if (Types.isArrayLike(type)) {
retu... | [
"private",
"static",
"boolean",
"isObject",
"(",
"Type",
"[",
"]",
"formalParameters",
")",
"{",
"if",
"(",
"formalParameters",
".",
"length",
"!=",
"1",
")",
"{",
"return",
"false",
";",
"}",
"final",
"Type",
"type",
"=",
"formalParameters",
"[",
"0",
"... | Test if method formal parameters designates a strict object, that is, is not primitive, array, collection or map.
@param formalParameters method formal parameters list.
@return true if formal parameters designates a strict object. | [
"Test",
"if",
"method",
"formal",
"parameters",
"designates",
"a",
"strict",
"object",
"that",
"is",
"is",
"not",
"primitive",
"array",
"collection",
"or",
"map",
"."
] | ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e | https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/http/encoder/QueryParametersParser.java#L309-L330 | test | Checks if the given formal parameters are of the type class type. | Of course, here is the Java code you requested:
```java
private static boolean isObject(Type[] formalParameters) {
if (formalParameters.length != 1) {
return false;
}
final Type type = formalParameters[0];
if (!(type instanceof Class)) {
return false;
}
if (Types.isPrimitive(type)) {
retu... |
aspectran/aspectran | core/src/main/java/com/aspectran/core/activity/CoreActivity.java | CoreActivity.resolveRequestEncoding | protected String resolveRequestEncoding() {
String encoding = getRequestRule().getEncoding();
if (encoding == null) {
encoding = getSetting(RequestRule.CHARACTER_ENCODING_SETTING_NAME);
}
return encoding;
} | java | protected String resolveRequestEncoding() {
String encoding = getRequestRule().getEncoding();
if (encoding == null) {
encoding = getSetting(RequestRule.CHARACTER_ENCODING_SETTING_NAME);
}
return encoding;
} | [
"protected",
"String",
"resolveRequestEncoding",
"(",
")",
"{",
"String",
"encoding",
"=",
"getRequestRule",
"(",
")",
".",
"getEncoding",
"(",
")",
";",
"if",
"(",
"encoding",
"==",
"null",
")",
"{",
"encoding",
"=",
"getSetting",
"(",
"RequestRule",
".",
... | Determines the request encoding.
@return the request encoding | [
"Determines",
"the",
"request",
"encoding",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/activity/CoreActivity.java#L380-L386 | train | Resolves the request encoding. | Of course, here is the Java code you requested:
```java
protected String resolveRequestEncoding() {
String encoding = getRequestRule().getEncoding();
if (encoding == null) {
encoding = getSetting(RequestRule.CHARACTER_ENCODING_SETTING_NAME);
}
return encoding;
}
```
Hop... |
kejunxia/AndroidMvc | library/poke/src/main/java/com/shipdream/lib/poke/Provider.java | Provider.release | void release(Object owner, Field field) {
Map<String, Integer> fields = owners.get(owner);
if(fields != null) {
release();
Integer count = fields.get(field.toGenericString());
if(--count > 0) {
fields.put(field.toGenericString(), count);
}... | java | void release(Object owner, Field field) {
Map<String, Integer> fields = owners.get(owner);
if(fields != null) {
release();
Integer count = fields.get(field.toGenericString());
if(--count > 0) {
fields.put(field.toGenericString(), count);
}... | [
"void",
"release",
"(",
"Object",
"owner",
",",
"Field",
"field",
")",
"{",
"Map",
"<",
"String",
",",
"Integer",
">",
"fields",
"=",
"owners",
".",
"get",
"(",
"owner",
")",
";",
"if",
"(",
"fields",
"!=",
"null",
")",
"{",
"release",
"(",
")",
... | Release an instance injected as a field of an object
@param owner The owner of the field
@param field The field | [
"Release",
"an",
"instance",
"injected",
"as",
"a",
"field",
"of",
"an",
"object"
] | c7893f0a13119d64297b9eb2988f7323b7da5bbc | https://github.com/kejunxia/AndroidMvc/blob/c7893f0a13119d64297b9eb2988f7323b7da5bbc/library/poke/src/main/java/com/shipdream/lib/poke/Provider.java#L232-L248 | train | Release a single record from a record. | Of course, here is the Java code you requested:
```java
void release(Object owner, Field field) {
Map<String, Integer> fields = owners.get(owner);
if(fields != null) {
release();
Integer count = fields.get(field.toGenericString());
if(--count > 0) {
... |
RestComm/jss7 | isup/isup-impl/src/main/java/org/restcomm/protocols/ss7/isup/impl/message/ISUPMessageFactoryImpl.java | ISUPMessageFactoryImpl.createFOT | public ForwardTransferMessage createFOT(int cic) {
ForwardTransferMessage msg = createFOT();
CircuitIdentificationCode code = this.parameterFactory.createCircuitIdentificationCode();
code.setCIC(cic);
msg.setCircuitIdentificationCode(code);
return msg;
} | java | public ForwardTransferMessage createFOT(int cic) {
ForwardTransferMessage msg = createFOT();
CircuitIdentificationCode code = this.parameterFactory.createCircuitIdentificationCode();
code.setCIC(cic);
msg.setCircuitIdentificationCode(code);
return msg;
} | [
"public",
"ForwardTransferMessage",
"createFOT",
"(",
"int",
"cic",
")",
"{",
"ForwardTransferMessage",
"msg",
"=",
"createFOT",
"(",
")",
";",
"CircuitIdentificationCode",
"code",
"=",
"this",
".",
"parameterFactory",
".",
"createCircuitIdentificationCode",
"(",
")",... | /*
(non-Javadoc)
@see org.restcomm.protocols.ss7.isup.ISUPMessageFactory#createFOT(int cic) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/isup/isup-impl/src/main/java/org/restcomm/protocols/ss7/isup/impl/message/ISUPMessageFactoryImpl.java#L2715-L2721 | train | Create a FOT message with the specified CircuitIdentificationCode. | Of course, here is the Java code you requested:
```java
public ForwardTransferMessage createFOT(int cic) {
ForwardTransferMessage msg = createFOT();
CircuitIdentificationCode code = this.parameterFactory.createCircuitIdentificationCode();
code.setCIC(cic);
msg.setCircuitIdentificationCo... |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ArchivedExecutionGraph.java | ArchivedExecutionGraph.createFrom | public static ArchivedExecutionGraph createFrom(ExecutionGraph executionGraph) {
final int numberVertices = executionGraph.getTotalNumberOfVertices();
Map<JobVertexID, ArchivedExecutionJobVertex> archivedTasks = new HashMap<>(numberVertices);
List<ArchivedExecutionJobVertex> archivedVerticesInCreationOrder = new... | java | public static ArchivedExecutionGraph createFrom(ExecutionGraph executionGraph) {
final int numberVertices = executionGraph.getTotalNumberOfVertices();
Map<JobVertexID, ArchivedExecutionJobVertex> archivedTasks = new HashMap<>(numberVertices);
List<ArchivedExecutionJobVertex> archivedVerticesInCreationOrder = new... | [
"public",
"static",
"ArchivedExecutionGraph",
"createFrom",
"(",
"ExecutionGraph",
"executionGraph",
")",
"{",
"final",
"int",
"numberVertices",
"=",
"executionGraph",
".",
"getTotalNumberOfVertices",
"(",
")",
";",
"Map",
"<",
"JobVertexID",
",",
"ArchivedExecutionJobV... | Create a {@link ArchivedExecutionGraph} from the given {@link ExecutionGraph}.
@param executionGraph to create the ArchivedExecutionGraph from
@return ArchivedExecutionGraph created from the given ExecutionGraph | [
"Create",
"a",
"{",
"@link",
"ArchivedExecutionGraph",
"}",
"from",
"the",
"given",
"{",
"@link",
"ExecutionGraph",
"}",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/ArchivedExecutionGraph.java#L304-L341 | train | Creates an instance of the ArchivedExecutionGraph class from the given ExecutionGraph. | Of course, here is the Java code you requested:
```java
public static ArchivedExecutionGraph createFrom(ExecutionGraph executionGraph) {
final int numberVertices = executionGraph.getTotalNumberOfVertices();
Map<JobVertexID, ArchivedExecutionJobVertex> archivedTasks = new HashMap<>(numberVertices);
List<Archived... |
Wikidata/Wikidata-Toolkit | wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/helpers/StatementBuilder.java | StatementBuilder.getQualifierList | protected ArrayList<Snak> getQualifierList(PropertyIdValue propertyIdValue) {
ArrayList<Snak> result = this.qualifiers.get(propertyIdValue);
if (result == null) {
result = new ArrayList<Snak>();
this.qualifiers.put(propertyIdValue, result);
}
return result;
} | java | protected ArrayList<Snak> getQualifierList(PropertyIdValue propertyIdValue) {
ArrayList<Snak> result = this.qualifiers.get(propertyIdValue);
if (result == null) {
result = new ArrayList<Snak>();
this.qualifiers.put(propertyIdValue, result);
}
return result;
} | [
"protected",
"ArrayList",
"<",
"Snak",
">",
"getQualifierList",
"(",
"PropertyIdValue",
"propertyIdValue",
")",
"{",
"ArrayList",
"<",
"Snak",
">",
"result",
"=",
"this",
".",
"qualifiers",
".",
"get",
"(",
"propertyIdValue",
")",
";",
"if",
"(",
"result",
"... | Returns the list of {@link Snak} objects for a given qualifier property.
@param propertyIdValue
@return | [
"Returns",
"the",
"list",
"of",
"{",
"@link",
"Snak",
"}",
"objects",
"for",
"a",
"given",
"qualifier",
"property",
"."
] | 7732851dda47e1febff406fba27bfec023f4786e | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/helpers/StatementBuilder.java#L281-L288 | train | Gets the qualifier list. | Of course, here is the Java code you requested:
```java
protected ArrayList<Snak> getQualifierList(PropertyIdValue propertyIdValue) {
ArrayList<Snak> result = this.qualifiers.get(propertyIdValue);
if (result == null) {
result = new ArrayList<Snak>();
this.qualifiers.put(propertyIdValue, result);
}
return... |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SDVariable.java | SDVariable.norm2 | public SDVariable norm2(String name, boolean keepDims, int... dimensions){
return sameDiff.norm2(name, this, keepDims, dimensions);
} | java | public SDVariable norm2(String name, boolean keepDims, int... dimensions){
return sameDiff.norm2(name, this, keepDims, dimensions);
} | [
"public",
"SDVariable",
"norm2",
"(",
"String",
"name",
",",
"boolean",
"keepDims",
",",
"int",
"...",
"dimensions",
")",
"{",
"return",
"sameDiff",
".",
"norm2",
"(",
"name",
",",
"this",
",",
"keepDims",
",",
"dimensions",
")",
";",
"}"
] | Norm2 (L2 norm) reduction operation: The output contains the L2 norm for each tensor/subset along the specified dimensions:<br>
{@code out = sqrt(sum_i x[i]^2)}<br>
Note that if keepDims = true, the output variable has the same rank as the input variable,
with the reduced dimensions having size 1. This can be useful fo... | [
"Norm2",
"(",
"L2",
"norm",
")",
"reduction",
"operation",
":",
"The",
"output",
"contains",
"the",
"L2",
"norm",
"for",
"each",
"tensor",
"/",
"subset",
"along",
"the",
"specified",
"dimensions",
":",
"<br",
">",
"{",
"@code",
"out",
"=",
"sqrt",
"(",
... | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SDVariable.java#L1589-L1591 | train | Normalize 2 operation optionally keeping specified dimensions | Of course, here is the Java code you requested:
```java
public SDVariable norm2(String name, boolean keepDims, int... dimensions){
return sameDiff.norm2(name, this, keepDims, dimensions);
}
```
Hope this helps! |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/task/HiveConverterUtils.java | HiveConverterUtils.generateStagingCTASStatementFromSelectStar | public static String generateStagingCTASStatementFromSelectStar(HiveDatasetFinder.DbAndTable outputDbAndTable,
HiveDatasetFinder.DbAndTable sourceEntity, Map<String, String> partitionDMLInfo,
StorageFormat storageFormat, String outputTableLocation) {
StringBuilder sourceQueryBuilder = new StringBuilder(... | java | public static String generateStagingCTASStatementFromSelectStar(HiveDatasetFinder.DbAndTable outputDbAndTable,
HiveDatasetFinder.DbAndTable sourceEntity, Map<String, String> partitionDMLInfo,
StorageFormat storageFormat, String outputTableLocation) {
StringBuilder sourceQueryBuilder = new StringBuilder(... | [
"public",
"static",
"String",
"generateStagingCTASStatementFromSelectStar",
"(",
"HiveDatasetFinder",
".",
"DbAndTable",
"outputDbAndTable",
",",
"HiveDatasetFinder",
".",
"DbAndTable",
"sourceEntity",
",",
"Map",
"<",
"String",
",",
"String",
">",
"partitionDMLInfo",
","... | Generates a CTAS statement to dump the contents of a table / partition into a new table.
@param outputDbAndTable output db and table where contents should be written.
@param sourceEntity source table / partition.
@param partitionDMLInfo map of partition values.
@param storageFormat format of output table.
@param output... | [
"Generates",
"a",
"CTAS",
"statement",
"to",
"dump",
"the",
"contents",
"of",
"a",
"table",
"/",
"partition",
"into",
"a",
"new",
"table",
"."
] | f029b4c0fea0fe4aa62f36dda2512344ff708bae | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/task/HiveConverterUtils.java#L162-L174 | train | Generate a CTAS statement from a SELECT star query | Of course, here is the Java code you requested:
```java
public static String generateStagingCTASStatementFromSelectStar(HiveDatasetFinder.DbAndTable outputDbAndTable,
HiveDatasetFinder.DbAndTable sourceEntity, Map<String, String> partitionDMLInfo,
StorageFormat storageFormat, String outputTableLocation) {
... |
StanKocken/EfficientAdapter | efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java | ViewHelper.setBackgroundResource | public static void setBackgroundResource(EfficientCacheView cacheView, int viewId,
@DrawableRes int resid) {
View view = cacheView.findViewByIdEfficient(viewId);
if (view != null) {
view.setBackgroundResource(resid);
}
} | java | public static void setBackgroundResource(EfficientCacheView cacheView, int viewId,
@DrawableRes int resid) {
View view = cacheView.findViewByIdEfficient(viewId);
if (view != null) {
view.setBackgroundResource(resid);
}
} | [
"public",
"static",
"void",
"setBackgroundResource",
"(",
"EfficientCacheView",
"cacheView",
",",
"int",
"viewId",
",",
"@",
"DrawableRes",
"int",
"resid",
")",
"{",
"View",
"view",
"=",
"cacheView",
".",
"findViewByIdEfficient",
"(",
"viewId",
")",
";",
"if",
... | Equivalent to calling View.setBackgroundResource
@param cacheView The cache of views to get the view from
@param viewId The id of the view whose background should change
@param resid The new background resource for the view | [
"Equivalent",
"to",
"calling",
"View",
".",
"setBackgroundResource"
] | 0bcc3a20182cbce9d7901e1e2a9104251637167d | https://github.com/StanKocken/EfficientAdapter/blob/0bcc3a20182cbce9d7901e1e2a9104251637167d/efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java#L71-L77 | train | Set the background resource of a specific view. | Of course, here is the Java code you requested:
```java
public static void setBackgroundResource(EfficientCacheView cacheView, int viewId,
@DrawableRes int resid) {
View view = cacheView.findViewByIdEfficient(viewId);
if (view != null) {
view.setBackgroundResource(resid);
... |
eclipse/xtext-core | org.eclipse.xtext.xtext.generator/xtend-gen/org/eclipse/xtext/xtext/generator/util/SyntheticTerminalDetector.java | SyntheticTerminalDetector.isSyntheticTerminalRule | public boolean isSyntheticTerminalRule(final TerminalRule rule) {
AbstractElement _alternatives = rule.getAlternatives();
if ((_alternatives instanceof Keyword)) {
AbstractElement _alternatives_1 = rule.getAlternatives();
String value = ((Keyword) _alternatives_1).getValue();
String _name = An... | java | public boolean isSyntheticTerminalRule(final TerminalRule rule) {
AbstractElement _alternatives = rule.getAlternatives();
if ((_alternatives instanceof Keyword)) {
AbstractElement _alternatives_1 = rule.getAlternatives();
String value = ((Keyword) _alternatives_1).getValue();
String _name = An... | [
"public",
"boolean",
"isSyntheticTerminalRule",
"(",
"final",
"TerminalRule",
"rule",
")",
"{",
"AbstractElement",
"_alternatives",
"=",
"rule",
".",
"getAlternatives",
"(",
")",
";",
"if",
"(",
"(",
"_alternatives",
"instanceof",
"Keyword",
")",
")",
"{",
"Abst... | Answers {@code true} if the given terminal rule is synthetic. That is,
the tokens for this rule will not be produced by the generated Antlr lexer
but manually in a custom token source. | [
"Answers",
"{"
] | bac941cb75cb24706519845ec174cfef874d7557 | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext.xtext.generator/xtend-gen/org/eclipse/xtext/xtext/generator/util/SyntheticTerminalDetector.java#L30-L40 | train | Replies if the given rule is a synthetic rule. | Of course, here is the Java code you requested:
```java
public boolean isSyntheticTerminalRule(final TerminalRule rule) {
AbstractElement _alternatives = rule.getAlternatives();
if ((_alternatives instanceof Keyword)) {
AbstractElement _alternatives_1 = rule.getAlternatives();
String value = ((Keyw... |
pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/HTMLUtilities.java | HTMLUtilities.inlineHtmlPage | public static String inlineHtmlPage(final String html, final String basePath) {
String retValue = html;
Document doc = null;
try {
doc = XMLUtilities.convertStringToDocument(html);
} catch (Exception ex) {
LOG.error("Failed to convert the HTML into a DOM Document... | java | public static String inlineHtmlPage(final String html, final String basePath) {
String retValue = html;
Document doc = null;
try {
doc = XMLUtilities.convertStringToDocument(html);
} catch (Exception ex) {
LOG.error("Failed to convert the HTML into a DOM Document... | [
"public",
"static",
"String",
"inlineHtmlPage",
"(",
"final",
"String",
"html",
",",
"final",
"String",
"basePath",
")",
"{",
"String",
"retValue",
"=",
"html",
";",
"Document",
"doc",
"=",
"null",
";",
"try",
"{",
"doc",
"=",
"XMLUtilities",
".",
"convert... | Takes a XHTML file (usually generated by Publican), and inlines all the
CSS, image and SVG data. The resulting string is a stand alone HTML file
with no references to external resources.
@param html The original XHTML code
@param basePath The path on which all the resources referenced by the
XHTML file can be foun... | [
"Takes",
"a",
"XHTML",
"file",
"(",
"usually",
"generated",
"by",
"Publican",
")",
"and",
"inlines",
"all",
"the",
"CSS",
"image",
"and",
"SVG",
"data",
".",
"The",
"resulting",
"string",
"is",
"a",
"stand",
"alone",
"HTML",
"file",
"with",
"no",
"refere... | 5ebf5ed30a94c34c33f4708caa04a8da99cbb15c | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/HTMLUtilities.java#L60-L78 | train | Inline HTML page. | Of course, here is the Java code you requested:
```java
public static String inlineHtmlPage(final String html, final String basePath) {
String retValue = html;
Document doc = null;
try {
doc = XMLUtilities.convertStringToDocument(html);
} catch (Exception ex) {
... |
galan/verjson | src/main/java/de/galan/verjson/util/Transformations.java | Transformations.getArray | public static ArrayNode getArray(ObjectNode obj, String fieldName) {
return obj == null ? null : array(obj.get(fieldName));
} | java | public static ArrayNode getArray(ObjectNode obj, String fieldName) {
return obj == null ? null : array(obj.get(fieldName));
} | [
"public",
"static",
"ArrayNode",
"getArray",
"(",
"ObjectNode",
"obj",
",",
"String",
"fieldName",
")",
"{",
"return",
"obj",
"==",
"null",
"?",
"null",
":",
"array",
"(",
"obj",
".",
"get",
"(",
"fieldName",
")",
")",
";",
"}"
] | Returns the field from a ObjectNode as ArrayNode | [
"Returns",
"the",
"field",
"from",
"a",
"ObjectNode",
"as",
"ArrayNode"
] | 4db610fb5198fde913114ed628234f957e1c19d5 | https://github.com/galan/verjson/blob/4db610fb5198fde913114ed628234f957e1c19d5/src/main/java/de/galan/verjson/util/Transformations.java#L74-L76 | train | Gets an ArrayNode from an ObjectNode. | Of course, here is the Java code you requested:
```java
public static ArrayNode getArray(ObjectNode obj, String fieldName) {
return obj == null ? null : array(obj.get(fieldName));
}
```
Hope this helps! |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java | BigDecimal.preAlign | private BigDecimal[] preAlign(BigDecimal lhs, BigDecimal augend, long padding, MathContext mc) {
assert padding != 0;
BigDecimal big;
BigDecimal small;
if (padding < 0) { // lhs is big; augend is small
big = lhs;
small = augend;
} else { // lhs is small; ... | java | private BigDecimal[] preAlign(BigDecimal lhs, BigDecimal augend, long padding, MathContext mc) {
assert padding != 0;
BigDecimal big;
BigDecimal small;
if (padding < 0) { // lhs is big; augend is small
big = lhs;
small = augend;
} else { // lhs is small; ... | [
"private",
"BigDecimal",
"[",
"]",
"preAlign",
"(",
"BigDecimal",
"lhs",
",",
"BigDecimal",
"augend",
",",
"long",
"padding",
",",
"MathContext",
"mc",
")",
"{",
"assert",
"padding",
"!=",
"0",
";",
"BigDecimal",
"big",
";",
"BigDecimal",
"small",
";",
"if... | Returns an array of length two, the sum of whose entries is
equal to the rounded sum of the {@code BigDecimal} arguments.
<p>If the digit positions of the arguments have a sufficient
gap between them, the value smaller in magnitude can be
condensed into a {@literal "sticky bit"} and the end result will
round the same ... | [
"Returns",
"an",
"array",
"of",
"length",
"two",
"the",
"sum",
"of",
"whose",
"entries",
"is",
"equal",
"to",
"the",
"rounded",
"sum",
"of",
"the",
"{",
"@code",
"BigDecimal",
"}",
"arguments",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java#L1385-L1425 | train | Pre - aligns the input BigDecimal operands. | Of course, here is the Java code you requested:
```java
private BigDecimal[] preAlign(BigDecimal lhs, BigDecimal augend, long padding, MathContext mc) {
assert padding != 0;
BigDecimal big;
BigDecimal small;
if (padding < 0) { // lhs is big; augend is small
big = lhs;
... |
ocpsoft/rewrite | integration-faces/src/main/java/org/ocpsoft/rewrite/faces/config/PhaseBinding.java | PhaseBinding.after | public PhaseBinding after(final PhaseId... phases)
{
if (phases != null)
this.afterPhases.addAll(Arrays.asList(phases));
return this;
} | java | public PhaseBinding after(final PhaseId... phases)
{
if (phases != null)
this.afterPhases.addAll(Arrays.asList(phases));
return this;
} | [
"public",
"PhaseBinding",
"after",
"(",
"final",
"PhaseId",
"...",
"phases",
")",
"{",
"if",
"(",
"phases",
"!=",
"null",
")",
"this",
".",
"afterPhases",
".",
"addAll",
"(",
"Arrays",
".",
"asList",
"(",
"phases",
")",
")",
";",
"return",
"this",
";",... | Perform this {@link PhaseBinding} after the given phases (Except {@link PhaseId#RENDER_RESPONSE}). The deferred
{@link Submission} will be performed once for each {@link PhaseId} provided. | [
"Perform",
"this",
"{"
] | eded0bad0101d119a3a1e67ed3f97a3bc9a8222e | https://github.com/ocpsoft/rewrite/blob/eded0bad0101d119a3a1e67ed3f97a3bc9a8222e/integration-faces/src/main/java/org/ocpsoft/rewrite/faces/config/PhaseBinding.java#L89-L94 | valid | Add all the phases after this one. | Of course, here is the Java code you requested:
```java
public PhaseBinding after(final PhaseId... phases)
{
if (phases != null)
this.afterPhases.addAll(Arrays.asList(phases));
return this;
}
```
Hope this helps! |
jhy/jsoup | src/main/java/org/jsoup/nodes/Element.java | Element.tagName | public Element tagName(String tagName) {
Validate.notEmpty(tagName, "Tag name must not be empty.");
tag = Tag.valueOf(tagName, NodeUtils.parser(this).settings()); // maintains the case option of the original parse
return this;
} | java | public Element tagName(String tagName) {
Validate.notEmpty(tagName, "Tag name must not be empty.");
tag = Tag.valueOf(tagName, NodeUtils.parser(this).settings()); // maintains the case option of the original parse
return this;
} | [
"public",
"Element",
"tagName",
"(",
"String",
"tagName",
")",
"{",
"Validate",
".",
"notEmpty",
"(",
"tagName",
",",
"\"Tag name must not be empty.\"",
")",
";",
"tag",
"=",
"Tag",
".",
"valueOf",
"(",
"tagName",
",",
"NodeUtils",
".",
"parser",
"(",
"this"... | Change the tag of this element. For example, convert a {@code <span>} to a {@code <div>} with
{@code el.tagName("div");}.
@param tagName new tag name for this element
@return this element, for chaining | [
"Change",
"the",
"tag",
"of",
"this",
"element",
".",
"For",
"example",
"convert",
"a",
"{",
"@code",
"<span",
">",
"}",
"to",
"a",
"{",
"@code",
"<div",
">",
"}",
"with",
"{",
"@code",
"el",
".",
"tagName",
"(",
"div",
")",
";",
"}",
"."
] | 68ff8cbe7ad847059737a09c567a501a7f1d251f | https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/nodes/Element.java#L151-L155 | train | Sets the tag name of the element. | Of course, here is the Java code you requested:
```java
public Element tagName(String tagName) {
Validate.notEmpty(tagName, "Tag name must not be empty.");
tag = Tag.valueOf(tagName, NodeUtils.parser(this).settings()); // maintains the case option of the original parse
return this;
}
```
H... |
yan74/afplib | org.afplib/src/main/java/org/afplib/afplib/impl/AfplibFactoryImpl.java | AfplibFactoryImpl.convertSFNameToString | public String convertSFNameToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
} | java | public String convertSFNameToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
} | [
"public",
"String",
"convertSFNameToString",
"(",
"EDataType",
"eDataType",
",",
"Object",
"instanceValue",
")",
"{",
"return",
"instanceValue",
"==",
"null",
"?",
"null",
":",
"instanceValue",
".",
"toString",
"(",
")",
";",
"}"
] | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f | https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/AfplibFactoryImpl.java#L8459-L8461 | train | Convert a SFSName to a String. | Of course, here is the Java code you requested:
```java
public String convertSFNameToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
}
```
Hope this helps! |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/crypto/X509Utils.java | X509Utils.getDisplayNameFromCertificate | @Nullable
public static String getDisplayNameFromCertificate(@Nonnull X509Certificate certificate, boolean withLocation) throws CertificateParsingException {
X500Name name = new X500Name(certificate.getSubjectX500Principal().getName());
String commonName = null, org = null, location = null, country ... | java | @Nullable
public static String getDisplayNameFromCertificate(@Nonnull X509Certificate certificate, boolean withLocation) throws CertificateParsingException {
X500Name name = new X500Name(certificate.getSubjectX500Principal().getName());
String commonName = null, org = null, location = null, country ... | [
"@",
"Nullable",
"public",
"static",
"String",
"getDisplayNameFromCertificate",
"(",
"@",
"Nonnull",
"X509Certificate",
"certificate",
",",
"boolean",
"withLocation",
")",
"throws",
"CertificateParsingException",
"{",
"X500Name",
"name",
"=",
"new",
"X500Name",
"(",
"... | Returns either a string that "sums up" the certificate for humans, in a similar manner to what you might see
in a web browser, or null if one cannot be extracted. This will typically be the common name (CN) field, but
can also be the org (O) field, org+location+country if withLocation is set, or the email
address for S... | [
"Returns",
"either",
"a",
"string",
"that",
"sums",
"up",
"the",
"certificate",
"for",
"humans",
"in",
"a",
"similar",
"manner",
"to",
"what",
"you",
"might",
"see",
"in",
"a",
"web",
"browser",
"or",
"null",
"if",
"one",
"cannot",
"be",
"extracted",
"."... | 9cf13d29315014ed59cf4fc5944e5f227e8df9a6 | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/crypto/X509Utils.java#L52-L83 | train | Get the display name from a certificate. | Of course, here is the Java code you requested:
```java
@Nullable
public static String getDisplayNameFromCertificate(@Nonnull X509Certificate certificate, boolean withLocation) throws CertificateParsingException {
X500Name name = new X500Name(certificate.getSubjectX500Principal().getName());
String... |
apache/flink | flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/util/SetCache.java | SetCache.getUnsortedGrouping | @SuppressWarnings("unchecked")
public <T> UnsortedGrouping<T> getUnsortedGrouping(int id) {
return verifyType(id, unsortedGroupings.get(id), SetType.UNSORTED_GROUPING);
} | java | @SuppressWarnings("unchecked")
public <T> UnsortedGrouping<T> getUnsortedGrouping(int id) {
return verifyType(id, unsortedGroupings.get(id), SetType.UNSORTED_GROUPING);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"UnsortedGrouping",
"<",
"T",
">",
"getUnsortedGrouping",
"(",
"int",
"id",
")",
"{",
"return",
"verifyType",
"(",
"id",
",",
"unsortedGroupings",
".",
"get",
"(",
"id",
")",
",",... | Returns the cached {@link UnsortedGrouping} for the given ID.
@param id Set ID
@param <T> UnsortedGrouping type
@return Cached UnsortedGrouping
@throws IllegalStateException if the cached set is not an UnsortedGrouping | [
"Returns",
"the",
"cached",
"{",
"@link",
"UnsortedGrouping",
"}",
"for",
"the",
"given",
"ID",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-python/src/main/java/org/apache/flink/python/api/util/SetCache.java#L169-L172 | train | Gets the unsorted grouping. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public <T> UnsortedGrouping<T> getUnsortedGrouping(int id) {
return verifyType(id, unsortedGroupings.get(id), SetType.UNSORTED_GROUPING);
}
```
Hope this helps! |
DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/jdbc/GenericBoJdbcDao.java | GenericBoJdbcDao.create | protected DaoResult create(Connection conn, T bo) {
if (bo == null) {
return null;
}
Savepoint savepoint = null;
try {
try {
savepoint = conn.getAutoCommit() ? null : conn.setSavepoint();
int numRows = execute(conn, calcSqlInsert(bo... | java | protected DaoResult create(Connection conn, T bo) {
if (bo == null) {
return null;
}
Savepoint savepoint = null;
try {
try {
savepoint = conn.getAutoCommit() ? null : conn.setSavepoint();
int numRows = execute(conn, calcSqlInsert(bo... | [
"protected",
"DaoResult",
"create",
"(",
"Connection",
"conn",
",",
"T",
"bo",
")",
"{",
"if",
"(",
"bo",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Savepoint",
"savepoint",
"=",
"null",
";",
"try",
"{",
"try",
"{",
"savepoint",
"=",
"conn"... | Create/Persist a new BO to storage.
@param conn
@param bo
@return
@since 0.8.1 | [
"Create",
"/",
"Persist",
"a",
"new",
"BO",
"to",
"storage",
"."
] | 8d059ddf641a1629aa53851f9d1b41abf175a180 | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/jdbc/GenericBoJdbcDao.java#L435-L460 | train | Create a new instance of the class. | Of course, here is the Java code you requested:
```java
protected DaoResult create(Connection conn, T bo) {
if (bo == null) {
return null;
}
Savepoint savepoint = null;
try {
try {
savepoint = conn.getAutoCommit() ? null : conn.setSavepoint();
... |
oblac/jodd | jodd-json/src/main/java/jodd/json/JsonSerializer.java | JsonSerializer.excludeTypes | public JsonSerializer excludeTypes(final String... typeNames) {
if (excludedTypeNames == null) {
excludedTypeNames = typeNames;
} else {
excludedTypeNames = ArraysUtil.join(excludedTypeNames, typeNames);
}
return this;
} | java | public JsonSerializer excludeTypes(final String... typeNames) {
if (excludedTypeNames == null) {
excludedTypeNames = typeNames;
} else {
excludedTypeNames = ArraysUtil.join(excludedTypeNames, typeNames);
}
return this;
} | [
"public",
"JsonSerializer",
"excludeTypes",
"(",
"final",
"String",
"...",
"typeNames",
")",
"{",
"if",
"(",
"excludedTypeNames",
"==",
"null",
")",
"{",
"excludedTypeNames",
"=",
"typeNames",
";",
"}",
"else",
"{",
"excludedTypeNames",
"=",
"ArraysUtil",
".",
... | Excludes type names. You can disable
serialization of properties that are of some type.
For example, you can disable properties of <code>InputStream</code>.
You can use wildcards to describe type names. | [
"Excludes",
"type",
"names",
".",
"You",
"can",
"disable",
"serialization",
"of",
"properties",
"that",
"are",
"of",
"some",
"type",
".",
"For",
"example",
"you",
"can",
"disable",
"properties",
"of",
"<code",
">",
"InputStream<",
"/",
"code",
">",
".",
"Y... | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-json/src/main/java/jodd/json/JsonSerializer.java#L242-L249 | test | Exclude the given types from being serialized. | Of course, here is the Java code you requested:
```java
public JsonSerializer excludeTypes(final String... typeNames) {
if (excludedTypeNames == null) {
excludedTypeNames = typeNames;
} else {
excludedTypeNames = ArraysUtil.join(excludedTypeNames, typeNames);
}
return this;
}
```
Hope this helps! |
alkacon/opencms-core | src/org/opencms/cmis/CmsCmisTypeManager.java | CmsCmisTypeManager.addType | private boolean addType(TypeDefinition type) {
if (type == null) {
return false;
}
if (type.getBaseTypeId() == null) {
return false;
}
// find base type
TypeDefinition baseType = null;
if (type.getBaseTypeId() == BaseTypeId.CMIS_DOCUMENT... | java | private boolean addType(TypeDefinition type) {
if (type == null) {
return false;
}
if (type.getBaseTypeId() == null) {
return false;
}
// find base type
TypeDefinition baseType = null;
if (type.getBaseTypeId() == BaseTypeId.CMIS_DOCUMENT... | [
"private",
"boolean",
"addType",
"(",
"TypeDefinition",
"type",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"type",
".",
"getBaseTypeId",
"(",
")",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
... | Adds a type to collection with inheriting base type properties.
@param type the type definition to add
@return true if the type definition was added | [
"Adds",
"a",
"type",
"to",
"collection",
"with",
"inheriting",
"base",
"type",
"properties",
"."
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cmis/CmsCmisTypeManager.java#L948-L983 | train | Add a type to the exception. | Of course, here is the Java code you requested:
```java
private boolean addType(TypeDefinition type) {
if (type == null) {
return false;
}
if (type.getBaseTypeId() == null) {
return false;
}
// find base type
TypeDefinition baseType = null;
... |
OpenEstate/OpenEstate-IO | OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/Einzelhandel.java | Einzelhandel.setHandelTyp | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public void setHandelTyp(Einzelhandel.HandelTyp value) {
this.handelTyp = value;
} | java | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public void setHandelTyp(Einzelhandel.HandelTyp value) {
this.handelTyp = value;
} | [
"@",
"Generated",
"(",
"value",
"=",
"\"com.sun.tools.xjc.Driver\"",
",",
"date",
"=",
"\"2018-10-12T02:54:50+02:00\"",
",",
"comments",
"=",
"\"JAXB RI v2.2.11\"",
")",
"public",
"void",
"setHandelTyp",
"(",
"Einzelhandel",
".",
"HandelTyp",
"value",
")",
"{",
"thi... | Sets the value of the handelTyp property.
@param value
allowed object is
{@link Einzelhandel.HandelTyp } | [
"Sets",
"the",
"value",
"of",
"the",
"handelTyp",
"property",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/Einzelhandel.java#L63-L66 | test | Sets the value of the handelTyp property. | Of course, here is the Java code you requested:
```java
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public void setHandelTyp(Einzelhandel.HandelTyp value) {
this.handelTyp = value;
}
```
Hope this helps! |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/ScreenshotTaker.java | ScreenshotTaker.initScreenShotSaver | private void initScreenShotSaver() {
if(screenShotSaverThread == null || screenShotSaver == null) {
screenShotSaverThread = new HandlerThread("ScreenShotSaver");
screenShotSaverThread.start();
screenShotSaver = new ScreenShotSaver(screenShotSaverThread);
}
} | java | private void initScreenShotSaver() {
if(screenShotSaverThread == null || screenShotSaver == null) {
screenShotSaverThread = new HandlerThread("ScreenShotSaver");
screenShotSaverThread.start();
screenShotSaver = new ScreenShotSaver(screenShotSaverThread);
}
} | [
"private",
"void",
"initScreenShotSaver",
"(",
")",
"{",
"if",
"(",
"screenShotSaverThread",
"==",
"null",
"||",
"screenShotSaver",
"==",
"null",
")",
"{",
"screenShotSaverThread",
"=",
"new",
"HandlerThread",
"(",
"\"ScreenShotSaver\"",
")",
";",
"screenShotSaverTh... | This method initializes the aysnc screenshot saving logic | [
"This",
"method",
"initializes",
"the",
"aysnc",
"screenshot",
"saving",
"logic"
] | 75e567c38f26a6a87dc8bef90b3886a20e28d291 | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/ScreenshotTaker.java#L285-L291 | train | Initialize the ScreenShotSaver | Of course, here is the Java code you requested:
```java
private void initScreenShotSaver() {
if(screenShotSaverThread == null || screenShotSaver == null) {
screenShotSaverThread = new HandlerThread("ScreenShotSaver");
screenShotSaverThread.start();
screenShotSaver = new ScreenShotSaver(screenShotSaverThread... |
citygml4j/citygml4j | src-gen/main/java/net/opengis/gml/ObjectFactory.java | ObjectFactory.createSphericalCSRef | @XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "sphericalCSRef")
public JAXBElement<SphericalCSRefType> createSphericalCSRef(SphericalCSRefType value) {
return new JAXBElement<SphericalCSRefType>(_SphericalCSRef_QNAME, SphericalCSRefType.class, null, value);
} | java | @XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "sphericalCSRef")
public JAXBElement<SphericalCSRefType> createSphericalCSRef(SphericalCSRefType value) {
return new JAXBElement<SphericalCSRefType>(_SphericalCSRef_QNAME, SphericalCSRefType.class, null, value);
} | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"http://www.opengis.net/gml\"",
",",
"name",
"=",
"\"sphericalCSRef\"",
")",
"public",
"JAXBElement",
"<",
"SphericalCSRefType",
">",
"createSphericalCSRef",
"(",
"SphericalCSRefType",
"value",
")",
"{",
"return",
"new",
... | Create an instance of {@link JAXBElement }{@code <}{@link SphericalCSRefType }{@code >}
@param value
Java instance representing xml element's value.
@return
the new instance of {@link JAXBElement }{@code <}{@link SphericalCSRefType }{@code >} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"SphericalCSRefType",
"}",
"{",
"@code",
">",
"}"
] | 9155997d5ecf7e8f19411a02ba047f13375b97b9 | https://github.com/citygml4j/citygml4j/blob/9155997d5ecf7e8f19411a02ba047f13375b97b9/src-gen/main/java/net/opengis/gml/ObjectFactory.java#L7071-L7074 | train | Create an instance of a SphericalCSRef. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "sphericalCSRef")
public JAXBElement<SphericalCSRefType> createSphericalCSRef(SphericalCSRefType value) {
return new JAXBElement<SphericalCSRefType>(_SphericalCSRef_QNAME, SphericalCSRef... |
aws/aws-sdk-java | aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/AmazonApiGatewayClient.java | AmazonApiGatewayClient.updateClientCertificate | @Override
public UpdateClientCertificateResult updateClientCertificate(UpdateClientCertificateRequest request) {
request = beforeClientExecution(request);
return executeUpdateClientCertificate(request);
} | java | @Override
public UpdateClientCertificateResult updateClientCertificate(UpdateClientCertificateRequest request) {
request = beforeClientExecution(request);
return executeUpdateClientCertificate(request);
} | [
"@",
"Override",
"public",
"UpdateClientCertificateResult",
"updateClientCertificate",
"(",
"UpdateClientCertificateRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeUpdateClientCertificate",
"(",
"request",
... | <p>
Changes information about an <a>ClientCertificate</a> resource.
</p>
@param updateClientCertificateRequest
A request to change information about an <a>ClientCertificate</a> resource.
@return Result of the UpdateClientCertificate operation returned by the service.
@throws UnauthorizedException
The request is denied... | [
"<p",
">",
"Changes",
"information",
"about",
"an",
"<a",
">",
"ClientCertificate<",
"/",
"a",
">",
"resource",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/AmazonApiGatewayClient.java#L6490-L6494 | train | Updates an existing client certificate. | Of course, here is the Java code you requested:
```java
@Override
public UpdateClientCertificateResult updateClientCertificate(UpdateClientCertificateRequest request) {
request = beforeClientExecution(request);
return executeUpdateClientCertificate(request);
}
```
Hope this helps! |
buschmais/jqa-core-framework | analysis/src/main/java/com/buschmais/jqassistant/core/analysis/impl/AbstractCypherRuleInterpreterPlugin.java | AbstractCypherRuleInterpreterPlugin.isSuppressedRow | private boolean isSuppressedRow(String ruleId, Map<String, Object> row, String primaryColumn) {
Object primaryValue = row.get(primaryColumn);
if (primaryValue != null && Suppress.class.isAssignableFrom(primaryValue.getClass())) {
Suppress suppress = (Suppress) primaryValue;
for (... | java | private boolean isSuppressedRow(String ruleId, Map<String, Object> row, String primaryColumn) {
Object primaryValue = row.get(primaryColumn);
if (primaryValue != null && Suppress.class.isAssignableFrom(primaryValue.getClass())) {
Suppress suppress = (Suppress) primaryValue;
for (... | [
"private",
"boolean",
"isSuppressedRow",
"(",
"String",
"ruleId",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"row",
",",
"String",
"primaryColumn",
")",
"{",
"Object",
"primaryValue",
"=",
"row",
".",
"get",
"(",
"primaryColumn",
")",
";",
"if",
"(",
... | Verifies if the given row shall be suppressed.
The primary column is checked if it contains a suppression that matches the
current rule id.
@param ruleId
The rule id.
@param row
The row.
@param primaryColumn
The name of the primary column.
@return <code>true</code> if the row shall be suppressed. | [
"Verifies",
"if",
"the",
"given",
"row",
"shall",
"be",
"suppressed",
"."
] | 0e63ff509cfe52f9063539a23d5f9f183b2ea4a5 | https://github.com/buschmais/jqa-core-framework/blob/0e63ff509cfe52f9063539a23d5f9f183b2ea4a5/analysis/src/main/java/com/buschmais/jqassistant/core/analysis/impl/AbstractCypherRuleInterpreterPlugin.java#L73-L84 | train | Check if the row is suppressed. | Of course, here is the Java code you requested:
```java
private boolean isSuppressedRow(String ruleId, Map<String, Object> row, String primaryColumn) {
Object primaryValue = row.get(primaryColumn);
if (primaryValue != null && Suppress.class.isAssignableFrom(primaryValue.getClass())) {
Suppr... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/util/rc/RC.java | RC.insert | public Triple
insert(Triple t) {
if (t.key == null) return null;
List<Triple> list = triplestore.get(t.key);
if (list == null) list = new ArrayList<Triple>();
Triple prev = addtriple(list, t);
triplestore.put(t.key, list);
return prev;
} | java | public Triple
insert(Triple t) {
if (t.key == null) return null;
List<Triple> list = triplestore.get(t.key);
if (list == null) list = new ArrayList<Triple>();
Triple prev = addtriple(list, t);
triplestore.put(t.key, list);
return prev;
} | [
"public",
"Triple",
"insert",
"(",
"Triple",
"t",
")",
"{",
"if",
"(",
"t",
".",
"key",
"==",
"null",
")",
"return",
"null",
";",
"List",
"<",
"Triple",
">",
"list",
"=",
"triplestore",
".",
"get",
"(",
"t",
".",
"key",
")",
";",
"if",
"(",
"li... | Allow for external loading | [
"Allow",
"for",
"external",
"loading"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/util/rc/RC.java#L417-L425 | test | Insert a new triple into the list of triples. | Of course, here is the Java code you requested:
```java
public Triple
insert(Triple t) {
if (t.key == null) return null;
List<Triple> list = triplestore.get(t.key);
if (list == null) list = new ArrayList<Triple>();
Triple prev = addtriple(list, t);
triplestore.put(t.key, list);
return prev;
... |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.deleteExplicitListItemAsync | public ServiceFuture<OperationStatus> deleteExplicitListItemAsync(UUID appId, String versionId, UUID entityId, long itemId, final ServiceCallback<OperationStatus> serviceCallback) {
return ServiceFuture.fromResponse(deleteExplicitListItemWithServiceResponseAsync(appId, versionId, entityId, itemId), serviceCallb... | java | public ServiceFuture<OperationStatus> deleteExplicitListItemAsync(UUID appId, String versionId, UUID entityId, long itemId, final ServiceCallback<OperationStatus> serviceCallback) {
return ServiceFuture.fromResponse(deleteExplicitListItemWithServiceResponseAsync(appId, versionId, entityId, itemId), serviceCallb... | [
"public",
"ServiceFuture",
"<",
"OperationStatus",
">",
"deleteExplicitListItemAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"long",
"itemId",
",",
"final",
"ServiceCallback",
"<",
"OperationStatus",
">",
"serviceCallback",
... | Delete the explicit list item from the Pattern.any explicit list.
@param appId The application ID.
@param versionId The version ID.
@param entityId The pattern.any entity id.
@param itemId The explicit list item which will be deleted.
@param serviceCallback the async ServiceCallback to handle successful and failed res... | [
"Delete",
"the",
"explicit",
"list",
"item",
"from",
"the",
"Pattern",
".",
"any",
"explicit",
"list",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L14277-L14279 | train | Deletes an explicit list item from an App Service Environment. | Of course, here is the Java code you requested:
```java
public ServiceFuture<OperationStatus> deleteExplicitListItemAsync(UUID appId, String versionId, UUID entityId, long itemId, final ServiceCallback<OperationStatus> serviceCallback) {
return ServiceFuture.fromResponse(deleteExplicitListItemWithServiceRespon... |
aws/aws-sdk-java | aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/AWSServiceCatalogClient.java | AWSServiceCatalogClient.describeProvisioningArtifact | @Override
public DescribeProvisioningArtifactResult describeProvisioningArtifact(DescribeProvisioningArtifactRequest request) {
request = beforeClientExecution(request);
return executeDescribeProvisioningArtifact(request);
} | java | @Override
public DescribeProvisioningArtifactResult describeProvisioningArtifact(DescribeProvisioningArtifactRequest request) {
request = beforeClientExecution(request);
return executeDescribeProvisioningArtifact(request);
} | [
"@",
"Override",
"public",
"DescribeProvisioningArtifactResult",
"describeProvisioningArtifact",
"(",
"DescribeProvisioningArtifactRequest",
"request",
")",
"{",
"request",
"=",
"beforeClientExecution",
"(",
"request",
")",
";",
"return",
"executeDescribeProvisioningArtifact",
... | <p>
Gets information about the specified provisioning artifact (also known as a version) for the specified product.
</p>
@param describeProvisioningArtifactRequest
@return Result of the DescribeProvisioningArtifact operation returned by the service.
@throws ResourceNotFoundException
The specified resource was not foun... | [
"<p",
">",
"Gets",
"information",
"about",
"the",
"specified",
"provisioning",
"artifact",
"(",
"also",
"known",
"as",
"a",
"version",
")",
"for",
"the",
"specified",
"product",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/AWSServiceCatalogClient.java#L2312-L2316 | train | Returns information about a package. | Of course, here is the Java code you requested:
```java
@Override
public DescribeProvisioningArtifactResult describeProvisioningArtifact(DescribeProvisioningArtifactRequest request) {
request = beforeClientExecution(request);
return executeDescribeProvisioningArtifact(request);
}
```
Hope this... |
aws/aws-sdk-java | aws-java-sdk-alexaforbusiness/src/main/java/com/amazonaws/services/alexaforbusiness/model/transform/ListBusinessReportSchedulesRequestMarshaller.java | ListBusinessReportSchedulesRequestMarshaller.marshall | public void marshall(ListBusinessReportSchedulesRequest listBusinessReportSchedulesRequest, ProtocolMarshaller protocolMarshaller) {
if (listBusinessReportSchedulesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
proto... | java | public void marshall(ListBusinessReportSchedulesRequest listBusinessReportSchedulesRequest, ProtocolMarshaller protocolMarshaller) {
if (listBusinessReportSchedulesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
proto... | [
"public",
"void",
"marshall",
"(",
"ListBusinessReportSchedulesRequest",
"listBusinessReportSchedulesRequest",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"listBusinessReportSchedulesRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientExcepti... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-alexaforbusiness/src/main/java/com/amazonaws/services/alexaforbusiness/model/transform/ListBusinessReportSchedulesRequestMarshaller.java#L44-L56 | train | Creates the marshalling method for the ANSWERSUBMITTED_BINDING instance. | Of course, here is the Java code you requested:
```java
public void marshall(ListBusinessReportSchedulesRequest listBusinessReportSchedulesRequest, ProtocolMarshaller protocolMarshaller) {
if (listBusinessReportSchedulesRequest == null) {
throw new SdkClientException("Invalid argument passed to ma... |
xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheListUtil.java | CacheListUtil.addFirst | public static Single<Boolean> addFirst(String cacheKey, Object value) {
return addFirst(CacheService.CACHE_CONFIG_BEAN, cacheKey, value);
} | java | public static Single<Boolean> addFirst(String cacheKey, Object value) {
return addFirst(CacheService.CACHE_CONFIG_BEAN, cacheKey, value);
} | [
"public",
"static",
"Single",
"<",
"Boolean",
">",
"addFirst",
"(",
"String",
"cacheKey",
",",
"Object",
"value",
")",
"{",
"return",
"addFirst",
"(",
"CacheService",
".",
"CACHE_CONFIG_BEAN",
",",
"cacheKey",
",",
"value",
")",
";",
"}"
] | add element to the list's header
@param cacheKey the key for the cached list.
@param value the value to be added. | [
"add",
"element",
"to",
"the",
"list",
"s",
"header"
] | 1948e088545553d2745b2c86d8b5a64988bb850e | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheListUtil.java#L103-L105 | train | Add the value to the first cache entry. | Of course, here is the Java code you requested:
```java
public static Single<Boolean> addFirst(String cacheKey, Object value) {
return addFirst(CacheService.CACHE_CONFIG_BEAN, cacheKey, value);
}
```
Hope this helps! |
google/guava | guava/src/com/google/common/collect/AbstractMapBasedMultimap.java | AbstractMapBasedMultimap.get | @Override
public Collection<V> get(@Nullable K key) {
Collection<V> collection = map.get(key);
if (collection == null) {
collection = createCollection(key);
}
return wrapCollection(key, collection);
} | java | @Override
public Collection<V> get(@Nullable K key) {
Collection<V> collection = map.get(key);
if (collection == null) {
collection = createCollection(key);
}
return wrapCollection(key, collection);
} | [
"@",
"Override",
"public",
"Collection",
"<",
"V",
">",
"get",
"(",
"@",
"Nullable",
"K",
"key",
")",
"{",
"Collection",
"<",
"V",
">",
"collection",
"=",
"map",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"collection",
"==",
"null",
")",
"{",
"... | {@inheritDoc}
<p>The returned collection is not serializable. | [
"{",
"@inheritDoc",
"}"
] | 7155d12b70a2406fa84d94d4b8b3bc108e89abfd | https://github.com/google/guava/blob/7155d12b70a2406fa84d94d4b8b3bc108e89abfd/guava/src/com/google/common/collect/AbstractMapBasedMultimap.java#L285-L292 | valid | Get a collection of the value associated with the given key. | Of course, here is the Java code you requested:
```java
@Override
public Collection<V> get(@Nullable K key) {
Collection<V> collection = map.get(key);
if (collection == null) {
collection = createCollection(key);
}
return wrapCollection(key, collection);
}
```
Hope this helps! |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Dispatching.java | Dispatching.curry | public static <T1, T2, T3, R> BiFunction<T2, T3, R> curry(TriFunction<T1, T2, T3, R> function, T1 first) {
dbc.precondition(function != null, "cannot bind parameter of a null function");
return (second, third) -> function.apply(first, second, third);
} | java | public static <T1, T2, T3, R> BiFunction<T2, T3, R> curry(TriFunction<T1, T2, T3, R> function, T1 first) {
dbc.precondition(function != null, "cannot bind parameter of a null function");
return (second, third) -> function.apply(first, second, third);
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"BiFunction",
"<",
"T2",
",",
"T3",
",",
"R",
">",
"curry",
"(",
"TriFunction",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"function",
",",
"T1",
"first",
")",
"{",
"dbc... | Partial application of the first parameter to a ternary function.
@param <T1> the function first parameter type
@param <T2> the function second parameter type
@param <T3> the function third parameter type
@param <R> the function return type
@param function the function to be curried
@param first the value to be currie... | [
"Partial",
"application",
"of",
"the",
"first",
"parameter",
"to",
"a",
"ternary",
"function",
"."
] | 98115a436e35335c5e8831f9fdc12f6d93d524be | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Dispatching.java#L151-L154 | train | Curries a TriFunction to a binary function. | Of course, here is the Java code you requested:
```java
public static <T1, T2, T3, R> BiFunction<T2, T3, R> curry(TriFunction<T1, T2, T3, R> function, T1 first) {
dbc.precondition(function != null, "cannot bind parameter of a null function");
return (second, third) -> function.apply(first, second, thir... |
elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/QuickSelectDBIDs.java | QuickSelectDBIDs.quickSelect | public static void quickSelect(ArrayModifiableDBIDs data, Comparator<? super DBIDRef> comparator, int rank) {
quickSelect(data, comparator, 0, data.size(), rank);
} | java | public static void quickSelect(ArrayModifiableDBIDs data, Comparator<? super DBIDRef> comparator, int rank) {
quickSelect(data, comparator, 0, data.size(), rank);
} | [
"public",
"static",
"void",
"quickSelect",
"(",
"ArrayModifiableDBIDs",
"data",
",",
"Comparator",
"<",
"?",
"super",
"DBIDRef",
">",
"comparator",
",",
"int",
"rank",
")",
"{",
"quickSelect",
"(",
"data",
",",
"comparator",
",",
"0",
",",
"data",
".",
"si... | QuickSelect is essentially quicksort, except that we only "sort" that half
of the array that we are interested in.
Note: the array is <b>modified</b> by this.
@param data Data to process
@param comparator Comparator to use
@param rank Rank position that we are interested in (integer!) | [
"QuickSelect",
"is",
"essentially",
"quicksort",
"except",
"that",
"we",
"only",
"sort",
"that",
"half",
"of",
"the",
"array",
"that",
"we",
"are",
"interested",
"in",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/ids/QuickSelectDBIDs.java#L88-L90 | train | Quick select. | Of course, here is the Java code you requested:
```java
public static void quickSelect(ArrayModifiableDBIDs data, Comparator<? super DBIDRef> comparator, int rank) {
quickSelect(data, comparator, 0, data.size(), rank);
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-inspector/src/main/java/com/amazonaws/services/inspector/model/transform/ListAssessmentTargetsRequestMarshaller.java | ListAssessmentTargetsRequestMarshaller.marshall | public void marshall(ListAssessmentTargetsRequest listAssessmentTargetsRequest, ProtocolMarshaller protocolMarshaller) {
if (listAssessmentTargetsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.mars... | java | public void marshall(ListAssessmentTargetsRequest listAssessmentTargetsRequest, ProtocolMarshaller protocolMarshaller) {
if (listAssessmentTargetsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.mars... | [
"public",
"void",
"marshall",
"(",
"ListAssessmentTargetsRequest",
"listAssessmentTargetsRequest",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"listAssessmentTargetsRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"I... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-inspector/src/main/java/com/amazonaws/services/inspector/model/transform/ListAssessmentTargetsRequestMarshaller.java#L46-L59 | train | marshalls the given list of assessment targets to the given protocolMarshaller. | Of course, here is the Java code you requested:
```java
public void marshall(ListAssessmentTargetsRequest listAssessmentTargetsRequest, ProtocolMarshaller protocolMarshaller) {
if (listAssessmentTargetsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
... |
aol/cyclops | cyclops/src/main/java/cyclops/function/Memoize.java | Memoize.memoizeTriFunctionAsync | public static <T1, T2, T3, R> Function3<T1, T2, T3, R> memoizeTriFunctionAsync(final Function3<T1, T2, T3, R> fn, ScheduledExecutorService ex, String cron) {
Function1<Tuple3<T1, T2, T3>, R> memoise2 = memoizeFunctionAsync((final Tuple3<T1, T2, T3> triple) -> fn.apply(triple._1(), triple._2(), triple._3()), ex, c... | java | public static <T1, T2, T3, R> Function3<T1, T2, T3, R> memoizeTriFunctionAsync(final Function3<T1, T2, T3, R> fn, ScheduledExecutorService ex, String cron) {
Function1<Tuple3<T1, T2, T3>, R> memoise2 = memoizeFunctionAsync((final Tuple3<T1, T2, T3> triple) -> fn.apply(triple._1(), triple._2(), triple._3()), ex, c... | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"Function3",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"memoizeTriFunctionAsync",
"(",
"final",
"Function3",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"fn",
",",
"S... | Memoize this function and update cached values on a schedule
Does not support null keys
@param fn Function to Memoize
@param ex Scheduled Executor Service
@param cron Cron expression for updating cached values asynchonrously
@return Memoized asynchronously updating function | [
"Memoize",
"this",
"function",
"and",
"update",
"cached",
"values",
"on",
"a",
"schedule",
"Does",
"not",
"support",
"null",
"keys"
] | 59a9fde30190a4d1faeb9f6d9851d209d82b81dd | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/cyclops/function/Memoize.java#L290-L293 | train | Memoize a TriFunction in asynchronous fashion. | Of course, here is the Java code you requested:
```java
public static <T1, T2, T3, R> Function3<T1, T2, T3, R> memoizeTriFunctionAsync(final Function3<T1, T2, T3, R> fn, ScheduledExecutorService ex, String cron) {
Function1<Tuple3<T1, T2, T3>, R> memoise2 = memoizeFunctionAsync((final Tuple3<T1, T2, T3> triple) ... |
overturetool/overture | ide/ui/src/main/java/org/overture/ide/ui/utility/ast/AstLocationSearcher.java | AstLocationSearcher.search | public static INode search(List<INode> nodes, int offSet,
IVdmSourceUnit source)
{
synchronized (seacher)
{
if (DEBUG_PRINT)
{
System.out.println("Search start");
}
seacher.init();
seacher.offSet = offSet;
seacher.sourceFile = source.getSystemFile();
try
{
for (INode node : nodes... | java | public static INode search(List<INode> nodes, int offSet,
IVdmSourceUnit source)
{
synchronized (seacher)
{
if (DEBUG_PRINT)
{
System.out.println("Search start");
}
seacher.init();
seacher.offSet = offSet;
seacher.sourceFile = source.getSystemFile();
try
{
for (INode node : nodes... | [
"public",
"static",
"INode",
"search",
"(",
"List",
"<",
"INode",
">",
"nodes",
",",
"int",
"offSet",
",",
"IVdmSourceUnit",
"source",
")",
"{",
"synchronized",
"(",
"seacher",
")",
"{",
"if",
"(",
"DEBUG_PRINT",
")",
"{",
"System",
".",
"out",
".",
"p... | Search method to find the closest node to a location specified by a test offset
@param nodes
The nodes to search within
@param offSet
The offset to match a node to
@return The node closest to the offset or null | [
"Search",
"method",
"to",
"find",
"the",
"closest",
"node",
"to",
"a",
"location",
"specified",
"by",
"a",
"test",
"offset"
] | 83175dc6c24fa171cde4fcf61ecb648eba3bdbc1 | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/ide/ui/src/main/java/org/overture/ide/ui/utility/ast/AstLocationSearcher.java#L121-L148 | train | Search for a node in the list of nodes. | Of course, here is the Java code you requested:
```java
public static INode search(List<INode> nodes, int offSet,
IVdmSourceUnit source)
{
synchronized (seacher)
{
if (DEBUG_PRINT)
{
System.out.println("Search start");
}
seacher.init();
seacher.offSet = offSet;
seacher.sourceFile = source... |
eFaps/eFaps-Kernel | src/main/java/org/efaps/admin/ui/AbstractCollection.java | AbstractCollection.readFromDB4Fields | private void readFromDB4Fields()
throws CacheReloadException
{
try {
final QueryBuilder queryBldr = new QueryBuilder(CIAdminUserInterface.Field);
queryBldr.addWhereAttrEqValue(CIAdminUserInterface.Field.Collection, getId());
final MultiPrintQuery multi = queryBld... | java | private void readFromDB4Fields()
throws CacheReloadException
{
try {
final QueryBuilder queryBldr = new QueryBuilder(CIAdminUserInterface.Field);
queryBldr.addWhereAttrEqValue(CIAdminUserInterface.Field.Collection, getId());
final MultiPrintQuery multi = queryBld... | [
"private",
"void",
"readFromDB4Fields",
"(",
")",
"throws",
"CacheReloadException",
"{",
"try",
"{",
"final",
"QueryBuilder",
"queryBldr",
"=",
"new",
"QueryBuilder",
"(",
"CIAdminUserInterface",
".",
"Field",
")",
";",
"queryBldr",
".",
"addWhereAttrEqValue",
"(",
... | Read all fields related to this collection object.
@throws CacheReloadException on error | [
"Read",
"all",
"fields",
"related",
"to",
"this",
"collection",
"object",
"."
] | 04b96548f518c2386a93f5ec2b9349f9b9063859 | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/admin/ui/AbstractCollection.java#L200-L240 | train | Read from DB 4 fields. | Of course, here is the Java code you requested:
```java
private void readFromDB4Fields()
throws CacheReloadException
{
try {
final QueryBuilder queryBldr = new QueryBuilder(CIAdminUserInterface.Field);
queryBldr.addWhereAttrEqValue(CIAdminUserInterface.Field.Collection, get... |
glyptodon/guacamole-client | extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/permission/ModeledPermissionService.java | ModeledPermissionService.getPermissionInstances | protected Set<PermissionType> getPermissionInstances(Collection<ModelType> models) {
// Create new collection of permissions by manually converting each model
Set<PermissionType> permissions = new HashSet<PermissionType>(models.size());
for (ModelType model : models)
permissions.add... | java | protected Set<PermissionType> getPermissionInstances(Collection<ModelType> models) {
// Create new collection of permissions by manually converting each model
Set<PermissionType> permissions = new HashSet<PermissionType>(models.size());
for (ModelType model : models)
permissions.add... | [
"protected",
"Set",
"<",
"PermissionType",
">",
"getPermissionInstances",
"(",
"Collection",
"<",
"ModelType",
">",
"models",
")",
"{",
"// Create new collection of permissions by manually converting each model",
"Set",
"<",
"PermissionType",
">",
"permissions",
"=",
"new",... | Returns a collection of permissions which are based on the models in
the given collection.
@param models
The model objects to use to produce the permissions within the
returned set.
@return
A set of permissions which are based on the models in the given
collection. | [
"Returns",
"a",
"collection",
"of",
"permissions",
"which",
"are",
"based",
"on",
"the",
"models",
"in",
"the",
"given",
"collection",
"."
] | ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9 | 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/permission/ModeledPermissionService.java#L88-L97 | train | Get permissions for a collection of models. | Of course, here is the Java code you requested:
```java
protected Set<PermissionType> getPermissionInstances(Collection<ModelType> models) {
// Create new collection of permissions by manually converting each model
Set<PermissionType> permissions = new HashSet<PermissionType>(models.size());
f... |
FlyingHe/UtilsMaven | src/main/java/com/github/flyinghe/tools/WriteExcelUtils.java | WriteExcelUtils.setCellValue | public static Cell setCellValue(Cell cell, Object value, String dateFormat) {
SimpleDateFormat format =
new SimpleDateFormat(StringUtils.isNotBlank(dateFormat) ? dateFormat : DATE_PATTERN);
if (value == null) {
cell.setCellValue("");
} else if (value instanceof String... | java | public static Cell setCellValue(Cell cell, Object value, String dateFormat) {
SimpleDateFormat format =
new SimpleDateFormat(StringUtils.isNotBlank(dateFormat) ? dateFormat : DATE_PATTERN);
if (value == null) {
cell.setCellValue("");
} else if (value instanceof String... | [
"public",
"static",
"Cell",
"setCellValue",
"(",
"Cell",
"cell",
",",
"Object",
"value",
",",
"String",
"dateFormat",
")",
"{",
"SimpleDateFormat",
"format",
"=",
"new",
"SimpleDateFormat",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"dateFormat",
")",
"?",
"d... | 给一个Cell赋值,若为空则视为"",若不为基本类型及其包装类(日期类型除外),则其值通过toString()获取
@param cell 一个单元格
@param value 值
@param dateFormat 日期格式
@return 返回传入的Cell | [
"给一个Cell赋值",
"若为空则视为",
"若不为基本类型及其包装类",
"(",
"日期类型除外",
")",
"则其值通过toString",
"()",
"获取"
] | d9605b7bfe0c28a05289252e12d163e114080b4a | https://github.com/FlyingHe/UtilsMaven/blob/d9605b7bfe0c28a05289252e12d163e114080b4a/src/main/java/com/github/flyinghe/tools/WriteExcelUtils.java#L38-L69 | train | Method setCellValue. | Of course, here is the Java code you requested:
```java
public static Cell setCellValue(Cell cell, Object value, String dateFormat) {
SimpleDateFormat format =
new SimpleDateFormat(StringUtils.isNotBlank(dateFormat) ? dateFormat : DATE_PATTERN);
if (value == null) {
cell.set... |
reactor/reactor-core | reactor-core/src/main/java/reactor/core/publisher/Flux.java | Flux.concatMap | public final <V> Flux<V> concatMap(Function<? super T, ? extends Publisher<? extends V>>
mapper, int prefetch) {
return onAssembly(new FluxConcatMap<>(this, mapper, Queues.get(prefetch), prefetch,
FluxConcatMap.ErrorMode.IMMEDIATE));
} | java | public final <V> Flux<V> concatMap(Function<? super T, ? extends Publisher<? extends V>>
mapper, int prefetch) {
return onAssembly(new FluxConcatMap<>(this, mapper, Queues.get(prefetch), prefetch,
FluxConcatMap.ErrorMode.IMMEDIATE));
} | [
"public",
"final",
"<",
"V",
">",
"Flux",
"<",
"V",
">",
"concatMap",
"(",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"Publisher",
"<",
"?",
"extends",
"V",
">",
">",
"mapper",
",",
"int",
"prefetch",
")",
"{",
"return",
"onAssembly",
... | Transform the elements emitted by this {@link Flux} asynchronously into Publishers,
then flatten these inner publishers into a single {@link Flux}, sequentially and
preserving order using concatenation.
<p>
There are three dimensions to this operator that can be compared with
{@link #flatMap(Function) flatMap} and {@li... | [
"Transform",
"the",
"elements",
"emitted",
"by",
"this",
"{",
"@link",
"Flux",
"}",
"asynchronously",
"into",
"Publishers",
"then",
"flatten",
"these",
"inner",
"publishers",
"into",
"a",
"single",
"{",
"@link",
"Flux",
"}",
"sequentially",
"and",
"preserving",
... | df2eba4ab7d2393e1a942ce972c3307fbbd47ff9 | https://github.com/reactor/reactor-core/blob/df2eba4ab7d2393e1a942ce972c3307fbbd47ff9/reactor-core/src/main/java/reactor/core/publisher/Flux.java#L3481-L3485 | valid | Creates a Flux that concatenates the contents of this Flux using the provided Function to produce a sequence of Publishers. | Of course, here is the Java code you requested:
```java
public final <V> Flux<V> concatMap(Function<? super T, ? extends Publisher<? extends V>>
mapper, int prefetch) {
return onAssembly(new FluxConcatMap<>(this, mapper, Queues.get(prefetch), prefetch,
FluxConcatMap.ErrorMode.IMMEDIATE));
}
```
Hope this he... |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/spider/ExtensionSpider.java | ExtensionSpider.createDisplayName | private String createDisplayName(Target target, Object[] customConfigurations) {
HttpPrefixFetchFilter subtreeFecthFilter = getUriPrefixFecthFilter(customConfigurations);
if (subtreeFecthFilter != null) {
return abbreviateDisplayName(subtreeFecthFilter.getNormalisedPrefix());
}
if (target.getContext() != nu... | java | private String createDisplayName(Target target, Object[] customConfigurations) {
HttpPrefixFetchFilter subtreeFecthFilter = getUriPrefixFecthFilter(customConfigurations);
if (subtreeFecthFilter != null) {
return abbreviateDisplayName(subtreeFecthFilter.getNormalisedPrefix());
}
if (target.getContext() != nu... | [
"private",
"String",
"createDisplayName",
"(",
"Target",
"target",
",",
"Object",
"[",
"]",
"customConfigurations",
")",
"{",
"HttpPrefixFetchFilter",
"subtreeFecthFilter",
"=",
"getUriPrefixFecthFilter",
"(",
"customConfigurations",
")",
";",
"if",
"(",
"subtreeFecthFi... | Creates the display name for the given target and, optionally, the given custom configurations.
@param target the target that will be spidered
@param customConfigurations other custom configurations for the spider, might be {@code null}
@return a {@code String} containing the display name, never {@code null} | [
"Creates",
"the",
"display",
"name",
"for",
"the",
"given",
"target",
"and",
"optionally",
"the",
"given",
"custom",
"configurations",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/spider/ExtensionSpider.java#L558-L579 | train | Create a display name for the target. | Of course, here is the Java code you requested:
```java
private String createDisplayName(Target target, Object[] customConfigurations) {
HttpPrefixFetchFilter subtreeFecthFilter = getUriPrefixFecthFilter(customConfigurations);
if (subtreeFecthFilter != null) {
return abbreviateDisplayName(subtreeFecthFilter.get... |
aws/aws-sdk-java | aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/model/DBInstance.java | DBInstance.withDomainMemberships | public DBInstance withDomainMemberships(DomainMembership... domainMemberships) {
if (this.domainMemberships == null) {
setDomainMemberships(new com.amazonaws.internal.SdkInternalList<DomainMembership>(domainMemberships.length));
}
for (DomainMembership ele : domainMemberships) {
... | java | public DBInstance withDomainMemberships(DomainMembership... domainMemberships) {
if (this.domainMemberships == null) {
setDomainMemberships(new com.amazonaws.internal.SdkInternalList<DomainMembership>(domainMemberships.length));
}
for (DomainMembership ele : domainMemberships) {
... | [
"public",
"DBInstance",
"withDomainMemberships",
"(",
"DomainMembership",
"...",
"domainMemberships",
")",
"{",
"if",
"(",
"this",
".",
"domainMemberships",
"==",
"null",
")",
"{",
"setDomainMemberships",
"(",
"new",
"com",
".",
"amazonaws",
".",
"internal",
".",
... | <p>
The Active Directory Domain membership records associated with the DB instance.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setDomainMemberships(java.util.Collection)} or {@link #withDomainMemberships(java.util.Collection)} if
you want to override the existing val... | [
"<p",
">",
"The",
"Active",
"Directory",
"Domain",
"membership",
"records",
"associated",
"with",
"the",
"DB",
"instance",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"This",
"method",
"appends",
"the",
"values",
"... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/model/DBInstance.java#L2601-L2609 | train | Sets the domain memberships value for this DBInstance. | Of course, here is the Java code you requested:
```java
public DBInstance withDomainMemberships(DomainMembership... domainMemberships) {
if (this.domainMemberships == null) {
setDomainMemberships(new com.amazonaws.internal.SdkInternalList<DomainMembership>(domainMemberships.length));
}
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.