repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
redkale/redkale | src/org/redkale/boot/ClassFilter.java | ClassFilter.filter | @SuppressWarnings("unchecked")
public final void filter(AnyValue property, String clazzname, URL url) {
"""
自动扫描地过滤指定的class
@param property AnyValue
@param clazzname String
@param url URL
"""
filter(property, clazzname, true, url);
} | java | @SuppressWarnings("unchecked")
public final void filter(AnyValue property, String clazzname, URL url) {
filter(property, clazzname, true, url);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"final",
"void",
"filter",
"(",
"AnyValue",
"property",
",",
"String",
"clazzname",
",",
"URL",
"url",
")",
"{",
"filter",
"(",
"property",
",",
"clazzname",
",",
"true",
",",
"url",
")",
";",
... | 自动扫描地过滤指定的class
@param property AnyValue
@param clazzname String
@param url URL | [
"自动扫描地过滤指定的class"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/boot/ClassFilter.java#L144-L147 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_activateSharepoint_POST | public OvhTask organizationName_service_exchangeService_activateSharepoint_POST(String organizationName, String exchangeService, String primaryEmailAddress, String subDomain) throws IOException {
"""
Activate Sharepoint infra connected to this exchange service
REST: POST /email/exchange/{organizationName}/servi... | java | public OvhTask organizationName_service_exchangeService_activateSharepoint_POST(String organizationName, String exchangeService, String primaryEmailAddress, String subDomain) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/activateSharepoint";
StringBuilder sb = pat... | [
"public",
"OvhTask",
"organizationName_service_exchangeService_activateSharepoint_POST",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"String",
"primaryEmailAddress",
",",
"String",
"subDomain",
")",
"throws",
"IOException",
"{",
"String",
"qPath"... | Activate Sharepoint infra connected to this exchange service
REST: POST /email/exchange/{organizationName}/service/{exchangeService}/activateSharepoint
@param subDomain [required] sub domain that will be used for Your sharepoint infra (You will not be able to change it!)
@param primaryEmailAddress [required] primary e... | [
"Activate",
"Sharepoint",
"infra",
"connected",
"to",
"this",
"exchange",
"service"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L1028-L1036 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java | ResourcesInner.beginDeleteByIdAsync | public Observable<Void> beginDeleteByIdAsync(String resourceId, String apiVersion) {
"""
Deletes a resource by ID.
@param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provide... | java | public Observable<Void> beginDeleteByIdAsync(String resourceId, String apiVersion) {
return beginDeleteByIdWithServiceResponseAsync(resourceId, apiVersion).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return r... | [
"public",
"Observable",
"<",
"Void",
">",
"beginDeleteByIdAsync",
"(",
"String",
"resourceId",
",",
"String",
"apiVersion",
")",
"{",
"return",
"beginDeleteByIdWithServiceResponseAsync",
"(",
"resourceId",
",",
"apiVersion",
")",
".",
"map",
"(",
"new",
"Func1",
"... | Deletes a resource by ID.
@param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
@param apiVersion The API version to use for the op... | [
"Deletes",
"a",
"resource",
"by",
"ID",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java#L2012-L2019 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/AbstractEntityReader.java | AbstractEntityReader.getId | protected Object getId(Object entity, EntityMetadata metadata) {
"""
Gets the id.
@param entity
the entity
@param metadata
the metadata
@return the id
"""
try
{
return PropertyAccessorHelper.getId(entity, metadata);
}
catch (PropertyAccessException e)
... | java | protected Object getId(Object entity, EntityMetadata metadata)
{
try
{
return PropertyAccessorHelper.getId(entity, metadata);
}
catch (PropertyAccessException e)
{
log.error("Error while Getting ID for entity {}, Caused by: {}.", entity, e);
... | [
"protected",
"Object",
"getId",
"(",
"Object",
"entity",
",",
"EntityMetadata",
"metadata",
")",
"{",
"try",
"{",
"return",
"PropertyAccessorHelper",
".",
"getId",
"(",
"entity",
",",
"metadata",
")",
";",
"}",
"catch",
"(",
"PropertyAccessException",
"e",
")"... | Gets the id.
@param entity
the entity
@param metadata
the metadata
@return the id | [
"Gets",
"the",
"id",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/AbstractEntityReader.java#L626-L638 |
apache/incubator-zipkin | zipkin/src/main/java/zipkin2/internal/HexCodec.java | HexCodec.lowerHexToUnsignedLong | public static long lowerHexToUnsignedLong(String lowerHex) {
"""
Parses a 1 to 32 character lower-hex string with no prefix into an unsigned long, tossing any
bits higher than 64.
"""
int length = lowerHex.length();
if (length < 1 || length > 32) throw isntLowerHexLong(lowerHex);
// trim off any ... | java | public static long lowerHexToUnsignedLong(String lowerHex) {
int length = lowerHex.length();
if (length < 1 || length > 32) throw isntLowerHexLong(lowerHex);
// trim off any high bits
int beginIndex = length > 16 ? length - 16 : 0;
return lowerHexToUnsignedLong(lowerHex, beginIndex);
} | [
"public",
"static",
"long",
"lowerHexToUnsignedLong",
"(",
"String",
"lowerHex",
")",
"{",
"int",
"length",
"=",
"lowerHex",
".",
"length",
"(",
")",
";",
"if",
"(",
"length",
"<",
"1",
"||",
"length",
">",
"32",
")",
"throw",
"isntLowerHexLong",
"(",
"l... | Parses a 1 to 32 character lower-hex string with no prefix into an unsigned long, tossing any
bits higher than 64. | [
"Parses",
"a",
"1",
"to",
"32",
"character",
"lower",
"-",
"hex",
"string",
"with",
"no",
"prefix",
"into",
"an",
"unsigned",
"long",
"tossing",
"any",
"bits",
"higher",
"than",
"64",
"."
] | train | https://github.com/apache/incubator-zipkin/blob/89b2fab983fc626b3be32ce9d7cf64b3f01f1a87/zipkin/src/main/java/zipkin2/internal/HexCodec.java#L25-L33 |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.removeValue | public void removeValue(T value, boolean reload) {
"""
Removes a value from the list box. Nothing is done if the value isn't on
the list box.
@param value the value to be removed from the list
@param reload perform a 'material select' reload to update the DOM.
"""
int idx = getIndex(value);
... | java | public void removeValue(T value, boolean reload) {
int idx = getIndex(value);
if (idx >= 0) {
removeItemInternal(idx, reload);
}
} | [
"public",
"void",
"removeValue",
"(",
"T",
"value",
",",
"boolean",
"reload",
")",
"{",
"int",
"idx",
"=",
"getIndex",
"(",
"value",
")",
";",
"if",
"(",
"idx",
">=",
"0",
")",
"{",
"removeItemInternal",
"(",
"idx",
",",
"reload",
")",
";",
"}",
"}... | Removes a value from the list box. Nothing is done if the value isn't on
the list box.
@param value the value to be removed from the list
@param reload perform a 'material select' reload to update the DOM. | [
"Removes",
"a",
"value",
"from",
"the",
"list",
"box",
".",
"Nothing",
"is",
"done",
"if",
"the",
"value",
"isn",
"t",
"on",
"the",
"list",
"box",
"."
] | train | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L507-L512 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/spider/SpiderPanelTableModel.java | SpiderPanelTableModel.addScanResult | public void addScanResult(String uri, String method, String flags, boolean skipped) {
"""
Adds a new spider scan result. Method is synchronized internally.
@param uri the uri
@param method the method
@param flags the flags
@param skipped {@code true} if the result was skipped, {@code false} otherwise
"""... | java | public void addScanResult(String uri, String method, String flags, boolean skipped) {
SpiderScanResult result = new SpiderScanResult(uri, method, flags, !skipped);
scanResults.add(result);
fireTableRowsInserted(scanResults.size() - 1, scanResults.size() - 1);
} | [
"public",
"void",
"addScanResult",
"(",
"String",
"uri",
",",
"String",
"method",
",",
"String",
"flags",
",",
"boolean",
"skipped",
")",
"{",
"SpiderScanResult",
"result",
"=",
"new",
"SpiderScanResult",
"(",
"uri",
",",
"method",
",",
"flags",
",",
"!",
... | Adds a new spider scan result. Method is synchronized internally.
@param uri the uri
@param method the method
@param flags the flags
@param skipped {@code true} if the result was skipped, {@code false} otherwise | [
"Adds",
"a",
"new",
"spider",
"scan",
"result",
".",
"Method",
"is",
"synchronized",
"internally",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/spider/SpiderPanelTableModel.java#L121-L125 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_LineIntersector.java | ST_LineIntersector.add | private static void add(Polygon poly, int flag, ArrayList<SegmentString> segments) {
"""
Convert a polygon as a list of segments and mark it with a flag
@param poly
@param flag
@param segments
"""
add(poly.getExteriorRing(), flag, segments);
for (int j = 0; j < poly.getNumInteriorRing(); j++... | java | private static void add(Polygon poly, int flag, ArrayList<SegmentString> segments) {
add(poly.getExteriorRing(), flag, segments);
for (int j = 0; j < poly.getNumInteriorRing(); j++) {
add(poly.getInteriorRingN(j), flag, segments);
}
} | [
"private",
"static",
"void",
"add",
"(",
"Polygon",
"poly",
",",
"int",
"flag",
",",
"ArrayList",
"<",
"SegmentString",
">",
"segments",
")",
"{",
"add",
"(",
"poly",
".",
"getExteriorRing",
"(",
")",
",",
"flag",
",",
"segments",
")",
";",
"for",
"(",... | Convert a polygon as a list of segments and mark it with a flag
@param poly
@param flag
@param segments | [
"Convert",
"a",
"polygon",
"as",
"a",
"list",
"of",
"segments",
"and",
"mark",
"it",
"with",
"a",
"flag"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/split/ST_LineIntersector.java#L131-L136 |
Red5/red5-server-common | src/main/java/org/red5/server/service/ServiceInvoker.java | ServiceInvoker.getServiceHandler | private Object getServiceHandler(IScope scope, String serviceName) {
"""
Lookup a handler for the passed service name in the given scope.
@param scope
Scope
@param serviceName
Service name
@return Service handler
"""
// get application scope handler first
Object service = scope.getHand... | java | private Object getServiceHandler(IScope scope, String serviceName) {
// get application scope handler first
Object service = scope.getHandler();
if (serviceName == null || serviceName.equals("")) {
// no service requested, return application scope handler
log.trace("... | [
"private",
"Object",
"getServiceHandler",
"(",
"IScope",
"scope",
",",
"String",
"serviceName",
")",
"{",
"// get application scope handler first\r",
"Object",
"service",
"=",
"scope",
".",
"getHandler",
"(",
")",
";",
"if",
"(",
"serviceName",
"==",
"null",
"||",... | Lookup a handler for the passed service name in the given scope.
@param scope
Scope
@param serviceName
Service name
@return Service handler | [
"Lookup",
"a",
"handler",
"for",
"the",
"passed",
"service",
"name",
"in",
"the",
"given",
"scope",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/service/ServiceInvoker.java#L79-L96 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Primitives.java | Primitives.box | @SafeVarargs
public static Double[] box(final double... a) {
"""
<p>
Converts an array of primitive doubles to objects.
</p>
<p>
This method returns {@code null} for a {@code null} input array.
</p>
@param a
a {@code double} array
@return a {@code Double} array, {@code null} if null array input
... | java | @SafeVarargs
public static Double[] box(final double... a) {
if (a == null) {
return null;
}
return box(a, 0, a.length);
} | [
"@",
"SafeVarargs",
"public",
"static",
"Double",
"[",
"]",
"box",
"(",
"final",
"double",
"...",
"a",
")",
"{",
"if",
"(",
"a",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"box",
"(",
"a",
",",
"0",
",",
"a",
".",
"length",
"... | <p>
Converts an array of primitive doubles to objects.
</p>
<p>
This method returns {@code null} for a {@code null} input array.
</p>
@param a
a {@code double} array
@return a {@code Double} array, {@code null} if null array input | [
"<p",
">",
"Converts",
"an",
"array",
"of",
"primitive",
"doubles",
"to",
"objects",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Primitives.java#L389-L396 |
stratosphere/stratosphere | stratosphere-clients/src/main/java/eu/stratosphere/client/web/WebInterfaceServer.java | WebInterfaceServer.checkAndCreateDirectories | private final void checkAndCreateDirectories(File f, boolean needWritePermission) throws IOException {
"""
Checks and creates the directory described by the abstract directory path. This function checks
if the directory exists and creates it if necessary. It also checks read permissions and
write permission, if ... | java | private final void checkAndCreateDirectories(File f, boolean needWritePermission) throws IOException {
String dir = f.getAbsolutePath();
// check if it exists and it is not a directory
if (f.exists() && !f.isDirectory()) {
throw new IOException("A none directory file with the same name as the configured direc... | [
"private",
"final",
"void",
"checkAndCreateDirectories",
"(",
"File",
"f",
",",
"boolean",
"needWritePermission",
")",
"throws",
"IOException",
"{",
"String",
"dir",
"=",
"f",
".",
"getAbsolutePath",
"(",
")",
";",
"// check if it exists and it is not a directory",
"i... | Checks and creates the directory described by the abstract directory path. This function checks
if the directory exists and creates it if necessary. It also checks read permissions and
write permission, if necessary.
@param dir
The String describing the directory path.
@param needWritePermission
A flag indicating whet... | [
"Checks",
"and",
"creates",
"the",
"directory",
"described",
"by",
"the",
"abstract",
"directory",
"path",
".",
"This",
"function",
"checks",
"if",
"the",
"directory",
"exists",
"and",
"creates",
"it",
"if",
"necessary",
".",
"It",
"also",
"checks",
"read",
... | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-clients/src/main/java/eu/stratosphere/client/web/WebInterfaceServer.java#L257-L282 |
reactor/reactor-netty | src/main/java/reactor/netty/http/client/HttpClient.java | HttpClient.httpResponseDecoder | public final HttpClient httpResponseDecoder(Function<HttpResponseDecoderSpec, HttpResponseDecoderSpec> responseDecoderOptions) {
"""
Configure the {@link io.netty.handler.codec.http.HttpClientCodec}'s response decoding options.
@param responseDecoderOptions a function to mutate the provided Http response decode... | java | public final HttpClient httpResponseDecoder(Function<HttpResponseDecoderSpec, HttpResponseDecoderSpec> responseDecoderOptions) {
return tcpConfiguration(
responseDecoderOptions.apply(new HttpResponseDecoderSpec())
.build());
} | [
"public",
"final",
"HttpClient",
"httpResponseDecoder",
"(",
"Function",
"<",
"HttpResponseDecoderSpec",
",",
"HttpResponseDecoderSpec",
">",
"responseDecoderOptions",
")",
"{",
"return",
"tcpConfiguration",
"(",
"responseDecoderOptions",
".",
"apply",
"(",
"new",
"HttpRe... | Configure the {@link io.netty.handler.codec.http.HttpClientCodec}'s response decoding options.
@param responseDecoderOptions a function to mutate the provided Http response decoder options
@return a new {@link HttpClient} | [
"Configure",
"the",
"{",
"@link",
"io",
".",
"netty",
".",
"handler",
".",
"codec",
".",
"http",
".",
"HttpClientCodec",
"}",
"s",
"response",
"decoding",
"options",
"."
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/http/client/HttpClient.java#L829-L833 |
ebean-orm/ebean-querybean | src/main/java/io/ebean/typequery/PBaseCompareable.java | PBaseCompareable.inRangeWith | public final R inRangeWith(TQProperty<R> highProperty, T value) {
"""
Value in Range between 2 properties.
<pre>{@code
.startDate.inRangeWith(endDate, now)
// which equates to
startDate <= now and (endDate > now or endDate is null)
}</pre>
<p>
This is a convenience expression combining a number of... | java | public final R inRangeWith(TQProperty<R> highProperty, T value) {
expr().inRangeWith(_name, highProperty._name, value);
return _root;
} | [
"public",
"final",
"R",
"inRangeWith",
"(",
"TQProperty",
"<",
"R",
">",
"highProperty",
",",
"T",
"value",
")",
"{",
"expr",
"(",
")",
".",
"inRangeWith",
"(",
"_name",
",",
"highProperty",
".",
"_name",
",",
"value",
")",
";",
"return",
"_root",
";",... | Value in Range between 2 properties.
<pre>{@code
.startDate.inRangeWith(endDate, now)
// which equates to
startDate <= now and (endDate > now or endDate is null)
}</pre>
<p>
This is a convenience expression combining a number of simple expressions.
The most common use of this could be called "effective dating" whe... | [
"Value",
"in",
"Range",
"between",
"2",
"properties",
"."
] | train | https://github.com/ebean-orm/ebean-querybean/blob/821650cb817c9c0fdcc97f93408dc79170b12423/src/main/java/io/ebean/typequery/PBaseCompareable.java#L111-L114 |
Cleveroad/LoopBar | LoopBar-widget/src/main/java/com/cleveroad/loopbar/widget/LoopBarView.java | LoopBarView.addItemDecoration | @SuppressWarnings("unused")
public final void addItemDecoration(RecyclerView.ItemDecoration decor, int index) {
"""
Add an {@link RecyclerView.ItemDecoration} to wrapped RecyclerView. Item decorations can
affect both measurement and drawing of individual item views.
<p>
<p>Item decorations are ordered. Deco... | java | @SuppressWarnings("unused")
public final void addItemDecoration(RecyclerView.ItemDecoration decor, int index) {
getRvCategories().addItemDecoration(decor, index);
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"public",
"final",
"void",
"addItemDecoration",
"(",
"RecyclerView",
".",
"ItemDecoration",
"decor",
",",
"int",
"index",
")",
"{",
"getRvCategories",
"(",
")",
".",
"addItemDecoration",
"(",
"decor",
",",
"index"... | Add an {@link RecyclerView.ItemDecoration} to wrapped RecyclerView. Item decorations can
affect both measurement and drawing of individual item views.
<p>
<p>Item decorations are ordered. Decorations placed earlier in the list will
be run/queried/drawn first for their effects on item views. Padding added to views
will ... | [
"Add",
"an",
"{",
"@link",
"RecyclerView",
".",
"ItemDecoration",
"}",
"to",
"wrapped",
"RecyclerView",
".",
"Item",
"decorations",
"can",
"affect",
"both",
"measurement",
"and",
"drawing",
"of",
"individual",
"item",
"views",
".",
"<p",
">",
"<p",
">",
"Ite... | train | https://github.com/Cleveroad/LoopBar/blob/6ff5e0b35e637202202f9b4ca141195bdcfd5697/LoopBar-widget/src/main/java/com/cleveroad/loopbar/widget/LoopBarView.java#L565-L568 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java | CommonOps_DDRM.elementLessThan | public static BMatrixRMaj elementLessThan(DMatrixRMaj A , double value , BMatrixRMaj output ) {
"""
Applies the > operator to each element in A. Results are stored in a boolean matrix.
@param A Input matrx
@param value value each element is compared against
@param output (Optional) Storage for results. C... | java | public static BMatrixRMaj elementLessThan(DMatrixRMaj A , double value , BMatrixRMaj output )
{
if( output == null ) {
output = new BMatrixRMaj(A.numRows,A.numCols);
}
output.reshape(A.numRows, A.numCols);
int N = A.getNumElements();
for (int i = 0; i < N; i++)... | [
"public",
"static",
"BMatrixRMaj",
"elementLessThan",
"(",
"DMatrixRMaj",
"A",
",",
"double",
"value",
",",
"BMatrixRMaj",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"{",
"output",
"=",
"new",
"BMatrixRMaj",
"(",
"A",
".",
"numRows",
",",
... | Applies the > operator to each element in A. Results are stored in a boolean matrix.
@param A Input matrx
@param value value each element is compared against
@param output (Optional) Storage for results. Can be null. Is reshaped.
@return Boolean matrix with results | [
"Applies",
"the",
">",
";",
"operator",
"to",
"each",
"element",
"in",
"A",
".",
"Results",
"are",
"stored",
"in",
"a",
"boolean",
"matrix",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L2604-L2619 |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/configuration/GlobalConfiguration.java | GlobalConfiguration.getLongInternal | private long getLongInternal(final String key, final long defaultValue) {
"""
Returns the value associated with the given key as a long integer.
@param key
the key pointing to the associated value
@param defaultValue
the default value which is returned in case there is no value associated with the given key
... | java | private long getLongInternal(final String key, final long defaultValue) {
long retVal = defaultValue;
try {
synchronized (this.confData) {
if (this.confData.containsKey(key)) {
retVal = Long.parseLong(this.confData.get(key));
}
}
} catch (NumberFormatException e) {
if (LOG.isDebugEnabled... | [
"private",
"long",
"getLongInternal",
"(",
"final",
"String",
"key",
",",
"final",
"long",
"defaultValue",
")",
"{",
"long",
"retVal",
"=",
"defaultValue",
";",
"try",
"{",
"synchronized",
"(",
"this",
".",
"confData",
")",
"{",
"if",
"(",
"this",
".",
"... | Returns the value associated with the given key as a long integer.
@param key
the key pointing to the associated value
@param defaultValue
the default value which is returned in case there is no value associated with the given key
@return the (default) value associated with the given key | [
"Returns",
"the",
"value",
"associated",
"with",
"the",
"given",
"key",
"as",
"a",
"long",
"integer",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/configuration/GlobalConfiguration.java#L147-L166 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java | PoolsImpl.enableAutoScaleAsync | public Observable<Void> enableAutoScaleAsync(String poolId, PoolEnableAutoScaleParameter poolEnableAutoScaleParameter) {
"""
Enables automatic scaling for a pool.
You cannot enable automatic scaling on a pool if a resize operation is in progress on the pool. If automatic scaling of the pool is currently disabled,... | java | public Observable<Void> enableAutoScaleAsync(String poolId, PoolEnableAutoScaleParameter poolEnableAutoScaleParameter) {
return enableAutoScaleWithServiceResponseAsync(poolId, poolEnableAutoScaleParameter).map(new Func1<ServiceResponseWithHeaders<Void, PoolEnableAutoScaleHeaders>, Void>() {
@Overrid... | [
"public",
"Observable",
"<",
"Void",
">",
"enableAutoScaleAsync",
"(",
"String",
"poolId",
",",
"PoolEnableAutoScaleParameter",
"poolEnableAutoScaleParameter",
")",
"{",
"return",
"enableAutoScaleWithServiceResponseAsync",
"(",
"poolId",
",",
"poolEnableAutoScaleParameter",
"... | Enables automatic scaling for a pool.
You cannot enable automatic scaling on a pool if a resize operation is in progress on the pool. If automatic scaling of the pool is currently disabled, you must specify a valid autoscale formula as part of the request. If automatic scaling of the pool is already enabled, you may sp... | [
"Enables",
"automatic",
"scaling",
"for",
"a",
"pool",
".",
"You",
"cannot",
"enable",
"automatic",
"scaling",
"on",
"a",
"pool",
"if",
"a",
"resize",
"operation",
"is",
"in",
"progress",
"on",
"the",
"pool",
".",
"If",
"automatic",
"scaling",
"of",
"the",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java#L2290-L2297 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/wishlists/WishlistItemUrl.java | WishlistItemUrl.getWishlistItemsByWishlistNameUrl | public static MozuUrl getWishlistItemsByWishlistNameUrl(Integer customerAccountId, String filter, Integer pageSize, String responseFields, String sortBy, Integer startIndex, String wishlistName) {
"""
Get Resource Url for GetWishlistItemsByWishlistName
@param customerAccountId The unique identifier of the custome... | java | public static MozuUrl getWishlistItemsByWishlistNameUrl(Integer customerAccountId, String filter, Integer pageSize, String responseFields, String sortBy, Integer startIndex, String wishlistName)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/wishlists/customers/{customerAccountId}/{wishlistName}/items?... | [
"public",
"static",
"MozuUrl",
"getWishlistItemsByWishlistNameUrl",
"(",
"Integer",
"customerAccountId",
",",
"String",
"filter",
",",
"Integer",
"pageSize",
",",
"String",
"responseFields",
",",
"String",
"sortBy",
",",
"Integer",
"startIndex",
",",
"String",
"wishli... | Get Resource Url for GetWishlistItemsByWishlistName
@param customerAccountId The unique identifier of the customer account for which to retrieve wish lists.
@param filter A set of filter expressions representing the search parameters for a query. This parameter is optional. Refer to [Sorting and Filtering](../../../../... | [
"Get",
"Resource",
"Url",
"for",
"GetWishlistItemsByWishlistName"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/wishlists/WishlistItemUrl.java#L65-L76 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/MutableArray.java | MutableArray.setArray | @NonNull
@Override
public MutableArray setArray(int index, Array value) {
"""
Sets a Array object at the given index.
@param index the index. This value must not exceed the bounds of the array.
@param value the Array object
@return The self object
"""
return setValue(index, value);
} | java | @NonNull
@Override
public MutableArray setArray(int index, Array value) {
return setValue(index, value);
} | [
"@",
"NonNull",
"@",
"Override",
"public",
"MutableArray",
"setArray",
"(",
"int",
"index",
",",
"Array",
"value",
")",
"{",
"return",
"setValue",
"(",
"index",
",",
"value",
")",
";",
"}"
] | Sets a Array object at the given index.
@param index the index. This value must not exceed the bounds of the array.
@param value the Array object
@return The self object | [
"Sets",
"a",
"Array",
"object",
"at",
"the",
"given",
"index",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L234-L238 |
defei/codelogger-utils | src/main/java/org/codelogger/utils/StringUtils.java | StringUtils.startsWithIgnoreCase | public static boolean startsWithIgnoreCase(final String source, final String target) {
"""
Returns true if given source string start with target string ignore case
sensitive; false otherwise.
@param source string to be tested.
@param target string to be tested.
@return true if given source string start with ... | java | public static boolean startsWithIgnoreCase(final String source, final String target) {
if (source.startsWith(target)) {
return true;
}
if (source.length() < target.length()) {
return false;
}
return source.substring(0, target.length()).equalsIgnoreCase(target);
} | [
"public",
"static",
"boolean",
"startsWithIgnoreCase",
"(",
"final",
"String",
"source",
",",
"final",
"String",
"target",
")",
"{",
"if",
"(",
"source",
".",
"startsWith",
"(",
"target",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"source",
".... | Returns true if given source string start with target string ignore case
sensitive; false otherwise.
@param source string to be tested.
@param target string to be tested.
@return true if given source string start with target string ignore case
sensitive; false otherwise. | [
"Returns",
"true",
"if",
"given",
"source",
"string",
"start",
"with",
"target",
"string",
"ignore",
"case",
"sensitive",
";",
"false",
"otherwise",
"."
] | train | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/StringUtils.java#L311-L320 |
mockito/mockito | src/main/java/org/mockito/internal/invocation/MatcherApplicationStrategy.java | MatcherApplicationStrategy.getMatcherApplicationStrategyFor | public static MatcherApplicationStrategy getMatcherApplicationStrategyFor(Invocation invocation, List<ArgumentMatcher<?>> matchers) {
"""
Returns the {@link MatcherApplicationStrategy} that must be used to capture the
arguments of the given <b>invocation</b> using the given <b>matchers</b>.
@param invocation
... | java | public static MatcherApplicationStrategy getMatcherApplicationStrategyFor(Invocation invocation, List<ArgumentMatcher<?>> matchers) {
MatcherApplicationType type = getMatcherApplicationType(invocation, matchers);
return new MatcherApplicationStrategy(invocation, matchers, type);
} | [
"public",
"static",
"MatcherApplicationStrategy",
"getMatcherApplicationStrategyFor",
"(",
"Invocation",
"invocation",
",",
"List",
"<",
"ArgumentMatcher",
"<",
"?",
">",
">",
"matchers",
")",
"{",
"MatcherApplicationType",
"type",
"=",
"getMatcherApplicationType",
"(",
... | Returns the {@link MatcherApplicationStrategy} that must be used to capture the
arguments of the given <b>invocation</b> using the given <b>matchers</b>.
@param invocation
that contain the arguments to capture
@param matchers
that will be used to capture the arguments of the invocation,
the passed {@link List} is not ... | [
"Returns",
"the",
"{",
"@link",
"MatcherApplicationStrategy",
"}",
"that",
"must",
"be",
"used",
"to",
"capture",
"the",
"arguments",
"of",
"the",
"given",
"<b",
">",
"invocation<",
"/",
"b",
">",
"using",
"the",
"given",
"<b",
">",
"matchers<",
"/",
"b",
... | train | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/invocation/MatcherApplicationStrategy.java#L52-L56 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/WidgetUtil.java | WidgetUtil.embedFlashObject | public static HTML embedFlashObject (Panel container, String htmlString) {
"""
Given an HTML string that defines a Flash object, creates a new DOM node for it and adds it
to the appropriate container. Please note: the container should be added to the page prior
to calling this function.
"""
// Please... | java | public static HTML embedFlashObject (Panel container, String htmlString)
{
// Please note: the following is a work-around for an IE7 bug. If we create a Flash object
// node *before* attaching it to the DOM tree, IE will silently fail to register
// the Flash object's callback functions for ... | [
"public",
"static",
"HTML",
"embedFlashObject",
"(",
"Panel",
"container",
",",
"String",
"htmlString",
")",
"{",
"// Please note: the following is a work-around for an IE7 bug. If we create a Flash object",
"// node *before* attaching it to the DOM tree, IE will silently fail to register"... | Given an HTML string that defines a Flash object, creates a new DOM node for it and adds it
to the appropriate container. Please note: the container should be added to the page prior
to calling this function. | [
"Given",
"an",
"HTML",
"string",
"that",
"defines",
"a",
"Flash",
"object",
"creates",
"a",
"new",
"DOM",
"node",
"for",
"it",
"and",
"adds",
"it",
"to",
"the",
"appropriate",
"container",
".",
"Please",
"note",
":",
"the",
"container",
"should",
"be",
"... | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/WidgetUtil.java#L203-L214 |
meertensinstituut/mtas | src/main/java/mtas/codec/MtasCodecPostingsFormat.java | MtasCodecPostingsFormat.getTerm | public static String getTerm(IndexInput inTerm, Long ref) throws IOException {
"""
Gets the term.
@param inTerm the in term
@param ref the ref
@return the term
@throws IOException Signals that an I/O exception has occurred.
"""
try {
inTerm.seek(ref);
return inTerm.readString();
} cat... | java | public static String getTerm(IndexInput inTerm, Long ref) throws IOException {
try {
inTerm.seek(ref);
return inTerm.readString();
} catch (Exception e) {
throw new IOException(e);
}
} | [
"public",
"static",
"String",
"getTerm",
"(",
"IndexInput",
"inTerm",
",",
"Long",
"ref",
")",
"throws",
"IOException",
"{",
"try",
"{",
"inTerm",
".",
"seek",
"(",
"ref",
")",
";",
"return",
"inTerm",
".",
"readString",
"(",
")",
";",
"}",
"catch",
"(... | Gets the term.
@param inTerm the in term
@param ref the ref
@return the term
@throws IOException Signals that an I/O exception has occurred. | [
"Gets",
"the",
"term",
"."
] | train | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/codec/MtasCodecPostingsFormat.java#L292-L299 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.updateApiKey | public JSONObject updateApiKey(String key, List<String> acls) throws AlgoliaException {
"""
Update an api key
@param acls the list of ACL for this key. Defined by an array of strings that
can contains the following values:
- search: allow to search (https and http)
- addObject: allows to add/update an object... | java | public JSONObject updateApiKey(String key, List<String> acls) throws AlgoliaException {
return updateApiKey(key, acls, 0, 0, 0);
} | [
"public",
"JSONObject",
"updateApiKey",
"(",
"String",
"key",
",",
"List",
"<",
"String",
">",
"acls",
")",
"throws",
"AlgoliaException",
"{",
"return",
"updateApiKey",
"(",
"key",
",",
"acls",
",",
"0",
",",
"0",
",",
"0",
")",
";",
"}"
] | Update an api key
@param acls the list of ACL for this key. Defined by an array of strings that
can contains the following values:
- search: allow to search (https and http)
- addObject: allows to add/update an object in the index (https only)
- deleteObject : allows to delete an existing object (https only)
- deleteI... | [
"Update",
"an",
"api",
"key"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L1159-L1161 |
alkacon/opencms-core | src/org/opencms/flex/CmsFlexResponse.java | CmsFlexResponse.addToIncludeList | public void addToIncludeList(String target, Map<String, String[]> parameterMap, Map<String, Object> attributeMap) {
"""
Adds an inclusion target to the list of include results.<p>
Should be used only in inclusion-scenarios
like the JSP cms:include tag processing.<p>
@param target the include target name to ... | java | public void addToIncludeList(String target, Map<String, String[]> parameterMap, Map<String, Object> attributeMap) {
if (m_includeList == null) {
m_includeList = new ArrayList<String>(10);
m_includeListParameters = new ArrayList<Map<String, String[]>>(10);
m_includeListAttrib... | [
"public",
"void",
"addToIncludeList",
"(",
"String",
"target",
",",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"parameterMap",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"attributeMap",
")",
"{",
"if",
"(",
"m_includeList",
"==",
"null",
")"... | Adds an inclusion target to the list of include results.<p>
Should be used only in inclusion-scenarios
like the JSP cms:include tag processing.<p>
@param target the include target name to add
@param parameterMap the map of parameters given with the include command
@param attributeMap the map of attributes given with ... | [
"Adds",
"an",
"inclusion",
"target",
"to",
"the",
"list",
"of",
"include",
"results",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/flex/CmsFlexResponse.java#L498-L517 |
Nordstrom/JUnit-Foundation | src/main/java/com/nordstrom/automation/junit/RetryHandler.java | RetryHandler.getMaxRetry | static int getMaxRetry(Object runner, final FrameworkMethod method) {
"""
Get the configured maximum retry count for failed tests ({@link JUnitSetting#MAX_RETRY MAX_RETRY}).
<p>
<b>NOTE</b>: If the specified method or the class that declares it are marked with the {@code @NoRetry}
annotation, this method return... | java | static int getMaxRetry(Object runner, final FrameworkMethod method) {
int maxRetry = 0;
// determine if retry is disabled for this method
NoRetry noRetryOnMethod = method.getAnnotation(NoRetry.class);
// determine if retry is disabled for the class that declares this method... | [
"static",
"int",
"getMaxRetry",
"(",
"Object",
"runner",
",",
"final",
"FrameworkMethod",
"method",
")",
"{",
"int",
"maxRetry",
"=",
"0",
";",
"// determine if retry is disabled for this method\r",
"NoRetry",
"noRetryOnMethod",
"=",
"method",
".",
"getAnnotation",
"(... | Get the configured maximum retry count for failed tests ({@link JUnitSetting#MAX_RETRY MAX_RETRY}).
<p>
<b>NOTE</b>: If the specified method or the class that declares it are marked with the {@code @NoRetry}
annotation, this method returns zero (0).
@param runner JUnit test runner
@param method test method for which r... | [
"Get",
"the",
"configured",
"maximum",
"retry",
"count",
"for",
"failed",
"tests",
"(",
"{",
"@link",
"JUnitSetting#MAX_RETRY",
"MAX_RETRY",
"}",
")",
".",
"<p",
">",
"<b",
">",
"NOTE<",
"/",
"b",
">",
":",
"If",
"the",
"specified",
"method",
"or",
"the"... | train | https://github.com/Nordstrom/JUnit-Foundation/blob/f24d91f8677d262c27d18ef29ed633eaac717be5/src/main/java/com/nordstrom/automation/junit/RetryHandler.java#L105-L120 |
alexvasilkov/GestureViews | library/src/main/java/com/alexvasilkov/gestures/animation/ViewPositionAnimator.java | ViewPositionAnimator.setToState | public void setToState(State state, @FloatRange(from = 0f, to = 1f) float position) {
"""
Specifies target ('to') state and it's position which will be used to interpolate
current state for intermediate positions (i.e. during animation or exit gesture).<br>
This allows you to set up correct state without changin... | java | public void setToState(State state, @FloatRange(from = 0f, to = 1f) float position) {
if (position <= 0) {
throw new IllegalArgumentException("'To' position cannot be <= 0");
}
if (position > 1f) {
throw new IllegalArgumentException("'To' position cannot be > 1");
... | [
"public",
"void",
"setToState",
"(",
"State",
"state",
",",
"@",
"FloatRange",
"(",
"from",
"=",
"0f",
",",
"to",
"=",
"1f",
")",
"float",
"position",
")",
"{",
"if",
"(",
"position",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"("... | Specifies target ('to') state and it's position which will be used to interpolate
current state for intermediate positions (i.e. during animation or exit gesture).<br>
This allows you to set up correct state without changing current position
({@link #getPosition()}).
<p>
Only use this method if you understand what you ... | [
"Specifies",
"target",
"(",
"to",
")",
"state",
"and",
"it",
"s",
"position",
"which",
"will",
"be",
"used",
"to",
"interpolate",
"current",
"state",
"for",
"intermediate",
"positions",
"(",
"i",
".",
"e",
".",
"during",
"animation",
"or",
"exit",
"gesture... | train | https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/animation/ViewPositionAnimator.java#L454-L470 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FileSystem.java | FileSystem.copyFromLocalFile | @Deprecated
public void copyFromLocalFile(Path src, Path dst)
throws IOException {
"""
The src file is on the local disk. Add it to FS at
the given dst name and the source is kept intact afterwards
"""
copyFromLocalFile(false, true, false, src, dst);
} | java | @Deprecated
public void copyFromLocalFile(Path src, Path dst)
throws IOException {
copyFromLocalFile(false, true, false, src, dst);
} | [
"@",
"Deprecated",
"public",
"void",
"copyFromLocalFile",
"(",
"Path",
"src",
",",
"Path",
"dst",
")",
"throws",
"IOException",
"{",
"copyFromLocalFile",
"(",
"false",
",",
"true",
",",
"false",
",",
"src",
",",
"dst",
")",
";",
"}"
] | The src file is on the local disk. Add it to FS at
the given dst name and the source is kept intact afterwards | [
"The",
"src",
"file",
"is",
"on",
"the",
"local",
"disk",
".",
"Add",
"it",
"to",
"FS",
"at",
"the",
"given",
"dst",
"name",
"and",
"the",
"source",
"is",
"kept",
"intact",
"afterwards"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileSystem.java#L1622-L1626 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java | LocationHelper.circularLocation | public static Location circularLocation(int start, int end, Strand strand, int length) {
"""
Converts a location which defines the outer bounds of a circular
location and splits it into the required portions. Unlike any
other location builder this allows you to express your input
location on the reverse strand
... | java | public static Location circularLocation(int start, int end, Strand strand, int length) {
int min = Math.min(start, end);
int max = Math.max(start, end);
//Tells us we're dealing with something that's not _right_
boolean isReverse = (min != start);
if (min > length) {
throw new IllegalArgumentException("C... | [
"public",
"static",
"Location",
"circularLocation",
"(",
"int",
"start",
",",
"int",
"end",
",",
"Strand",
"strand",
",",
"int",
"length",
")",
"{",
"int",
"min",
"=",
"Math",
".",
"min",
"(",
"start",
",",
"end",
")",
";",
"int",
"max",
"=",
"Math",... | Converts a location which defines the outer bounds of a circular
location and splits it into the required portions. Unlike any
other location builder this allows you to express your input
location on the reverse strand
@param location The location which currently expresses the outer
bounds of a circular location.
@par... | [
"Converts",
"a",
"location",
"which",
"defines",
"the",
"outer",
"bounds",
"of",
"a",
"circular",
"location",
"and",
"splits",
"it",
"into",
"the",
"required",
"portions",
".",
"Unlike",
"any",
"other",
"location",
"builder",
"this",
"allows",
"you",
"to",
"... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java#L123-L164 |
looly/hutool | hutool-json/src/main/java/cn/hutool/json/JSONObject.java | JSONObject.putOpt | public JSONObject putOpt(String key, Object value) throws JSONException {
"""
在键和值都为非空的情况下put到JSONObject中
@param key 键
@param value 值对象,可以是以下类型: Boolean, Double, Integer, JSONArray, JSONObject, Long, String, or the JSONNull.NULL.
@return this.
@throws JSONException 值是无穷数字
"""
if (key != null && value ... | java | public JSONObject putOpt(String key, Object value) throws JSONException {
if (key != null && value != null) {
this.put(key, value);
}
return this;
} | [
"public",
"JSONObject",
"putOpt",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"key",
"!=",
"null",
"&&",
"value",
"!=",
"null",
")",
"{",
"this",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}",
... | 在键和值都为非空的情况下put到JSONObject中
@param key 键
@param value 值对象,可以是以下类型: Boolean, Double, Integer, JSONArray, JSONObject, Long, String, or the JSONNull.NULL.
@return this.
@throws JSONException 值是无穷数字 | [
"在键和值都为非空的情况下put到JSONObject中"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-json/src/main/java/cn/hutool/json/JSONObject.java#L422-L427 |
apache/incubator-gobblin | gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinClusterUtils.java | GobblinClusterUtils.getAppWorkDirPath | public static Path getAppWorkDirPath(FileSystem fs, String applicationName, String applicationId) {
"""
Get the application working directory {@link Path}.
@param fs a {@link FileSystem} instance on which {@link FileSystem#getHomeDirectory()} is called
to get the home directory of the {@link FileSystem} of the... | java | public static Path getAppWorkDirPath(FileSystem fs, String applicationName, String applicationId) {
return new Path(fs.getHomeDirectory(), getAppWorkDirPath(applicationName, applicationId));
} | [
"public",
"static",
"Path",
"getAppWorkDirPath",
"(",
"FileSystem",
"fs",
",",
"String",
"applicationName",
",",
"String",
"applicationId",
")",
"{",
"return",
"new",
"Path",
"(",
"fs",
".",
"getHomeDirectory",
"(",
")",
",",
"getAppWorkDirPath",
"(",
"applicati... | Get the application working directory {@link Path}.
@param fs a {@link FileSystem} instance on which {@link FileSystem#getHomeDirectory()} is called
to get the home directory of the {@link FileSystem} of the application working directory
@param applicationName the application name
@param applicationId the application ... | [
"Get",
"the",
"application",
"working",
"directory",
"{",
"@link",
"Path",
"}",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinClusterUtils.java#L60-L62 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/subdoc/LookupInBuilder.java | LookupInBuilder.getCount | public LookupInBuilder getCount(Iterable<String> paths, SubdocOptionsBuilder optionsBuilder) {
"""
Get a count of values inside the JSON document.
This method is only available with Couchbase Server 5.0 and later.
@param paths the paths inside the document where to get the count from.
@param optionsBuilder ... | java | public LookupInBuilder getCount(Iterable<String> paths, SubdocOptionsBuilder optionsBuilder) {
this.async.getCount(paths, optionsBuilder);
return this;
} | [
"public",
"LookupInBuilder",
"getCount",
"(",
"Iterable",
"<",
"String",
">",
"paths",
",",
"SubdocOptionsBuilder",
"optionsBuilder",
")",
"{",
"this",
".",
"async",
".",
"getCount",
"(",
"paths",
",",
"optionsBuilder",
")",
";",
"return",
"this",
";",
"}"
] | Get a count of values inside the JSON document.
This method is only available with Couchbase Server 5.0 and later.
@param paths the paths inside the document where to get the count from.
@param optionsBuilder {@link SubdocOptionsBuilder}
@return this builder for chaining. | [
"Get",
"a",
"count",
"of",
"values",
"inside",
"the",
"JSON",
"document",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/subdoc/LookupInBuilder.java#L292-L295 |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/runner/single/InstanceSolverRunner.java | InstanceSolverRunner.checkNodesExistence | private static void checkNodesExistence(Model mo, Collection<Node> ns) throws SchedulerModelingException {
"""
Check for the existence of nodes in a model
@param mo the model to check
@param ns the nodes to check
@throws SchedulerModelingException if at least one of the given nodes is not in the RP.
"""
... | java | private static void checkNodesExistence(Model mo, Collection<Node> ns) throws SchedulerModelingException {
for (Node node : ns) {
if (!mo.getMapping().contains(node)) {
throw new SchedulerModelingException(mo, "Unknown node '" + node + "'");
}
}
} | [
"private",
"static",
"void",
"checkNodesExistence",
"(",
"Model",
"mo",
",",
"Collection",
"<",
"Node",
">",
"ns",
")",
"throws",
"SchedulerModelingException",
"{",
"for",
"(",
"Node",
"node",
":",
"ns",
")",
"{",
"if",
"(",
"!",
"mo",
".",
"getMapping",
... | Check for the existence of nodes in a model
@param mo the model to check
@param ns the nodes to check
@throws SchedulerModelingException if at least one of the given nodes is not in the RP. | [
"Check",
"for",
"the",
"existence",
"of",
"nodes",
"in",
"a",
"model"
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/runner/single/InstanceSolverRunner.java#L301-L307 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/format/DecimalStyle.java | DecimalStyle.withPositiveSign | public DecimalStyle withPositiveSign(char positiveSign) {
"""
Returns a copy of the info with a new character that represents the positive sign.
<p>
The character used to represent a positive number may vary by culture.
This method specifies the character to use.
@param positiveSign the character for the po... | java | public DecimalStyle withPositiveSign(char positiveSign) {
if (positiveSign == this.positiveSign) {
return this;
}
return new DecimalStyle(zeroDigit, positiveSign, negativeSign, decimalSeparator);
} | [
"public",
"DecimalStyle",
"withPositiveSign",
"(",
"char",
"positiveSign",
")",
"{",
"if",
"(",
"positiveSign",
"==",
"this",
".",
"positiveSign",
")",
"{",
"return",
"this",
";",
"}",
"return",
"new",
"DecimalStyle",
"(",
"zeroDigit",
",",
"positiveSign",
","... | Returns a copy of the info with a new character that represents the positive sign.
<p>
The character used to represent a positive number may vary by culture.
This method specifies the character to use.
@param positiveSign the character for the positive sign
@return a copy with a new character that represents the pos... | [
"Returns",
"a",
"copy",
"of",
"the",
"info",
"with",
"a",
"new",
"character",
"that",
"represents",
"the",
"positive",
"sign",
".",
"<p",
">",
"The",
"character",
"used",
"to",
"represent",
"a",
"positive",
"number",
"may",
"vary",
"by",
"culture",
".",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/format/DecimalStyle.java#L245-L250 |
Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java | CompletableFuture.get | public T get(long timeout, TimeUnit unit)
throws InterruptedException, ExecutionException, TimeoutException {
"""
Waits if necessary for at most the given time for this future to complete, and then returns its
result, if available.
@param timeout the maximum time to wait
@param unit the time unit of the... | java | public T get(long timeout, TimeUnit unit)
throws InterruptedException, ExecutionException, TimeoutException {
long nanos = unit.toNanos(timeout);
Object r;
if ((r = result) == null)
r = timedGet(nanos);
return (T) reportGet(r);
} | [
"public",
"T",
"get",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
",",
"ExecutionException",
",",
"TimeoutException",
"{",
"long",
"nanos",
"=",
"unit",
".",
"toNanos",
"(",
"timeout",
")",
";",
"Object",
"r",
";",... | Waits if necessary for at most the given time for this future to complete, and then returns its
result, if available.
@param timeout the maximum time to wait
@param unit the time unit of the timeout argument
@return the result value
@throws CancellationException if this future was cancelled
@throws ExecutionException ... | [
"Waits",
"if",
"necessary",
"for",
"at",
"most",
"the",
"given",
"time",
"for",
"this",
"future",
"to",
"complete",
"and",
"then",
"returns",
"its",
"result",
"if",
"available",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CompletableFuture.java#L1367-L1374 |
apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/source/extractor/filebased/FileBasedSource.java | FileBasedSource.addLineageSourceInfo | protected void addLineageSourceInfo(WorkUnit workUnit, State state) {
"""
Add lineage source info to a single work unit
@param workUnit a single work unit, not an instance of {@link org.apache.gobblin.source.workunit.MultiWorkUnit}
@param state configurations
"""
if (!lineageInfo.isPresent()) {
l... | java | protected void addLineageSourceInfo(WorkUnit workUnit, State state) {
if (!lineageInfo.isPresent()) {
log.info("Lineage is not enabled");
return;
}
String platform = state.getProp(ConfigurationKeys.SOURCE_FILEBASED_PLATFORM, DatasetConstants.PLATFORM_HDFS);
Path dataDir = new Path(state.get... | [
"protected",
"void",
"addLineageSourceInfo",
"(",
"WorkUnit",
"workUnit",
",",
"State",
"state",
")",
"{",
"if",
"(",
"!",
"lineageInfo",
".",
"isPresent",
"(",
")",
")",
"{",
"log",
".",
"info",
"(",
"\"Lineage is not enabled\"",
")",
";",
"return",
";",
... | Add lineage source info to a single work unit
@param workUnit a single work unit, not an instance of {@link org.apache.gobblin.source.workunit.MultiWorkUnit}
@param state configurations | [
"Add",
"lineage",
"source",
"info",
"to",
"a",
"single",
"work",
"unit"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/filebased/FileBasedSource.java#L236-L247 |
wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/ResourceCopy.java | ResourceCopy.copyExternalAssets | public static void copyExternalAssets(AbstractWisdomMojo mojo, MavenResourcesFiltering filtering) throws IOException {
"""
Copies the external assets from "src/main/assets" to "wisdom/assets". Copied resources are filtered.
@param mojo the mojo
@param filtering the component required to filter resources
... | java | public static void copyExternalAssets(AbstractWisdomMojo mojo, MavenResourcesFiltering filtering) throws IOException {
File in = new File(mojo.basedir, Constants.ASSETS_SRC_DIR);
if (!in.exists()) {
return;
}
File out = new File(mojo.getWisdomRootDirectory(), Constants.ASSETS... | [
"public",
"static",
"void",
"copyExternalAssets",
"(",
"AbstractWisdomMojo",
"mojo",
",",
"MavenResourcesFiltering",
"filtering",
")",
"throws",
"IOException",
"{",
"File",
"in",
"=",
"new",
"File",
"(",
"mojo",
".",
"basedir",
",",
"Constants",
".",
"ASSETS_SRC_D... | Copies the external assets from "src/main/assets" to "wisdom/assets". Copied resources are filtered.
@param mojo the mojo
@param filtering the component required to filter resources
@throws IOException if a file cannot be copied | [
"Copies",
"the",
"external",
"assets",
"from",
"src",
"/",
"main",
"/",
"assets",
"to",
"wisdom",
"/",
"assets",
".",
"Copied",
"resources",
"are",
"filtered",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/ResourceCopy.java#L214-L221 |
HeidelTime/heideltime | src/de/unihd/dbs/uima/annotator/treetagger/TreeTaggerWrapper.java | TreeTaggerWrapper.doTreeTag | private void doTreeTag(JCas jcas) {
"""
based on tokens from the jcas object, adds part of speech (POS) and sentence
tags to the jcas object using the treetagger program.
@param jcas JCas object supplied by the pipeline
"""
try {
if(ttProc == null) {
ttProc = new TreeTaggerProcess(ttprops.getTreeTag... | java | private void doTreeTag(JCas jcas) {
try {
if(ttProc == null) {
ttProc = new TreeTaggerProcess(ttprops.getTreeTaggingProcess());
}
Logger.printDetail(component, "TreeTagger (pos tagging) with: " + ttprops.parFileName);
AnnotationIndex ai = jcas.getAnnotationIndex(Token.type);
List<String> to... | [
"private",
"void",
"doTreeTag",
"(",
"JCas",
"jcas",
")",
"{",
"try",
"{",
"if",
"(",
"ttProc",
"==",
"null",
")",
"{",
"ttProc",
"=",
"new",
"TreeTaggerProcess",
"(",
"ttprops",
".",
"getTreeTaggingProcess",
"(",
")",
")",
";",
"}",
"Logger",
".",
"pr... | based on tokens from the jcas object, adds part of speech (POS) and sentence
tags to the jcas object using the treetagger program.
@param jcas JCas object supplied by the pipeline | [
"based",
"on",
"tokens",
"from",
"the",
"jcas",
"object",
"adds",
"part",
"of",
"speech",
"(",
"POS",
")",
"and",
"sentence",
"tags",
"to",
"the",
"jcas",
"object",
"using",
"the",
"treetagger",
"program",
"."
] | train | https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/treetagger/TreeTaggerWrapper.java#L369-L400 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Primitives.java | Primitives.box | @SafeVarargs
public static Float[] box(final float... a) {
"""
<p>
Converts an array of primitive floats to objects.
</p>
<p>
This method returns {@code null} for a {@code null} input array.
</p>
@param a
a {@code float} array
@return a {@code Float} array, {@code null} if null array input
"""... | java | @SafeVarargs
public static Float[] box(final float... a) {
if (a == null) {
return null;
}
return box(a, 0, a.length);
} | [
"@",
"SafeVarargs",
"public",
"static",
"Float",
"[",
"]",
"box",
"(",
"final",
"float",
"...",
"a",
")",
"{",
"if",
"(",
"a",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"box",
"(",
"a",
",",
"0",
",",
"a",
".",
"length",
")"... | <p>
Converts an array of primitive floats to objects.
</p>
<p>
This method returns {@code null} for a {@code null} input array.
</p>
@param a
a {@code float} array
@return a {@code Float} array, {@code null} if null array input | [
"<p",
">",
"Converts",
"an",
"array",
"of",
"primitive",
"floats",
"to",
"objects",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Primitives.java#L351-L358 |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.getScreenCoords | public Point getScreenCoords (int x, int y) {
"""
Converts the supplied full coordinates to screen coordinates.
"""
return MisoUtil.fullToScreen(_metrics, x, y, new Point());
} | java | public Point getScreenCoords (int x, int y)
{
return MisoUtil.fullToScreen(_metrics, x, y, new Point());
} | [
"public",
"Point",
"getScreenCoords",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"return",
"MisoUtil",
".",
"fullToScreen",
"(",
"_metrics",
",",
"x",
",",
"y",
",",
"new",
"Point",
"(",
")",
")",
";",
"}"
] | Converts the supplied full coordinates to screen coordinates. | [
"Converts",
"the",
"supplied",
"full",
"coordinates",
"to",
"screen",
"coordinates",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L319-L322 |
twilliamson/mogwee-logging | src/main/java/com/mogwee/logging/Logger.java | Logger.errorDebug | public final void errorDebug(final Throwable cause, final String message) {
"""
Logs a message and stack trace if DEBUG logging is enabled
or a formatted message and exception description if ERROR logging is enabled.
@param cause an exception to print stack trace of if DEBUG logging is enabled
@param messag... | java | public final void errorDebug(final Throwable cause, final String message)
{
logDebug(Level.ERROR, cause, message);
} | [
"public",
"final",
"void",
"errorDebug",
"(",
"final",
"Throwable",
"cause",
",",
"final",
"String",
"message",
")",
"{",
"logDebug",
"(",
"Level",
".",
"ERROR",
",",
"cause",
",",
"message",
")",
";",
"}"
] | Logs a message and stack trace if DEBUG logging is enabled
or a formatted message and exception description if ERROR logging is enabled.
@param cause an exception to print stack trace of if DEBUG logging is enabled
@param message a message | [
"Logs",
"a",
"message",
"and",
"stack",
"trace",
"if",
"DEBUG",
"logging",
"is",
"enabled",
"or",
"a",
"formatted",
"message",
"and",
"exception",
"description",
"if",
"ERROR",
"logging",
"is",
"enabled",
"."
] | train | https://github.com/twilliamson/mogwee-logging/blob/30b99c2649de455432d956a8f6a74316de4cd62c/src/main/java/com/mogwee/logging/Logger.java#L417-L420 |
playn/playn | android/src/playn/android/AndroidAudio.java | AndroidAudio.createSound | public SoundImpl<?> createSound(AssetFileDescriptor fd) {
"""
Creates a sound instance from the supplied asset file descriptor.
"""
PooledSound sound = new PooledSound(pool.load(fd, 1));
loadingSounds.put(sound.soundId, sound);
return sound;
} | java | public SoundImpl<?> createSound(AssetFileDescriptor fd) {
PooledSound sound = new PooledSound(pool.load(fd, 1));
loadingSounds.put(sound.soundId, sound);
return sound;
} | [
"public",
"SoundImpl",
"<",
"?",
">",
"createSound",
"(",
"AssetFileDescriptor",
"fd",
")",
"{",
"PooledSound",
"sound",
"=",
"new",
"PooledSound",
"(",
"pool",
".",
"load",
"(",
"fd",
",",
"1",
")",
")",
";",
"loadingSounds",
".",
"put",
"(",
"sound",
... | Creates a sound instance from the supplied asset file descriptor. | [
"Creates",
"a",
"sound",
"instance",
"from",
"the",
"supplied",
"asset",
"file",
"descriptor",
"."
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/android/src/playn/android/AndroidAudio.java#L125-L129 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/NNStorage.java | NNStorage.findFile | private File findFile(NameNodeDirType dirType, String name) {
"""
Return the first readable storage file of the given name
across any of the 'current' directories in SDs of the
given type, or null if no such file exists.
"""
for (StorageDirectory sd : dirIterable(dirType)) {
File candidate = new Fi... | java | private File findFile(NameNodeDirType dirType, String name) {
for (StorageDirectory sd : dirIterable(dirType)) {
File candidate = new File(sd.getCurrentDir(), name);
if (sd.getCurrentDir().canRead() &&
candidate.exists()) {
return candidate;
}
}
return null;
} | [
"private",
"File",
"findFile",
"(",
"NameNodeDirType",
"dirType",
",",
"String",
"name",
")",
"{",
"for",
"(",
"StorageDirectory",
"sd",
":",
"dirIterable",
"(",
"dirType",
")",
")",
"{",
"File",
"candidate",
"=",
"new",
"File",
"(",
"sd",
".",
"getCurrent... | Return the first readable storage file of the given name
across any of the 'current' directories in SDs of the
given type, or null if no such file exists. | [
"Return",
"the",
"first",
"readable",
"storage",
"file",
"of",
"the",
"given",
"name",
"across",
"any",
"of",
"the",
"current",
"directories",
"in",
"SDs",
"of",
"the",
"given",
"type",
"or",
"null",
"if",
"no",
"such",
"file",
"exists",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NNStorage.java#L801-L810 |
EdwardRaff/JSAT | JSAT/src/jsat/distributions/kernels/KernelPoints.java | KernelPoints.addNewKernelPoint | public void addNewKernelPoint() {
"""
Adds a new Kernel Point to the internal list this object represents. The
new Kernel Point will be equivalent to creating a new KernelPoint
directly.
"""
KernelPoint source = points.get(0);
KernelPoint toAdd = new KernelPoint(k, errorTolerance);
to... | java | public void addNewKernelPoint()
{
KernelPoint source = points.get(0);
KernelPoint toAdd = new KernelPoint(k, errorTolerance);
toAdd.setMaxBudget(maxBudget);
toAdd.setBudgetStrategy(budgetStrategy);
standardMove(toAdd, source);
toAdd.kernelAccel = source.kerne... | [
"public",
"void",
"addNewKernelPoint",
"(",
")",
"{",
"KernelPoint",
"source",
"=",
"points",
".",
"get",
"(",
"0",
")",
";",
"KernelPoint",
"toAdd",
"=",
"new",
"KernelPoint",
"(",
"k",
",",
"errorTolerance",
")",
";",
"toAdd",
".",
"setMaxBudget",
"(",
... | Adds a new Kernel Point to the internal list this object represents. The
new Kernel Point will be equivalent to creating a new KernelPoint
directly. | [
"Adds",
"a",
"new",
"Kernel",
"Point",
"to",
"the",
"internal",
"list",
"this",
"object",
"represents",
".",
"The",
"new",
"Kernel",
"Point",
"will",
"be",
"equivalent",
"to",
"creating",
"a",
"new",
"KernelPoint",
"directly",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/kernels/KernelPoints.java#L579-L593 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/mapreduce/MRJobLauncher.java | MRJobLauncher.calculateDestJarFile | private Path calculateDestJarFile(FileStatus status, Path jarFileDir) {
"""
Calculate the target filePath of the jar file to be copied on HDFS,
given the {@link FileStatus} of a jarFile and the path of directory that contains jar.
"""
// SNAPSHOT jars should not be shared, as different jobs may be using d... | java | private Path calculateDestJarFile(FileStatus status, Path jarFileDir) {
// SNAPSHOT jars should not be shared, as different jobs may be using different versions of it
Path baseDir = status.getPath().getName().contains("SNAPSHOT") ? this.unsharedJarsDir : jarFileDir;
// DistributedCache requires absolute pat... | [
"private",
"Path",
"calculateDestJarFile",
"(",
"FileStatus",
"status",
",",
"Path",
"jarFileDir",
")",
"{",
"// SNAPSHOT jars should not be shared, as different jobs may be using different versions of it",
"Path",
"baseDir",
"=",
"status",
".",
"getPath",
"(",
")",
".",
"g... | Calculate the target filePath of the jar file to be copied on HDFS,
given the {@link FileStatus} of a jarFile and the path of directory that contains jar. | [
"Calculate",
"the",
"target",
"filePath",
"of",
"the",
"jar",
"file",
"to",
"be",
"copied",
"on",
"HDFS",
"given",
"the",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/mapreduce/MRJobLauncher.java#L520-L525 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/WebApplicationContext.java | WebApplicationContext.setErrorPage | public void setErrorPage(String error, String uriInContext) {
"""
set error page URI.
@param error A string representing an error code or a
exception classname
@param uriInContext
"""
if (_errorPages == null)
_errorPages= new HashMap();
_errorPages.put(error, uriInContext);
} | java | public void setErrorPage(String error, String uriInContext)
{
if (_errorPages == null)
_errorPages= new HashMap();
_errorPages.put(error, uriInContext);
} | [
"public",
"void",
"setErrorPage",
"(",
"String",
"error",
",",
"String",
"uriInContext",
")",
"{",
"if",
"(",
"_errorPages",
"==",
"null",
")",
"_errorPages",
"=",
"new",
"HashMap",
"(",
")",
";",
"_errorPages",
".",
"put",
"(",
"error",
",",
"uriInContext... | set error page URI.
@param error A string representing an error code or a
exception classname
@param uriInContext | [
"set",
"error",
"page",
"URI",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/WebApplicationContext.java#L801-L806 |
Netflix/denominator | core/src/main/java/denominator/hook/InstanceMetadataHook.java | InstanceMetadataHook.get | public static String get(URI metadataService, String path) {
"""
Retrieves content at a path, if present.
@param metadataService endpoint with trailing slash. ex. {@code http://169.254.169.254/latest/meta-data/}
@param path path to the metadata desired. ex. {@code public-ipv4} or {@code
iam/securit... | java | public static String get(URI metadataService, String path) {
checkNotNull(metadataService, "metadataService");
checkArgument(metadataService.getPath().endsWith("/"),
"metadataService must end with '/'; %s provided",
metadataService);
checkNotNull(path, "path");
InputS... | [
"public",
"static",
"String",
"get",
"(",
"URI",
"metadataService",
",",
"String",
"path",
")",
"{",
"checkNotNull",
"(",
"metadataService",
",",
"\"metadataService\"",
")",
";",
"checkArgument",
"(",
"metadataService",
".",
"getPath",
"(",
")",
".",
"endsWith",... | Retrieves content at a path, if present.
@param metadataService endpoint with trailing slash. ex. {@code http://169.254.169.254/latest/meta-data/}
@param path path to the metadata desired. ex. {@code public-ipv4} or {@code
iam/security-credentials/role-name}
@return null if {@code metadataService} service c... | [
"Retrieves",
"content",
"at",
"a",
"path",
"if",
"present",
"."
] | train | https://github.com/Netflix/denominator/blob/c565e3b8c6043051252e0947029511f9ac5d306f/core/src/main/java/denominator/hook/InstanceMetadataHook.java#L79-L103 |
amsa-code/risky | ais/src/main/java/au/gov/amsa/ais/AisExtractor.java | AisExtractor.getSignedValue | public synchronized int getSignedValue(int from, int to) {
"""
Returns a signed integer value using the bits from character position
start to position stop in the decoded message.
@param from
@param to
@return
"""
try {
// is synchronized so that values of bitSet and calculated can be... | java | public synchronized int getSignedValue(int from, int to) {
try {
// is synchronized so that values of bitSet and calculated can be
// lazily
// calculated and safely published (thread safe).
SixBit.convertSixBitToBits(message, padBits, bitSet, calculated, from, to... | [
"public",
"synchronized",
"int",
"getSignedValue",
"(",
"int",
"from",
",",
"int",
"to",
")",
"{",
"try",
"{",
"// is synchronized so that values of bitSet and calculated can be",
"// lazily",
"// calculated and safely published (thread safe).",
"SixBit",
".",
"convertSixBitToB... | Returns a signed integer value using the bits from character position
start to position stop in the decoded message.
@param from
@param to
@return | [
"Returns",
"a",
"signed",
"integer",
"value",
"using",
"the",
"bits",
"from",
"character",
"position",
"start",
"to",
"position",
"stop",
"in",
"the",
"decoded",
"message",
"."
] | train | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/ais/src/main/java/au/gov/amsa/ais/AisExtractor.java#L82-L92 |
navnorth/LRJavaLib | src/com/navnorth/learningregistry/LRActivity.java | LRActivity.addChild | private boolean addChild(String name, Object value, String[] pathKeys) {
"""
Add a child object to the activity at the specified path
@param name Name of the object to add
@param value Object to add
@param pathKeys The path in which to add the object
@return True if added, false if not (due to bad path or du... | java | private boolean addChild(String name, Object value, String[] pathKeys)
{
Map<String, Object> selected = (Map<String, Object>)resourceData;
if (pathKeys != null)
{
selected = getMap(pathKeys);
}
if (selected != null && !selected.containsKey(name))... | [
"private",
"boolean",
"addChild",
"(",
"String",
"name",
",",
"Object",
"value",
",",
"String",
"[",
"]",
"pathKeys",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"selected",
"=",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"resourceData... | Add a child object to the activity at the specified path
@param name Name of the object to add
@param value Object to add
@param pathKeys The path in which to add the object
@return True if added, false if not (due to bad path or duplicate name at destination) | [
"Add",
"a",
"child",
"object",
"to",
"the",
"activity",
"at",
"the",
"specified",
"path"
] | train | https://github.com/navnorth/LRJavaLib/blob/27af28b9f80d772273592414e7d0dccffaac09e1/src/com/navnorth/learningregistry/LRActivity.java#L477-L493 |
deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/linalg/io/ClassPathResource.java | ClassPathResource.getTempFileFromArchive | public File getTempFileFromArchive(File rootDirectory) throws IOException {
"""
Get a temp file from the classpath, and (optionally) place it in the specified directory<br>
Note that:<br>
- If the directory is not specified, the file is copied to the default temporary directory, using
{@link Files#createTempFil... | java | public File getTempFileFromArchive(File rootDirectory) throws IOException {
InputStream is = getInputStream();
File tmpFile;
if(rootDirectory != null){
//Maintain original file names, as it's going in a directory...
tmpFile = new File(rootDirectory, FilenameUtils.getName(... | [
"public",
"File",
"getTempFileFromArchive",
"(",
"File",
"rootDirectory",
")",
"throws",
"IOException",
"{",
"InputStream",
"is",
"=",
"getInputStream",
"(",
")",
";",
"File",
"tmpFile",
";",
"if",
"(",
"rootDirectory",
"!=",
"null",
")",
"{",
"//Maintain origin... | Get a temp file from the classpath, and (optionally) place it in the specified directory<br>
Note that:<br>
- If the directory is not specified, the file is copied to the default temporary directory, using
{@link Files#createTempFile(String, String, FileAttribute[])}. Consequently, the extracted file will have a
differ... | [
"Get",
"a",
"temp",
"file",
"from",
"the",
"classpath",
"and",
"(",
"optionally",
")",
"place",
"it",
"in",
"the",
"specified",
"directory<br",
">",
"Note",
"that",
":",
"<br",
">",
"-",
"If",
"the",
"directory",
"is",
"not",
"specified",
"the",
"file",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/io/ClassPathResource.java#L130-L148 |
lucee/Lucee | core/src/main/java/lucee/runtime/tag/Log.java | Log.setFile | public void setFile(String file) throws ApplicationException {
"""
set the value file
@param file value to set
@throws ApplicationException
"""
if (StringUtil.isEmpty(file)) return;
if (file.indexOf('/') != -1 || file.indexOf('\\') != -1)
throw new ApplicationException("value [" + file + "] from at... | java | public void setFile(String file) throws ApplicationException {
if (StringUtil.isEmpty(file)) return;
if (file.indexOf('/') != -1 || file.indexOf('\\') != -1)
throw new ApplicationException("value [" + file + "] from attribute [file] at tag [log] can only contain a filename, file separators like [\\/] are not al... | [
"public",
"void",
"setFile",
"(",
"String",
"file",
")",
"throws",
"ApplicationException",
"{",
"if",
"(",
"StringUtil",
".",
"isEmpty",
"(",
"file",
")",
")",
"return",
";",
"if",
"(",
"file",
".",
"indexOf",
"(",
"'",
"'",
")",
"!=",
"-",
"1",
"||"... | set the value file
@param file value to set
@throws ApplicationException | [
"set",
"the",
"value",
"file"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Log.java#L156-L163 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/JobOperations.java | JobOperations.createJob | public void createJob(String jobId, PoolInformation poolInfo, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
"""
Adds a job to the Batch account.
@param jobId The ID of the job to be added.
@param poolInfo Specifies how a job should be assigned to a pool.
@param a... | java | public void createJob(String jobId, PoolInformation poolInfo, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
JobAddParameter param = new JobAddParameter()
.withId(jobId)
.withPoolInfo(poolInfo);
createJob(param, additionalBeh... | [
"public",
"void",
"createJob",
"(",
"String",
"jobId",
",",
"PoolInformation",
"poolInfo",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"JobAddParameter",
"param",
"=",
"new",
... | Adds a job to the Batch account.
@param jobId The ID of the job to be added.
@param poolInfo Specifies how a job should be assigned to a pool.
@param additionalBehaviors A collection of {@link BatchClientBehavior} instances that are applied to the Batch service request.
@throws BatchErrorException Exception thrown whe... | [
"Adds",
"a",
"job",
"to",
"the",
"Batch",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/JobOperations.java#L289-L295 |
undertow-io/undertow | core/src/main/java/io/undertow/server/HttpServerExchange.java | HttpServerExchange.getResponseChannel | public StreamSinkChannel getResponseChannel() {
"""
Get the response channel. The channel must be closed and fully flushed before the next response can be started.
In order to close the channel you must first call {@link org.xnio.channels.StreamSinkChannel#shutdownWrites()},
and then call {@link org.xnio.channel... | java | public StreamSinkChannel getResponseChannel() {
if (responseChannel != null) {
return null;
}
final ConduitWrapper<StreamSinkConduit>[] wrappers = responseWrappers;
this.responseWrappers = null;
final ConduitStreamSinkChannel sinkChannel = connection.getSinkChannel();... | [
"public",
"StreamSinkChannel",
"getResponseChannel",
"(",
")",
"{",
"if",
"(",
"responseChannel",
"!=",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"ConduitWrapper",
"<",
"StreamSinkConduit",
">",
"[",
"]",
"wrappers",
"=",
"responseWrappers",
";",
... | Get the response channel. The channel must be closed and fully flushed before the next response can be started.
In order to close the channel you must first call {@link org.xnio.channels.StreamSinkChannel#shutdownWrites()},
and then call {@link org.xnio.channels.StreamSinkChannel#flush()} until it returns true. Alterna... | [
"Get",
"the",
"response",
"channel",
".",
"The",
"channel",
"must",
"be",
"closed",
"and",
"fully",
"flushed",
"before",
"the",
"next",
"response",
"can",
"be",
"started",
".",
"In",
"order",
"to",
"close",
"the",
"channel",
"you",
"must",
"first",
"call",... | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/HttpServerExchange.java#L1303-L1322 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/YearMonth.java | YearMonth.plusMonths | public YearMonth plusMonths(long monthsToAdd) {
"""
Returns a copy of this year-month with the specified period in months added.
<p>
This instance is immutable and unaffected by this method call.
@param monthsToAdd the months to add, may be negative
@return a {@code YearMonth} based on this year-month with ... | java | public YearMonth plusMonths(long monthsToAdd) {
if (monthsToAdd == 0) {
return this;
}
long monthCount = year * 12L + (month - 1);
long calcMonths = monthCount + monthsToAdd; // safe overflow
int newYear = YEAR.checkValidIntValue(Jdk8Methods.floorDiv(calcMonths, 12))... | [
"public",
"YearMonth",
"plusMonths",
"(",
"long",
"monthsToAdd",
")",
"{",
"if",
"(",
"monthsToAdd",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"long",
"monthCount",
"=",
"year",
"*",
"12L",
"+",
"(",
"month",
"-",
"1",
")",
";",
"long",
"calcM... | Returns a copy of this year-month with the specified period in months added.
<p>
This instance is immutable and unaffected by this method call.
@param monthsToAdd the months to add, may be negative
@return a {@code YearMonth} based on this year-month with the months added, not null
@throws DateTimeException if the re... | [
"Returns",
"a",
"copy",
"of",
"this",
"year",
"-",
"month",
"with",
"the",
"specified",
"period",
"in",
"months",
"added",
".",
"<p",
">",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/YearMonth.java#L735-L744 |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.sameWeek | public static boolean sameWeek(Date dateOne, Date dateTwo) {
"""
Test to see if two dates are in the same week
@param dateOne first date
@param dateTwo second date
@return true if the two dates are in the same week
"""
if ((dateOne == null) || (dateTwo == null)) {
return false;
... | java | public static boolean sameWeek(Date dateOne, Date dateTwo) {
if ((dateOne == null) || (dateTwo == null)) {
return false;
}
Calendar cal = Calendar.getInstance();
cal.setTime(dateOne);
int year = cal.get(Calendar.YEAR);
int week = cal.get(Calendar.WEEK_OF_YEAR... | [
"public",
"static",
"boolean",
"sameWeek",
"(",
"Date",
"dateOne",
",",
"Date",
"dateTwo",
")",
"{",
"if",
"(",
"(",
"dateOne",
"==",
"null",
")",
"||",
"(",
"dateTwo",
"==",
"null",
")",
")",
"{",
"return",
"false",
";",
"}",
"Calendar",
"cal",
"=",... | Test to see if two dates are in the same week
@param dateOne first date
@param dateTwo second date
@return true if the two dates are in the same week | [
"Test",
"to",
"see",
"if",
"two",
"dates",
"are",
"in",
"the",
"same",
"week"
] | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L255-L270 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationsInner.java | ExpressRouteCircuitAuthorizationsInner.listAsync | public Observable<Page<ExpressRouteCircuitAuthorizationInner>> listAsync(final String resourceGroupName, final String circuitName) {
"""
Gets all authorizations in an express route circuit.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the circuit.
@throws IllegalArgu... | java | public Observable<Page<ExpressRouteCircuitAuthorizationInner>> listAsync(final String resourceGroupName, final String circuitName) {
return listWithServiceResponseAsync(resourceGroupName, circuitName)
.map(new Func1<ServiceResponse<Page<ExpressRouteCircuitAuthorizationInner>>, Page<ExpressRouteCircu... | [
"public",
"Observable",
"<",
"Page",
"<",
"ExpressRouteCircuitAuthorizationInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"circuitName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",... | Gets all authorizations in an express route circuit.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the circuit.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<ExpressRouteCircuitAuthorizationInner> object | [
"Gets",
"all",
"authorizations",
"in",
"an",
"express",
"route",
"circuit",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/ExpressRouteCircuitAuthorizationsInner.java#L581-L589 |
eostermueller/headlessInTraceClient | src/main/java/org/headlessintrace/client/model/DefaultTraceEventParser.java | DefaultTraceEventParser.applyTimeToDate | public static long applyTimeToDate(Date date, Date time) throws IntraceException {
"""
set the give time properties (hour/minute/sec/milli) onto the give data object.
@param date
@param time
@return
@throws IntraceException
"""
Calendar dateCal = new GregorianCalendar();
dateCal.setTime(date);
Cal... | java | public static long applyTimeToDate(Date date, Date time) throws IntraceException {
Calendar dateCal = new GregorianCalendar();
dateCal.setTime(date);
Calendar timeCal = new GregorianCalendar();
dateCal.setTime(time);
dateCal.set(Calendar.HOUR_OF_DAY, timeCal.get(Calendar.HOUR_OF_DAY )); // 24 hour clock... | [
"public",
"static",
"long",
"applyTimeToDate",
"(",
"Date",
"date",
",",
"Date",
"time",
")",
"throws",
"IntraceException",
"{",
"Calendar",
"dateCal",
"=",
"new",
"GregorianCalendar",
"(",
")",
";",
"dateCal",
".",
"setTime",
"(",
"date",
")",
";",
"Calenda... | set the give time properties (hour/minute/sec/milli) onto the give data object.
@param date
@param time
@return
@throws IntraceException | [
"set",
"the",
"give",
"time",
"properties",
"(",
"hour",
"/",
"minute",
"/",
"sec",
"/",
"milli",
")",
"onto",
"the",
"give",
"data",
"object",
"."
] | train | https://github.com/eostermueller/headlessInTraceClient/blob/50b1dccc5ff9e342c7c1d06b5a382e8c0afc7604/src/main/java/org/headlessintrace/client/model/DefaultTraceEventParser.java#L194-L209 |
yonik/noggit | src/main/java/org/noggit/JSONParser.java | JSONParser.readExp | private int readExp(CharArr arr, int lim) throws IOException {
"""
call after 'e' or 'E' has been seen to read the rest of the exponent
"""
nstate |= HAS_EXPONENT;
int ch = getChar(); lim--;
if (ch=='+' || ch=='-') {
arr.write(ch);
ch = getChar(); lim--;
}
// make sure at leas... | java | private int readExp(CharArr arr, int lim) throws IOException {
nstate |= HAS_EXPONENT;
int ch = getChar(); lim--;
if (ch=='+' || ch=='-') {
arr.write(ch);
ch = getChar(); lim--;
}
// make sure at least one digit is read.
if (ch<'0' || ch>'9') {
throw err("missing exponent num... | [
"private",
"int",
"readExp",
"(",
"CharArr",
"arr",
",",
"int",
"lim",
")",
"throws",
"IOException",
"{",
"nstate",
"|=",
"HAS_EXPONENT",
";",
"int",
"ch",
"=",
"getChar",
"(",
")",
";",
"lim",
"--",
";",
"if",
"(",
"ch",
"==",
"'",
"'",
"||",
"ch"... | call after 'e' or 'E' has been seen to read the rest of the exponent | [
"call",
"after",
"e",
"or",
"E",
"has",
"been",
"seen",
"to",
"read",
"the",
"rest",
"of",
"the",
"exponent"
] | train | https://github.com/yonik/noggit/blob/8febcdc7f88126bde8a1909519b4644655f78106/src/main/java/org/noggit/JSONParser.java#L565-L581 |
pebble/pebble-android-sdk | PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/util/PebbleDictionary.java | PebbleDictionary.addUint16 | public void addUint16(final int key, final short s) {
"""
Associate the specified unsigned short with the provided key in the dictionary. If another key-value pair with
the same key is already present in the dictionary, it will be replaced.
@param key
key with which the specified value is associated
@param s... | java | public void addUint16(final int key, final short s) {
PebbleTuple t = PebbleTuple.create(key, PebbleTuple.TupleType.UINT, PebbleTuple.Width.SHORT, s);
addTuple(t);
} | [
"public",
"void",
"addUint16",
"(",
"final",
"int",
"key",
",",
"final",
"short",
"s",
")",
"{",
"PebbleTuple",
"t",
"=",
"PebbleTuple",
".",
"create",
"(",
"key",
",",
"PebbleTuple",
".",
"TupleType",
".",
"UINT",
",",
"PebbleTuple",
".",
"Width",
".",
... | Associate the specified unsigned short with the provided key in the dictionary. If another key-value pair with
the same key is already present in the dictionary, it will be replaced.
@param key
key with which the specified value is associated
@param s
value to be associated with the specified key | [
"Associate",
"the",
"specified",
"unsigned",
"short",
"with",
"the",
"provided",
"key",
"in",
"the",
"dictionary",
".",
"If",
"another",
"key",
"-",
"value",
"pair",
"with",
"the",
"same",
"key",
"is",
"already",
"present",
"in",
"the",
"dictionary",
"it",
... | train | https://github.com/pebble/pebble-android-sdk/blob/ddfc53ecf3950deebb62a1f205aa21fbe9bce45d/PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/util/PebbleDictionary.java#L149-L152 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/Transaction.java | Transaction.bitcoinSerializeToStream | protected void bitcoinSerializeToStream(OutputStream stream, boolean useSegwit) throws IOException {
"""
Serialize according to <a href="https://github.com/bitcoin/bips/blob/master/bip-0144.mediawiki">BIP144</a> or the
<a href="https://en.bitcoin.it/wiki/Protocol_documentation#tx">classic format</a>, depending on... | java | protected void bitcoinSerializeToStream(OutputStream stream, boolean useSegwit) throws IOException {
// version
uint32ToByteStreamLE(version, stream);
// marker, flag
if (useSegwit) {
stream.write(0);
stream.write(1);
}
// txin_count, txins
... | [
"protected",
"void",
"bitcoinSerializeToStream",
"(",
"OutputStream",
"stream",
",",
"boolean",
"useSegwit",
")",
"throws",
"IOException",
"{",
"// version",
"uint32ToByteStreamLE",
"(",
"version",
",",
"stream",
")",
";",
"// marker, flag",
"if",
"(",
"useSegwit",
... | Serialize according to <a href="https://github.com/bitcoin/bips/blob/master/bip-0144.mediawiki">BIP144</a> or the
<a href="https://en.bitcoin.it/wiki/Protocol_documentation#tx">classic format</a>, depending on if segwit is
desired. | [
"Serialize",
"according",
"to",
"<a",
"href",
"=",
"https",
":",
"//",
"github",
".",
"com",
"/",
"bitcoin",
"/",
"bips",
"/",
"blob",
"/",
"master",
"/",
"bip",
"-",
"0144",
".",
"mediawiki",
">",
"BIP144<",
"/",
"a",
">",
"or",
"the",
"<a",
"href... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/Transaction.java#L1436-L1460 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingImpl.java | LoggingImpl.writeLogEntries | private void writeLogEntries(Iterable<LogEntry> logEntries, WriteOption... writeOptions) {
"""
/* Write logs synchronously or asynchronously based on writeSynchronicity setting.
"""
switch (this.writeSynchronicity) {
case SYNC:
get(writeAsync(logEntries, writeOptions));
break;
... | java | private void writeLogEntries(Iterable<LogEntry> logEntries, WriteOption... writeOptions) {
switch (this.writeSynchronicity) {
case SYNC:
get(writeAsync(logEntries, writeOptions));
break;
case ASYNC:
default:
final ApiFuture<Void> writeFuture = writeAsync(logEntries, writeO... | [
"private",
"void",
"writeLogEntries",
"(",
"Iterable",
"<",
"LogEntry",
">",
"logEntries",
",",
"WriteOption",
"...",
"writeOptions",
")",
"{",
"switch",
"(",
"this",
".",
"writeSynchronicity",
")",
"{",
"case",
"SYNC",
":",
"get",
"(",
"writeAsync",
"(",
"l... | /* Write logs synchronously or asynchronously based on writeSynchronicity setting. | [
"/",
"*",
"Write",
"logs",
"synchronously",
"or",
"asynchronously",
"based",
"on",
"writeSynchronicity",
"setting",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-logging/src/main/java/com/google/cloud/logging/LoggingImpl.java#L584-L619 |
facebook/fresco | drawee-span/src/main/java/com/facebook/drawee/span/SimpleDraweeSpanTextView.java | SimpleDraweeSpanTextView.setDraweeSpanStringBuilder | public void setDraweeSpanStringBuilder(DraweeSpanStringBuilder draweeSpanStringBuilder) {
"""
Bind the given string builder to this view.
@param draweeSpanStringBuilder the builder to attach to
"""
// setText will trigger onTextChanged, which will clean up the old draweeSpanStringBuilder
// if neces... | java | public void setDraweeSpanStringBuilder(DraweeSpanStringBuilder draweeSpanStringBuilder) {
// setText will trigger onTextChanged, which will clean up the old draweeSpanStringBuilder
// if necessary
setText(draweeSpanStringBuilder, BufferType.SPANNABLE);
mDraweeStringBuilder = draweeSpanStringBuilder;
... | [
"public",
"void",
"setDraweeSpanStringBuilder",
"(",
"DraweeSpanStringBuilder",
"draweeSpanStringBuilder",
")",
"{",
"// setText will trigger onTextChanged, which will clean up the old draweeSpanStringBuilder",
"// if necessary",
"setText",
"(",
"draweeSpanStringBuilder",
",",
"BufferTyp... | Bind the given string builder to this view.
@param draweeSpanStringBuilder the builder to attach to | [
"Bind",
"the",
"given",
"string",
"builder",
"to",
"this",
"view",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/drawee-span/src/main/java/com/facebook/drawee/span/SimpleDraweeSpanTextView.java#L85-L93 |
ef-labs/vertx-when | vertx-when/src/main/java/com/englishtown/vertx/promises/impl/DefaultWhenFileSystem.java | DefaultWhenFileSystem.chmodRecursive | @Override
public Promise<Void> chmodRecursive(String path, String perms, String dirPerms) {
"""
Change the permissions on the file represented by {@code path} to {@code perms}, asynchronously.<p>
The permission String takes the form rwxr-x--- as
specified in {<a href="http://download.oracle.com/javase/7/docs... | java | @Override
public Promise<Void> chmodRecursive(String path, String perms, String dirPerms) {
return adapter.toPromise(handler -> vertx.fileSystem().chmodRecursive(path, perms, dirPerms, handler));
} | [
"@",
"Override",
"public",
"Promise",
"<",
"Void",
">",
"chmodRecursive",
"(",
"String",
"path",
",",
"String",
"perms",
",",
"String",
"dirPerms",
")",
"{",
"return",
"adapter",
".",
"toPromise",
"(",
"handler",
"->",
"vertx",
".",
"fileSystem",
"(",
")",... | Change the permissions on the file represented by {@code path} to {@code perms}, asynchronously.<p>
The permission String takes the form rwxr-x--- as
specified in {<a href="http://download.oracle.com/javase/7/docs/api/java/nio/file/attribute/PosixFilePermissions.html">here</a>}.
<p>
If the file is directory then all co... | [
"Change",
"the",
"permissions",
"on",
"the",
"file",
"represented",
"by",
"{",
"@code",
"path",
"}",
"to",
"{",
"@code",
"perms",
"}",
"asynchronously",
".",
"<p",
">",
"The",
"permission",
"String",
"takes",
"the",
"form",
"rwxr",
"-",
"x",
"---",
"as",... | train | https://github.com/ef-labs/vertx-when/blob/dc4fde973f58130f2eb2159206ee78b867048f4d/vertx-when/src/main/java/com/englishtown/vertx/promises/impl/DefaultWhenFileSystem.java#L123-L126 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/stereo/StereoTool.java | StereoTool.isTrigonalBipyramidal | public static boolean isTrigonalBipyramidal(IAtom atomA, IAtom atomB, IAtom atomC, IAtom atomD, IAtom atomE,
IAtom atomF) {
"""
Checks these 6 atoms to see if they form a trigonal-bipyramidal shape.
@param atomA one of the axial atoms
@param atomB the central atom
@param atomC one of the equatoria... | java | public static boolean isTrigonalBipyramidal(IAtom atomA, IAtom atomB, IAtom atomC, IAtom atomD, IAtom atomE,
IAtom atomF) {
Point3d pointA = atomA.getPoint3d();
Point3d pointB = atomB.getPoint3d();
Point3d pointC = atomC.getPoint3d();
Point3d pointD = atomD.getPoint3d();
... | [
"public",
"static",
"boolean",
"isTrigonalBipyramidal",
"(",
"IAtom",
"atomA",
",",
"IAtom",
"atomB",
",",
"IAtom",
"atomC",
",",
"IAtom",
"atomD",
",",
"IAtom",
"atomE",
",",
"IAtom",
"atomF",
")",
"{",
"Point3d",
"pointA",
"=",
"atomA",
".",
"getPoint3d",
... | Checks these 6 atoms to see if they form a trigonal-bipyramidal shape.
@param atomA one of the axial atoms
@param atomB the central atom
@param atomC one of the equatorial atoms
@param atomD one of the equatorial atoms
@param atomE one of the equatorial atoms
@param atomF the other axial atom
@return true if the geome... | [
"Checks",
"these",
"6",
"atoms",
"to",
"see",
"if",
"they",
"form",
"a",
"trigonal",
"-",
"bipyramidal",
"shape",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/stereo/StereoTool.java#L242-L268 |
DaGeRe/KoPeMe | kopeme-core/src/main/java/de/dagere/kopeme/PomProjectNameReader.java | PomProjectNameReader.foundPomXml | public boolean foundPomXml(final File directory, final int depth) {
"""
Tries to find the pom recursively by going up in the directory tree.
@param directory The start folder where to search
@param depth how many times should we try to go up to find the pom?
@return a boolean denoting if the pom was found / s... | java | public boolean foundPomXml(final File directory, final int depth) {
LOG.debug("Directory: {}", directory);
if (depth == -1 || directory == null || !directory.isDirectory()) {
return false;
} else {
File[] pomFiles = directory.listFiles(new FileFilter() {
@Override
public boolean accept(final File pa... | [
"public",
"boolean",
"foundPomXml",
"(",
"final",
"File",
"directory",
",",
"final",
"int",
"depth",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Directory: {}\"",
",",
"directory",
")",
";",
"if",
"(",
"depth",
"==",
"-",
"1",
"||",
"directory",
"==",
"null",... | Tries to find the pom recursively by going up in the directory tree.
@param directory The start folder where to search
@param depth how many times should we try to go up to find the pom?
@return a boolean denoting if the pom was found / side effect setting the pom file | [
"Tries",
"to",
"find",
"the",
"pom",
"recursively",
"by",
"going",
"up",
"in",
"the",
"directory",
"tree",
"."
] | train | https://github.com/DaGeRe/KoPeMe/blob/a4939113cba73cb20a2c7d6dc8d34d0139a3e340/kopeme-core/src/main/java/de/dagere/kopeme/PomProjectNameReader.java#L39-L57 |
steveohara/j2mod | src/main/java/com/ghgande/j2mod/modbus/io/ModbusTransaction.java | ModbusTransaction.checkValidity | void checkValidity() throws ModbusException {
"""
Checks the validity of the transaction, by
checking if the values of the response correspond
to the values of the request.
@throws ModbusException if the transaction is not valid.
"""
if (request != null && response != null) {
if (reque... | java | void checkValidity() throws ModbusException {
if (request != null && response != null) {
if (request.getUnitID() != response.getUnitID()) {
throw new ModbusIOException("Unit ID mismatch - Request [%s] Response [%s]", request.getHexMessage(), response.getHexMessage());
}
... | [
"void",
"checkValidity",
"(",
")",
"throws",
"ModbusException",
"{",
"if",
"(",
"request",
"!=",
"null",
"&&",
"response",
"!=",
"null",
")",
"{",
"if",
"(",
"request",
".",
"getUnitID",
"(",
")",
"!=",
"response",
".",
"getUnitID",
"(",
")",
")",
"{",... | Checks the validity of the transaction, by
checking if the values of the response correspond
to the values of the request.
@throws ModbusException if the transaction is not valid. | [
"Checks",
"the",
"validity",
"of",
"the",
"transaction",
"by",
"checking",
"if",
"the",
"values",
"of",
"the",
"response",
"correspond",
"to",
"the",
"values",
"of",
"the",
"request",
"."
] | train | https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/io/ModbusTransaction.java#L165-L174 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/ProxiedFileSystemUtils.java | ProxiedFileSystemUtils.createProxiedFileSystem | static FileSystem createProxiedFileSystem(@NonNull final String userNameToProxyAs, Properties properties, URI fsURI,
Configuration conf) throws IOException {
"""
Creates a {@link FileSystem} that can perform any operations allowed by the specified userNameToProxyAs.
@param userNameToProxyAs The name of th... | java | static FileSystem createProxiedFileSystem(@NonNull final String userNameToProxyAs, Properties properties, URI fsURI,
Configuration conf) throws IOException {
Preconditions.checkArgument(properties.containsKey(AUTH_TYPE_KEY));
switch (AuthType.valueOf(properties.getProperty(AUTH_TYPE_KEY))) {
case T... | [
"static",
"FileSystem",
"createProxiedFileSystem",
"(",
"@",
"NonNull",
"final",
"String",
"userNameToProxyAs",
",",
"Properties",
"properties",
",",
"URI",
"fsURI",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkArgument"... | Creates a {@link FileSystem} that can perform any operations allowed by the specified userNameToProxyAs.
@param userNameToProxyAs The name of the user the super user should proxy as
@param properties {@link java.util.Properties} containing initialization properties.
@param fsURI The {@link URI} for the {@link FileSyst... | [
"Creates",
"a",
"{",
"@link",
"FileSystem",
"}",
"that",
"can",
"perform",
"any",
"operations",
"allowed",
"by",
"the",
"specified",
"userNameToProxyAs",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ProxiedFileSystemUtils.java#L81-L111 |
apache/groovy | src/main/groovy/groovy/lang/MetaMethod.java | MetaMethod.processDoMethodInvokeException | public final RuntimeException processDoMethodInvokeException (Exception e, Object object, Object [] argumentArray) {
"""
This method is called when an exception occurs while invoking this method.
"""
// if (e instanceof IllegalArgumentException) {
// //TODO: test if this is OK with new MOP, s... | java | public final RuntimeException processDoMethodInvokeException (Exception e, Object object, Object [] argumentArray) {
// if (e instanceof IllegalArgumentException) {
// //TODO: test if this is OK with new MOP, should be changed!
// // we don't want the exception being unwrapped if it is a Il... | [
"public",
"final",
"RuntimeException",
"processDoMethodInvokeException",
"(",
"Exception",
"e",
",",
"Object",
"object",
",",
"Object",
"[",
"]",
"argumentArray",
")",
"{",
"// if (e instanceof IllegalArgumentException) {",
"// //TODO: test if this is OK with ne... | This method is called when an exception occurs while invoking this method. | [
"This",
"method",
"is",
"called",
"when",
"an",
"exception",
"occurs",
"while",
"invoking",
"this",
"method",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/MetaMethod.java#L291-L310 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java | OjbTagsHandler.forObjectCache | public void forObjectCache(String template, Properties attributes) throws XDocletException {
"""
Processes the template for the object cache of the current class definition.
@param template The template
@param attributes The attributes of the tag
@exception XDocletException if an erro... | java | public void forObjectCache(String template, Properties attributes) throws XDocletException
{
_curObjectCacheDef = _curClassDef.getObjectCache();
if (_curObjectCacheDef != null)
{
generate(template);
_curObjectCacheDef = null;
}
} | [
"public",
"void",
"forObjectCache",
"(",
"String",
"template",
",",
"Properties",
"attributes",
")",
"throws",
"XDocletException",
"{",
"_curObjectCacheDef",
"=",
"_curClassDef",
".",
"getObjectCache",
"(",
")",
";",
"if",
"(",
"_curObjectCacheDef",
"!=",
"null",
... | Processes the template for the object cache of the current class definition.
@param template The template
@param attributes The attributes of the tag
@exception XDocletException if an error occurs
@doc.tag type="block" | [
"Processes",
"the",
"template",
"for",
"the",
"object",
"cache",
"of",
"the",
"current",
"class",
"definition",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/OjbTagsHandler.java#L508-L516 |
LearnLib/automatalib | serialization/fsm/src/main/java/net/automatalib/serialization/fsm/parser/FSM2DFAParser.java | FSM2DFAParser.checkDataDefinitions | @Override
protected void checkDataDefinitions(StreamTokenizer streamTokenizer) throws FSMParseException {
"""
Checks the data definition by ensuring the index in the state vector containing acceptance information is
defined.
@throws FSMParseException
when the acceptance information could not be found.
... | java | @Override
protected void checkDataDefinitions(StreamTokenizer streamTokenizer) throws FSMParseException {
if (acceptIndex == -1) {
throw new FSMParseException(String.format(ACCEPT_NOT_FOUND, acceptingDataVariableName),
streamTokenizer);
}
} | [
"@",
"Override",
"protected",
"void",
"checkDataDefinitions",
"(",
"StreamTokenizer",
"streamTokenizer",
")",
"throws",
"FSMParseException",
"{",
"if",
"(",
"acceptIndex",
"==",
"-",
"1",
")",
"{",
"throw",
"new",
"FSMParseException",
"(",
"String",
".",
"format",... | Checks the data definition by ensuring the index in the state vector containing acceptance information is
defined.
@throws FSMParseException
when the acceptance information could not be found. | [
"Checks",
"the",
"data",
"definition",
"by",
"ensuring",
"the",
"index",
"in",
"the",
"state",
"vector",
"containing",
"acceptance",
"information",
"is",
"defined",
"."
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/serialization/fsm/src/main/java/net/automatalib/serialization/fsm/parser/FSM2DFAParser.java#L178-L184 |
jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java | CodedConstant.getRetRequiredCheck | public static String getRetRequiredCheck(String express, Field field) {
"""
get return required field check java expression.
@param express java expression
@param field java field
@return full java expression
"""
String code = "if (CodedConstant.isNull(" + express + ")) {\n";
code += "th... | java | public static String getRetRequiredCheck(String express, Field field) {
String code = "if (CodedConstant.isNull(" + express + ")) {\n";
code += "throw new UninitializedMessageException(CodedConstant.asList(\"" + field.getName() + "\"));\n";
code += "}\n";
return code;
} | [
"public",
"static",
"String",
"getRetRequiredCheck",
"(",
"String",
"express",
",",
"Field",
"field",
")",
"{",
"String",
"code",
"=",
"\"if (CodedConstant.isNull(\"",
"+",
"express",
"+",
"\")) {\\n\"",
";",
"code",
"+=",
"\"throw new UninitializedMessageException(Code... | get return required field check java expression.
@param express java expression
@param field java field
@return full java expression | [
"get",
"return",
"required",
"field",
"check",
"java",
"expression",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/code/CodedConstant.java#L897-L903 |
knowm/Sundial | src/main/java/org/knowm/sundial/SundialJobScheduler.java | SundialJobScheduler.addJob | public static void addJob(
String jobName,
Class<? extends Job> jobClass,
Map<String, Object> params,
boolean isConcurrencyAllowed)
throws SundialSchedulerException {
"""
Adds a Job to the scheduler. Replaces a matching existing Job.
@param jobName
@param jobClass
@param par... | java | public static void addJob(
String jobName,
Class<? extends Job> jobClass,
Map<String, Object> params,
boolean isConcurrencyAllowed)
throws SundialSchedulerException {
try {
JobDataMap jobDataMap = new JobDataMap();
if (params != null) {
for (Entry<String,... | [
"public",
"static",
"void",
"addJob",
"(",
"String",
"jobName",
",",
"Class",
"<",
"?",
"extends",
"Job",
">",
"jobClass",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
",",
"boolean",
"isConcurrencyAllowed",
")",
"throws",
"SundialSchedulerExceptio... | Adds a Job to the scheduler. Replaces a matching existing Job.
@param jobName
@param jobClass
@param params Set this null if there are no params
@param isConcurrencyAllowed | [
"Adds",
"a",
"Job",
"to",
"the",
"scheduler",
".",
"Replaces",
"a",
"matching",
"existing",
"Job",
"."
] | train | https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/SundialJobScheduler.java#L213-L241 |
b3log/latke | latke-core/src/main/java/org/b3log/latke/repository/jdbc/JdbcRepository.java | JdbcRepository.buildSelect | private void buildSelect(final StringBuilder selectBuilder, final List<Projection> projections) {
"""
Builds 'SELECT' part with the specified select build and projections.
@param selectBuilder the specified select builder
@param projections the specified projections
"""
selectBuilder.append("SELE... | java | private void buildSelect(final StringBuilder selectBuilder, final List<Projection> projections) {
selectBuilder.append("SELECT ");
if (null == projections || projections.isEmpty()) {
selectBuilder.append(" * ");
return;
}
selectBuilder.append(projections.stream(... | [
"private",
"void",
"buildSelect",
"(",
"final",
"StringBuilder",
"selectBuilder",
",",
"final",
"List",
"<",
"Projection",
">",
"projections",
")",
"{",
"selectBuilder",
".",
"append",
"(",
"\"SELECT \"",
")",
";",
"if",
"(",
"null",
"==",
"projections",
"||",... | Builds 'SELECT' part with the specified select build and projections.
@param selectBuilder the specified select builder
@param projections the specified projections | [
"Builds",
"SELECT",
"part",
"with",
"the",
"specified",
"select",
"build",
"and",
"projections",
"."
] | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/repository/jdbc/JdbcRepository.java#L581-L590 |
ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultJsonQueryLogEntryCreator.java | DefaultJsonQueryLogEntryCreator.writeParamsForSinglePreparedEntry | protected void writeParamsForSinglePreparedEntry(StringBuilder sb, SortedMap<String, String> paramMap, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
"""
Write parameters for single execution as json.
<p>default: ["foo","100"],
@param sb StringBuilder to write
@param paramMap sorte... | java | protected void writeParamsForSinglePreparedEntry(StringBuilder sb, SortedMap<String, String> paramMap, ExecutionInfo execInfo, List<QueryInfo> queryInfoList) {
sb.append("[");
for (Map.Entry<String, String> paramEntry : paramMap.entrySet()) {
Object value = paramEntry.getValue();
... | [
"protected",
"void",
"writeParamsForSinglePreparedEntry",
"(",
"StringBuilder",
"sb",
",",
"SortedMap",
"<",
"String",
",",
"String",
">",
"paramMap",
",",
"ExecutionInfo",
"execInfo",
",",
"List",
"<",
"QueryInfo",
">",
"queryInfoList",
")",
"{",
"sb",
".",
"ap... | Write parameters for single execution as json.
<p>default: ["foo","100"],
@param sb StringBuilder to write
@param paramMap sorted parameters map
@param execInfo execution info
@param queryInfoList query info list | [
"Write",
"parameters",
"for",
"single",
"execution",
"as",
"json",
"."
] | train | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/listener/logging/DefaultJsonQueryLogEntryCreator.java#L248-L263 |
kiswanij/jk-util | src/main/java/com/jk/util/JKIOUtil.java | JKIOUtil.writeDataToTempFile | public static File writeDataToTempFile(final String data, final String ext) {
"""
Write data to temp file.
@param data String
@param ext the ext
@return File
"""
try {
final File file = createTempFile(ext);
final PrintWriter out = new PrintWriter(new FileOutputStream(file));
out.print(data... | java | public static File writeDataToTempFile(final String data, final String ext) {
try {
final File file = createTempFile(ext);
final PrintWriter out = new PrintWriter(new FileOutputStream(file));
out.print(data);
// out.flush();
out.close();
// file.deleteOnExit();
return file;
} catch (IOEx... | [
"public",
"static",
"File",
"writeDataToTempFile",
"(",
"final",
"String",
"data",
",",
"final",
"String",
"ext",
")",
"{",
"try",
"{",
"final",
"File",
"file",
"=",
"createTempFile",
"(",
"ext",
")",
";",
"final",
"PrintWriter",
"out",
"=",
"new",
"PrintW... | Write data to temp file.
@param data String
@param ext the ext
@return File | [
"Write",
"data",
"to",
"temp",
"file",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKIOUtil.java#L464-L477 |
mikepenz/MaterialDrawer | library/src/main/java/com/mikepenz/materialdrawer/AccountHeader.java | AccountHeader.addProfile | public void addProfile(@NonNull IProfile profile, int position) {
"""
Add a new profile at a specific position to the list
@param profile
@param position
"""
if (mAccountHeaderBuilder.mProfiles == null) {
mAccountHeaderBuilder.mProfiles = new ArrayList<>();
}
mAccountHea... | java | public void addProfile(@NonNull IProfile profile, int position) {
if (mAccountHeaderBuilder.mProfiles == null) {
mAccountHeaderBuilder.mProfiles = new ArrayList<>();
}
mAccountHeaderBuilder.mProfiles.add(position, profile);
mAccountHeaderBuilder.updateHeaderAndList();
} | [
"public",
"void",
"addProfile",
"(",
"@",
"NonNull",
"IProfile",
"profile",
",",
"int",
"position",
")",
"{",
"if",
"(",
"mAccountHeaderBuilder",
".",
"mProfiles",
"==",
"null",
")",
"{",
"mAccountHeaderBuilder",
".",
"mProfiles",
"=",
"new",
"ArrayList",
"<>"... | Add a new profile at a specific position to the list
@param profile
@param position | [
"Add",
"a",
"new",
"profile",
"at",
"a",
"specific",
"position",
"to",
"the",
"list"
] | train | https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/AccountHeader.java#L284-L291 |
ziccardi/jnrpe | jnrpe-plugins/src/main/java/it/jnrpe/plugin/utils/SshUtils.java | SshUtils.getSession | public static Session getSession(final ICommandLine cl) throws Exception {
"""
Starts an ssh session
@param cl the command line object
@return an ssh session
@throws Exception on any error
"""
JSch jsch = new JSch();
Session session = null;
int timeout = DEFAULT_TIMEOUT;
in... | java | public static Session getSession(final ICommandLine cl) throws Exception {
JSch jsch = new JSch();
Session session = null;
int timeout = DEFAULT_TIMEOUT;
int port = cl.hasOption("port") ? Integer.parseInt(cl.getOptionValue("port")) : +DEFAULT_PORT;
String hostname = cl.getOptionV... | [
"public",
"static",
"Session",
"getSession",
"(",
"final",
"ICommandLine",
"cl",
")",
"throws",
"Exception",
"{",
"JSch",
"jsch",
"=",
"new",
"JSch",
"(",
")",
";",
"Session",
"session",
"=",
"null",
";",
"int",
"timeout",
"=",
"DEFAULT_TIMEOUT",
";",
"int... | Starts an ssh session
@param cl the command line object
@return an ssh session
@throws Exception on any error | [
"Starts",
"an",
"ssh",
"session"
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-plugins/src/main/java/it/jnrpe/plugin/utils/SshUtils.java#L51-L76 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalCreator.java | JournalCreator.putTempStream | public String putTempStream(Context context, InputStream in)
throws ServerException {
"""
Create a journal entry, add the arguments, and invoke the method.
"""
try {
CreatorJournalEntry cje =
new CreatorJournalEntry(METHOD_PUT_TEMP_STREAM, context);
... | java | public String putTempStream(Context context, InputStream in)
throws ServerException {
try {
CreatorJournalEntry cje =
new CreatorJournalEntry(METHOD_PUT_TEMP_STREAM, context);
cje.addArgument(ARGUMENT_NAME_IN, in);
return (String) cje.invokeAnd... | [
"public",
"String",
"putTempStream",
"(",
"Context",
"context",
",",
"InputStream",
"in",
")",
"throws",
"ServerException",
"{",
"try",
"{",
"CreatorJournalEntry",
"cje",
"=",
"new",
"CreatorJournalEntry",
"(",
"METHOD_PUT_TEMP_STREAM",
",",
"context",
")",
";",
"... | Create a journal entry, add the arguments, and invoke the method. | [
"Create",
"a",
"journal",
"entry",
"add",
"the",
"arguments",
"and",
"invoke",
"the",
"method",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/JournalCreator.java#L345-L355 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java | Matrix.times | public Matrix times(double s) {
"""
Multiply a matrix by a scalar, C = s*A
@param s scalar
@return s*A
"""
Matrix X = new Matrix(m, n);
double[][] C = X.getArray();
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
C[i][j] = ... | java | public Matrix times(double s)
{
Matrix X = new Matrix(m, n);
double[][] C = X.getArray();
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
C[i][j] = s * A[i][j];
}
}
return X;
} | [
"public",
"Matrix",
"times",
"(",
"double",
"s",
")",
"{",
"Matrix",
"X",
"=",
"new",
"Matrix",
"(",
"m",
",",
"n",
")",
";",
"double",
"[",
"]",
"[",
"]",
"C",
"=",
"X",
".",
"getArray",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";"... | Multiply a matrix by a scalar, C = s*A
@param s scalar
@return s*A | [
"Multiply",
"a",
"matrix",
"by",
"a",
"scalar",
"C",
"=",
"s",
"*",
"A"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java#L900-L912 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/RegexUtils.java | RegexUtils.createPattern | public static Pattern createPattern(final String pattern, final int flags) {
"""
Creates the pattern with the given flags.
@param pattern the pattern, may be null.
@param flags the flags
@return the compiled pattern or {@link RegexUtils#MATCH_NOTHING_PATTERN} if pattern is null or invalid.
"""
i... | java | public static Pattern createPattern(final String pattern, final int flags) {
if (pattern == null) {
LOGGER.debug("Pattern cannot be null");
return MATCH_NOTHING_PATTERN;
}
try {
return Pattern.compile(pattern, flags);
} catch (final PatternSyntaxExcept... | [
"public",
"static",
"Pattern",
"createPattern",
"(",
"final",
"String",
"pattern",
",",
"final",
"int",
"flags",
")",
"{",
"if",
"(",
"pattern",
"==",
"null",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Pattern cannot be null\"",
")",
";",
"return",
"MATCH_NOT... | Creates the pattern with the given flags.
@param pattern the pattern, may be null.
@param flags the flags
@return the compiled pattern or {@link RegexUtils#MATCH_NOTHING_PATTERN} if pattern is null or invalid. | [
"Creates",
"the",
"pattern",
"with",
"the",
"given",
"flags",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/RegexUtils.java#L80-L91 |
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java | DefaultComparisonFormatter.appendFullDocumentHeader | protected void appendFullDocumentHeader(StringBuilder sb, Document doc) {
"""
Appends the XML declaration and DOCTYPE if present as well as the document's root element for {@link
#getFullFormattedXml}.
@param sb the builder to append to
@param doc the document to format
@since XMLUnit 2.4.0
"""
... | java | protected void appendFullDocumentHeader(StringBuilder sb, Document doc) {
if (appendDocumentXmlDeclaration(sb, doc)) {
sb.append("\n");
}
if (appendDocumentType(sb, doc.getDoctype())) {
sb.append("\n");
}
appendOnlyElementStartTagWithAttributes(sb, doc.get... | [
"protected",
"void",
"appendFullDocumentHeader",
"(",
"StringBuilder",
"sb",
",",
"Document",
"doc",
")",
"{",
"if",
"(",
"appendDocumentXmlDeclaration",
"(",
"sb",
",",
"doc",
")",
")",
"{",
"sb",
".",
"append",
"(",
"\"\\n\"",
")",
";",
"}",
"if",
"(",
... | Appends the XML declaration and DOCTYPE if present as well as the document's root element for {@link
#getFullFormattedXml}.
@param sb the builder to append to
@param doc the document to format
@since XMLUnit 2.4.0 | [
"Appends",
"the",
"XML",
"declaration",
"and",
"DOCTYPE",
"if",
"present",
"as",
"well",
"as",
"the",
"document",
"s",
"root",
"element",
"for",
"{",
"@link",
"#getFullFormattedXml",
"}",
"."
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java#L393-L401 |
jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Tag.java | ID3v2Tag.setUserDefinedURLFrame | public void setUserDefinedURLFrame(String description, String value) {
"""
Sets the data contained in the user defined url frame (WXXX).
@param description a description of the url
@param value the url for the frame
"""
try
{
byte[] b = new byte[description.length() + value.length() + 2];
int byt... | java | public void setUserDefinedURLFrame(String description, String value)
{
try
{
byte[] b = new byte[description.length() + value.length() + 2];
int bytesCopied = 0;
b[bytesCopied++] = 0;
System.arraycopy(description.getBytes(ENC_TYPE), 0, b, bytesCopied, description.length());
bytesCopied += descriptio... | [
"public",
"void",
"setUserDefinedURLFrame",
"(",
"String",
"description",
",",
"String",
"value",
")",
"{",
"try",
"{",
"byte",
"[",
"]",
"b",
"=",
"new",
"byte",
"[",
"description",
".",
"length",
"(",
")",
"+",
"value",
".",
"length",
"(",
")",
"+",
... | Sets the data contained in the user defined url frame (WXXX).
@param description a description of the url
@param value the url for the frame | [
"Sets",
"the",
"data",
"contained",
"in",
"the",
"user",
"defined",
"url",
"frame",
"(",
"WXXX",
")",
"."
] | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Tag.java#L368-L387 |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/StringUtil.java | StringUtil.defaultIfBlank | public static String defaultIfBlank(String _str, String _default) {
"""
Checks if given String is blank (see {@link #isBlank(String)}.<br>
If String is blank, the given default is returned, otherwise the String is returned.
@param _str string to check
@param _default default in case of blank string
@return _st... | java | public static String defaultIfBlank(String _str, String _default) {
return isBlank(_str) ? _default : _str;
} | [
"public",
"static",
"String",
"defaultIfBlank",
"(",
"String",
"_str",
",",
"String",
"_default",
")",
"{",
"return",
"isBlank",
"(",
"_str",
")",
"?",
"_default",
":",
"_str",
";",
"}"
] | Checks if given String is blank (see {@link #isBlank(String)}.<br>
If String is blank, the given default is returned, otherwise the String is returned.
@param _str string to check
@param _default default in case of blank string
@return _str or _default | [
"Checks",
"if",
"given",
"String",
"is",
"blank",
"(",
"see",
"{"
] | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/StringUtil.java#L345-L347 |
strator-dev/greenpepper | greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/velocity/ConfluenceGreenPepper.java | ConfluenceGreenPepper.getPageProperty | public String getPageProperty(String key, String identifier) {
"""
<p>getPageProperty.</p>
@param key a {@link java.lang.String} object.
@param identifier a {@link java.lang.String} object.
@return a {@link java.lang.String} object.
"""
Space space = getSpaceManager().getSpace(identifier);
... | java | public String getPageProperty(String key, String identifier) {
Space space = getSpaceManager().getSpace(identifier);
if (space == null)
return null;
ContentEntityObject entityObject = getContentEntityManager().getById(space.getHomePage().getId());
return getContentPropertyMa... | [
"public",
"String",
"getPageProperty",
"(",
"String",
"key",
",",
"String",
"identifier",
")",
"{",
"Space",
"space",
"=",
"getSpaceManager",
"(",
")",
".",
"getSpace",
"(",
"identifier",
")",
";",
"if",
"(",
"space",
"==",
"null",
")",
"return",
"null",
... | <p>getPageProperty.</p>
@param key a {@link java.lang.String} object.
@param identifier a {@link java.lang.String} object.
@return a {@link java.lang.String} object. | [
"<p",
">",
"getPageProperty",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/confluence/greenpepper-confluence-code/src/main/java/com/greenpepper/confluence/velocity/ConfluenceGreenPepper.java#L837-L844 |
JOML-CI/JOML | src/org/joml/Matrix4x3f.java | Matrix4x3f.rotationTowards | public Matrix4x3f rotationTowards(Vector3fc dir, Vector3fc up) {
"""
Set this matrix to a model transformation for a right-handed coordinate system,
that aligns the local <code>-z</code> axis with <code>dir</code>.
<p>
In order to apply the rotation transformation to a previous existing transformation,
use {@l... | java | public Matrix4x3f rotationTowards(Vector3fc dir, Vector3fc up) {
return rotationTowards(dir.x(), dir.y(), dir.z(), up.x(), up.y(), up.z());
} | [
"public",
"Matrix4x3f",
"rotationTowards",
"(",
"Vector3fc",
"dir",
",",
"Vector3fc",
"up",
")",
"{",
"return",
"rotationTowards",
"(",
"dir",
".",
"x",
"(",
")",
",",
"dir",
".",
"y",
"(",
")",
",",
"dir",
".",
"z",
"(",
")",
",",
"up",
".",
"x",
... | Set this matrix to a model transformation for a right-handed coordinate system,
that aligns the local <code>-z</code> axis with <code>dir</code>.
<p>
In order to apply the rotation transformation to a previous existing transformation,
use {@link #rotateTowards(float, float, float, float, float, float) rotateTowards}.
<... | [
"Set",
"this",
"matrix",
"to",
"a",
"model",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"that",
"aligns",
"the",
"local",
"<code",
">",
"-",
"z<",
"/",
"code",
">",
"axis",
"with",
"<code",
">",
"dir<",
"/",
"code",
"... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3f.java#L8786-L8788 |
openbase/jul | extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/MultiLanguageTextProcessor.java | MultiLanguageTextProcessor.addMultiLanguageText | public static MultiLanguageText.Builder addMultiLanguageText(final MultiLanguageText.Builder multiLanguageTextBuilder, final String languageCode, final String multiLanguageText) {
"""
Add a multiLanguageText to a multiLanguageTextBuilder by languageCode. If the multiLanguageText is already contained for the
langu... | java | public static MultiLanguageText.Builder addMultiLanguageText(final MultiLanguageText.Builder multiLanguageTextBuilder, final String languageCode, final String multiLanguageText) {
for (int i = 0; i < multiLanguageTextBuilder.getEntryCount(); i++) {
// found multiLanguageTexts for the entry key
... | [
"public",
"static",
"MultiLanguageText",
".",
"Builder",
"addMultiLanguageText",
"(",
"final",
"MultiLanguageText",
".",
"Builder",
"multiLanguageTextBuilder",
",",
"final",
"String",
"languageCode",
",",
"final",
"String",
"multiLanguageText",
")",
"{",
"for",
"(",
"... | Add a multiLanguageText to a multiLanguageTextBuilder by languageCode. If the multiLanguageText is already contained for the
language code nothing will be done. If the languageCode already exists and the multiLanguageText is not contained
it will be added to the end of the multiLanguageText list by this language code. ... | [
"Add",
"a",
"multiLanguageText",
"to",
"a",
"multiLanguageTextBuilder",
"by",
"languageCode",
".",
"If",
"the",
"multiLanguageText",
"is",
"already",
"contained",
"for",
"the",
"language",
"code",
"nothing",
"will",
"be",
"done",
".",
"If",
"the",
"languageCode",
... | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/MultiLanguageTextProcessor.java#L136-L154 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/db/TableSession.java | TableSession.cleanBuffer | public void cleanBuffer(BaseBuffer buffer, Record record) {
"""
Clean the buffer of fields that will change a field that has been modified by the client.
@param buffer The Vector buffer to clean.
@param record The target Record.
"""
Vector<Object> vector = (Vector)buffer.getPhysicalData();
in... | java | public void cleanBuffer(BaseBuffer buffer, Record record)
{
Vector<Object> vector = (Vector)buffer.getPhysicalData();
int iCurrentIndex = 0;
buffer.resetPosition(); // Start at the first field
int iFieldCount = record.getFieldCount(); // Number of fields to read in
for (int... | [
"public",
"void",
"cleanBuffer",
"(",
"BaseBuffer",
"buffer",
",",
"Record",
"record",
")",
"{",
"Vector",
"<",
"Object",
">",
"vector",
"=",
"(",
"Vector",
")",
"buffer",
".",
"getPhysicalData",
"(",
")",
";",
"int",
"iCurrentIndex",
"=",
"0",
";",
"buf... | Clean the buffer of fields that will change a field that has been modified by the client.
@param buffer The Vector buffer to clean.
@param record The target Record. | [
"Clean",
"the",
"buffer",
"of",
"fields",
"that",
"will",
"change",
"a",
"field",
"that",
"has",
"been",
"modified",
"by",
"the",
"client",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/db/TableSession.java#L926-L945 |
exoplatform/jcr | exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/UserHandlerImpl.java | UserHandlerImpl.preSave | private void preSave(User user, boolean isNew) throws Exception {
"""
Notifying listeners before user creation.
@param user
the user which is used in create operation
@param isNew
true, if we have a deal with new user, otherwise it is false
which mean update operation is in progress
@throws Exception
if a... | java | private void preSave(User user, boolean isNew) throws Exception
{
for (UserEventListener listener : listeners)
{
listener.preSave(user, isNew);
}
} | [
"private",
"void",
"preSave",
"(",
"User",
"user",
",",
"boolean",
"isNew",
")",
"throws",
"Exception",
"{",
"for",
"(",
"UserEventListener",
"listener",
":",
"listeners",
")",
"{",
"listener",
".",
"preSave",
"(",
"user",
",",
"isNew",
")",
";",
"}",
"}... | Notifying listeners before user creation.
@param user
the user which is used in create operation
@param isNew
true, if we have a deal with new user, otherwise it is false
which mean update operation is in progress
@throws Exception
if any listener failed to handle the event | [
"Notifying",
"listeners",
"before",
"user",
"creation",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.ext.services/src/main/java/org/exoplatform/services/jcr/ext/organization/UserHandlerImpl.java#L651-L657 |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java | XMLUtil.getAttributeLongWithDefault | @Pure
public static Long getAttributeLongWithDefault(Node document, boolean caseSensitive, Long defaultValue, String... path) {
"""
Replies the long value that corresponds to the specified attribute's path.
<p>The path is an ordered list of tag's names and ended by the name of
the attribute.
@param documen... | java | @Pure
public static Long getAttributeLongWithDefault(Node document, boolean caseSensitive, Long defaultValue, String... path) {
assert document != null : AssertMessages.notNullParameter(0);
final String v = getAttributeValue(document, caseSensitive, 0, path);
if (v != null) {
try {
return Long.parseLong(v... | [
"@",
"Pure",
"public",
"static",
"Long",
"getAttributeLongWithDefault",
"(",
"Node",
"document",
",",
"boolean",
"caseSensitive",
",",
"Long",
"defaultValue",
",",
"String",
"...",
"path",
")",
"{",
"assert",
"document",
"!=",
"null",
":",
"AssertMessages",
".",... | Replies the long value that corresponds to the specified attribute's path.
<p>The path is an ordered list of tag's names and ended by the name of
the attribute.
@param document is the XML document to explore.
@param caseSensitive indicates of the {@code path}'s components are case sensitive.
@param defaultValue is th... | [
"Replies",
"the",
"long",
"value",
"that",
"corresponds",
"to",
"the",
"specified",
"attribute",
"s",
"path",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L920-L932 |
ef-labs/vertx-jersey | vertx-jersey/src/main/java/com/englishtown/vertx/guice/GuiceJerseyServer.java | GuiceJerseyServer.injectMultibindings | protected void injectMultibindings(ServiceLocator locator, Injector injector) {
"""
This is a workaround for the hk2 bridge limitations
@param locator the HK2 locator
@param injector the Guice injector
"""
injectMultiBindings(locator, injector, new Key<Set<ContainerRequestFilter>>() {
}, ... | java | protected void injectMultibindings(ServiceLocator locator, Injector injector) {
injectMultiBindings(locator, injector, new Key<Set<ContainerRequestFilter>>() {
}, ContainerRequestFilter.class);
injectMultiBindings(locator, injector, new Key<Set<ContainerResponseFilter>>() {
}, Container... | [
"protected",
"void",
"injectMultibindings",
"(",
"ServiceLocator",
"locator",
",",
"Injector",
"injector",
")",
"{",
"injectMultiBindings",
"(",
"locator",
",",
"injector",
",",
"new",
"Key",
"<",
"Set",
"<",
"ContainerRequestFilter",
">",
">",
"(",
")",
"{",
... | This is a workaround for the hk2 bridge limitations
@param locator the HK2 locator
@param injector the Guice injector | [
"This",
"is",
"a",
"workaround",
"for",
"the",
"hk2",
"bridge",
"limitations"
] | train | https://github.com/ef-labs/vertx-jersey/blob/733482a8a5afb1fb257c682b3767655e56f7a0fe/vertx-jersey/src/main/java/com/englishtown/vertx/guice/GuiceJerseyServer.java#L74-L93 |
dkmfbk/knowledgestore | ks-server-hbase/src/main/java/eu/fbk/knowledgestore/datastore/hbase/utils/HBaseUtils.java | HBaseUtils.createDelete | @Override
public Delete createDelete(URI id, String tableName) throws IOException {
"""
Creates deletes for HBase tables
@param record
@param tableName
@param conf
@return
@throws IOException
"""
Delete del = null;
HTable hTable = getTable(tableName);
if (hTable != null) {
... | java | @Override
public Delete createDelete(URI id, String tableName) throws IOException {
Delete del = null;
HTable hTable = getTable(tableName);
if (hTable != null) {
del = new Delete(Bytes.toBytes(id.toString()));
}
return del;
} | [
"@",
"Override",
"public",
"Delete",
"createDelete",
"(",
"URI",
"id",
",",
"String",
"tableName",
")",
"throws",
"IOException",
"{",
"Delete",
"del",
"=",
"null",
";",
"HTable",
"hTable",
"=",
"getTable",
"(",
"tableName",
")",
";",
"if",
"(",
"hTable",
... | Creates deletes for HBase tables
@param record
@param tableName
@param conf
@return
@throws IOException | [
"Creates",
"deletes",
"for",
"HBase",
"tables"
] | train | https://github.com/dkmfbk/knowledgestore/blob/a548101b1dd67fcf72a1ec6f838ea7539bdbbe7a/ks-server-hbase/src/main/java/eu/fbk/knowledgestore/datastore/hbase/utils/HBaseUtils.java#L210-L218 |
GenesysPureEngage/provisioning-client-java | src/main/java/com/genesys/internal/provisioning/api/NotificationsApi.java | NotificationsApi.connectWithHttpInfo | public ApiResponse<Void> connectWithHttpInfo() throws ApiException {
"""
CometD connect
CometD connect, see https://docs.cometd.org/current/reference/#_bayeux_meta_connect
@return ApiResponse<Void>
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
... | java | public ApiResponse<Void> connectWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = connectValidateBeforeCall(null, null);
return apiClient.execute(call);
} | [
"public",
"ApiResponse",
"<",
"Void",
">",
"connectWithHttpInfo",
"(",
")",
"throws",
"ApiException",
"{",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"call",
"=",
"connectValidateBeforeCall",
"(",
"null",
",",
"null",
")",
";",
"return",
"apiClient",
... | CometD connect
CometD connect, see https://docs.cometd.org/current/reference/#_bayeux_meta_connect
@return ApiResponse<Void>
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"CometD",
"connect",
"CometD",
"connect",
"see",
"https",
":",
"//",
"docs",
".",
"cometd",
".",
"org",
"/",
"current",
"/",
"reference",
"/",
"#_bayeux_meta_connect"
] | train | https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/internal/provisioning/api/NotificationsApi.java#L128-L131 |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/validation/InvalidVertexIdsValidator.java | InvalidVertexIdsValidator.validate | @Override
public boolean validate(Graph<K, VV, EV> graph) throws Exception {
"""
Checks that the edge set input contains valid vertex Ids, i.e. that they
also exist in the vertex input set.
@return a boolean stating whether a graph is valid
with respect to its vertex ids.
"""
DataSet<Tuple1<K>> edgeIds... | java | @Override
public boolean validate(Graph<K, VV, EV> graph) throws Exception {
DataSet<Tuple1<K>> edgeIds = graph.getEdges()
.flatMap(new MapEdgeIds<>()).distinct();
DataSet<K> invalidIds = graph.getVertices().coGroup(edgeIds).where(0)
.equalTo(0).with(new GroupInvalidIds<>()).first(1);
return invalidIds.... | [
"@",
"Override",
"public",
"boolean",
"validate",
"(",
"Graph",
"<",
"K",
",",
"VV",
",",
"EV",
">",
"graph",
")",
"throws",
"Exception",
"{",
"DataSet",
"<",
"Tuple1",
"<",
"K",
">>",
"edgeIds",
"=",
"graph",
".",
"getEdges",
"(",
")",
".",
"flatMap... | Checks that the edge set input contains valid vertex Ids, i.e. that they
also exist in the vertex input set.
@return a boolean stating whether a graph is valid
with respect to its vertex ids. | [
"Checks",
"that",
"the",
"edge",
"set",
"input",
"contains",
"valid",
"vertex",
"Ids",
"i",
".",
"e",
".",
"that",
"they",
"also",
"exist",
"in",
"the",
"vertex",
"input",
"set",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/validation/InvalidVertexIdsValidator.java#L48-L56 |
intellimate/Izou | src/main/java/org/intellimate/izou/system/sound/replaced/MixerAspect.java | MixerAspect.getAndRegisterLine | static Line getAndRegisterLine(Line line) {
"""
creates the appropriate IzouSoundLine if the request originates from an AddOn.
@param line the line
@return an IzouSoundLine if an addon requested the line
"""
AddOnModel addOnModel;
Optional<AddOnModel> addOnModelForClassLoader = main.getSecuri... | java | static Line getAndRegisterLine(Line line) {
AddOnModel addOnModel;
Optional<AddOnModel> addOnModelForClassLoader = main.getSecurityManager().getAddOnModelForClassLoader();
if (!addOnModelForClassLoader.isPresent()) {
logger.debug("the SoundManager will not manage this line, obtained ... | [
"static",
"Line",
"getAndRegisterLine",
"(",
"Line",
"line",
")",
"{",
"AddOnModel",
"addOnModel",
";",
"Optional",
"<",
"AddOnModel",
">",
"addOnModelForClassLoader",
"=",
"main",
".",
"getSecurityManager",
"(",
")",
".",
"getAddOnModelForClassLoader",
"(",
")",
... | creates the appropriate IzouSoundLine if the request originates from an AddOn.
@param line the line
@return an IzouSoundLine if an addon requested the line | [
"creates",
"the",
"appropriate",
"IzouSoundLine",
"if",
"the",
"request",
"originates",
"from",
"an",
"AddOn",
"."
] | train | https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/system/sound/replaced/MixerAspect.java#L37-L63 |
dhemery/hartley | src/main/java/com/dhemery/expressing/Expressive.java | Expressive.assertThat | public <S,V> void assertThat(S subject, Feature<? super S, V> feature, Ticker ticker, Matcher<? super V> criteria) {
"""
Assert that a polled sample of the feature satisfies the criteria.
<p>Example:</p>
<pre>
{@code
Page searchResultsPage = ...;
Feature<Page,Boolean> resultCount() { ... }
Ticker withinTen... | java | public <S,V> void assertThat(S subject, Feature<? super S, V> feature, Ticker ticker, Matcher<? super V> criteria) {
assertThat(sampled(subject, feature), ticker, criteria);
} | [
"public",
"<",
"S",
",",
"V",
">",
"void",
"assertThat",
"(",
"S",
"subject",
",",
"Feature",
"<",
"?",
"super",
"S",
",",
"V",
">",
"feature",
",",
"Ticker",
"ticker",
",",
"Matcher",
"<",
"?",
"super",
"V",
">",
"criteria",
")",
"{",
"assertThat"... | Assert that a polled sample of the feature satisfies the criteria.
<p>Example:</p>
<pre>
{@code
Page searchResultsPage = ...;
Feature<Page,Boolean> resultCount() { ... }
Ticker withinTenSeconds = ...;
...
assertThat(searchResultsPage, resultCount(), withinTenSeconds, is(greaterThan(9)));
} | [
"Assert",
"that",
"a",
"polled",
"sample",
"of",
"the",
"feature",
"satisfies",
"the",
"criteria",
".",
"<p",
">",
"Example",
":",
"<",
"/",
"p",
">",
"<pre",
">",
"{",
"@code"
] | train | https://github.com/dhemery/hartley/blob/7754bd6bc12695f2249601b8890da530a61fcf33/src/main/java/com/dhemery/expressing/Expressive.java#L95-L97 |
mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java | DatabaseUtils.concatenateWhere | public static String concatenateWhere(String a, String b) {
"""
Concatenates two SQL WHERE clauses, handling empty or null values.
"""
if (TextUtils.isEmpty(a)) {
return b;
}
if (TextUtils.isEmpty(b)) {
return a;
}
return "(" + a + ") AND (" + b ... | java | public static String concatenateWhere(String a, String b) {
if (TextUtils.isEmpty(a)) {
return b;
}
if (TextUtils.isEmpty(b)) {
return a;
}
return "(" + a + ") AND (" + b + ")";
} | [
"public",
"static",
"String",
"concatenateWhere",
"(",
"String",
"a",
",",
"String",
"b",
")",
"{",
"if",
"(",
"TextUtils",
".",
"isEmpty",
"(",
"a",
")",
")",
"{",
"return",
"b",
";",
"}",
"if",
"(",
"TextUtils",
".",
"isEmpty",
"(",
"b",
")",
")"... | Concatenates two SQL WHERE clauses, handling empty or null values. | [
"Concatenates",
"two",
"SQL",
"WHERE",
"clauses",
"handling",
"empty",
"or",
"null",
"values",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/DatabaseUtils.java#L391-L400 |
tvesalainen/util | util/src/main/java/org/vesalainen/ui/AbstractView.java | AbstractView.updatePoint | public void updatePoint(double x, double y) {
"""
Updates the limits if point is not inside visible screen.
@param x
@param y
"""
userBounds.add(x, y);
transform.transform(x, y, transformedUserBounds::add);
} | java | public void updatePoint(double x, double y)
{
userBounds.add(x, y);
transform.transform(x, y, transformedUserBounds::add);
} | [
"public",
"void",
"updatePoint",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"userBounds",
".",
"add",
"(",
"x",
",",
"y",
")",
";",
"transform",
".",
"transform",
"(",
"x",
",",
"y",
",",
"transformedUserBounds",
"::",
"add",
")",
";",
"}"
] | Updates the limits if point is not inside visible screen.
@param x
@param y | [
"Updates",
"the",
"limits",
"if",
"point",
"is",
"not",
"inside",
"visible",
"screen",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/ui/AbstractView.java#L99-L103 |
shinesolutions/swagger-aem | java/generated/src/main/java/com/shinesolutions/swaggeraem4j/api/SlingApi.java | SlingApi.deleteNodeAsync | public com.squareup.okhttp.Call deleteNodeAsync(String path, String name, final ApiCallback<Void> callback) throws ApiException {
"""
(asynchronously)
@param path (required)
@param name (required)
@param callback The callback to be executed when the API call finishes
@return The request call
@throws ApiEx... | java | public com.squareup.okhttp.Call deleteNodeAsync(String path, String name, final ApiCallback<Void> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != null) {
... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"deleteNodeAsync",
"(",
"String",
"path",
",",
"String",
"name",
",",
"final",
"ApiCallback",
"<",
"Void",
">",
"callback",
")",
"throws",
"ApiException",
"{",
"ProgressResponseBody",
".",
"Progress... | (asynchronously)
@param path (required)
@param name (required)
@param callback The callback to be executed when the API call finishes
@return The request call
@throws ApiException If fail to process the API call, e.g. serializing the request body object | [
"(",
"asynchronously",
")"
] | train | https://github.com/shinesolutions/swagger-aem/blob/ae7da4df93e817dc2bad843779b2069d9c4e7c6b/java/generated/src/main/java/com/shinesolutions/swaggeraem4j/api/SlingApi.java#L301-L325 |
apache/groovy | src/main/java/org/codehaus/groovy/syntax/Token.java | Token.newSymbol | public static Token newSymbol(int type, int startLine, int startColumn) {
"""
Creates a token that represents a symbol, using a library for the text.
"""
return new Token(type, Types.getText(type), startLine, startColumn);
} | java | public static Token newSymbol(int type, int startLine, int startColumn) {
return new Token(type, Types.getText(type), startLine, startColumn);
} | [
"public",
"static",
"Token",
"newSymbol",
"(",
"int",
"type",
",",
"int",
"startLine",
",",
"int",
"startColumn",
")",
"{",
"return",
"new",
"Token",
"(",
"type",
",",
"Types",
".",
"getText",
"(",
"type",
")",
",",
"startLine",
",",
"startColumn",
")",
... | Creates a token that represents a symbol, using a library for the text. | [
"Creates",
"a",
"token",
"that",
"represents",
"a",
"symbol",
"using",
"a",
"library",
"for",
"the",
"text",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/syntax/Token.java#L261-L263 |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java | BusItinerary.getNearestBusHalt | @Pure
public BusItineraryHalt getNearestBusHalt(double x, double y) {
"""
Replies the nearest bus halt to the given point.
@param x x coordinate.
@param y y coordinate.
@return the nearest bus halt or <code>null</code> if none was found.
"""
double distance = Double.POSITIVE_INFINITY;
BusItineraryHal... | java | @Pure
public BusItineraryHalt getNearestBusHalt(double x, double y) {
double distance = Double.POSITIVE_INFINITY;
BusItineraryHalt besthalt = null;
double dist;
for (final BusItineraryHalt halt : this.validHalts) {
dist = halt.distance(x, y);
if (dist < distance) {
distance = dist;
besthalt = ha... | [
"@",
"Pure",
"public",
"BusItineraryHalt",
"getNearestBusHalt",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"double",
"distance",
"=",
"Double",
".",
"POSITIVE_INFINITY",
";",
"BusItineraryHalt",
"besthalt",
"=",
"null",
";",
"double",
"dist",
";",
"for"... | Replies the nearest bus halt to the given point.
@param x x coordinate.
@param y y coordinate.
@return the nearest bus halt or <code>null</code> if none was found. | [
"Replies",
"the",
"nearest",
"bus",
"halt",
"to",
"the",
"given",
"point",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java#L1029-L1044 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.