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 |
|---|---|---|---|---|---|---|---|---|---|---|
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java | WaveformFinder.getWaveformPreview | WaveformPreview getWaveformPreview(int rekordboxId, SlotReference slot, Client client)
throws IOException {
"""
Requests the waveform preview for a specific track ID, given a connection to a player that has already been
set up.
@param rekordboxId the track whose waveform preview is desired
@param ... | java | WaveformPreview getWaveformPreview(int rekordboxId, SlotReference slot, Client client)
throws IOException {
final NumberField idField = new NumberField(rekordboxId);
// First try to get the NXS2-style color waveform if we are supposed to.
if (preferColor.get()) {
try {
... | [
"WaveformPreview",
"getWaveformPreview",
"(",
"int",
"rekordboxId",
",",
"SlotReference",
"slot",
",",
"Client",
"client",
")",
"throws",
"IOException",
"{",
"final",
"NumberField",
"idField",
"=",
"new",
"NumberField",
"(",
"rekordboxId",
")",
";",
"// First try to... | Requests the waveform preview for a specific track ID, given a connection to a player that has already been
set up.
@param rekordboxId the track whose waveform preview is desired
@param slot identifies the media slot we are querying
@param client the dbserver client that is communicating with the appropriate player
@... | [
"Requests",
"the",
"waveform",
"preview",
"for",
"a",
"specific",
"track",
"ID",
"given",
"a",
"connection",
"to",
"a",
"player",
"that",
"has",
"already",
"been",
"set",
"up",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformFinder.java#L480-L502 |
dvdme/forecastio-lib-java | src/com/github/dvdme/ForecastIOLib/ForecastIO.java | ForecastIO.getForecast | public boolean getForecast(String LATITUDE, String LONGITUDE) {
"""
Gets the forecast reports for the given coordinates with the set options
@param LATITUDE the geographical latitude
@param LONGITUDE the geographical longitude
@return True if successful
"""
try {
String reply = httpGET( urlBuilder(LA... | java | public boolean getForecast(String LATITUDE, String LONGITUDE) {
try {
String reply = httpGET( urlBuilder(LATITUDE, LONGITUDE) );
if(reply == null)
return false;
this.forecast = Json.parse(reply).asObject();
//this.forecast = JsonObject.readFrom(reply);
} catch (NullPointerException e) {
System.... | [
"public",
"boolean",
"getForecast",
"(",
"String",
"LATITUDE",
",",
"String",
"LONGITUDE",
")",
"{",
"try",
"{",
"String",
"reply",
"=",
"httpGET",
"(",
"urlBuilder",
"(",
"LATITUDE",
",",
"LONGITUDE",
")",
")",
";",
"if",
"(",
"reply",
"==",
"null",
")"... | Gets the forecast reports for the given coordinates with the set options
@param LATITUDE the geographical latitude
@param LONGITUDE the geographical longitude
@return True if successful | [
"Gets",
"the",
"forecast",
"reports",
"for",
"the",
"given",
"coordinates",
"with",
"the",
"set",
"options"
] | train | https://github.com/dvdme/forecastio-lib-java/blob/63c0ff17446eb7eb4e9f8bef4e19272f14c74e85/src/com/github/dvdme/ForecastIOLib/ForecastIO.java#L555-L572 |
micronaut-projects/micronaut-core | http-server-netty/src/main/java/io/micronaut/http/server/netty/NettyHttpResponseFactory.java | NettyHttpResponseFactory.getOrCreate | @Internal
public static NettyMutableHttpResponse getOrCreate(NettyHttpRequest<?> request) {
"""
Lookup the response from the context.
@param request The context
@return The {@link NettyMutableHttpResponse}
"""
return getOr(request, io.micronaut.http.HttpResponse.ok());
} | java | @Internal
public static NettyMutableHttpResponse getOrCreate(NettyHttpRequest<?> request) {
return getOr(request, io.micronaut.http.HttpResponse.ok());
} | [
"@",
"Internal",
"public",
"static",
"NettyMutableHttpResponse",
"getOrCreate",
"(",
"NettyHttpRequest",
"<",
"?",
">",
"request",
")",
"{",
"return",
"getOr",
"(",
"request",
",",
"io",
".",
"micronaut",
".",
"http",
".",
"HttpResponse",
".",
"ok",
"(",
")"... | Lookup the response from the context.
@param request The context
@return The {@link NettyMutableHttpResponse} | [
"Lookup",
"the",
"response",
"from",
"the",
"context",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/http-server-netty/src/main/java/io/micronaut/http/server/netty/NettyHttpResponseFactory.java#L77-L80 |
maguro/aunit | junit/src/main/java/com/toolazydogs/aunit/internal/Util.java | Util.validateIsStatic | @SuppressWarnings( {
"""
Validate that a method is static.
@param method the method to be tested
@param errors a list to place the errors
""""ThrowableInstanceNeverThrown"})
public static void validateIsStatic(Method method, List<Throwable> errors)
{
if (!Modifier.isStatic(method.getModifie... | java | @SuppressWarnings({"ThrowableInstanceNeverThrown"})
public static void validateIsStatic(Method method, List<Throwable> errors)
{
if (!Modifier.isStatic(method.getModifiers()))
{
errors.add(new Exception("Method " + method.getName() + "() should be static"));
}
if (!Mo... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"ThrowableInstanceNeverThrown\"",
"}",
")",
"public",
"static",
"void",
"validateIsStatic",
"(",
"Method",
"method",
",",
"List",
"<",
"Throwable",
">",
"errors",
")",
"{",
"if",
"(",
"!",
"Modifier",
".",
"isStatic",
"(",
... | Validate that a method is static.
@param method the method to be tested
@param errors a list to place the errors | [
"Validate",
"that",
"a",
"method",
"is",
"static",
"."
] | train | https://github.com/maguro/aunit/blob/1f972e35b28327e5e2e7881befc928df0546d74c/junit/src/main/java/com/toolazydogs/aunit/internal/Util.java#L85-L96 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksInner.java | WebhooksInner.beginUpdateAsync | public Observable<WebhookInner> beginUpdateAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) {
"""
Updates a webhook with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belo... | java | public Observable<WebhookInner> beginUpdateAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).map(new Func1<ServiceResponse<W... | [
"public",
"Observable",
"<",
"WebhookInner",
">",
"beginUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"webhookName",
",",
"WebhookUpdateParameters",
"webhookUpdateParameters",
")",
"{",
"return",
"beginUpdateWithServiceRespo... | Updates a webhook with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param webhookName The name of the webhook.
@param webhookUpdateParameters The parameters for updating a webhook.
@th... | [
"Updates",
"a",
"webhook",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/WebhooksInner.java#L683-L690 |
CodeNarc/CodeNarc | src/main/java/org/codenarc/util/AstUtil.java | AstUtil.hasAnnotation | public static boolean hasAnnotation(AnnotatedNode node, String name) {
"""
Return true only if the node has the named annotation
@param node - the AST Node to check
@param name - the name of the annotation
@return true only if the node has the named annotation
"""
return AstUtil.getAnnotation(node,... | java | public static boolean hasAnnotation(AnnotatedNode node, String name) {
return AstUtil.getAnnotation(node, name) != null;
} | [
"public",
"static",
"boolean",
"hasAnnotation",
"(",
"AnnotatedNode",
"node",
",",
"String",
"name",
")",
"{",
"return",
"AstUtil",
".",
"getAnnotation",
"(",
"node",
",",
"name",
")",
"!=",
"null",
";",
"}"
] | Return true only if the node has the named annotation
@param node - the AST Node to check
@param name - the name of the annotation
@return true only if the node has the named annotation | [
"Return",
"true",
"only",
"if",
"the",
"node",
"has",
"the",
"named",
"annotation"
] | train | https://github.com/CodeNarc/CodeNarc/blob/9a7cec02cb8cbaf845030f2434309e8968f5d7a7/src/main/java/org/codenarc/util/AstUtil.java#L489-L491 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java | AtlasEntityStoreV1.validateEntityAssociations | private void validateEntityAssociations(String guid, List<AtlasClassification> classifications) throws AtlasBaseException {
"""
Validate if classification is not already associated with the entities
@param guid unique entity id
@param classifications list of classifications to be associated
"""
... | java | private void validateEntityAssociations(String guid, List<AtlasClassification> classifications) throws AtlasBaseException {
List<String> entityClassifications = getClassificationNames(guid);
for (AtlasClassification classification : classifications) {
String newClassification = classificati... | [
"private",
"void",
"validateEntityAssociations",
"(",
"String",
"guid",
",",
"List",
"<",
"AtlasClassification",
">",
"classifications",
")",
"throws",
"AtlasBaseException",
"{",
"List",
"<",
"String",
">",
"entityClassifications",
"=",
"getClassificationNames",
"(",
... | Validate if classification is not already associated with the entities
@param guid unique entity id
@param classifications list of classifications to be associated | [
"Validate",
"if",
"classification",
"is",
"not",
"already",
"associated",
"with",
"the",
"entities"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java#L726-L737 |
tvesalainen/util | util/src/main/java/org/vesalainen/math/Polygon.java | Polygon.isVertex | boolean isVertex(double x, double y) {
"""
Returns true if given point is vertex.
<p>This is mainly for testing!
@param x
@param y
@return
"""
int cnt = points.numRows;
double[] d = points.data;
for (int ii=0;ii<cnt;ii++)
{
if (x == d[2*ii] && y== d[2*ii+1])... | java | boolean isVertex(double x, double y)
{
int cnt = points.numRows;
double[] d = points.data;
for (int ii=0;ii<cnt;ii++)
{
if (x == d[2*ii] && y== d[2*ii+1])
{
return true;
}
}
return false;
} | [
"boolean",
"isVertex",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"int",
"cnt",
"=",
"points",
".",
"numRows",
";",
"double",
"[",
"]",
"d",
"=",
"points",
".",
"data",
";",
"for",
"(",
"int",
"ii",
"=",
"0",
";",
"ii",
"<",
"cnt",
";",
... | Returns true if given point is vertex.
<p>This is mainly for testing!
@param x
@param y
@return | [
"Returns",
"true",
"if",
"given",
"point",
"is",
"vertex",
".",
"<p",
">",
"This",
"is",
"mainly",
"for",
"testing!"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/Polygon.java#L123-L135 |
ziccardi/jnrpe | jnrpe-plugins/src/main/java/it/jnrpe/plugin/CheckHttp.java | CheckHttp.checkRedirectResponse | private String checkRedirectResponse(final URL url, final String method, final Integer timeout, final Properties props, final String postData,
final String redirect, final boolean ignoreBody, final List<Metric> metrics) throws Exception {
"""
Apply the logic to check for url redirects.
@param url
-... | java | private String checkRedirectResponse(final URL url, final String method, final Integer timeout, final Properties props, final String postData,
final String redirect, final boolean ignoreBody, final List<Metric> metrics) throws Exception {
// @todo handle sticky/port and follow param options
... | [
"private",
"String",
"checkRedirectResponse",
"(",
"final",
"URL",
"url",
",",
"final",
"String",
"method",
",",
"final",
"Integer",
"timeout",
",",
"final",
"Properties",
"props",
",",
"final",
"String",
"postData",
",",
"final",
"String",
"redirect",
",",
"f... | Apply the logic to check for url redirects.
@param url
- The server URL
@param method
- The HTTP method
@param timeout
- The timeout
@param props
-
@param postData
-
@param redirect
-
@param ignoreBody
-
@param metrics
- This list will be filled with the gathered metrics
@return String
@throws Exception
- | [
"Apply",
"the",
"logic",
"to",
"check",
"for",
"url",
"redirects",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-plugins/src/main/java/it/jnrpe/plugin/CheckHttp.java#L307-L328 |
javers/javers | javers-core/src/main/java/org/javers/core/metamodel/type/ManagedClass.java | ManagedClass.getProperty | JaversProperty getProperty(String withName) {
"""
finds property by name (managed or withTransientAnn)
@throws JaversException PROPERTY_NOT_FOUND
"""
Validate.argumentIsNotNull(withName);
if (!propertiesByName.containsKey(withName)){
throw new JaversException(PROPERTY_NOT_FOUND, ... | java | JaversProperty getProperty(String withName) {
Validate.argumentIsNotNull(withName);
if (!propertiesByName.containsKey(withName)){
throw new JaversException(PROPERTY_NOT_FOUND, withName, baseJavaClass.getName());
}
return propertiesByName.get(withName);
} | [
"JaversProperty",
"getProperty",
"(",
"String",
"withName",
")",
"{",
"Validate",
".",
"argumentIsNotNull",
"(",
"withName",
")",
";",
"if",
"(",
"!",
"propertiesByName",
".",
"containsKey",
"(",
"withName",
")",
")",
"{",
"throw",
"new",
"JaversException",
"(... | finds property by name (managed or withTransientAnn)
@throws JaversException PROPERTY_NOT_FOUND | [
"finds",
"property",
"by",
"name",
"(",
"managed",
"or",
"withTransientAnn",
")"
] | train | https://github.com/javers/javers/blob/a51511be7d8bcee3e1812db8b7e69a45330b4e14/javers-core/src/main/java/org/javers/core/metamodel/type/ManagedClass.java#L80-L86 |
dashorst/wicket-stuff-markup-validator | isorelax/src/main/java/org/iso_relax/verifier/VerifierFactory.java | VerifierFactory.newVerifier | public Verifier newVerifier(InputStream stream, String systemId )
throws VerifierConfigurationException, SAXException, IOException {
"""
parses a schema from the specified InputStream and returns a Verifier object
that validates documents by using that schema.
@param systemId
System ID of this stream.
... | java | public Verifier newVerifier(InputStream stream, String systemId )
throws VerifierConfigurationException, SAXException, IOException {
return compileSchema(stream,systemId).newVerifier();
} | [
"public",
"Verifier",
"newVerifier",
"(",
"InputStream",
"stream",
",",
"String",
"systemId",
")",
"throws",
"VerifierConfigurationException",
",",
"SAXException",
",",
"IOException",
"{",
"return",
"compileSchema",
"(",
"stream",
",",
"systemId",
")",
".",
"newVeri... | parses a schema from the specified InputStream and returns a Verifier object
that validates documents by using that schema.
@param systemId
System ID of this stream. | [
"parses",
"a",
"schema",
"from",
"the",
"specified",
"InputStream",
"and",
"returns",
"a",
"Verifier",
"object",
"that",
"validates",
"documents",
"by",
"using",
"that",
"schema",
"."
] | train | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/isorelax/src/main/java/org/iso_relax/verifier/VerifierFactory.java#L77-L81 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java | Text.implode | public static String implode(String[] arr, String delim) {
"""
Concatenates all strings in the string array using the specified delimiter.
@param arr
@param delim
@return the concatenated string
"""
StringBuilder buf = new StringBuilder();
for (int i = 0; i < arr.length; i++)
{
... | java | public static String implode(String[] arr, String delim)
{
StringBuilder buf = new StringBuilder();
for (int i = 0; i < arr.length; i++)
{
if (i > 0)
{
buf.append(delim);
}
buf.append(arr[i]);
}
return buf.toString();
} | [
"public",
"static",
"String",
"implode",
"(",
"String",
"[",
"]",
"arr",
",",
"String",
"delim",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"arr",
".",
"length",
";... | Concatenates all strings in the string array using the specified delimiter.
@param arr
@param delim
@return the concatenated string | [
"Concatenates",
"all",
"strings",
"in",
"the",
"string",
"array",
"using",
"the",
"specified",
"delimiter",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/Text.java#L206-L218 |
hazelcast/hazelcast | hazelcast-client/src/main/java/com/hazelcast/client/util/ClientStateListener.java | ClientStateListener.awaitConnected | public boolean awaitConnected(long timeout, TimeUnit unit)
throws InterruptedException {
"""
Waits until the client is connected to cluster or the timeout expires.
Does not wait if the client is already shutting down or shutdown.
@param timeout the maximum time to wait
@param unit the time unit... | java | public boolean awaitConnected(long timeout, TimeUnit unit)
throws InterruptedException {
lock.lock();
try {
if (currentState.equals(CLIENT_CONNECTED)) {
return true;
}
if (currentState.equals(SHUTTING_DOWN) || currentState.equals(SHUTDOWN)... | [
"public",
"boolean",
"awaitConnected",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"currentState",
".",
"equals",
"(",
"CLIENT_CONNECTED",
")",
")",
... | Waits until the client is connected to cluster or the timeout expires.
Does not wait if the client is already shutting down or shutdown.
@param timeout the maximum time to wait
@param unit the time unit of the {@code timeout} argument
@return true if the client is connected to the cluster. On returning false,
you c... | [
"Waits",
"until",
"the",
"client",
"is",
"connected",
"to",
"cluster",
"or",
"the",
"timeout",
"expires",
".",
"Does",
"not",
"wait",
"if",
"the",
"client",
"is",
"already",
"shutting",
"down",
"or",
"shutdown",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast-client/src/main/java/com/hazelcast/client/util/ClientStateListener.java#L88-L113 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobStepsInner.java | JobStepsInner.createOrUpdate | public JobStepInner createOrUpdate(String resourceGroupName, String serverName, String jobAgentName, String jobName, String stepName, JobStepInner parameters) {
"""
Creates or updates a job step. This will implicitly create a new job version.
@param resourceGroupName The name of the resource group that contains... | java | public JobStepInner createOrUpdate(String resourceGroupName, String serverName, String jobAgentName, String jobName, String stepName, JobStepInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, jobAgentName, jobName, stepName, parameters).toBlocking().single().body();... | [
"public",
"JobStepInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"jobAgentName",
",",
"String",
"jobName",
",",
"String",
"stepName",
",",
"JobStepInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithS... | Creates or updates a job step. This will implicitly create a new job version.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param jobAgentName The name of the jo... | [
"Creates",
"or",
"updates",
"a",
"job",
"step",
".",
"This",
"will",
"implicitly",
"create",
"a",
"new",
"job",
"version",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobStepsInner.java#L613-L615 |
apereo/cas | core/cas-server-core-logout-api/src/main/java/org/apereo/cas/logout/slo/BaseSingleLogoutServiceMessageHandler.java | BaseSingleLogoutServiceMessageHandler.getLogoutHttpMessageToSend | protected LogoutHttpMessage getLogoutHttpMessageToSend(final SingleLogoutRequest request, final SingleLogoutMessage logoutMessage) {
"""
Gets logout http message to send.
@param request the request
@param logoutMessage the logout message
@return the logout http message to send
"""
return new... | java | protected LogoutHttpMessage getLogoutHttpMessageToSend(final SingleLogoutRequest request, final SingleLogoutMessage logoutMessage) {
return new LogoutHttpMessage(request.getLogoutUrl(), logoutMessage.getPayload(), this.asynchronous);
} | [
"protected",
"LogoutHttpMessage",
"getLogoutHttpMessageToSend",
"(",
"final",
"SingleLogoutRequest",
"request",
",",
"final",
"SingleLogoutMessage",
"logoutMessage",
")",
"{",
"return",
"new",
"LogoutHttpMessage",
"(",
"request",
".",
"getLogoutUrl",
"(",
")",
",",
"log... | Gets logout http message to send.
@param request the request
@param logoutMessage the logout message
@return the logout http message to send | [
"Gets",
"logout",
"http",
"message",
"to",
"send",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-logout-api/src/main/java/org/apereo/cas/logout/slo/BaseSingleLogoutServiceMessageHandler.java#L204-L206 |
pravega/pravega | controller/src/main/java/io/pravega/controller/server/SegmentHelper.java | SegmentHelper.createTableSegment | public CompletableFuture<Boolean> createTableSegment(final String tableName,
String delegationToken,
final long clientRequestId) {
"""
This method sends a WireCommand to create a table segment.
@par... | java | public CompletableFuture<Boolean> createTableSegment(final String tableName,
String delegationToken,
final long clientRequestId) {
final CompletableFuture<Boolean> result = new CompletableFuture<>()... | [
"public",
"CompletableFuture",
"<",
"Boolean",
">",
"createTableSegment",
"(",
"final",
"String",
"tableName",
",",
"String",
"delegationToken",
",",
"final",
"long",
"clientRequestId",
")",
"{",
"final",
"CompletableFuture",
"<",
"Boolean",
">",
"result",
"=",
"n... | This method sends a WireCommand to create a table segment.
@param tableName Qualified table name.
@param delegationToken The token to be presented to the segmentstore.
@param clientRequestId Request id.
@return A CompletableFuture that, when completed normally, will indicate the table segment creatio... | [
"This",
"method",
"sends",
"a",
"WireCommand",
"to",
"create",
"a",
"table",
"segment",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/SegmentHelper.java#L632-L683 |
rwl/CSparseJ | src/main/java/edu/emory/mathcs/csparsej/tfloat/Scs_schol.java | Scs_schol.cs_schol | public static Scss cs_schol(int order, Scs A) {
"""
Ordering and symbolic analysis for a Cholesky factorization.
@param order
ordering option (0 or 1)
@param A
column-compressed matrix
@return symbolic analysis for Cholesky, null on error
"""
int n, c[], post[], P[];
Scs C;
Sc... | java | public static Scss cs_schol(int order, Scs A) {
int n, c[], post[], P[];
Scs C;
Scss S;
if (!Scs_util.CS_CSC(A))
return (null); /* check inputs */
n = A.n;
S = new Scss(); /* allocate result S */
P = Scs_amd.cs_amd(order, A); /* P = amd(A+A'), ... | [
"public",
"static",
"Scss",
"cs_schol",
"(",
"int",
"order",
",",
"Scs",
"A",
")",
"{",
"int",
"n",
",",
"c",
"[",
"]",
",",
"post",
"[",
"]",
",",
"P",
"[",
"]",
";",
"Scs",
"C",
";",
"Scss",
"S",
";",
"if",
"(",
"!",
"Scs_util",
".",
"CS_... | Ordering and symbolic analysis for a Cholesky factorization.
@param order
ordering option (0 or 1)
@param A
column-compressed matrix
@return symbolic analysis for Cholesky, null on error | [
"Ordering",
"and",
"symbolic",
"analysis",
"for",
"a",
"Cholesky",
"factorization",
"."
] | train | https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tfloat/Scs_schol.java#L46-L65 |
astrapi69/jaulp-wicket | jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/util/application/ApplicationExtensions.java | ApplicationExtensions.setRootRequestMapperForDevelopment | public static void setRootRequestMapperForDevelopment(final Application application,
final int httpPort, final int httpsPort) {
"""
Sets the RootRequestMapper for the given application from the given httpPort and httpsPort.
Note: if the configuration type is RuntimeConfigurationType.DEVELOPMENT then only HTTP s... | java | public static void setRootRequestMapperForDevelopment(final Application application,
final int httpPort, final int httpsPort)
{
application.setRootRequestMapper(new HttpsMapper(application.getRootRequestMapper(),
new HttpsConfig(httpPort, httpsPort))
{
@Override
protected Scheme getDesiredSchemeFor(fina... | [
"public",
"static",
"void",
"setRootRequestMapperForDevelopment",
"(",
"final",
"Application",
"application",
",",
"final",
"int",
"httpPort",
",",
"final",
"int",
"httpsPort",
")",
"{",
"application",
".",
"setRootRequestMapper",
"(",
"new",
"HttpsMapper",
"(",
"ap... | Sets the RootRequestMapper for the given application from the given httpPort and httpsPort.
Note: if the configuration type is RuntimeConfigurationType.DEVELOPMENT then only HTTP scheme
will be returned.
@param application
the application
@param httpPort
the http port
@param httpsPort
the https port | [
"Sets",
"the",
"RootRequestMapper",
"for",
"the",
"given",
"application",
"from",
"the",
"given",
"httpPort",
"and",
"httpsPort",
".",
"Note",
":",
"if",
"the",
"configuration",
"type",
"is",
"RuntimeConfigurationType",
".",
"DEVELOPMENT",
"then",
"only",
"HTTP",
... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/util/application/ApplicationExtensions.java#L540-L561 |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java | ConvertBufferedImage.convertTo_F32 | public static BufferedImage convertTo_F32(Planar<GrayF32> src, BufferedImage dst, boolean orderRgb) {
"""
Converts a {@link Planar} {@link GrayF32} into a BufferedImage.
@param src Input image.
@param dst Where the converted image is written to. If null a new image is created.
@param orderRgb If applicable, ... | java | public static BufferedImage convertTo_F32(Planar<GrayF32> src, BufferedImage dst, boolean orderRgb) {
dst = checkInputs(src, dst);
if( orderRgb ) {
src = orderBandsIntoBuffered(src, dst);
}
DataBuffer buffer = dst.getRaster().getDataBuffer();
ConvertRaster.planarToBuffered_F32(src, buffer, dst);
retur... | [
"public",
"static",
"BufferedImage",
"convertTo_F32",
"(",
"Planar",
"<",
"GrayF32",
">",
"src",
",",
"BufferedImage",
"dst",
",",
"boolean",
"orderRgb",
")",
"{",
"dst",
"=",
"checkInputs",
"(",
"src",
",",
"dst",
")",
";",
"if",
"(",
"orderRgb",
")",
"... | Converts a {@link Planar} {@link GrayF32} into a BufferedImage.
@param src Input image.
@param dst Where the converted image is written to. If null a new image is created.
@param orderRgb If applicable, should it change the order of the color bands (assumed RGB or ARGB) into the
order based on BufferedImage.TYPE. Mos... | [
"Converts",
"a",
"{",
"@link",
"Planar",
"}",
"{",
"@link",
"GrayF32",
"}",
"into",
"a",
"BufferedImage",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/ConvertBufferedImage.java#L818-L829 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/IOUtils.java | IOUtils.copy | public static void copy(InputStream input, Writer writer) throws IOException {
"""
Writes all the contents of an InputStream to a Writer.
@param input
the input stream to read from
@param writer
the writer to write to
@throws java.io.IOException
if an IOExcption occurs
"""
copy(new InputStreamReader(... | java | public static void copy(InputStream input, Writer writer) throws IOException {
copy(new InputStreamReader(input), writer);
} | [
"public",
"static",
"void",
"copy",
"(",
"InputStream",
"input",
",",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"copy",
"(",
"new",
"InputStreamReader",
"(",
"input",
")",
",",
"writer",
")",
";",
"}"
] | Writes all the contents of an InputStream to a Writer.
@param input
the input stream to read from
@param writer
the writer to write to
@throws java.io.IOException
if an IOExcption occurs | [
"Writes",
"all",
"the",
"contents",
"of",
"an",
"InputStream",
"to",
"a",
"Writer",
"."
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/IOUtils.java#L104-L106 |
jparsec/jparsec | jparsec/src/main/java/org/jparsec/Scanners.java | Scanners.notChar2 | private static Pattern notChar2(final char c1, final char c2) {
"""
Matches a character if the input has at least 1 character, or if the input has at least 2
characters with the first 2 characters not being {@code c1} and {@code c2}.
@return the Pattern object.
"""
return new Pattern() {
@Overrid... | java | private static Pattern notChar2(final char c1, final char c2) {
return new Pattern() {
@Override public int match(CharSequence src, int begin, int end) {
if (begin == end - 1) return 1;
if (begin >= end) return MISMATCH;
if (src.charAt(begin) == c1 && src.charAt(begin + 1) == c2) retur... | [
"private",
"static",
"Pattern",
"notChar2",
"(",
"final",
"char",
"c1",
",",
"final",
"char",
"c2",
")",
"{",
"return",
"new",
"Pattern",
"(",
")",
"{",
"@",
"Override",
"public",
"int",
"match",
"(",
"CharSequence",
"src",
",",
"int",
"begin",
",",
"i... | Matches a character if the input has at least 1 character, or if the input has at least 2
characters with the first 2 characters not being {@code c1} and {@code c2}.
@return the Pattern object. | [
"Matches",
"a",
"character",
"if",
"the",
"input",
"has",
"at",
"least",
"1",
"character",
"or",
"if",
"the",
"input",
"has",
"at",
"least",
"2",
"characters",
"with",
"the",
"first",
"2",
"characters",
"not",
"being",
"{",
"@code",
"c1",
"}",
"and",
"... | train | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/Scanners.java#L558-L567 |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/reflect/ReflectUtil.java | ReflectUtil.getBoundedSourceName | private static String getBoundedSourceName(String token, Type[] bounds, String direction)
throws NoSourceNameException {
"""
Creates a bounded source name of the form {@code T extends Foo & Bar},
{@code ? super Baz} or {@code ?} as appropriate.
"""
List<String> boundNames = new ArrayList<String>();
... | java | private static String getBoundedSourceName(String token, Type[] bounds, String direction)
throws NoSourceNameException {
List<String> boundNames = new ArrayList<String>();
for (Type boundary : bounds) {
boundNames.add(getSourceName(boundary));
}
return String.format("%s %s %s", token, direct... | [
"private",
"static",
"String",
"getBoundedSourceName",
"(",
"String",
"token",
",",
"Type",
"[",
"]",
"bounds",
",",
"String",
"direction",
")",
"throws",
"NoSourceNameException",
"{",
"List",
"<",
"String",
">",
"boundNames",
"=",
"new",
"ArrayList",
"<",
"St... | Creates a bounded source name of the form {@code T extends Foo & Bar},
{@code ? super Baz} or {@code ?} as appropriate. | [
"Creates",
"a",
"bounded",
"source",
"name",
"of",
"the",
"form",
"{"
] | train | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/reflect/ReflectUtil.java#L310-L317 |
apache/flink | flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java | SegmentsUtil.getInt | public static int getInt(MemorySegment[] segments, int offset) {
"""
get int from segments.
@param segments target segments.
@param offset value offset.
"""
if (inFirstSegment(segments, offset, 4)) {
return segments[0].getInt(offset);
} else {
return getIntMultiSegments(segments, offset);
}
} | java | public static int getInt(MemorySegment[] segments, int offset) {
if (inFirstSegment(segments, offset, 4)) {
return segments[0].getInt(offset);
} else {
return getIntMultiSegments(segments, offset);
}
} | [
"public",
"static",
"int",
"getInt",
"(",
"MemorySegment",
"[",
"]",
"segments",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"inFirstSegment",
"(",
"segments",
",",
"offset",
",",
"4",
")",
")",
"{",
"return",
"segments",
"[",
"0",
"]",
".",
"getInt",
... | get int from segments.
@param segments target segments.
@param offset value offset. | [
"get",
"int",
"from",
"segments",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/util/SegmentsUtil.java#L618-L624 |
liyiorg/weixin-popular | src/main/java/weixin/popular/client/LocalHttpClient.java | LocalHttpClient.initMchKeyStore | public static void initMchKeyStore(String mch_id, InputStream inputStream) {
"""
初始化 MCH HttpClient KeyStore
@since 2.8.7
@param mch_id mch_id
@param inputStream p12 文件流
"""
try {
KeyStore keyStore = KeyStore.getInstance("PKCS12");
keyStore.load(inputStream,mch_id.toCharArray());
inputStream... | java | public static void initMchKeyStore(String mch_id, InputStream inputStream) {
try {
KeyStore keyStore = KeyStore.getInstance("PKCS12");
keyStore.load(inputStream,mch_id.toCharArray());
inputStream.close();
CloseableHttpClient httpClient = HttpClientFactory.createKeyMaterialHttpClient(keyStore, mch_id,t... | [
"public",
"static",
"void",
"initMchKeyStore",
"(",
"String",
"mch_id",
",",
"InputStream",
"inputStream",
")",
"{",
"try",
"{",
"KeyStore",
"keyStore",
"=",
"KeyStore",
".",
"getInstance",
"(",
"\"PKCS12\"",
")",
";",
"keyStore",
".",
"load",
"(",
"inputStrea... | 初始化 MCH HttpClient KeyStore
@since 2.8.7
@param mch_id mch_id
@param inputStream p12 文件流 | [
"初始化",
"MCH",
"HttpClient",
"KeyStore"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/client/LocalHttpClient.java#L103-L113 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/MemcachedClient.java | MemcachedClient.asyncGetBulk | @Override
public BulkFuture<Map<String, Object>> asyncGetBulk(
Iterator<String> keyIter) {
"""
Asynchronously get a bunch of objects from the cache and decode them with
the given transcoder.
@param keyIter Iterator that produces the keys to request
@return a Future result of that fetch
@throws Ill... | java | @Override
public BulkFuture<Map<String, Object>> asyncGetBulk(
Iterator<String> keyIter) {
return asyncGetBulk(keyIter, transcoder);
} | [
"@",
"Override",
"public",
"BulkFuture",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"asyncGetBulk",
"(",
"Iterator",
"<",
"String",
">",
"keyIter",
")",
"{",
"return",
"asyncGetBulk",
"(",
"keyIter",
",",
"transcoder",
")",
";",
"}"
] | Asynchronously get a bunch of objects from the cache and decode them with
the given transcoder.
@param keyIter Iterator that produces the keys to request
@return a Future result of that fetch
@throws IllegalStateException in the rare circumstance where queue is too
full to accept any more requests | [
"Asynchronously",
"get",
"a",
"bunch",
"of",
"objects",
"from",
"the",
"cache",
"and",
"decode",
"them",
"with",
"the",
"given",
"transcoder",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/MemcachedClient.java#L1429-L1433 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/debug/GVRConsoleFactory.java | GVRConsoleFactory.createTerminalConsoleShell | static Shell createTerminalConsoleShell(String prompt, String appName,
ShellCommandHandler mainHandler, InputStream input, OutputStream output) {
"""
Facade method for operating the Unix-like terminal supporting line editing and command
history.
@param prompt Prompt to be displayed
@param appName ... | java | static Shell createTerminalConsoleShell(String prompt, String appName,
ShellCommandHandler mainHandler, InputStream input, OutputStream output) {
try {
PrintStream out = new PrintStream(output);
// Build jline terminal
jline.Terminal term = TerminalFactory.get();... | [
"static",
"Shell",
"createTerminalConsoleShell",
"(",
"String",
"prompt",
",",
"String",
"appName",
",",
"ShellCommandHandler",
"mainHandler",
",",
"InputStream",
"input",
",",
"OutputStream",
"output",
")",
"{",
"try",
"{",
"PrintStream",
"out",
"=",
"new",
"Prin... | Facade method for operating the Unix-like terminal supporting line editing and command
history.
@param prompt Prompt to be displayed
@param appName The app name string
@param mainHandler Main command handler
@param input Input stream.
@param output Output stream.
@return Shell that can be either further customized or ... | [
"Facade",
"method",
"for",
"operating",
"the",
"Unix",
"-",
"like",
"terminal",
"supporting",
"line",
"editing",
"and",
"command",
"history",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/debug/GVRConsoleFactory.java#L97-L128 |
groupon/odo | client/src/main/java/com/groupon/odo/client/Client.java | Client.getServerGroups | public List<ServerGroup> getServerGroups() {
"""
Get the collection of the server groups
@return Collection of active server groups
"""
ArrayList<ServerGroup> groups = new ArrayList<ServerGroup>();
try {
JSONObject response = new JSONObject(doGet(BASE_SERVERGROUP, null));
... | java | public List<ServerGroup> getServerGroups() {
ArrayList<ServerGroup> groups = new ArrayList<ServerGroup>();
try {
JSONObject response = new JSONObject(doGet(BASE_SERVERGROUP, null));
JSONArray serverArray = response.getJSONArray("servergroups");
for (int i = 0; i < se... | [
"public",
"List",
"<",
"ServerGroup",
">",
"getServerGroups",
"(",
")",
"{",
"ArrayList",
"<",
"ServerGroup",
">",
"groups",
"=",
"new",
"ArrayList",
"<",
"ServerGroup",
">",
"(",
")",
";",
"try",
"{",
"JSONObject",
"response",
"=",
"new",
"JSONObject",
"(... | Get the collection of the server groups
@return Collection of active server groups | [
"Get",
"the",
"collection",
"of",
"the",
"server",
"groups"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L1249-L1265 |
vznet/mongo-jackson-mapper | src/main/java/net/vz/mongodb/jackson/DBQuery.java | DBQuery.notIn | public static Query notIn(String field, Collection<?> values) {
"""
The field is not in the given set of values
@param field The field to compare
@param values The value to compare to
@return the query
"""
return new Query().notIn(field, values);
} | java | public static Query notIn(String field, Collection<?> values) {
return new Query().notIn(field, values);
} | [
"public",
"static",
"Query",
"notIn",
"(",
"String",
"field",
",",
"Collection",
"<",
"?",
">",
"values",
")",
"{",
"return",
"new",
"Query",
"(",
")",
".",
"notIn",
"(",
"field",
",",
"values",
")",
";",
"}"
] | The field is not in the given set of values
@param field The field to compare
@param values The value to compare to
@return the query | [
"The",
"field",
"is",
"not",
"in",
"the",
"given",
"set",
"of",
"values"
] | train | https://github.com/vznet/mongo-jackson-mapper/blob/ecd189aefa89636cddf70fb383f5d676be347976/src/main/java/net/vz/mongodb/jackson/DBQuery.java#L150-L152 |
apache/incubator-druid | core/src/main/java/org/apache/druid/java/util/common/lifecycle/Lifecycle.java | Lifecycle.addMaybeStartManagedInstance | public <T> T addMaybeStartManagedInstance(T o, Stage stage) throws Exception {
"""
Adds a "managed" instance (annotated with {@link LifecycleStart} and {@link LifecycleStop}) to the Lifecycle
and starts it if the lifecycle has already been started.
@param o The object to add to the lifecycle
@param stage ... | java | public <T> T addMaybeStartManagedInstance(T o, Stage stage) throws Exception
{
addMaybeStartHandler(new AnnotationBasedHandler(o), stage);
return o;
} | [
"public",
"<",
"T",
">",
"T",
"addMaybeStartManagedInstance",
"(",
"T",
"o",
",",
"Stage",
"stage",
")",
"throws",
"Exception",
"{",
"addMaybeStartHandler",
"(",
"new",
"AnnotationBasedHandler",
"(",
"o",
")",
",",
"stage",
")",
";",
"return",
"o",
";",
"}... | Adds a "managed" instance (annotated with {@link LifecycleStart} and {@link LifecycleStop}) to the Lifecycle
and starts it if the lifecycle has already been started.
@param o The object to add to the lifecycle
@param stage The stage to add the lifecycle at
@throws Exception {@link Lifecycle#addMaybeStartHandler(H... | [
"Adds",
"a",
"managed",
"instance",
"(",
"annotated",
"with",
"{",
"@link",
"LifecycleStart",
"}",
"and",
"{",
"@link",
"LifecycleStop",
"}",
")",
"to",
"the",
"Lifecycle",
"and",
"starts",
"it",
"if",
"the",
"lifecycle",
"has",
"already",
"been",
"started",... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/java/util/common/lifecycle/Lifecycle.java#L234-L238 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.remote.portable.core/src/com/ibm/ws/ejb/portable/LoggerHelper.java | LoggerHelper.getLogger | public static Logger getLogger(String className, String groupName) {
"""
Gets a new logger and registers it with the specified Tr logging group.
@param className the requesting class name
@param groupName the Tr logging group name
@return the logger
"""
Logger logger = Logger.getLogger(className);... | java | public static Logger getLogger(String className, String groupName)
{
Logger logger = Logger.getLogger(className);
if (!svCheckedForWAS)
{
try
{
Class loggerHelperClass = Class.forName("com.ibm.ws.logging.LoggerHelper");
svAddLoggerToGr... | [
"public",
"static",
"Logger",
"getLogger",
"(",
"String",
"className",
",",
"String",
"groupName",
")",
"{",
"Logger",
"logger",
"=",
"Logger",
".",
"getLogger",
"(",
"className",
")",
";",
"if",
"(",
"!",
"svCheckedForWAS",
")",
"{",
"try",
"{",
"Class",
... | Gets a new logger and registers it with the specified Tr logging group.
@param className the requesting class name
@param groupName the Tr logging group name
@return the logger | [
"Gets",
"a",
"new",
"logger",
"and",
"registers",
"it",
"with",
"the",
"specified",
"Tr",
"logging",
"group",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.remote.portable.core/src/com/ibm/ws/ejb/portable/LoggerHelper.java#L46-L80 |
dbracewell/hermes | hermes-core/src/main/java/com/davidbracewell/hermes/extraction/regex/TokenRegex.java | TokenRegex.matchFirst | public Optional<HString> matchFirst(HString text) {
"""
Match first optional.
@param text the text
@return the optional
"""
TokenMatcher matcher = new TokenMatcher(nfa, text);
if (matcher.find()) {
return Optional.of(matcher.group());
}
return Optional.empty();
} | java | public Optional<HString> matchFirst(HString text) {
TokenMatcher matcher = new TokenMatcher(nfa, text);
if (matcher.find()) {
return Optional.of(matcher.group());
}
return Optional.empty();
} | [
"public",
"Optional",
"<",
"HString",
">",
"matchFirst",
"(",
"HString",
"text",
")",
"{",
"TokenMatcher",
"matcher",
"=",
"new",
"TokenMatcher",
"(",
"nfa",
",",
"text",
")",
";",
"if",
"(",
"matcher",
".",
"find",
"(",
")",
")",
"{",
"return",
"Optio... | Match first optional.
@param text the text
@return the optional | [
"Match",
"first",
"optional",
"."
] | train | https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/extraction/regex/TokenRegex.java#L257-L263 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxws.webcontainer/src/com/ibm/ws/jaxws/webcontainer/LibertyJaxWsServlet.java | LibertyJaxWsServlet.service | @Override
public void service(ServletRequest req, ServletResponse res)
throws ServletException, IOException {
"""
As AbstractHTTPServlet in CXF, with this, it will make sure that, all the request methods
will be routed to handleRequest method.
"""
HttpServletRequest request;
... | java | @Override
public void service(ServletRequest req, ServletResponse res)
throws ServletException, IOException {
HttpServletRequest request;
HttpServletResponse response;
try {
request = (HttpServletRequest) req;
if (collaborator != null) {
... | [
"@",
"Override",
"public",
"void",
"service",
"(",
"ServletRequest",
"req",
",",
"ServletResponse",
"res",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"HttpServletRequest",
"request",
";",
"HttpServletResponse",
"response",
";",
"try",
"{",
"request"... | As AbstractHTTPServlet in CXF, with this, it will make sure that, all the request methods
will be routed to handleRequest method. | [
"As",
"AbstractHTTPServlet",
"in",
"CXF",
"with",
"this",
"it",
"will",
"make",
"sure",
"that",
"all",
"the",
"request",
"methods",
"will",
"be",
"routed",
"to",
"handleRequest",
"method",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.webcontainer/src/com/ibm/ws/jaxws/webcontainer/LibertyJaxWsServlet.java#L65-L89 |
attribyte/wpdb | src/main/java/org/attribyte/wp/db/DB.java | DB.appendPagingSortSQL | private StringBuilder appendPagingSortSQL(final StringBuilder sql, final Post.Sort sort,final Paging paging) {
"""
Appends paging interval constraint, if required, paging and sort.
@param sql The buffer to append to.
@param sort The sort.
@param paging The paging.
@return The input buffer.
"""
if(pa... | java | private StringBuilder appendPagingSortSQL(final StringBuilder sql, final Post.Sort sort,final Paging paging) {
if(paging.interval != null) {
sql.append(" AND post_date");
sql.append(paging.startIsOpen ? " >" : " >=");
sql.append("?");
sql.append(" AND post_date");
sq... | [
"private",
"StringBuilder",
"appendPagingSortSQL",
"(",
"final",
"StringBuilder",
"sql",
",",
"final",
"Post",
".",
"Sort",
"sort",
",",
"final",
"Paging",
"paging",
")",
"{",
"if",
"(",
"paging",
".",
"interval",
"!=",
"null",
")",
"{",
"sql",
".",
"appen... | Appends paging interval constraint, if required, paging and sort.
@param sql The buffer to append to.
@param sort The sort.
@param paging The paging.
@return The input buffer. | [
"Appends",
"paging",
"interval",
"constraint",
"if",
"required",
"paging",
"and",
"sort",
"."
] | train | https://github.com/attribyte/wpdb/blob/b9adf6131dfb67899ebff770c9bfeb001cc42f30/src/main/java/org/attribyte/wp/db/DB.java#L1223-L1260 |
HadoopGenomics/Hadoop-BAM | src/main/java/org/seqdoop/hadoop_bam/BAMRecordReader.java | BAMRecordReader.getKey | public static long getKey(final SAMRecord rec) {
"""
Note: this is the only getKey function that handles unmapped reads
specially!
"""
final int refIdx = rec.getReferenceIndex();
final int start = rec.getAlignmentStart();
if (!(rec.getReadUnmappedFlag() || refIdx < 0 || start < 0))
return getKey(re... | java | public static long getKey(final SAMRecord rec) {
final int refIdx = rec.getReferenceIndex();
final int start = rec.getAlignmentStart();
if (!(rec.getReadUnmappedFlag() || refIdx < 0 || start < 0))
return getKey(refIdx, start);
// Put unmapped reads at the end, but don't give them all the exact same
// k... | [
"public",
"static",
"long",
"getKey",
"(",
"final",
"SAMRecord",
"rec",
")",
"{",
"final",
"int",
"refIdx",
"=",
"rec",
".",
"getReferenceIndex",
"(",
")",
";",
"final",
"int",
"start",
"=",
"rec",
".",
"getAlignmentStart",
"(",
")",
";",
"if",
"(",
"!... | Note: this is the only getKey function that handles unmapped reads
specially! | [
"Note",
":",
"this",
"is",
"the",
"only",
"getKey",
"function",
"that",
"handles",
"unmapped",
"reads",
"specially!"
] | train | https://github.com/HadoopGenomics/Hadoop-BAM/blob/9f974cf635a8d72f69604021cc3d5f3469d38d2f/src/main/java/org/seqdoop/hadoop_bam/BAMRecordReader.java#L80-L110 |
gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation3DGUI.java | ShanksSimulation3DGUI.addDisplay | public void addDisplay(String displayID, Display3D display)
throws ShanksException {
"""
Add a display to the simulation
@param displayID
@param display
@throws DuplictaedDisplayIDException
@throws DuplicatedPortrayalIDException
@throws ScenarioNotFoundException
"""
Scenario3DPortray... | java | public void addDisplay(String displayID, Display3D display)
throws ShanksException {
Scenario3DPortrayal scenarioPortrayal = (Scenario3DPortrayal) this
.getSimulation().getScenarioPortrayal();
HashMap<String, Display3D> displays = scenarioPortrayal.getDisplays();
if (... | [
"public",
"void",
"addDisplay",
"(",
"String",
"displayID",
",",
"Display3D",
"display",
")",
"throws",
"ShanksException",
"{",
"Scenario3DPortrayal",
"scenarioPortrayal",
"=",
"(",
"Scenario3DPortrayal",
")",
"this",
".",
"getSimulation",
"(",
")",
".",
"getScenari... | Add a display to the simulation
@param displayID
@param display
@throws DuplictaedDisplayIDException
@throws DuplicatedPortrayalIDException
@throws ScenarioNotFoundException | [
"Add",
"a",
"display",
"to",
"the",
"simulation"
] | train | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation3DGUI.java#L308-L318 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java | CoverageUtilities.integerArray2WritableRaster | public static WritableRaster integerArray2WritableRaster( int[] array, double divide, int width, int height ) {
"""
Transforms an array of integer values into a {@link WritableRaster}.
@param array the values to transform.
@param divide the factor by which to divide the values.
@param width the width of the r... | java | public static WritableRaster integerArray2WritableRaster( int[] array, double divide, int width, int height ) {
WritableRaster writableRaster = createWritableRaster(width, height, null, null, null);
int index = 0;;
for( int x = 0; x < width; x++ ) {
for( int y = 0; y < height; y++ ) ... | [
"public",
"static",
"WritableRaster",
"integerArray2WritableRaster",
"(",
"int",
"[",
"]",
"array",
",",
"double",
"divide",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"WritableRaster",
"writableRaster",
"=",
"createWritableRaster",
"(",
"width",
",",
... | Transforms an array of integer values into a {@link WritableRaster}.
@param array the values to transform.
@param divide the factor by which to divide the values.
@param width the width of the resulting image.
@param height the height of the resulting image.
@return the raster. | [
"Transforms",
"an",
"array",
"of",
"integer",
"values",
"into",
"a",
"{",
"@link",
"WritableRaster",
"}",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java#L1112-L1122 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/replacer/AbstractPbeReplacer.java | AbstractPbeReplacer.transform | private byte[] transform(int cryptMode, byte[] value, byte[] salt, int iterations) throws Exception {
"""
Encrypt/decrypt given value by using the configured cipher algorithm with provided salt and iterations count.
@param cryptMode mode (one of {@link Cipher#DECRYPT_MODE}, {@link Cipher#ENCRYPT_MODE})
@param ... | java | private byte[] transform(int cryptMode, byte[] value, byte[] salt, int iterations) throws Exception {
checkPositive(iterations, "Count of iterations has to be positive number.");
SecretKeyFactory factory = SecretKeyFactory.getInstance(secretKeyFactoryAlgorithm);
char[] password = getPassword();
... | [
"private",
"byte",
"[",
"]",
"transform",
"(",
"int",
"cryptMode",
",",
"byte",
"[",
"]",
"value",
",",
"byte",
"[",
"]",
"salt",
",",
"int",
"iterations",
")",
"throws",
"Exception",
"{",
"checkPositive",
"(",
"iterations",
",",
"\"Count of iterations has t... | Encrypt/decrypt given value by using the configured cipher algorithm with provided salt and iterations count.
@param cryptMode mode (one of {@link Cipher#DECRYPT_MODE}, {@link Cipher#ENCRYPT_MODE})
@param value value to encrypt/decrypt
@param salt salt to be used
@param iterations count of iterations
@return encrypted... | [
"Encrypt",
"/",
"decrypt",
"given",
"value",
"by",
"using",
"the",
"configured",
"cipher",
"algorithm",
"with",
"provided",
"salt",
"and",
"iterations",
"count",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/replacer/AbstractPbeReplacer.java#L158-L170 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_datacenter_datacenterId_disasterRecovery_zerto_disable_POST | public OvhTask serviceName_datacenter_datacenterId_disasterRecovery_zerto_disable_POST(String serviceName, Long datacenterId, Long secondaryDatacenterId, String secondaryServiceName) throws IOException {
"""
Disable Zerto
REST: POST /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/disasterRecovery/zerto/... | java | public OvhTask serviceName_datacenter_datacenterId_disasterRecovery_zerto_disable_POST(String serviceName, Long datacenterId, Long secondaryDatacenterId, String secondaryServiceName) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/disasterRecovery/zerto/disable";
StringB... | [
"public",
"OvhTask",
"serviceName_datacenter_datacenterId_disasterRecovery_zerto_disable_POST",
"(",
"String",
"serviceName",
",",
"Long",
"datacenterId",
",",
"Long",
"secondaryDatacenterId",
",",
"String",
"secondaryServiceName",
")",
"throws",
"IOException",
"{",
"String",
... | Disable Zerto
REST: POST /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/disasterRecovery/zerto/disable
@param secondaryServiceName [required] Your secondary dedicatedCloud
@param secondaryDatacenterId [required] Your secondary datacenter id
@param serviceName [required] Domain of the service
@param datacenter... | [
"Disable",
"Zerto"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L1775-L1783 |
aalmiray/Json-lib | src/main/java/net/sf/json/JSONArray.java | JSONArray._fromArray | private static JSONArray _fromArray( byte[] array, JsonConfig jsonConfig ) {
"""
Construct a JSONArray from an byte[].<br>
@param array An byte[] array.
"""
if( !addInstance( array ) ){
try{
return jsonConfig.getCycleDetectionStrategy()
.handleRepeatedReferenceAs... | java | private static JSONArray _fromArray( byte[] array, JsonConfig jsonConfig ) {
if( !addInstance( array ) ){
try{
return jsonConfig.getCycleDetectionStrategy()
.handleRepeatedReferenceAsArray( array );
}catch( JSONException jsone ){
removeInstance( array );... | [
"private",
"static",
"JSONArray",
"_fromArray",
"(",
"byte",
"[",
"]",
"array",
",",
"JsonConfig",
"jsonConfig",
")",
"{",
"if",
"(",
"!",
"addInstance",
"(",
"array",
")",
")",
"{",
"try",
"{",
"return",
"jsonConfig",
".",
"getCycleDetectionStrategy",
"(",
... | Construct a JSONArray from an byte[].<br>
@param array An byte[] array. | [
"Construct",
"a",
"JSONArray",
"from",
"an",
"byte",
"[]",
".",
"<br",
">"
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONArray.java#L575-L603 |
graphql-java/graphql-java | src/main/java/graphql/schema/idl/SchemaTypeExtensionsChecker.java | SchemaTypeExtensionsChecker.checkEnumTypeExtensions | private void checkEnumTypeExtensions(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry) {
"""
/*
Enum type extensions have the potential to be invalid if incorrectly defined.
The named type must already be defined and must be an Enum type.
All values of an Enum type extension must be unique.
All... | java | private void checkEnumTypeExtensions(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry) {
typeRegistry.enumTypeExtensions()
.forEach((name, extensions) -> {
checkTypeExtensionHasCorrespondingType(errors, typeRegistry, name, extensions, EnumTypeDefinition.class);
... | [
"private",
"void",
"checkEnumTypeExtensions",
"(",
"List",
"<",
"GraphQLError",
">",
"errors",
",",
"TypeDefinitionRegistry",
"typeRegistry",
")",
"{",
"typeRegistry",
".",
"enumTypeExtensions",
"(",
")",
".",
"forEach",
"(",
"(",
"name",
",",
"extensions",
")",
... | /*
Enum type extensions have the potential to be invalid if incorrectly defined.
The named type must already be defined and must be an Enum type.
All values of an Enum type extension must be unique.
All values of an Enum type extension must not already be a value of the original Enum.
Any directives provided must not ... | [
"/",
"*",
"Enum",
"type",
"extensions",
"have",
"the",
"potential",
"to",
"be",
"invalid",
"if",
"incorrectly",
"defined",
"."
] | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/schema/idl/SchemaTypeExtensionsChecker.java#L207-L233 |
RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipSession.java | SipSession.waitResponse | public EventObject waitResponse(SipTransaction trans, long timeout) {
"""
The waitResponse() method waits for a response to a previously sent transactional request
message. Call this method after using one of the sendRequestWithTransaction() methods.
This method blocks until one of the following occurs: 1) A j... | java | public EventObject waitResponse(SipTransaction trans, long timeout) {
// TODO later: waitResponse() for nontransactional-request case
initErrorInfo();
synchronized (trans.getBlock()) {
LinkedList<EventObject> events = trans.getEvents();
if (events.isEmpty()) {
try {
trans.get... | [
"public",
"EventObject",
"waitResponse",
"(",
"SipTransaction",
"trans",
",",
"long",
"timeout",
")",
"{",
"// TODO later: waitResponse() for nontransactional-request case",
"initErrorInfo",
"(",
")",
";",
"synchronized",
"(",
"trans",
".",
"getBlock",
"(",
")",
")",
... | The waitResponse() method waits for a response to a previously sent transactional request
message. Call this method after using one of the sendRequestWithTransaction() methods.
This method blocks until one of the following occurs: 1) A javax.sip.ResponseEvent is received.
This is the object returned by this method. 2)... | [
"The",
"waitResponse",
"()",
"method",
"waits",
"for",
"a",
"response",
"to",
"a",
"previously",
"sent",
"transactional",
"request",
"message",
".",
"Call",
"this",
"method",
"after",
"using",
"one",
"of",
"the",
"sendRequestWithTransaction",
"()",
"methods",
".... | train | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipSession.java#L1125-L1151 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Poi.java | Poi.setLon | public void setLon(final int LON_DEG, final int LON_MIN, final int LON_SEC) {
"""
Sets the longitude of the poi in the format
51° 20' 10"
@param LON_DEG
@param LON_MIN
@param LON_SEC
"""
this.lon = convert(LON_DEG, LON_MIN, LON_SEC);
this.LOCATION.setLocation(this.lat, this.lon);
ad... | java | public void setLon(final int LON_DEG, final int LON_MIN, final int LON_SEC) {
this.lon = convert(LON_DEG, LON_MIN, LON_SEC);
this.LOCATION.setLocation(this.lat, this.lon);
adjustDirection();
} | [
"public",
"void",
"setLon",
"(",
"final",
"int",
"LON_DEG",
",",
"final",
"int",
"LON_MIN",
",",
"final",
"int",
"LON_SEC",
")",
"{",
"this",
".",
"lon",
"=",
"convert",
"(",
"LON_DEG",
",",
"LON_MIN",
",",
"LON_SEC",
")",
";",
"this",
".",
"LOCATION",... | Sets the longitude of the poi in the format
51° 20' 10"
@param LON_DEG
@param LON_MIN
@param LON_SEC | [
"Sets",
"the",
"longitude",
"of",
"the",
"poi",
"in",
"the",
"format",
"51°",
"20",
"10"
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Poi.java#L228-L232 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/ConfigurationUtils.java | ConfigurationUtils.getMasterRpcAddresses | public static List<InetSocketAddress> getMasterRpcAddresses(AlluxioConfiguration conf) {
"""
Gets the RPC addresses of all masters based on the configuration.
@param conf the configuration to use
@return the master rpc addresses
"""
// First check whether rpc addresses are explicitly configured.
if... | java | public static List<InetSocketAddress> getMasterRpcAddresses(AlluxioConfiguration conf) {
// First check whether rpc addresses are explicitly configured.
if (conf.isSet(PropertyKey.MASTER_RPC_ADDRESSES)) {
return parseInetSocketAddresses(conf.getList(PropertyKey.MASTER_RPC_ADDRESSES, ","));
}
// F... | [
"public",
"static",
"List",
"<",
"InetSocketAddress",
">",
"getMasterRpcAddresses",
"(",
"AlluxioConfiguration",
"conf",
")",
"{",
"// First check whether rpc addresses are explicitly configured.",
"if",
"(",
"conf",
".",
"isSet",
"(",
"PropertyKey",
".",
"MASTER_RPC_ADDRES... | Gets the RPC addresses of all masters based on the configuration.
@param conf the configuration to use
@return the master rpc addresses | [
"Gets",
"the",
"RPC",
"addresses",
"of",
"all",
"masters",
"based",
"on",
"the",
"configuration",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ConfigurationUtils.java#L136-L145 |
javalite/activejdbc | javalite-common/src/main/java/org/javalite/common/Util.java | Util.joinAndRepeat | public static void joinAndRepeat(StringBuilder sb, String str, String delimiter, int count) {
"""
Repeats string of characters a defined number of times with a delimiter, and appends result to StringBuilder.
<p>For example, <tt>joinAndRepeat(sb, "?", ",", 3)</tt> will append <tt>"?,?,?"</tt> to <tt>sb</tt>.
... | java | public static void joinAndRepeat(StringBuilder sb, String str, String delimiter, int count) {
if (count > 0) {
sb.append(str);
for (int i = 1; i < count; i++) {
sb.append(delimiter);
sb.append(str);
}
}
} | [
"public",
"static",
"void",
"joinAndRepeat",
"(",
"StringBuilder",
"sb",
",",
"String",
"str",
",",
"String",
"delimiter",
",",
"int",
"count",
")",
"{",
"if",
"(",
"count",
">",
"0",
")",
"{",
"sb",
".",
"append",
"(",
"str",
")",
";",
"for",
"(",
... | Repeats string of characters a defined number of times with a delimiter, and appends result to StringBuilder.
<p>For example, <tt>joinAndRepeat(sb, "?", ",", 3)</tt> will append <tt>"?,?,?"</tt> to <tt>sb</tt>.
@param sb StringBuilder to append result to
@param str string of characters to be repeated.
@param delimite... | [
"Repeats",
"string",
"of",
"characters",
"a",
"defined",
"number",
"of",
"times",
"with",
"a",
"delimiter",
"and",
"appends",
"result",
"to",
"StringBuilder",
"."
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/javalite-common/src/main/java/org/javalite/common/Util.java#L387-L395 |
revapi/revapi | revapi/src/main/java/org/revapi/AnalysisResult.java | AnalysisResult.fakeSuccess | public static AnalysisResult fakeSuccess() {
"""
A factory method for users that need to report success without actually running any analysis. The returned
result will be successful, but will not contain the actual configurations of extensions.
@return a "fake" successful analysis result
"""
return... | java | public static AnalysisResult fakeSuccess() {
return new AnalysisResult(null, new Extensions(Collections.emptyMap(), Collections.emptyMap(),
Collections.emptyMap(), Collections.emptyMap()));
} | [
"public",
"static",
"AnalysisResult",
"fakeSuccess",
"(",
")",
"{",
"return",
"new",
"AnalysisResult",
"(",
"null",
",",
"new",
"Extensions",
"(",
"Collections",
".",
"emptyMap",
"(",
")",
",",
"Collections",
".",
"emptyMap",
"(",
")",
",",
"Collections",
".... | A factory method for users that need to report success without actually running any analysis. The returned
result will be successful, but will not contain the actual configurations of extensions.
@return a "fake" successful analysis result | [
"A",
"factory",
"method",
"for",
"users",
"that",
"need",
"to",
"report",
"success",
"without",
"actually",
"running",
"any",
"analysis",
".",
"The",
"returned",
"result",
"will",
"be",
"successful",
"but",
"will",
"not",
"contain",
"the",
"actual",
"configura... | train | https://github.com/revapi/revapi/blob/e070b136d977441ab96fdce067a13e7e0423295b/revapi/src/main/java/org/revapi/AnalysisResult.java#L58-L61 |
biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java | Alignments.getAllPairsAlignments | public static <S extends Sequence<C>, C extends Compound> List<SequencePair<S, C>> getAllPairsAlignments(
List<S> sequences, PairwiseSequenceAlignerType type, GapPenalty gapPenalty,
SubstitutionMatrix<C> subMatrix) {
"""
Factory method which computes a sequence alignment for all {@link Sequence} pairs in the... | java | public static <S extends Sequence<C>, C extends Compound> List<SequencePair<S, C>> getAllPairsAlignments(
List<S> sequences, PairwiseSequenceAlignerType type, GapPenalty gapPenalty,
SubstitutionMatrix<C> subMatrix) {
return runPairwiseAligners(getAllPairsAligners(sequences, type, gapPenalty, subMatrix));
} | [
"public",
"static",
"<",
"S",
"extends",
"Sequence",
"<",
"C",
">",
",",
"C",
"extends",
"Compound",
">",
"List",
"<",
"SequencePair",
"<",
"S",
",",
"C",
">",
">",
"getAllPairsAlignments",
"(",
"List",
"<",
"S",
">",
"sequences",
",",
"PairwiseSequenceA... | Factory method which computes a sequence alignment for all {@link Sequence} pairs in the given {@link List}.
This method runs the alignments in parallel by submitting all of the alignments to the shared thread pool of the
{@link ConcurrencyTools} utility.
@param <S> each {@link Sequence} of an alignment pair is of typ... | [
"Factory",
"method",
"which",
"computes",
"a",
"sequence",
"alignment",
"for",
"all",
"{",
"@link",
"Sequence",
"}",
"pairs",
"in",
"the",
"given",
"{",
"@link",
"List",
"}",
".",
"This",
"method",
"runs",
"the",
"alignments",
"in",
"parallel",
"by",
"subm... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java#L132-L136 |
messagebird/java-rest-api | api/src/main/java/com/messagebird/RequestSigner.java | RequestSigner.computeSignature | private byte[] computeSignature(Request request) {
"""
Computes the signature for a request instance.
@param request Request to compute signature for.
@return HMAC-SHA2556 signature for the provided request.
"""
String timestampAndQuery = request.getTimestamp() + '\n' +
request.getS... | java | private byte[] computeSignature(Request request) {
String timestampAndQuery = request.getTimestamp() + '\n' +
request.getSortedQueryParameters() + '\n';
byte[] timestampAndQueryBytes = timestampAndQuery.getBytes(CHARSET_UTF8);
byte[] bodyHashBytes = getSha256Hash(request.getData... | [
"private",
"byte",
"[",
"]",
"computeSignature",
"(",
"Request",
"request",
")",
"{",
"String",
"timestampAndQuery",
"=",
"request",
".",
"getTimestamp",
"(",
")",
"+",
"'",
"'",
"+",
"request",
".",
"getSortedQueryParameters",
"(",
")",
"+",
"'",
"'",
";"... | Computes the signature for a request instance.
@param request Request to compute signature for.
@return HMAC-SHA2556 signature for the provided request. | [
"Computes",
"the",
"signature",
"for",
"a",
"request",
"instance",
"."
] | train | https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/RequestSigner.java#L75-L83 |
igniterealtime/Smack | smack-core/src/main/java/org/jivesoftware/smack/util/MultiMap.java | MultiMap.removeOne | public boolean removeOne(Object key, V value) {
"""
Remove the mapping of the given key to the value.
<p>
Returns <code>true</code> if the mapping was removed and <code>false</code> if the mapping did not exist.
</p>
@param key
@param value
@return true if the mapping was removed, false otherwise.
"""
... | java | public boolean removeOne(Object key, V value) {
List<V> list = map.get(key);
if (list == null) {
return false;
}
boolean res = list.remove(value);
if (list.isEmpty()) {
// Remove the key also if the value set is now empty
map.remove(key);
... | [
"public",
"boolean",
"removeOne",
"(",
"Object",
"key",
",",
"V",
"value",
")",
"{",
"List",
"<",
"V",
">",
"list",
"=",
"map",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"list",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"boolean",
... | Remove the mapping of the given key to the value.
<p>
Returns <code>true</code> if the mapping was removed and <code>false</code> if the mapping did not exist.
</p>
@param key
@param value
@return true if the mapping was removed, false otherwise. | [
"Remove",
"the",
"mapping",
"of",
"the",
"given",
"key",
"to",
"the",
"value",
".",
"<p",
">",
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"mapping",
"was",
"removed",
"and",
"<code",
">",
"false<",
"/",
"code",
">",
"if",
"the",... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/util/MultiMap.java#L160-L171 |
lite2073/email-validator | src/com/dominicsayers/isemail/IsEMail.java | IsEMail.is_email | public static boolean is_email(String email, boolean checkDNS)
throws DNSLookupException {
"""
Checks the syntax of an email address.
@param email
The email address to be checked.
@param checkDNS
Whether a DNS check should be performed or not.
@return True if the email address is valid.
@throws DNSLook... | java | public static boolean is_email(String email, boolean checkDNS)
throws DNSLookupException {
return (is_email_verbose(email, checkDNS).getState() == GeneralState.OK);
} | [
"public",
"static",
"boolean",
"is_email",
"(",
"String",
"email",
",",
"boolean",
"checkDNS",
")",
"throws",
"DNSLookupException",
"{",
"return",
"(",
"is_email_verbose",
"(",
"email",
",",
"checkDNS",
")",
".",
"getState",
"(",
")",
"==",
"GeneralState",
"."... | Checks the syntax of an email address.
@param email
The email address to be checked.
@param checkDNS
Whether a DNS check should be performed or not.
@return True if the email address is valid.
@throws DNSLookupException
Is thrown if an internal error in the DNS lookup appeared. | [
"Checks",
"the",
"syntax",
"of",
"an",
"email",
"address",
"."
] | train | https://github.com/lite2073/email-validator/blob/cfdda77ed630854b44d62def0d5b7228d5c4e712/src/com/dominicsayers/isemail/IsEMail.java#L73-L76 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java | BigtableDataClient.readRow | public Row readRow(String tableId, ByteString rowKey) {
"""
Convenience method for synchronously reading a single row. If the row does not exist, the value
will be null.
<p>Sample code:
<pre>{code
try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
String t... | java | public Row readRow(String tableId, ByteString rowKey) {
return ApiExceptions.callAndTranslateApiException(readRowAsync(tableId, rowKey, null));
} | [
"public",
"Row",
"readRow",
"(",
"String",
"tableId",
",",
"ByteString",
"rowKey",
")",
"{",
"return",
"ApiExceptions",
".",
"callAndTranslateApiException",
"(",
"readRowAsync",
"(",
"tableId",
",",
"rowKey",
",",
"null",
")",
")",
";",
"}"
] | Convenience method for synchronously reading a single row. If the row does not exist, the value
will be null.
<p>Sample code:
<pre>{code
try (BigtableDataClient bigtableDataClient = BigtableDataClient.create("[PROJECT]", "[INSTANCE]")) {
String tableId = "[TABLE]";
Row row = bigtableDataClient.readRow(tableId, ByteS... | [
"Convenience",
"method",
"for",
"synchronously",
"reading",
"a",
"single",
"row",
".",
"If",
"the",
"row",
"does",
"not",
"exist",
"the",
"value",
"will",
"be",
"null",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataClient.java#L169-L171 |
Alluxio/alluxio | core/common/src/main/java/alluxio/extensions/ExtensionFactoryRegistry.java | ExtensionFactoryRegistry.scanLibs | private void scanLibs(List<T> factories, String libDir) {
"""
Finds all factory from the lib directory.
@param factories list of factories to add to
"""
LOG.info("Loading core jars from {}", libDir);
List<File> files = new ArrayList<>();
try (DirectoryStream<Path> stream =
Files.newDirec... | java | private void scanLibs(List<T> factories, String libDir) {
LOG.info("Loading core jars from {}", libDir);
List<File> files = new ArrayList<>();
try (DirectoryStream<Path> stream =
Files.newDirectoryStream(Paths.get(libDir), mExtensionPattern)) {
for (Path entry : stream) {
if (entry.toF... | [
"private",
"void",
"scanLibs",
"(",
"List",
"<",
"T",
">",
"factories",
",",
"String",
"libDir",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Loading core jars from {}\"",
",",
"libDir",
")",
";",
"List",
"<",
"File",
">",
"files",
"=",
"new",
"ArrayList",
"<>"... | Finds all factory from the lib directory.
@param factories list of factories to add to | [
"Finds",
"all",
"factory",
"from",
"the",
"lib",
"directory",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/extensions/ExtensionFactoryRegistry.java#L169-L183 |
lessthanoptimal/ejml | examples/src/org/ejml/example/PrincipalComponentAnalysis.java | PrincipalComponentAnalysis.sampleToEigenSpace | public double[] sampleToEigenSpace( double[] sampleData ) {
"""
Converts a vector from sample space into eigen space.
@param sampleData Sample space data.
@return Eigen space projection.
"""
if( sampleData.length != A.getNumCols() )
throw new IllegalArgumentException("Unexpected sample ... | java | public double[] sampleToEigenSpace( double[] sampleData ) {
if( sampleData.length != A.getNumCols() )
throw new IllegalArgumentException("Unexpected sample length");
DMatrixRMaj mean = DMatrixRMaj.wrap(A.getNumCols(),1,this.mean);
DMatrixRMaj s = new DMatrixRMaj(A.getNumCols(),1,tru... | [
"public",
"double",
"[",
"]",
"sampleToEigenSpace",
"(",
"double",
"[",
"]",
"sampleData",
")",
"{",
"if",
"(",
"sampleData",
".",
"length",
"!=",
"A",
".",
"getNumCols",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Unexpected sample leng... | Converts a vector from sample space into eigen space.
@param sampleData Sample space data.
@return Eigen space projection. | [
"Converts",
"a",
"vector",
"from",
"sample",
"space",
"into",
"eigen",
"space",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/examples/src/org/ejml/example/PrincipalComponentAnalysis.java#L176-L189 |
Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java | ESFilterBuilder.populateInQuery | private QueryBuilder populateInQuery(InExpression inExpression, EntityMetadata metadata) {
"""
Populate IN query filter.
@param inExpression
the in expression
@param metadata
the metadata
@return the filter builder
"""
String property = getField(inExpression.getExpression().toParsedText());
... | java | private QueryBuilder populateInQuery(InExpression inExpression, EntityMetadata metadata)
{
String property = getField(inExpression.getExpression().toParsedText());
Expression inItemsParameter = inExpression.getInItems();
log.debug("IN query parameters for field " + property + " is: " + inIt... | [
"private",
"QueryBuilder",
"populateInQuery",
"(",
"InExpression",
"inExpression",
",",
"EntityMetadata",
"metadata",
")",
"{",
"String",
"property",
"=",
"getField",
"(",
"inExpression",
".",
"getExpression",
"(",
")",
".",
"toParsedText",
"(",
")",
")",
";",
"... | Populate IN query filter.
@param inExpression
the in expression
@param metadata
the metadata
@return the filter builder | [
"Populate",
"IN",
"query",
"filter",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESFilterBuilder.java#L175-L184 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/protocols/channels/PaymentChannelClient.java | PaymentChannelClient.incrementPayment | @Override
public ListenableFuture<PaymentIncrementAck> incrementPayment(Coin size, @Nullable ByteString info, @Nullable KeyParameter userKey)
throws ValueOutOfRangeException, IllegalStateException, ECKey.KeyIsEncryptedException {
"""
Increments the total value which we pay the server. Note that the... | java | @Override
public ListenableFuture<PaymentIncrementAck> incrementPayment(Coin size, @Nullable ByteString info, @Nullable KeyParameter userKey)
throws ValueOutOfRangeException, IllegalStateException, ECKey.KeyIsEncryptedException {
lock.lock();
try {
if (state() == null || !con... | [
"@",
"Override",
"public",
"ListenableFuture",
"<",
"PaymentIncrementAck",
">",
"incrementPayment",
"(",
"Coin",
"size",
",",
"@",
"Nullable",
"ByteString",
"info",
",",
"@",
"Nullable",
"KeyParameter",
"userKey",
")",
"throws",
"ValueOutOfRangeException",
",",
"Ill... | Increments the total value which we pay the server. Note that the amount of money sent may not be the same as the
amount of money actually requested. It can be larger if the amount left over in the channel would be too small to
be accepted by the Bitcoin network. ValueOutOfRangeException will be thrown, however, if the... | [
"Increments",
"the",
"total",
"value",
"which",
"we",
"pay",
"the",
"server",
".",
"Note",
"that",
"the",
"amount",
"of",
"money",
"sent",
"may",
"not",
"be",
"the",
"same",
"as",
"the",
"amount",
"of",
"money",
"actually",
"requested",
".",
"It",
"can",... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/protocols/channels/PaymentChannelClient.java#L671-L708 |
alkacon/opencms-core | src/org/opencms/cmis/A_CmsCmisRepository.java | A_CmsCmisRepository.getOpenCmsProperties | protected List<CmsProperty> getOpenCmsProperties(Map<String, PropertyData<?>> properties) {
"""
Helper method to create OpenCms property objects from a map of CMIS properties.<p>
@param properties the CMIS properties
@return the OpenCms properties
"""
List<CmsProperty> cmsProperties = new Arra... | java | protected List<CmsProperty> getOpenCmsProperties(Map<String, PropertyData<?>> properties) {
List<CmsProperty> cmsProperties = new ArrayList<CmsProperty>();
for (Map.Entry<String, PropertyData<?>> entry : properties.entrySet()) {
String propId = entry.getKey();
if (propId.st... | [
"protected",
"List",
"<",
"CmsProperty",
">",
"getOpenCmsProperties",
"(",
"Map",
"<",
"String",
",",
"PropertyData",
"<",
"?",
">",
">",
"properties",
")",
"{",
"List",
"<",
"CmsProperty",
">",
"cmsProperties",
"=",
"new",
"ArrayList",
"<",
"CmsProperty",
"... | Helper method to create OpenCms property objects from a map of CMIS properties.<p>
@param properties the CMIS properties
@return the OpenCms properties | [
"Helper",
"method",
"to",
"create",
"OpenCms",
"property",
"objects",
"from",
"a",
"map",
"of",
"CMIS",
"properties",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cmis/A_CmsCmisRepository.java#L337-L352 |
skuzzle/semantic-version | src/main/java/de/skuzzle/semantic/Version.java | Version.nextMajor | public Version nextMajor(String newPrelease) {
"""
Given this Version, returns the next major Version. That is, the major part is
incremented by 1 and the remaining parts are set to 0. The pre-release part will be
set to the given identifier and the build-meta-data is dropped.
@param newPrelease The pre-relea... | java | public Version nextMajor(String newPrelease) {
require(newPrelease != null, "newPreRelease is null");
final String[] preReleaseParts = parsePreRelease(newPrelease);
return new Version(this.major + 1, 0, 0, preReleaseParts, EMPTY_ARRAY);
} | [
"public",
"Version",
"nextMajor",
"(",
"String",
"newPrelease",
")",
"{",
"require",
"(",
"newPrelease",
"!=",
"null",
",",
"\"newPreRelease is null\"",
")",
";",
"final",
"String",
"[",
"]",
"preReleaseParts",
"=",
"parsePreRelease",
"(",
"newPrelease",
")",
";... | Given this Version, returns the next major Version. That is, the major part is
incremented by 1 and the remaining parts are set to 0. The pre-release part will be
set to the given identifier and the build-meta-data is dropped.
@param newPrelease The pre-release part for the resulting Version.
@return The incremented v... | [
"Given",
"this",
"Version",
"returns",
"the",
"next",
"major",
"Version",
".",
"That",
"is",
"the",
"major",
"part",
"is",
"incremented",
"by",
"1",
"and",
"the",
"remaining",
"parts",
"are",
"set",
"to",
"0",
".",
"The",
"pre",
"-",
"release",
"part",
... | train | https://github.com/skuzzle/semantic-version/blob/2ddb66fb80244cd7f67c77ed5f8072d1132ad933/src/main/java/de/skuzzle/semantic/Version.java#L717-L721 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/cluster/RedisClusterURIUtil.java | RedisClusterURIUtil.applyUriConnectionSettings | static void applyUriConnectionSettings(RedisURI from, RedisURI to) {
"""
Apply {@link RedisURI} settings such as SSL/Timeout/password.
@param from from {@link RedisURI}.
@param to from {@link RedisURI}.
"""
if (from.getPassword() != null && from.getPassword().length != 0) {
to.setPassw... | java | static void applyUriConnectionSettings(RedisURI from, RedisURI to) {
if (from.getPassword() != null && from.getPassword().length != 0) {
to.setPassword(new String(from.getPassword()));
}
to.setTimeout(from.getTimeout());
to.setSsl(from.isSsl());
to.setStartTls(from.... | [
"static",
"void",
"applyUriConnectionSettings",
"(",
"RedisURI",
"from",
",",
"RedisURI",
"to",
")",
"{",
"if",
"(",
"from",
".",
"getPassword",
"(",
")",
"!=",
"null",
"&&",
"from",
".",
"getPassword",
"(",
")",
".",
"length",
"!=",
"0",
")",
"{",
"to... | Apply {@link RedisURI} settings such as SSL/Timeout/password.
@param from from {@link RedisURI}.
@param to from {@link RedisURI}. | [
"Apply",
"{",
"@link",
"RedisURI",
"}",
"settings",
"such",
"as",
"SSL",
"/",
"Timeout",
"/",
"password",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/cluster/RedisClusterURIUtil.java#L72-L82 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DomainsInner.java | DomainsInner.beginCreateOrUpdate | public DomainInner beginCreateOrUpdate(String resourceGroupName, String domainName, DomainInner domain) {
"""
Creates or updates a domain.
Creates or updates a domain.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param domainName Name of the domain.
@param domain Domain... | java | public DomainInner beginCreateOrUpdate(String resourceGroupName, String domainName, DomainInner domain) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, domainName, domain).toBlocking().single().body();
} | [
"public",
"DomainInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"domainName",
",",
"DomainInner",
"domain",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"domainName",
",",
"domain",
")... | Creates or updates a domain.
Creates or updates a domain.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param domainName Name of the domain.
@param domain Domain registration information.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws DefaultErro... | [
"Creates",
"or",
"updates",
"a",
"domain",
".",
"Creates",
"or",
"updates",
"a",
"domain",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DomainsInner.java#L920-L922 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java | BpmnParse.parseTask | public ActivityImpl parseTask(Element taskElement, ScopeImpl scope) {
"""
Parses a task with no specific type (behaves as passthrough).
"""
ActivityImpl activity = createActivityOnScope(taskElement, scope);
activity.setActivityBehavior(new TaskActivityBehavior());
parseAsynchronousContinuationForA... | java | public ActivityImpl parseTask(Element taskElement, ScopeImpl scope) {
ActivityImpl activity = createActivityOnScope(taskElement, scope);
activity.setActivityBehavior(new TaskActivityBehavior());
parseAsynchronousContinuationForActivity(taskElement, activity);
parseExecutionListenersOnScope(taskElement... | [
"public",
"ActivityImpl",
"parseTask",
"(",
"Element",
"taskElement",
",",
"ScopeImpl",
"scope",
")",
"{",
"ActivityImpl",
"activity",
"=",
"createActivityOnScope",
"(",
"taskElement",
",",
"scope",
")",
";",
"activity",
".",
"setActivityBehavior",
"(",
"new",
"Ta... | Parses a task with no specific type (behaves as passthrough). | [
"Parses",
"a",
"task",
"with",
"no",
"specific",
"type",
"(",
"behaves",
"as",
"passthrough",
")",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L2509-L2522 |
hazelcast/hazelcast | hazelcast-client/src/main/java/com/hazelcast/client/cache/impl/ClientCacheHelper.java | ClientCacheHelper.createCacheConfig | static <K, V> CacheConfig<K, V> createCacheConfig(HazelcastClientInstanceImpl client,
CacheConfig<K, V> newCacheConfig) {
"""
Creates a new cache configuration on Hazelcast members.
@param client the client instance which will send the operation ... | java | static <K, V> CacheConfig<K, V> createCacheConfig(HazelcastClientInstanceImpl client,
CacheConfig<K, V> newCacheConfig) {
try {
String nameWithPrefix = newCacheConfig.getNameWithPrefix();
int partitionId = client.getClientPartitionSer... | [
"static",
"<",
"K",
",",
"V",
">",
"CacheConfig",
"<",
"K",
",",
"V",
">",
"createCacheConfig",
"(",
"HazelcastClientInstanceImpl",
"client",
",",
"CacheConfig",
"<",
"K",
",",
"V",
">",
"newCacheConfig",
")",
"{",
"try",
"{",
"String",
"nameWithPrefix",
"... | Creates a new cache configuration on Hazelcast members.
@param client the client instance which will send the operation to server
@param newCacheConfig the cache configuration to be sent to server
@param <K> type of the key of the cache
@param <V> type of the value of the ... | [
"Creates",
"a",
"new",
"cache",
"configuration",
"on",
"Hazelcast",
"members",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast-client/src/main/java/com/hazelcast/client/cache/impl/ClientCacheHelper.java#L114-L132 |
facebook/fresco | imagepipeline-base/src/main/java/com/facebook/imageutils/StreamProcessor.java | StreamProcessor.readPackedInt | public static int readPackedInt(InputStream is, int numBytes, boolean isLittleEndian)
throws IOException {
"""
Consumes up to 4 bytes and returns them as int (taking into account endianess).
Throws exception if specified number of bytes cannot be consumed.
@param is the input stream to read bytes from
@pa... | java | public static int readPackedInt(InputStream is, int numBytes, boolean isLittleEndian)
throws IOException {
int value = 0;
for (int i = 0; i < numBytes; i++) {
int b = is.read();
if (b == -1) {
throw new IOException("no more bytes");
}
if (isLittleEndian) {
value |= ... | [
"public",
"static",
"int",
"readPackedInt",
"(",
"InputStream",
"is",
",",
"int",
"numBytes",
",",
"boolean",
"isLittleEndian",
")",
"throws",
"IOException",
"{",
"int",
"value",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numBytes",... | Consumes up to 4 bytes and returns them as int (taking into account endianess).
Throws exception if specified number of bytes cannot be consumed.
@param is the input stream to read bytes from
@param numBytes the number of bytes to read
@param isLittleEndian whether the bytes should be interpreted in little or big endia... | [
"Consumes",
"up",
"to",
"4",
"bytes",
"and",
"returns",
"them",
"as",
"int",
"(",
"taking",
"into",
"account",
"endianess",
")",
".",
"Throws",
"exception",
"if",
"specified",
"number",
"of",
"bytes",
"cannot",
"be",
"consumed",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline-base/src/main/java/com/facebook/imageutils/StreamProcessor.java#L26-L41 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/Util.java | Util.pwr2LawPrev | public static final int pwr2LawPrev(final int ppo, final int curPoint) {
"""
Computes the previous, smaller integer point in the power series
<i>point = 2<sup>( i / ppo )</sup></i> given the current point in the series.
For illustration, this can be used in a loop as follows:
<pre>{@code
int maxP = 1024;
in... | java | public static final int pwr2LawPrev(final int ppo, final int curPoint) {
if (curPoint <= 1) { return 0; }
int gi = (int)round(log2(curPoint) * ppo); //current generating index
int prev;
do {
prev = (int)round(pow(2.0, (double) --gi / ppo));
} while (prev >= curPoint);
return prev;
} | [
"public",
"static",
"final",
"int",
"pwr2LawPrev",
"(",
"final",
"int",
"ppo",
",",
"final",
"int",
"curPoint",
")",
"{",
"if",
"(",
"curPoint",
"<=",
"1",
")",
"{",
"return",
"0",
";",
"}",
"int",
"gi",
"=",
"(",
"int",
")",
"round",
"(",
"log2",
... | Computes the previous, smaller integer point in the power series
<i>point = 2<sup>( i / ppo )</sup></i> given the current point in the series.
For illustration, this can be used in a loop as follows:
<pre>{@code
int maxP = 1024;
int minP = 1;
int ppo = 2;
for (int p = maxP; p >= minP; p = pwr2LawPrev(ppo, p)) {
Syste... | [
"Computes",
"the",
"previous",
"smaller",
"integer",
"point",
"in",
"the",
"power",
"series",
"<i",
">",
"point",
"=",
"2<sup",
">",
"(",
"i",
"/",
"ppo",
")",
"<",
"/",
"sup",
">",
"<",
"/",
"i",
">",
"given",
"the",
"current",
"point",
"in",
"the... | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/Util.java#L518-L526 |
alkacon/opencms-core | src/org/opencms/gwt/CmsClientUserSettingConverter.java | CmsClientUserSettingConverter.saveSettings | public void saveSettings(Map<String, String> settings) throws Exception {
"""
Saves the given user preference values.<p>
@param settings the user preference values to save
@throws Exception if something goes wrong
"""
for (Map.Entry<String, String> entry : settings.entrySet()) {
Stri... | java | public void saveSettings(Map<String, String> settings) throws Exception {
for (Map.Entry<String, String> entry : settings.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
saveSetting(key, value);
}
m_currentPreferences.save(m_cms);
... | [
"public",
"void",
"saveSettings",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"settings",
")",
"throws",
"Exception",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
":",
"settings",
".",
"entrySet",
"(",
")",
")",
... | Saves the given user preference values.<p>
@param settings the user preference values to save
@throws Exception if something goes wrong | [
"Saves",
"the",
"given",
"user",
"preference",
"values",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/CmsClientUserSettingConverter.java#L167-L176 |
skyscreamer/JSONassert | src/main/java/org/skyscreamer/jsonassert/JSONAssert.java | JSONAssert.assertEquals | public static void assertEquals(String expectedStr, String actualStr, JSONComparator comparator)
throws JSONException {
"""
Asserts that the json string provided matches the expected string. If it isn't it throws an
{@link AssertionError}.
@param expectedStr Expected JSON string
@param actualStr ... | java | public static void assertEquals(String expectedStr, String actualStr, JSONComparator comparator)
throws JSONException {
assertEquals("", expectedStr, actualStr, comparator);
} | [
"public",
"static",
"void",
"assertEquals",
"(",
"String",
"expectedStr",
",",
"String",
"actualStr",
",",
"JSONComparator",
"comparator",
")",
"throws",
"JSONException",
"{",
"assertEquals",
"(",
"\"\"",
",",
"expectedStr",
",",
"actualStr",
",",
"comparator",
")... | Asserts that the json string provided matches the expected string. If it isn't it throws an
{@link AssertionError}.
@param expectedStr Expected JSON string
@param actualStr String to compare
@param comparator Comparator
@throws JSONException JSON parsing error | [
"Asserts",
"that",
"the",
"json",
"string",
"provided",
"matches",
"the",
"expected",
"string",
".",
"If",
"it",
"isn",
"t",
"it",
"throws",
"an",
"{",
"@link",
"AssertionError",
"}",
"."
] | train | https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/JSONAssert.java#L462-L466 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.validateGeneral | public static <T extends CharSequence> T validateGeneral(T value, int min, String errorMsg) throws ValidateException {
"""
验证是否为给定最小长度的英文字母 、数字和下划线
@param <T> 字符串类型
@param value 值
@param min 最小长度,负数自动识别为0
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常
"""
return validateGeneral... | java | public static <T extends CharSequence> T validateGeneral(T value, int min, String errorMsg) throws ValidateException {
return validateGeneral(value, min, 0, errorMsg);
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"validateGeneral",
"(",
"T",
"value",
",",
"int",
"min",
",",
"String",
"errorMsg",
")",
"throws",
"ValidateException",
"{",
"return",
"validateGeneral",
"(",
"value",
",",
"min",
",",
"0",
... | 验证是否为给定最小长度的英文字母 、数字和下划线
@param <T> 字符串类型
@param value 值
@param min 最小长度,负数自动识别为0
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常 | [
"验证是否为给定最小长度的英文字母",
"、数字和下划线"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L423-L425 |
alibaba/jstorm | jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/common/HdfsUtils.java | HdfsUtils.tryCreateFile | public static FSDataOutputStream tryCreateFile(FileSystem fs, Path file) throws IOException {
"""
Returns null if file already exists. throws if there was unexpected problem
"""
try {
FSDataOutputStream os = fs.create(file, false);
return os;
} catch (FileAlreadyExistsException e) {
r... | java | public static FSDataOutputStream tryCreateFile(FileSystem fs, Path file) throws IOException {
try {
FSDataOutputStream os = fs.create(file, false);
return os;
} catch (FileAlreadyExistsException e) {
return null;
} catch (RemoteException e) {
if( e.unwrapRemoteException() instanceof ... | [
"public",
"static",
"FSDataOutputStream",
"tryCreateFile",
"(",
"FileSystem",
"fs",
",",
"Path",
"file",
")",
"throws",
"IOException",
"{",
"try",
"{",
"FSDataOutputStream",
"os",
"=",
"fs",
".",
"create",
"(",
"file",
",",
"false",
")",
";",
"return",
"os",... | Returns null if file already exists. throws if there was unexpected problem | [
"Returns",
"null",
"if",
"file",
"already",
"exists",
".",
"throws",
"if",
"there",
"was",
"unexpected",
"problem"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-hdfs/src/main/java/com/alibaba/jstorm/hdfs/common/HdfsUtils.java#L65-L78 |
Azure/azure-sdk-for-java | containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupsInner.java | ContainerGroupsInner.createOrUpdate | public ContainerGroupInner createOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) {
"""
Create or update container groups.
Create or update container groups with specified configurations.
@param resourceGroupName The name of the resource group.
@param container... | java | public ContainerGroupInner createOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).toBlocking().last().body();
} | [
"public",
"ContainerGroupInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"containerGroupName",
",",
"ContainerGroupInner",
"containerGroup",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"containerGroup... | Create or update container groups.
Create or update container groups with specified configurations.
@param resourceGroupName The name of the resource group.
@param containerGroupName The name of the container group.
@param containerGroup The properties of the container group to be created or updated.
@throws IllegalAr... | [
"Create",
"or",
"update",
"container",
"groups",
".",
"Create",
"or",
"update",
"container",
"groups",
"with",
"specified",
"configurations",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerinstance/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerinstance/v2018_02_01_preview/implementation/ContainerGroupsInner.java#L441-L443 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/svm/SBP.java | SBP.setBurnIn | public void setBurnIn(double burnIn) {
"""
Sets the burn in fraction. SBP averages the intermediate solutions from
each step as the final solution. The intermediate steps of SBP are highly
correlated, and the begging solutions are usually not as meaningful
toward the converged solution. To overcome this issue a... | java | public void setBurnIn(double burnIn)
{
if(Double.isNaN(burnIn) || burnIn < 0 || burnIn >= 1)
throw new IllegalArgumentException("BurnInFraction must be in [0, 1), not " + burnIn);
this.burnIn = burnIn;
} | [
"public",
"void",
"setBurnIn",
"(",
"double",
"burnIn",
")",
"{",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"burnIn",
")",
"||",
"burnIn",
"<",
"0",
"||",
"burnIn",
">=",
"1",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"BurnInFraction must be in [... | Sets the burn in fraction. SBP averages the intermediate solutions from
each step as the final solution. The intermediate steps of SBP are highly
correlated, and the begging solutions are usually not as meaningful
toward the converged solution. To overcome this issue a certain fraction
of the iterations are not average... | [
"Sets",
"the",
"burn",
"in",
"fraction",
".",
"SBP",
"averages",
"the",
"intermediate",
"solutions",
"from",
"each",
"step",
"as",
"the",
"final",
"solution",
".",
"The",
"intermediate",
"steps",
"of",
"SBP",
"are",
"highly",
"correlated",
"and",
"the",
"beg... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/svm/SBP.java#L132-L137 |
openbaton/openbaton-client | sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceRecordAgent.java | NetworkServiceRecordAgent.updateVNFR | @Help(help = "update VirtualNetworkFunctionRecord")
public String updateVNFR(
final String idNsr,
final String idVnfr,
final VirtualNetworkFunctionRecord virtualNetworkFunctionRecord)
throws SDKException {
"""
Updates a VirtualNetworkFunctionRecord.
@param idNsr the ID of the NetworkSe... | java | @Help(help = "update VirtualNetworkFunctionRecord")
public String updateVNFR(
final String idNsr,
final String idVnfr,
final VirtualNetworkFunctionRecord virtualNetworkFunctionRecord)
throws SDKException {
String url = idNsr + "/vnfrecords" + "/" + idVnfr;
return requestPut(url, virtua... | [
"@",
"Help",
"(",
"help",
"=",
"\"update VirtualNetworkFunctionRecord\"",
")",
"public",
"String",
"updateVNFR",
"(",
"final",
"String",
"idNsr",
",",
"final",
"String",
"idVnfr",
",",
"final",
"VirtualNetworkFunctionRecord",
"virtualNetworkFunctionRecord",
")",
"throws... | Updates a VirtualNetworkFunctionRecord.
@param idNsr the ID of the NetworkServiceRecord containing the VirtualNetworkFunctionRecord
@param idVnfr the ID of the VirtualNetworkFunctionRecord to update
@param virtualNetworkFunctionRecord the updated version of the VirtualNetworkFunctionRecord
@return the updated VirtualN... | [
"Updates",
"a",
"VirtualNetworkFunctionRecord",
"."
] | train | https://github.com/openbaton/openbaton-client/blob/6ca6dd6b62a23940d312213d6fa489d5b636061a/sdk/src/main/java/org/openbaton/sdk/api/rest/NetworkServiceRecordAgent.java#L398-L406 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpSubsystemChannel.java | SftpSubsystemChannel.setAttributes | public void setAttributes(SftpFile file, SftpFileAttributes attrs)
throws SftpStatusException, SshException {
"""
Sets the attributes of a file.
@param file
the file object.
@param attrs
the new attributes.
@throws SshException
"""
if (file.getHandle() == null) {
throw new SftpStatusException(... | java | public void setAttributes(SftpFile file, SftpFileAttributes attrs)
throws SftpStatusException, SshException {
if (file.getHandle() == null) {
throw new SftpStatusException(SftpStatusException.INVALID_HANDLE,
"The handle is not an open file handle!");
}
try {
UnsignedInteger32 requestId = nextReques... | [
"public",
"void",
"setAttributes",
"(",
"SftpFile",
"file",
",",
"SftpFileAttributes",
"attrs",
")",
"throws",
"SftpStatusException",
",",
"SshException",
"{",
"if",
"(",
"file",
".",
"getHandle",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"SftpStatusEx... | Sets the attributes of a file.
@param file
the file object.
@param attrs
the new attributes.
@throws SshException | [
"Sets",
"the",
"attributes",
"of",
"a",
"file",
"."
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/sftp/SftpSubsystemChannel.java#L497-L520 |
Graylog2/graylog2-server | graylog2-server/src/main/java/org/graylog2/plugin/inject/Graylog2Module.java | Graylog2Module.registerJacksonSubtype | protected void registerJacksonSubtype(Class<?> klass, String name) {
"""
Use this if the class does not have a {@link com.fasterxml.jackson.annotation.JsonTypeName} annotation.
@param klass
@param name
"""
jacksonSubTypesBinder().addBinding().toInstance(new NamedType(klass, name));
} | java | protected void registerJacksonSubtype(Class<?> klass, String name) {
jacksonSubTypesBinder().addBinding().toInstance(new NamedType(klass, name));
} | [
"protected",
"void",
"registerJacksonSubtype",
"(",
"Class",
"<",
"?",
">",
"klass",
",",
"String",
"name",
")",
"{",
"jacksonSubTypesBinder",
"(",
")",
".",
"addBinding",
"(",
")",
".",
"toInstance",
"(",
"new",
"NamedType",
"(",
"klass",
",",
"name",
")"... | Use this if the class does not have a {@link com.fasterxml.jackson.annotation.JsonTypeName} annotation.
@param klass
@param name | [
"Use",
"this",
"if",
"the",
"class",
"does",
"not",
"have",
"a",
"{"
] | train | https://github.com/Graylog2/graylog2-server/blob/50b565dcead6e0a372236d5c2f8530dc5726fa9b/graylog2-server/src/main/java/org/graylog2/plugin/inject/Graylog2Module.java#L455-L457 |
twitter/hraven | hraven-core/src/main/java/com/twitter/hraven/datasource/HdfsStatsService.java | HdfsStatsService.getOlderRunId | public static long getOlderRunId(int i, long runId) {
"""
this function returns an older timestamp ideally we would be using the
daily aggregation table and be simply looking for last run of the
aggregation, but right now, in the hourly table, we try to look for certain
timestamps in the past instead of scannin... | java | public static long getOlderRunId(int i, long runId) {
/**
* try to pick a randomized hour around that old date instead of picking
* exactly the same hour
*/
int randomizedHourInSeconds = (int) (Math.random() * 23) * 3600;
/**
* consider the day before old date and add randomizedHour for... | [
"public",
"static",
"long",
"getOlderRunId",
"(",
"int",
"i",
",",
"long",
"runId",
")",
"{",
"/**\n * try to pick a randomized hour around that old date instead of picking\n * exactly the same hour\n */",
"int",
"randomizedHourInSeconds",
"=",
"(",
"int",
")",
"(",... | this function returns an older timestamp ideally we would be using the
daily aggregation table and be simply looking for last run of the
aggregation, but right now, in the hourly table, we try to look for certain
timestamps in the past instead of scanning the entire table for the last
run.
@param i (i should always be ... | [
"this",
"function",
"returns",
"an",
"older",
"timestamp",
"ideally",
"we",
"would",
"be",
"using",
"the",
"daily",
"aggregation",
"table",
"and",
"be",
"simply",
"looking",
"for",
"last",
"run",
"of",
"the",
"aggregation",
"but",
"right",
"now",
"in",
"the"... | train | https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/HdfsStatsService.java#L283-L309 |
dihedron/dihedron-commons | src/main/java/org/dihedron/core/formatters/HexWriter.java | HexWriter.toMultiLineHex | public static String toMultiLineHex(byte[] data, String byteSeparator, int wrapAfter) {
"""
Formats a byte[] as an hexadecimal String, interleaving bytes with a
separator string.
@param data
the byte[] to format.
@param byteSeparator
the string to be used to separate bytes.
@param wrapAfter
the number of ... | java | public static String toMultiLineHex(byte[] data, String byteSeparator, int wrapAfter) {
int n, x;
String w = null;
String s = null;
String separator = null;
for (n = 0; n < data.length; n++) {
x = (int) (0x000000FF & data[n]);
w = Integer.toHexString(x).toUpperCase();
if (w.length() == 1) {
... | [
"public",
"static",
"String",
"toMultiLineHex",
"(",
"byte",
"[",
"]",
"data",
",",
"String",
"byteSeparator",
",",
"int",
"wrapAfter",
")",
"{",
"int",
"n",
",",
"x",
";",
"String",
"w",
"=",
"null",
";",
"String",
"s",
"=",
"null",
";",
"String",
"... | Formats a byte[] as an hexadecimal String, interleaving bytes with a
separator string.
@param data
the byte[] to format.
@param byteSeparator
the string to be used to separate bytes.
@param wrapAfter
the number of bytes to be written per line.
@return
the formatted string. | [
"Formats",
"a",
"byte",
"[]",
"as",
"an",
"hexadecimal",
"String",
"interleaving",
"bytes",
"with",
"a",
"separator",
"string",
"."
] | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/core/formatters/HexWriter.java#L108-L131 |
gallandarakhneorg/afc | core/maths/mathphysics/src/main/java/org/arakhne/afc/math/physics/MeasureUnitUtil.java | MeasureUnitUtil.fromRadiansPerSecond | @Pure
public static double fromRadiansPerSecond(double value, AngularUnit outputUnit) {
"""
Convert the given value expressed in radians per second to the given unit.
@param value is the value to convert
@param outputUnit is the unit of result.
@return the result of the convertion.
"""
switch (outputUn... | java | @Pure
public static double fromRadiansPerSecond(double value, AngularUnit outputUnit) {
switch (outputUnit) {
case TURNS_PER_SECOND:
return value / (2. * MathConstants.PI);
case DEGREES_PER_SECOND:
return Math.toDegrees(value);
case RADIANS_PER_SECOND:
default:
}
return value;
} | [
"@",
"Pure",
"public",
"static",
"double",
"fromRadiansPerSecond",
"(",
"double",
"value",
",",
"AngularUnit",
"outputUnit",
")",
"{",
"switch",
"(",
"outputUnit",
")",
"{",
"case",
"TURNS_PER_SECOND",
":",
"return",
"value",
"/",
"(",
"2.",
"*",
"MathConstant... | Convert the given value expressed in radians per second to the given unit.
@param value is the value to convert
@param outputUnit is the unit of result.
@return the result of the convertion. | [
"Convert",
"the",
"given",
"value",
"expressed",
"in",
"radians",
"per",
"second",
"to",
"the",
"given",
"unit",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathphysics/src/main/java/org/arakhne/afc/math/physics/MeasureUnitUtil.java#L677-L688 |
phax/ph-commons | ph-dao/src/main/java/com/helger/dao/wal/WALListener.java | WALListener.registerForLaterWriting | public void registerForLaterWriting (@Nonnull final AbstractWALDAO <?> aDAO,
@Nonnull final String sWALFilename,
@Nonnull final TimeValue aWaitingWime) {
"""
This is the main method for registration of later writing.
@param aDAO
The ... | java | public void registerForLaterWriting (@Nonnull final AbstractWALDAO <?> aDAO,
@Nonnull final String sWALFilename,
@Nonnull final TimeValue aWaitingWime)
{
// In case many DAOs of the same class exist, the filename is also added
final... | [
"public",
"void",
"registerForLaterWriting",
"(",
"@",
"Nonnull",
"final",
"AbstractWALDAO",
"<",
"?",
">",
"aDAO",
",",
"@",
"Nonnull",
"final",
"String",
"sWALFilename",
",",
"@",
"Nonnull",
"final",
"TimeValue",
"aWaitingWime",
")",
"{",
"// In case many DAOs o... | This is the main method for registration of later writing.
@param aDAO
The DAO to be written
@param sWALFilename
The filename of the WAL file for later deletion (in case the
filename changes over time).
@param aWaitingWime
The time to wait, until the file is physically written. May not be
<code>null</code>. | [
"This",
"is",
"the",
"main",
"method",
"for",
"registration",
"of",
"later",
"writing",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-dao/src/main/java/com/helger/dao/wal/WALListener.java#L128-L176 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java | JobsImpl.listFromJobSchedule | public PagedList<CloudJob> listFromJobSchedule(final String jobScheduleId) {
"""
Lists the jobs that have been created under the specified job schedule.
@param jobScheduleId The ID of the job schedule from which you want to get a list of jobs.
@throws IllegalArgumentException thrown if parameters fail the vali... | java | public PagedList<CloudJob> listFromJobSchedule(final String jobScheduleId) {
ServiceResponseWithHeaders<Page<CloudJob>, JobListFromJobScheduleHeaders> response = listFromJobScheduleSinglePageAsync(jobScheduleId).toBlocking().single();
return new PagedList<CloudJob>(response.body()) {
@Overri... | [
"public",
"PagedList",
"<",
"CloudJob",
">",
"listFromJobSchedule",
"(",
"final",
"String",
"jobScheduleId",
")",
"{",
"ServiceResponseWithHeaders",
"<",
"Page",
"<",
"CloudJob",
">",
",",
"JobListFromJobScheduleHeaders",
">",
"response",
"=",
"listFromJobScheduleSingle... | Lists the jobs that have been created under the specified job schedule.
@param jobScheduleId The ID of the job schedule from which you want to get a list of jobs.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws BatchErrorException thrown if the request is rejected by server
@throws Ru... | [
"Lists",
"the",
"jobs",
"that",
"have",
"been",
"created",
"under",
"the",
"specified",
"job",
"schedule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L2512-L2520 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/RouteTablesInner.java | RouteTablesInner.updateTagsAsync | public Observable<RouteTableInner> updateTagsAsync(String resourceGroupName, String routeTableName) {
"""
Updates a route table tags.
@param resourceGroupName The name of the resource group.
@param routeTableName The name of the route table.
@throws IllegalArgumentException thrown if parameters fail the valid... | java | public Observable<RouteTableInner> updateTagsAsync(String resourceGroupName, String routeTableName) {
return updateTagsWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1<ServiceResponse<RouteTableInner>, RouteTableInner>() {
@Override
public RouteTableInner call(Se... | [
"public",
"Observable",
"<",
"RouteTableInner",
">",
"updateTagsAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"routeTableName",
")",
"{",
"return",
"updateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"routeTableName",
")",
".",
"map",
"(",
... | Updates a route table tags.
@param resourceGroupName The name of the resource group.
@param routeTableName The name of the route table.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Updates",
"a",
"route",
"table",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/RouteTablesInner.java#L636-L643 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveEventsInner.java | LiveEventsInner.beginUpdate | public LiveEventInner beginUpdate(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) {
"""
Updates a existing Live Event.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@para... | java | public LiveEventInner beginUpdate(String resourceGroupName, String accountName, String liveEventName, LiveEventInner parameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, parameters).toBlocking().single().body();
} | [
"public",
"LiveEventInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"liveEventName",
",",
"LiveEventInner",
"parameters",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"acc... | Updates a existing Live Event.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param liveEventName The name of the Live Event.
@param parameters Live Event properties needed for creation.
@throws IllegalArgumentException thrown... | [
"Updates",
"a",
"existing",
"Live",
"Event",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LiveEventsInner.java#L840-L842 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java | EnvironmentSettingsInner.startAsync | public Observable<Void> startAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) {
"""
Starts a template by starting all resources inside the template. This operation can take a while to complete.
@param resourceGroupName The name of the resource group.
@param ... | java | public Observable<Void> startAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName) {
return startWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
... | [
"public",
"Observable",
"<",
"Void",
">",
"startAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"labName",
",",
"String",
"environmentSettingName",
")",
"{",
"return",
"startWithServiceResponseAsync",
"(",
"resourceGroupName",... | Starts a template by starting all resources inside the template. This operation can take a while to complete.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@param environmentSettingName The name of the environment Setting... | [
"Starts",
"a",
"template",
"by",
"starting",
"all",
"resources",
"inside",
"the",
"template",
".",
"This",
"operation",
"can",
"take",
"a",
"while",
"to",
"complete",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java#L1432-L1439 |
hedyn/wsonrpc | wsonrpc-core/src/main/java/net/apexes/wsonrpc/core/JsonRpcControl.java | JsonRpcControl.receiveResponse | public <T> T receiveResponse(byte[] bytes, Class<T> returnType) throws IOException, WsonrpcException, RemoteException {
"""
接收远程调用得到的回复,从回复中返回指定类型的对象。
@param bytes 接收到的字节数组
@param returnType 返回的对象类型
@return 返回指定类型的对象
@throws IOException IO错误
@throws WsonrpcException
@throws RemoteException 远程方法抛... | java | public <T> T receiveResponse(byte[] bytes, Class<T> returnType) throws IOException, WsonrpcException, RemoteException {
JsonRpcMessage msg;
try {
msg = receive(bytes);
} catch (JsonException e) {
throw new WsonrpcException("parse response error", e);
}
... | [
"public",
"<",
"T",
">",
"T",
"receiveResponse",
"(",
"byte",
"[",
"]",
"bytes",
",",
"Class",
"<",
"T",
">",
"returnType",
")",
"throws",
"IOException",
",",
"WsonrpcException",
",",
"RemoteException",
"{",
"JsonRpcMessage",
"msg",
";",
"try",
"{",
"msg",... | 接收远程调用得到的回复,从回复中返回指定类型的对象。
@param bytes 接收到的字节数组
@param returnType 返回的对象类型
@return 返回指定类型的对象
@throws IOException IO错误
@throws WsonrpcException
@throws RemoteException 远程方法抛出异常 | [
"接收远程调用得到的回复,从回复中返回指定类型的对象。"
] | train | https://github.com/hedyn/wsonrpc/blob/decbaad4cb8145590bab039d5cfe12437ada0d0a/wsonrpc-core/src/main/java/net/apexes/wsonrpc/core/JsonRpcControl.java#L93-L105 |
geomajas/geomajas-project-client-gwt2 | plugin/tms/tms/src/main/java/org/geomajas/gwt2/plugin/tms/client/TmsClient.java | TmsClient.createTmsMap | protected MapConfiguration createTmsMap(Profile profile, int nrOfZoomLevels) {
"""
Create a map with one of the default profiles and a specific number of zoom levels (default = 21).
@param profile
@param nrOfZoomLevels
@return
"""
MapConfiguration mapConfiguration = null;
switch (profile) {
case GL... | java | protected MapConfiguration createTmsMap(Profile profile, int nrOfZoomLevels) {
MapConfiguration mapConfiguration = null;
switch (profile) {
case GLOBAL_GEODETIC:
mapConfiguration = createTmsMap("EPSG:4326", CrsType.DEGREES, new Bbox(-180, -90, 360, 180), 256,
nrOfZoomLevels);
break;
case GLOBAL_... | [
"protected",
"MapConfiguration",
"createTmsMap",
"(",
"Profile",
"profile",
",",
"int",
"nrOfZoomLevels",
")",
"{",
"MapConfiguration",
"mapConfiguration",
"=",
"null",
";",
"switch",
"(",
"profile",
")",
"{",
"case",
"GLOBAL_GEODETIC",
":",
"mapConfiguration",
"=",... | Create a map with one of the default profiles and a specific number of zoom levels (default = 21).
@param profile
@param nrOfZoomLevels
@return | [
"Create",
"a",
"map",
"with",
"one",
"of",
"the",
"default",
"profiles",
"and",
"a",
"specific",
"number",
"of",
"zoom",
"levels",
"(",
"default",
"=",
"21",
")",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/tms/tms/src/main/java/org/geomajas/gwt2/plugin/tms/client/TmsClient.java#L285-L301 |
couchbase/CouchbaseMock | src/main/java/com/couchbase/mock/DocumentLoader.java | DocumentLoader.loadFromSerializedXZ | public static void loadFromSerializedXZ(InputStream is, String bucketName, CouchbaseMock mock) throws IOException {
"""
Loads the {@code beer-sample} documents from the built-in serialized compressed resource.
@param is The input stream
@param bucketName The target bucket into which the docs should be loaded
... | java | public static void loadFromSerializedXZ(InputStream is, String bucketName, CouchbaseMock mock) throws IOException {
XZInputStream xzi = new XZInputStream(is);
ObjectInputStream ois = new ObjectInputStream(xzi);
StoredInfo si;
try {
si = (StoredInfo) ois.readObject();
... | [
"public",
"static",
"void",
"loadFromSerializedXZ",
"(",
"InputStream",
"is",
",",
"String",
"bucketName",
",",
"CouchbaseMock",
"mock",
")",
"throws",
"IOException",
"{",
"XZInputStream",
"xzi",
"=",
"new",
"XZInputStream",
"(",
"is",
")",
";",
"ObjectInputStream... | Loads the {@code beer-sample} documents from the built-in serialized compressed resource.
@param is The input stream
@param bucketName The target bucket into which the docs should be loaded
@param mock The cluster
@throws IOException if an I/O error occurs | [
"Loads",
"the",
"{",
"@code",
"beer",
"-",
"sample",
"}",
"documents",
"from",
"the",
"built",
"-",
"in",
"serialized",
"compressed",
"resource",
"."
] | train | https://github.com/couchbase/CouchbaseMock/blob/2085bbebade1d5b6356480e7bf335139d08383da/src/main/java/com/couchbase/mock/DocumentLoader.java#L151-L169 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.setRow | public Matrix4f setRow(int row, Vector4fc src) throws IndexOutOfBoundsException {
"""
Set the row at the given <code>row</code> index, starting with <code>0</code>.
@param row
the row index in <code>[0..3]</code>
@param src
the row components to set
@return this
@throws IndexOutOfBoundsException if <code>r... | java | public Matrix4f setRow(int row, Vector4fc src) throws IndexOutOfBoundsException {
switch (row) {
case 0:
this._m00(src.x());
this._m10(src.y());
this._m20(src.z());
this._m30(src.w());
break;
case 1:
this._m01(src.x());
... | [
"public",
"Matrix4f",
"setRow",
"(",
"int",
"row",
",",
"Vector4fc",
"src",
")",
"throws",
"IndexOutOfBoundsException",
"{",
"switch",
"(",
"row",
")",
"{",
"case",
"0",
":",
"this",
".",
"_m00",
"(",
"src",
".",
"x",
"(",
")",
")",
";",
"this",
".",... | Set the row at the given <code>row</code> index, starting with <code>0</code>.
@param row
the row index in <code>[0..3]</code>
@param src
the row components to set
@return this
@throws IndexOutOfBoundsException if <code>row</code> is not in <code>[0..3]</code> | [
"Set",
"the",
"row",
"at",
"the",
"given",
"<code",
">",
"row<",
"/",
"code",
">",
"index",
"starting",
"with",
"<code",
">",
"0<",
"/",
"code",
">",
"."
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L12370-L12401 |
orbisgis/h2gis | postgis-jts/src/main/java/org/h2gis/postgis_jts/JtsBinaryParser.java | JtsBinaryParser.parseCS | private CoordinateSequence parseCS(ValueGetter data, boolean haveZ, boolean haveM) {
"""
Parse the given {@link org.postgis.binary.ValueGetter} into a JTS
{@link org.locationtech.jts.geom.CoordinateSequence}.
@param data {@link org.postgis.binary.ValueGetter} to parse.
@param haveZ True if the {@link org.loca... | java | private CoordinateSequence parseCS(ValueGetter data, boolean haveZ, boolean haveM) {
int count = data.getInt();
int dims = haveZ ? 3 : 2;
CoordinateSequence cs = new Double(count, dims);
for(int i = 0; i < count; ++i) {
for(int d = 0; d < dims; ++d) {
cs.setO... | [
"private",
"CoordinateSequence",
"parseCS",
"(",
"ValueGetter",
"data",
",",
"boolean",
"haveZ",
",",
"boolean",
"haveM",
")",
"{",
"int",
"count",
"=",
"data",
".",
"getInt",
"(",
")",
";",
"int",
"dims",
"=",
"haveZ",
"?",
"3",
":",
"2",
";",
"Coordi... | Parse the given {@link org.postgis.binary.ValueGetter} into a JTS
{@link org.locationtech.jts.geom.CoordinateSequence}.
@param data {@link org.postgis.binary.ValueGetter} to parse.
@param haveZ True if the {@link org.locationtech.jts.geom.CoordinateSequence} has a Z component.
@param haveM True if the {@link org.locat... | [
"Parse",
"the",
"given",
"{",
"@link",
"org",
".",
"postgis",
".",
"binary",
".",
"ValueGetter",
"}",
"into",
"a",
"JTS",
"{",
"@link",
"org",
".",
"locationtech",
".",
"jts",
".",
"geom",
".",
"CoordinateSequence",
"}",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/postgis-jts/src/main/java/org/h2gis/postgis_jts/JtsBinaryParser.java#L210-L226 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/util/MandatoryWarningHandler.java | MandatoryWarningHandler.reportDeferredDiagnostic | public void reportDeferredDiagnostic() {
"""
Report any diagnostic that might have been deferred by previous calls of report().
"""
if (deferredDiagnosticKind != null) {
if (deferredDiagnosticArg == null)
logMandatoryNote(deferredDiagnosticSource, deferredDiagnosticKind.getK... | java | public void reportDeferredDiagnostic() {
if (deferredDiagnosticKind != null) {
if (deferredDiagnosticArg == null)
logMandatoryNote(deferredDiagnosticSource, deferredDiagnosticKind.getKey(prefix));
else
logMandatoryNote(deferredDiagnosticSource, deferredDia... | [
"public",
"void",
"reportDeferredDiagnostic",
"(",
")",
"{",
"if",
"(",
"deferredDiagnosticKind",
"!=",
"null",
")",
"{",
"if",
"(",
"deferredDiagnosticArg",
"==",
"null",
")",
"logMandatoryNote",
"(",
"deferredDiagnosticSource",
",",
"deferredDiagnosticKind",
".",
... | Report any diagnostic that might have been deferred by previous calls of report(). | [
"Report",
"any",
"diagnostic",
"that",
"might",
"have",
"been",
"deferred",
"by",
"previous",
"calls",
"of",
"report",
"()",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/util/MandatoryWarningHandler.java#L171-L181 |
ixa-ehu/ixa-pipe-nerc | src/main/java/eus/ixa/ixa/pipe/nerc/NERTaggerServer.java | NERTaggerServer.getAnnotations | private String getAnnotations(Annotate annotator, String stringFromClient)
throws JDOMException, IOException {
"""
Named Entity annotator.
@param annotator
the annotator
@param stringFromClient
the string to be annotated
@return the annotation result
@throws IOException
if io error
@throws JDOMExce... | java | private String getAnnotations(Annotate annotator, String stringFromClient)
throws JDOMException, IOException {
// get a breader from the string coming from the client
BufferedReader clientReader = new BufferedReader(
new StringReader(stringFromClient));
KAFDocument kaf = KAFDocument.createFrom... | [
"private",
"String",
"getAnnotations",
"(",
"Annotate",
"annotator",
",",
"String",
"stringFromClient",
")",
"throws",
"JDOMException",
",",
"IOException",
"{",
"// get a breader from the string coming from the client",
"BufferedReader",
"clientReader",
"=",
"new",
"BufferedR... | Named Entity annotator.
@param annotator
the annotator
@param stringFromClient
the string to be annotated
@return the annotation result
@throws IOException
if io error
@throws JDOMException
if xml error | [
"Named",
"Entity",
"annotator",
"."
] | train | https://github.com/ixa-ehu/ixa-pipe-nerc/blob/299cb49348eb7650fef2ae47c73f6d3384b43c34/src/main/java/eus/ixa/ixa/pipe/nerc/NERTaggerServer.java#L187-L209 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/NumberInRange.java | NumberInRange.isInRange | @ArgumentsChecked
@Throws(IllegalNullArgumentException.class)
public static boolean isInRange(@Nonnull final Number number, @Nonnull final BigDecimal min, @Nonnull final BigDecimal max) {
"""
Test if a number is in an arbitrary range.
@param number
a number
@param min
lower boundary of the range
@param ma... | java | @ArgumentsChecked
@Throws(IllegalNullArgumentException.class)
public static boolean isInRange(@Nonnull final Number number, @Nonnull final BigDecimal min, @Nonnull final BigDecimal max) {
Check.notNull(number, "number");
Check.notNull(min, "min");
Check.notNull(max, "max");
BigDecimal bigDecimal = null;
if... | [
"@",
"ArgumentsChecked",
"@",
"Throws",
"(",
"IllegalNullArgumentException",
".",
"class",
")",
"public",
"static",
"boolean",
"isInRange",
"(",
"@",
"Nonnull",
"final",
"Number",
"number",
",",
"@",
"Nonnull",
"final",
"BigDecimal",
"min",
",",
"@",
"Nonnull",
... | Test if a number is in an arbitrary range.
@param number
a number
@param min
lower boundary of the range
@param max
upper boundary of the range
@return true if the given number is within the range | [
"Test",
"if",
"a",
"number",
"is",
"in",
"an",
"arbitrary",
"range",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/NumberInRange.java#L250-L271 |
lets-blade/blade | src/main/java/com/blade/Environment.java | Environment.addAll | public Environment addAll(@NonNull Map<String, String> map) {
"""
Add a map to props
@param map map config instance
@return return Environment instance
"""
map.forEach((key, value) -> this.props.setProperty(key, value));
return this;
} | java | public Environment addAll(@NonNull Map<String, String> map) {
map.forEach((key, value) -> this.props.setProperty(key, value));
return this;
} | [
"public",
"Environment",
"addAll",
"(",
"@",
"NonNull",
"Map",
"<",
"String",
",",
"String",
">",
"map",
")",
"{",
"map",
".",
"forEach",
"(",
"(",
"key",
",",
"value",
")",
"->",
"this",
".",
"props",
".",
"setProperty",
"(",
"key",
",",
"value",
... | Add a map to props
@param map map config instance
@return return Environment instance | [
"Add",
"a",
"map",
"to",
"props"
] | train | https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/Environment.java#L239-L242 |
eclipse/hawkbit | hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/AutoCompleteTextFieldComponent.java | AutoCompleteTextFieldComponent.onQueryFilterChange | public void onQueryFilterChange(final String currentText, final boolean valid, final String validationMessage) {
"""
Called when the filter-query has been changed in the textfield, e.g. from
client-side.
@param currentText
the current text of the textfield which has been changed
@param valid
{@code boolean}... | java | public void onQueryFilterChange(final String currentText, final boolean valid, final String validationMessage) {
if (valid) {
showValidationSuccesIcon(currentText);
} else {
showValidationFailureIcon(validationMessage);
}
listeners.forEach(listener -> listener.que... | [
"public",
"void",
"onQueryFilterChange",
"(",
"final",
"String",
"currentText",
",",
"final",
"boolean",
"valid",
",",
"final",
"String",
"validationMessage",
")",
"{",
"if",
"(",
"valid",
")",
"{",
"showValidationSuccesIcon",
"(",
"currentText",
")",
";",
"}",
... | Called when the filter-query has been changed in the textfield, e.g. from
client-side.
@param currentText
the current text of the textfield which has been changed
@param valid
{@code boolean} if the current text is RSQL syntax valid
otherwise {@code false}
@param validationMessage
a message shown in case of syntax err... | [
"Called",
"when",
"the",
"filter",
"-",
"query",
"has",
"been",
"changed",
"in",
"the",
"textfield",
"e",
".",
"g",
".",
"from",
"client",
"-",
"side",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/AutoCompleteTextFieldComponent.java#L156-L163 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/jmx/InstanceMBean.java | InstanceMBean.registerWanPublisherMBeans | private void registerWanPublisherMBeans(WanReplicationService wanReplicationService) {
"""
Registers managed beans for all WAN publishers, if any.
@param wanReplicationService the WAN replication service
"""
final Map<String, LocalWanStats> wanStats = wanReplicationService.getStats();
if (wa... | java | private void registerWanPublisherMBeans(WanReplicationService wanReplicationService) {
final Map<String, LocalWanStats> wanStats = wanReplicationService.getStats();
if (wanStats == null) {
return;
}
for (Entry<String, LocalWanStats> replicationStatsEntry : wanStats.entrySet(... | [
"private",
"void",
"registerWanPublisherMBeans",
"(",
"WanReplicationService",
"wanReplicationService",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"LocalWanStats",
">",
"wanStats",
"=",
"wanReplicationService",
".",
"getStats",
"(",
")",
";",
"if",
"(",
"wanStats... | Registers managed beans for all WAN publishers, if any.
@param wanReplicationService the WAN replication service | [
"Registers",
"managed",
"beans",
"for",
"all",
"WAN",
"publishers",
"if",
"any",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/jmx/InstanceMBean.java#L89-L104 |
TNG/JGiven | jgiven-core/src/main/java/com/tngtech/jgiven/attachment/Attachment.java | Attachment.fromText | public static Attachment fromText( String content, MediaType mediaType ) {
"""
Equivalent to {@link com.tngtech.jgiven.attachment.Attachment#Attachment(String, MediaType)}
@throws java.lang.IllegalArgumentException if mediaType is binary
"""
if( mediaType.isBinary() ) {
throw new IllegalAr... | java | public static Attachment fromText( String content, MediaType mediaType ) {
if( mediaType.isBinary() ) {
throw new IllegalArgumentException( "MediaType must not be binary" );
}
return new Attachment( content, mediaType );
} | [
"public",
"static",
"Attachment",
"fromText",
"(",
"String",
"content",
",",
"MediaType",
"mediaType",
")",
"{",
"if",
"(",
"mediaType",
".",
"isBinary",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"MediaType must not be binary\"",
")",
... | Equivalent to {@link com.tngtech.jgiven.attachment.Attachment#Attachment(String, MediaType)}
@throws java.lang.IllegalArgumentException if mediaType is binary | [
"Equivalent",
"to",
"{"
] | train | https://github.com/TNG/JGiven/blob/1a69248fc6d7eb380cdc4542e3be273842889748/jgiven-core/src/main/java/com/tngtech/jgiven/attachment/Attachment.java#L239-L244 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.userInGroup | public boolean userInGroup(String username, String groupname) throws CmsException {
"""
Tests if a user is member of the given group.<p>
@param username the name of the user to test
@param groupname the name of the group to test
@return <code>true</code>, if the user is in the group; or <code>false</code> o... | java | public boolean userInGroup(String username, String groupname) throws CmsException {
return (m_securityManager.userInGroup(m_context, username, groupname));
} | [
"public",
"boolean",
"userInGroup",
"(",
"String",
"username",
",",
"String",
"groupname",
")",
"throws",
"CmsException",
"{",
"return",
"(",
"m_securityManager",
".",
"userInGroup",
"(",
"m_context",
",",
"username",
",",
"groupname",
")",
")",
";",
"}"
] | Tests if a user is member of the given group.<p>
@param username the name of the user to test
@param groupname the name of the group to test
@return <code>true</code>, if the user is in the group; or <code>false</code> otherwise
@throws CmsException if operation was not successful | [
"Tests",
"if",
"a",
"user",
"is",
"member",
"of",
"the",
"given",
"group",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L3958-L3961 |
nguillaumin/slick2d-maven | slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/DataSet.java | DataSet.addKerning | public void addKerning(int first, int second, int offset) {
"""
Add some kerning data
@param first The first character
@param second The second character
@param offset The kerning offset to apply
"""
kerning.add(new KerningData(first, second, offset));
} | java | public void addKerning(int first, int second, int offset) {
kerning.add(new KerningData(first, second, offset));
} | [
"public",
"void",
"addKerning",
"(",
"int",
"first",
",",
"int",
"second",
",",
"int",
"offset",
")",
"{",
"kerning",
".",
"add",
"(",
"new",
"KerningData",
"(",
"first",
",",
"second",
",",
"offset",
")",
")",
";",
"}"
] | Add some kerning data
@param first The first character
@param second The second character
@param offset The kerning offset to apply | [
"Add",
"some",
"kerning",
"data"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-hiero/src/main/java/org/newdawn/slick/tools/hiero/DataSet.java#L225-L227 |
spring-projects/spring-android | spring-android-rest-template/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequest.java | HttpComponentsClientHttpRequest.addHeaders | static void addHeaders(HttpUriRequest httpRequest, HttpHeaders headers) {
"""
Add the given headers to the given HTTP request.
@param httpRequest the request to add the headers to
@param headers the headers to add
"""
for (Map.Entry<String, List<String>> entry : headers.entrySet()) {
String headerName =... | java | static void addHeaders(HttpUriRequest httpRequest, HttpHeaders headers) {
for (Map.Entry<String, List<String>> entry : headers.entrySet()) {
String headerName = entry.getKey();
if (HttpHeaders.COOKIE.equalsIgnoreCase(headerName)) { // RFC 6265
String headerValue = StringUtils.collectionToDelimitedString(en... | [
"static",
"void",
"addHeaders",
"(",
"HttpUriRequest",
"httpRequest",
",",
"HttpHeaders",
"headers",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"entry",
":",
"headers",
".",
"entrySet",
"(",
")",
")",
... | Add the given headers to the given HTTP request.
@param httpRequest the request to add the headers to
@param headers the headers to add | [
"Add",
"the",
"given",
"headers",
"to",
"the",
"given",
"HTTP",
"request",
"."
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-rest-template/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequest.java#L101-L115 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.templateModem_name_PUT | public void templateModem_name_PUT(String name, OvhTemplateModem body) throws IOException {
"""
Alter this object properties
REST: PUT /xdsl/templateModem/{name}
@param body [required] New object properties
@param name [required] Name of the Modem Template
"""
String qPath = "/xdsl/templateModem/{name}"... | java | public void templateModem_name_PUT(String name, OvhTemplateModem body) throws IOException {
String qPath = "/xdsl/templateModem/{name}";
StringBuilder sb = path(qPath, name);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"templateModem_name_PUT",
"(",
"String",
"name",
",",
"OvhTemplateModem",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/templateModem/{name}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"name",
")"... | Alter this object properties
REST: PUT /xdsl/templateModem/{name}
@param body [required] New object properties
@param name [required] Name of the Modem Template | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L136-L140 |
nostra13/Android-Universal-Image-Loader | library/src/main/java/com/nostra13/universalimageloader/core/DefaultConfigurationFactory.java | DefaultConfigurationFactory.createMemoryCache | public static MemoryCache createMemoryCache(Context context, int memoryCacheSize) {
"""
Creates default implementation of {@link MemoryCache} - {@link LruMemoryCache}<br />
Default cache size = 1/8 of available app memory.
"""
if (memoryCacheSize == 0) {
ActivityManager am = (ActivityManager) context.get... | java | public static MemoryCache createMemoryCache(Context context, int memoryCacheSize) {
if (memoryCacheSize == 0) {
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
int memoryClass = am.getMemoryClass();
if (hasHoneycomb() && isLargeHeap(context)) {
memoryClass = get... | [
"public",
"static",
"MemoryCache",
"createMemoryCache",
"(",
"Context",
"context",
",",
"int",
"memoryCacheSize",
")",
"{",
"if",
"(",
"memoryCacheSize",
"==",
"0",
")",
"{",
"ActivityManager",
"am",
"=",
"(",
"ActivityManager",
")",
"context",
".",
"getSystemSe... | Creates default implementation of {@link MemoryCache} - {@link LruMemoryCache}<br />
Default cache size = 1/8 of available app memory. | [
"Creates",
"default",
"implementation",
"of",
"{"
] | train | https://github.com/nostra13/Android-Universal-Image-Loader/blob/fc3c5f6779bb4f702e233653b61bd9d559e345cc/library/src/main/java/com/nostra13/universalimageloader/core/DefaultConfigurationFactory.java#L114-L124 |
xwiki/xwiki-rendering | xwiki-rendering-api/src/main/java/org/xwiki/rendering/internal/parser/reference/GenericLinkReferenceParser.java | GenericLinkReferenceParser.shouldEscape | private boolean shouldEscape(StringBuilder content, int charPosition) {
"""
Count the number of escape chars before a given character and if that number is odd then that character should be
escaped.
@param content the content in which to check for escapes
@param charPosition the position of the char for which... | java | private boolean shouldEscape(StringBuilder content, int charPosition)
{
int counter = 0;
int pos = charPosition - 1;
while (pos > -1 && content.charAt(pos) == ESCAPE_CHAR) {
counter++;
pos--;
}
return counter % 2 != 0;
} | [
"private",
"boolean",
"shouldEscape",
"(",
"StringBuilder",
"content",
",",
"int",
"charPosition",
")",
"{",
"int",
"counter",
"=",
"0",
";",
"int",
"pos",
"=",
"charPosition",
"-",
"1",
";",
"while",
"(",
"pos",
">",
"-",
"1",
"&&",
"content",
".",
"c... | Count the number of escape chars before a given character and if that number is odd then that character should be
escaped.
@param content the content in which to check for escapes
@param charPosition the position of the char for which to decide if it should be escaped or not
@return true if the character should be esc... | [
"Count",
"the",
"number",
"of",
"escape",
"chars",
"before",
"a",
"given",
"character",
"and",
"if",
"that",
"number",
"is",
"odd",
"then",
"that",
"character",
"should",
"be",
"escaped",
"."
] | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-api/src/main/java/org/xwiki/rendering/internal/parser/reference/GenericLinkReferenceParser.java#L292-L301 |
casbin/jcasbin | src/main/java/org/casbin/jcasbin/main/Enforcer.java | Enforcer.hasPermissionForUser | public boolean hasPermissionForUser(String user, String... permission) {
"""
hasPermissionForUser determines whether a user has a permission.
@param user the user.
@param permission the permission, usually be (obj, act). It is actually the rule without the subject.
@return whether the user has the permission.... | java | public boolean hasPermissionForUser(String user, String... permission) {
List<String> params = new ArrayList<>();
params.add(user);
Collections.addAll(params, permission);
return hasPolicy(params);
} | [
"public",
"boolean",
"hasPermissionForUser",
"(",
"String",
"user",
",",
"String",
"...",
"permission",
")",
"{",
"List",
"<",
"String",
">",
"params",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"params",
".",
"add",
"(",
"user",
")",
";",
"Collection... | hasPermissionForUser determines whether a user has a permission.
@param user the user.
@param permission the permission, usually be (obj, act). It is actually the rule without the subject.
@return whether the user has the permission. | [
"hasPermissionForUser",
"determines",
"whether",
"a",
"user",
"has",
"a",
"permission",
"."
] | train | https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/main/Enforcer.java#L329-L336 |
JodaOrg/joda-time | src/main/java/org/joda/time/TimeOfDay.java | TimeOfDay.withPeriodAdded | public TimeOfDay withPeriodAdded(ReadablePeriod period, int scalar) {
"""
Returns a copy of this time with the specified period added,
wrapping to what would be a new day if required.
<p>
If the addition is zero, then <code>this</code> is returned.
Fields in the period that aren't present in the partial are ig... | java | public TimeOfDay withPeriodAdded(ReadablePeriod period, int scalar) {
if (period == null || scalar == 0) {
return this;
}
int[] newValues = getValues();
for (int i = 0; i < period.size(); i++) {
DurationFieldType fieldType = period.getFieldType(i);
int... | [
"public",
"TimeOfDay",
"withPeriodAdded",
"(",
"ReadablePeriod",
"period",
",",
"int",
"scalar",
")",
"{",
"if",
"(",
"period",
"==",
"null",
"||",
"scalar",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"int",
"[",
"]",
"newValues",
"=",
"getValues",... | Returns a copy of this time with the specified period added,
wrapping to what would be a new day if required.
<p>
If the addition is zero, then <code>this</code> is returned.
Fields in the period that aren't present in the partial are ignored.
<p>
This method is typically used to add multiple copies of complex
period i... | [
"Returns",
"a",
"copy",
"of",
"this",
"time",
"with",
"the",
"specified",
"period",
"added",
"wrapping",
"to",
"what",
"would",
"be",
"a",
"new",
"day",
"if",
"required",
".",
"<p",
">",
"If",
"the",
"addition",
"is",
"zero",
"then",
"<code",
">",
"thi... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/TimeOfDay.java#L579-L593 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/BitmapUtil.java | BitmapUtil.splitHorizontally | public static Pair<Bitmap, Bitmap> splitHorizontally(@NonNull final Bitmap bitmap) {
"""
Splits a specific bitmap horizontally at half.
@param bitmap
The bitmap, which should be split, as an instance of the class {@link Bitmap}. The
bitmap may not be null
@return A pair, which contains the two bitmaps, which... | java | public static Pair<Bitmap, Bitmap> splitHorizontally(@NonNull final Bitmap bitmap) {
return splitHorizontally(bitmap, bitmap.getHeight() / 2);
} | [
"public",
"static",
"Pair",
"<",
"Bitmap",
",",
"Bitmap",
">",
"splitHorizontally",
"(",
"@",
"NonNull",
"final",
"Bitmap",
"bitmap",
")",
"{",
"return",
"splitHorizontally",
"(",
"bitmap",
",",
"bitmap",
".",
"getHeight",
"(",
")",
"/",
"2",
")",
";",
"... | Splits a specific bitmap horizontally at half.
@param bitmap
The bitmap, which should be split, as an instance of the class {@link Bitmap}. The
bitmap may not be null
@return A pair, which contains the two bitmaps, which the original bitmap has been split
into, as an instance of the class Pair | [
"Splits",
"a",
"specific",
"bitmap",
"horizontally",
"at",
"half",
"."
] | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/BitmapUtil.java#L370-L372 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.