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 |
|---|---|---|---|---|---|---|---|---|---|---|
JOML-CI/JOML | src/org/joml/Matrix3x2d.java | Matrix3x2d.get3x3 | public DoubleBuffer get3x3(int index, DoubleBuffer buffer) {
"""
Store this matrix as an equivalent 3x3 matrix in column-major order into the supplied {@link DoubleBuffer} starting at the specified
absolute buffer position/index.
<p>
This method will not increment the position of the given DoubleBuffer.
@par... | java | public DoubleBuffer get3x3(int index, DoubleBuffer buffer) {
MemUtil.INSTANCE.put3x3(this, index, buffer);
return buffer;
} | [
"public",
"DoubleBuffer",
"get3x3",
"(",
"int",
"index",
",",
"DoubleBuffer",
"buffer",
")",
"{",
"MemUtil",
".",
"INSTANCE",
".",
"put3x3",
"(",
"this",
",",
"index",
",",
"buffer",
")",
";",
"return",
"buffer",
";",
"}"
] | Store this matrix as an equivalent 3x3 matrix in column-major order into the supplied {@link DoubleBuffer} starting at the specified
absolute buffer position/index.
<p>
This method will not increment the position of the given DoubleBuffer.
@param index
the absolute position into the DoubleBuffer
@param buffer
will rec... | [
"Store",
"this",
"matrix",
"as",
"an",
"equivalent",
"3x3",
"matrix",
"in",
"column",
"-",
"major",
"order",
"into",
"the",
"supplied",
"{",
"@link",
"DoubleBuffer",
"}",
"starting",
"at",
"the",
"specified",
"absolute",
"buffer",
"position",
"/",
"index",
"... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3x2d.java#L912-L915 |
getsentry/sentry-java | sentry/src/main/java/io/sentry/time/FixedClock.java | FixedClock.tick | public void tick(long duration, TimeUnit unit) {
"""
Adjust the FixedClock by the given amount.
@param duration Duration of time to adjust the clock by.
@param unit Unit of time to adjust the clock by.
"""
this.date = new Date(date.getTime() + unit.toMillis(duration));
} | java | public void tick(long duration, TimeUnit unit) {
this.date = new Date(date.getTime() + unit.toMillis(duration));
} | [
"public",
"void",
"tick",
"(",
"long",
"duration",
",",
"TimeUnit",
"unit",
")",
"{",
"this",
".",
"date",
"=",
"new",
"Date",
"(",
"date",
".",
"getTime",
"(",
")",
"+",
"unit",
".",
"toMillis",
"(",
"duration",
")",
")",
";",
"}"
] | Adjust the FixedClock by the given amount.
@param duration Duration of time to adjust the clock by.
@param unit Unit of time to adjust the clock by. | [
"Adjust",
"the",
"FixedClock",
"by",
"the",
"given",
"amount",
"."
] | train | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/time/FixedClock.java#L42-L44 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-graph/src/main/java/org/deeplearning4j/graph/models/embeddings/InMemoryGraphLookupTable.java | InMemoryGraphLookupTable.calculateProb | public double calculateProb(int first, int second) {
"""
Calculate the probability of the second vertex given the first vertex
i.e., P(v_second | v_first)
@param first index of the first vertex
@param second index of the second vertex
@return probability, P(v_second | v_first)
"""
//Get vector for ... | java | public double calculateProb(int first, int second) {
//Get vector for first vertex, as well as code for second:
INDArray vec = vertexVectors.getRow(first);
int codeLength = tree.getCodeLength(second);
long code = tree.getCode(second);
int[] innerNodesForVertex = tree.getPathInner... | [
"public",
"double",
"calculateProb",
"(",
"int",
"first",
",",
"int",
"second",
")",
"{",
"//Get vector for first vertex, as well as code for second:",
"INDArray",
"vec",
"=",
"vertexVectors",
".",
"getRow",
"(",
"first",
")",
";",
"int",
"codeLength",
"=",
"tree",
... | Calculate the probability of the second vertex given the first vertex
i.e., P(v_second | v_first)
@param first index of the first vertex
@param second index of the second vertex
@return probability, P(v_second | v_first) | [
"Calculate",
"the",
"probability",
"of",
"the",
"second",
"vertex",
"given",
"the",
"first",
"vertex",
"i",
".",
"e",
".",
"P",
"(",
"v_second",
"|",
"v_first",
")"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-graph/src/main/java/org/deeplearning4j/graph/models/embeddings/InMemoryGraphLookupTable.java#L143-L164 |
facebook/fresco | samples/animation2/src/main/java/com/facebook/samples/animation2/color/ExampleColorBackend.java | ExampleColorBackend.createSampleColorAnimationBackend | public static AnimationBackend createSampleColorAnimationBackend(Resources resources) {
"""
Creates a simple animation backend that cycles through a list of colors.
@return the backend to use
"""
// Get the animation duration in ms for each color frame
int frameDurationMs = resources.getInteger(andr... | java | public static AnimationBackend createSampleColorAnimationBackend(Resources resources) {
// Get the animation duration in ms for each color frame
int frameDurationMs = resources.getInteger(android.R.integer.config_mediumAnimTime);
// Create and return the backend
return new ExampleColorBackend(SampleData... | [
"public",
"static",
"AnimationBackend",
"createSampleColorAnimationBackend",
"(",
"Resources",
"resources",
")",
"{",
"// Get the animation duration in ms for each color frame",
"int",
"frameDurationMs",
"=",
"resources",
".",
"getInteger",
"(",
"android",
".",
"R",
".",
"i... | Creates a simple animation backend that cycles through a list of colors.
@return the backend to use | [
"Creates",
"a",
"simple",
"animation",
"backend",
"that",
"cycles",
"through",
"a",
"list",
"of",
"colors",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/samples/animation2/src/main/java/com/facebook/samples/animation2/color/ExampleColorBackend.java#L35-L40 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_http_route_POST | public OvhRouteHttp serviceName_http_route_POST(String serviceName, OvhRouteHttpAction action, String displayName, Long frontendId, Long weight) throws IOException {
"""
Add a new HTTP route to your frontend
REST: POST /ipLoadbalancing/{serviceName}/http/route
@param weight [required] Route priority ([0..255])... | java | public OvhRouteHttp serviceName_http_route_POST(String serviceName, OvhRouteHttpAction action, String displayName, Long frontendId, Long weight) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/http/route";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<Stri... | [
"public",
"OvhRouteHttp",
"serviceName_http_route_POST",
"(",
"String",
"serviceName",
",",
"OvhRouteHttpAction",
"action",
",",
"String",
"displayName",
",",
"Long",
"frontendId",
",",
"Long",
"weight",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"... | Add a new HTTP route to your frontend
REST: POST /ipLoadbalancing/{serviceName}/http/route
@param weight [required] Route priority ([0..255]). 0 if null. Highest priority routes are evaluated last. Only the first matching route will trigger an action
@param frontendId [required] Route traffic for this frontend
@param ... | [
"Add",
"a",
"new",
"HTTP",
"route",
"to",
"your",
"frontend"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L121-L131 |
scoverage/scoverage-maven-plugin | src/main/java/org/scoverage/plugin/SCoverageForkedLifecycleConfigurator.java | SCoverageForkedLifecycleConfigurator.afterForkedLifecycleExit | public static void afterForkedLifecycleExit( MavenProject project, List<MavenProject> reactorProjects ) {
"""
Restores original configuration after leaving forked {@code scoverage} life cycle.
<br>
{@code project} is a project in default life cycle, {@code project.getExecutionProject()}
is a project in just fin... | java | public static void afterForkedLifecycleExit( MavenProject project, List<MavenProject> reactorProjects )
{
String forkedOutputDirectory = project.getExecutionProject().getBuild().getOutputDirectory();
project.getProperties().put( PROP_FORKED_OUTPUT_DIRECTORY, forkedOutputDirectory );
File fo... | [
"public",
"static",
"void",
"afterForkedLifecycleExit",
"(",
"MavenProject",
"project",
",",
"List",
"<",
"MavenProject",
">",
"reactorProjects",
")",
"{",
"String",
"forkedOutputDirectory",
"=",
"project",
".",
"getExecutionProject",
"(",
")",
".",
"getBuild",
"(",... | Restores original configuration after leaving forked {@code scoverage} life cycle.
<br>
{@code project} is a project in default life cycle, {@code project.getExecutionProject()}
is a project in just finished forked {@code scoverage} life cycle.
@param project Maven project in default life cycle.
@param reactorProjects... | [
"Restores",
"original",
"configuration",
"after",
"leaving",
"forked",
"{",
"@code",
"scoverage",
"}",
"life",
"cycle",
".",
"<br",
">",
"{",
"@code",
"project",
"}",
"is",
"a",
"project",
"in",
"default",
"life",
"cycle",
"{",
"@code",
"project",
".",
"ge... | train | https://github.com/scoverage/scoverage-maven-plugin/blob/b1c874aba521a65c85bcccfa8bff2213b5639c78/src/main/java/org/scoverage/plugin/SCoverageForkedLifecycleConfigurator.java#L123-L161 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/wallet/KeyChainGroup.java | KeyChainGroup.importKeysAndEncrypt | public int importKeysAndEncrypt(final List<ECKey> keys, KeyParameter aesKey) {
"""
Imports the given unencrypted keys into the basic chain, encrypting them along the way with the given key.
"""
// TODO: Firstly check if the aes key can decrypt any of the existing keys successfully.
checkState(k... | java | public int importKeysAndEncrypt(final List<ECKey> keys, KeyParameter aesKey) {
// TODO: Firstly check if the aes key can decrypt any of the existing keys successfully.
checkState(keyCrypter != null, "Not encrypted");
LinkedList<ECKey> encryptedKeys = Lists.newLinkedList();
for (ECKey key... | [
"public",
"int",
"importKeysAndEncrypt",
"(",
"final",
"List",
"<",
"ECKey",
">",
"keys",
",",
"KeyParameter",
"aesKey",
")",
"{",
"// TODO: Firstly check if the aes key can decrypt any of the existing keys successfully.",
"checkState",
"(",
"keyCrypter",
"!=",
"null",
",",... | Imports the given unencrypted keys into the basic chain, encrypting them along the way with the given key. | [
"Imports",
"the",
"given",
"unencrypted",
"keys",
"into",
"the",
"basic",
"chain",
"encrypting",
"them",
"along",
"the",
"way",
"with",
"the",
"given",
"key",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/wallet/KeyChainGroup.java#L490-L500 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/matrix/DiagonalMatrix.java | DiagonalMatrix.setRow | public void setRow(int row, DoubleVector vector) {
"""
{@inheritDoc}
Note that any values are not on the diagonal are ignored.
"""
checkIndices(row, vector.length() - 1);
values[row] = vector.get(row);
} | java | public void setRow(int row, DoubleVector vector) {
checkIndices(row, vector.length() - 1);
values[row] = vector.get(row);
} | [
"public",
"void",
"setRow",
"(",
"int",
"row",
",",
"DoubleVector",
"vector",
")",
"{",
"checkIndices",
"(",
"row",
",",
"vector",
".",
"length",
"(",
")",
"-",
"1",
")",
";",
"values",
"[",
"row",
"]",
"=",
"vector",
".",
"get",
"(",
"row",
")",
... | {@inheritDoc}
Note that any values are not on the diagonal are ignored. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/DiagonalMatrix.java#L198-L202 |
mapbox/mapbox-java | services-geojson/src/main/java/com/mapbox/geojson/MultiLineString.java | MultiLineString.fromLngLats | public static MultiLineString fromLngLats(@NonNull List<List<Point>> points,
@Nullable BoundingBox bbox) {
"""
Create a new instance of this class by defining a list of a list of {@link Point}s which follow
the correct specifications described in the Point documentation... | java | public static MultiLineString fromLngLats(@NonNull List<List<Point>> points,
@Nullable BoundingBox bbox) {
return new MultiLineString(TYPE, bbox, points);
} | [
"public",
"static",
"MultiLineString",
"fromLngLats",
"(",
"@",
"NonNull",
"List",
"<",
"List",
"<",
"Point",
">",
">",
"points",
",",
"@",
"Nullable",
"BoundingBox",
"bbox",
")",
"{",
"return",
"new",
"MultiLineString",
"(",
"TYPE",
",",
"bbox",
",",
"poi... | Create a new instance of this class by defining a list of a list of {@link Point}s which follow
the correct specifications described in the Point documentation. Note that there should not be
any duplicate points inside the list and the points combined should create a LineString with a
distance greater than 0.
@param p... | [
"Create",
"a",
"new",
"instance",
"of",
"this",
"class",
"by",
"defining",
"a",
"list",
"of",
"a",
"list",
"of",
"{",
"@link",
"Point",
"}",
"s",
"which",
"follow",
"the",
"correct",
"specifications",
"described",
"in",
"the",
"Point",
"documentation",
"."... | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-geojson/src/main/java/com/mapbox/geojson/MultiLineString.java#L177-L180 |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/util/GlobusPathMatchingResourcePatternResolver.java | GlobusPathMatchingResourcePatternResolver.getResource | public GlobusResource getResource(String location) {
"""
This method takes a location string and returns a GlobusResource of the
corresponding location. This method does not accept any patterns for the location string.
@param location An absolute or relative location in the style classpath:/folder/className.cla... | java | public GlobusResource getResource(String location) {
GlobusResource returnResource;
URL resourceURL;
if (location.startsWith("classpath:")) {
resourceURL = getClass().getClassLoader().getResource(location.replaceFirst("classpath:/", ""));
returnResource = new GlobusResour... | [
"public",
"GlobusResource",
"getResource",
"(",
"String",
"location",
")",
"{",
"GlobusResource",
"returnResource",
";",
"URL",
"resourceURL",
";",
"if",
"(",
"location",
".",
"startsWith",
"(",
"\"classpath:\"",
")",
")",
"{",
"resourceURL",
"=",
"getClass",
"(... | This method takes a location string and returns a GlobusResource of the
corresponding location. This method does not accept any patterns for the location string.
@param location An absolute or relative location in the style classpath:/folder/className.class,
file:/folder/fileName.ext, or folder/folder/fileName.ext
@re... | [
"This",
"method",
"takes",
"a",
"location",
"string",
"and",
"returns",
"a",
"GlobusResource",
"of",
"the",
"corresponding",
"location",
".",
"This",
"method",
"does",
"not",
"accept",
"any",
"patterns",
"for",
"the",
"location",
"string",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/util/GlobusPathMatchingResourcePatternResolver.java#L45-L56 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca/src/com/ibm/ws/jca/internal/Utils.java | Utils.getMessage | @Trivial
public static final String getMessage(String key, Object... params) {
"""
Gets an NLS message.
@param key the message key
@param params the message parameters
@return formatted message
"""
return TraceNLS.getFormattedMessage(Utils.class, tc.getResourceBundleName(), key, params, key);
... | java | @Trivial
public static final String getMessage(String key, Object... params) {
return TraceNLS.getFormattedMessage(Utils.class, tc.getResourceBundleName(), key, params, key);
} | [
"@",
"Trivial",
"public",
"static",
"final",
"String",
"getMessage",
"(",
"String",
"key",
",",
"Object",
"...",
"params",
")",
"{",
"return",
"TraceNLS",
".",
"getFormattedMessage",
"(",
"Utils",
".",
"class",
",",
"tc",
".",
"getResourceBundleName",
"(",
"... | Gets an NLS message.
@param key the message key
@param params the message parameters
@return formatted message | [
"Gets",
"an",
"NLS",
"message",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca/src/com/ibm/ws/jca/internal/Utils.java#L107-L110 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/activator/Activator.java | Activator.removeBean | public void removeBean(ContainerTx tx, BeanO bean) {
"""
Remove a bean from the cache. This method should be used to handle
situations where a bean goes bad.
<p>
@param tx The transaction from which to remove the bean
@param bean The bean to be removed
"""
bean.getActivationStrategy().atRemove(tx... | java | public void removeBean(ContainerTx tx, BeanO bean)
{
bean.getActivationStrategy().atRemove(tx, bean);
} | [
"public",
"void",
"removeBean",
"(",
"ContainerTx",
"tx",
",",
"BeanO",
"bean",
")",
"{",
"bean",
".",
"getActivationStrategy",
"(",
")",
".",
"atRemove",
"(",
"tx",
",",
"bean",
")",
";",
"}"
] | Remove a bean from the cache. This method should be used to handle
situations where a bean goes bad.
<p>
@param tx The transaction from which to remove the bean
@param bean The bean to be removed | [
"Remove",
"a",
"bean",
"from",
"the",
"cache",
".",
"This",
"method",
"should",
"be",
"used",
"to",
"handle",
"situations",
"where",
"a",
"bean",
"goes",
"bad",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/activator/Activator.java#L359-L362 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/actions/ExecuteSQLQueryAction.java | ExecuteSQLQueryAction.fillContextVariables | private void fillContextVariables(Map<String, List<String>> columnValuesMap, TestContext context)
throws CitrusRuntimeException {
"""
Fills the (requested) test context variables with the db result values
@param columnValuesMap the map containing column names --> list of result values
@param context ... | java | private void fillContextVariables(Map<String, List<String>> columnValuesMap, TestContext context)
throws CitrusRuntimeException {
for (Entry<String, String> variableEntry : extractVariables.entrySet()) {
String columnName = variableEntry.getKey();
if (columnValuesMap.contains... | [
"private",
"void",
"fillContextVariables",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"columnValuesMap",
",",
"TestContext",
"context",
")",
"throws",
"CitrusRuntimeException",
"{",
"for",
"(",
"Entry",
"<",
"String",
",",
"String",
">",
... | Fills the (requested) test context variables with the db result values
@param columnValuesMap the map containing column names --> list of result values
@param context the test context the variables are stored to
@throws CitrusRuntimeException if requested column name was not found | [
"Fills",
"the",
"(",
"requested",
")",
"test",
"context",
"variables",
"with",
"the",
"db",
"result",
"values"
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/actions/ExecuteSQLQueryAction.java#L148-L161 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsInner.java | ExpressRouteCircuitsInner.createOrUpdate | public ExpressRouteCircuitInner createOrUpdate(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) {
"""
Creates or updates an express route circuit.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the circuit.
@param parameters Parameters... | java | public ExpressRouteCircuitInner createOrUpdate(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).toBlocking().last().body();
} | [
"public",
"ExpressRouteCircuitInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"circuitName",
",",
"ExpressRouteCircuitInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"circuitName",
... | Creates or updates an express route circuit.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the circuit.
@param parameters Parameters supplied to the create or update express route circuit operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@thr... | [
"Creates",
"or",
"updates",
"an",
"express",
"route",
"circuit",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/ExpressRouteCircuitsInner.java#L395-L397 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/connect/DirectoryConnection.java | DirectoryConnection.sendConnectProtocol | private ErrorCode sendConnectProtocol(long to) {
"""
Send the Connect Protocol to the remote Directory Server.
@param to
the connection timeout.
@return
the ErrorCode of the request, OK for success.
"""
String sessId = session.id;
ErrorCode ec = ErrorCode.OK;
ConnectProtocol conR... | java | private ErrorCode sendConnectProtocol(long to) {
String sessId = session.id;
ErrorCode ec = ErrorCode.OK;
ConnectProtocol conReq = new ConnectProtocol(0, lastDxid,
session.timeOut, sessId, session.password, authData.userName, authData.secret, authData.obfuscated);
Servic... | [
"private",
"ErrorCode",
"sendConnectProtocol",
"(",
"long",
"to",
")",
"{",
"String",
"sessId",
"=",
"session",
".",
"id",
";",
"ErrorCode",
"ec",
"=",
"ErrorCode",
".",
"OK",
";",
"ConnectProtocol",
"conReq",
"=",
"new",
"ConnectProtocol",
"(",
"0",
",",
... | Send the Connect Protocol to the remote Directory Server.
@param to
the connection timeout.
@return
the ErrorCode of the request, OK for success. | [
"Send",
"the",
"Connect",
"Protocol",
"to",
"the",
"remote",
"Directory",
"Server",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/connect/DirectoryConnection.java#L748-L775 |
Erudika/para | para-core/src/main/java/com/erudika/para/core/utils/ParaObjectUtils.java | ParaObjectUtils.setUserDefinedProperties | private static <P> void setUserDefinedProperties(P pojo, Map<String, Object> props) {
"""
Handles "unknown" or user-defined fields. The Para object is populated with custom fields
which are stored within the "properties" field of {@link Sysprop}. Unknown or user-defined properties are
those which are not declare... | java | private static <P> void setUserDefinedProperties(P pojo, Map<String, Object> props) {
if (props != null && pojo instanceof Sysprop) {
for (Map.Entry<String, Object> entry : props.entrySet()) {
String name = entry.getKey();
Object value = entry.getValue();
// handle the case where we have custom user-de... | [
"private",
"static",
"<",
"P",
">",
"void",
"setUserDefinedProperties",
"(",
"P",
"pojo",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
")",
"{",
"if",
"(",
"props",
"!=",
"null",
"&&",
"pojo",
"instanceof",
"Sysprop",
")",
"{",
"for",
"(",
... | Handles "unknown" or user-defined fields. The Para object is populated with custom fields
which are stored within the "properties" field of {@link Sysprop}. Unknown or user-defined properties are
those which are not declared inside a Java class, but come from an API request.
@param pojo a Para object
@param props prope... | [
"Handles",
"unknown",
"or",
"user",
"-",
"defined",
"fields",
".",
"The",
"Para",
"object",
"is",
"populated",
"with",
"custom",
"fields",
"which",
"are",
"stored",
"within",
"the",
"properties",
"field",
"of",
"{"
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-core/src/main/java/com/erudika/para/core/utils/ParaObjectUtils.java#L425-L441 |
k3po/k3po | specification/socks5/src/main/java/org/kaazing/specification/socks5/internal/Functions.java | Functions.createClientGSSContext | @Function
public static GSSContext createClientGSSContext(String server) {
"""
Create a GSS Context from a clients point of view.
@param server the name of the host for which the GSS Context is being created
@return the GSS Context that a client can use to exchange security tokens for
a secure channel, then... | java | @Function
public static GSSContext createClientGSSContext(String server) {
try {
GSSManager manager = GSSManager.getInstance();
GSSName serverName = manager.createName(server, null);
GSSContext context = manager.createContext(serverName,
krb5Oid,
... | [
"@",
"Function",
"public",
"static",
"GSSContext",
"createClientGSSContext",
"(",
"String",
"server",
")",
"{",
"try",
"{",
"GSSManager",
"manager",
"=",
"GSSManager",
".",
"getInstance",
"(",
")",
";",
"GSSName",
"serverName",
"=",
"manager",
".",
"createName",... | Create a GSS Context from a clients point of view.
@param server the name of the host for which the GSS Context is being created
@return the GSS Context that a client can use to exchange security tokens for
a secure channel, then wrap()/unpack() messages. | [
"Create",
"a",
"GSS",
"Context",
"from",
"a",
"clients",
"point",
"of",
"view",
"."
] | train | https://github.com/k3po/k3po/blob/3ca4fd31ab4a397893aa640c62ada0e485c8bbd4/specification/socks5/src/main/java/org/kaazing/specification/socks5/internal/Functions.java#L67-L86 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.delegatedAccount_email_usage_POST | public OvhDomainUsageAccountStruct delegatedAccount_email_usage_POST(String email) throws IOException {
"""
usage of account
REST: POST /email/domain/delegatedAccount/{email}/usage
@param email [required] Email
"""
String qPath = "/email/domain/delegatedAccount/{email}/usage";
StringBuilder sb = path(q... | java | public OvhDomainUsageAccountStruct delegatedAccount_email_usage_POST(String email) throws IOException {
String qPath = "/email/domain/delegatedAccount/{email}/usage";
StringBuilder sb = path(qPath, email);
String resp = exec(qPath, "POST", sb.toString(), null);
return convertTo(resp, OvhDomainUsageAccountStruct... | [
"public",
"OvhDomainUsageAccountStruct",
"delegatedAccount_email_usage_POST",
"(",
"String",
"email",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/delegatedAccount/{email}/usage\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
... | usage of account
REST: POST /email/domain/delegatedAccount/{email}/usage
@param email [required] Email | [
"usage",
"of",
"account"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L360-L365 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/concurrent/SimpleReadWriteLock.java | SimpleReadWriteLock.readLockedThrowing | public <T, EXTYPE extends Exception> T readLockedThrowing (@Nonnull final IThrowingSupplier <? extends T, EXTYPE> aCallable) throws EXTYPE {
"""
Execute the provided callable in a read lock. Note: no
nullable/non-nullable can be assumed.
@param aCallable
Callable to be executed. May not be <code>null</code>.
... | java | public <T, EXTYPE extends Exception> T readLockedThrowing (@Nonnull final IThrowingSupplier <? extends T, EXTYPE> aCallable) throws EXTYPE
{
readLock ().lock ();
try
{
return aCallable.get ();
}
finally
{
readLock ().unlock ();
}
} | [
"public",
"<",
"T",
",",
"EXTYPE",
"extends",
"Exception",
">",
"T",
"readLockedThrowing",
"(",
"@",
"Nonnull",
"final",
"IThrowingSupplier",
"<",
"?",
"extends",
"T",
",",
"EXTYPE",
">",
"aCallable",
")",
"throws",
"EXTYPE",
"{",
"readLock",
"(",
")",
"."... | Execute the provided callable in a read lock. Note: no
nullable/non-nullable can be assumed.
@param aCallable
Callable to be executed. May not be <code>null</code>.
@return The return value of the callable. May be <code>null</code>.
@throws EXTYPE
If the callable throws the exception
@param <T>
Return type
@param <EXT... | [
"Execute",
"the",
"provided",
"callable",
"in",
"a",
"read",
"lock",
".",
"Note",
":",
"no",
"nullable",
"/",
"non",
"-",
"nullable",
"can",
"be",
"assumed",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/concurrent/SimpleReadWriteLock.java#L140-L151 |
google/error-prone | check_api/src/main/java/com/google/errorprone/util/ASTHelpers.java | ASTHelpers.findPathFromEnclosingNodeToTopLevel | public static <T> TreePath findPathFromEnclosingNodeToTopLevel(TreePath path, Class<T> klass) {
"""
Given a TreePath, finds the first enclosing node of the given type and returns the path from
the enclosing node to the top-level {@code CompilationUnitTree}.
"""
if (path != null) {
do {
path ... | java | public static <T> TreePath findPathFromEnclosingNodeToTopLevel(TreePath path, Class<T> klass) {
if (path != null) {
do {
path = path.getParentPath();
} while (path != null && !(klass.isInstance(path.getLeaf())));
}
return path;
} | [
"public",
"static",
"<",
"T",
">",
"TreePath",
"findPathFromEnclosingNodeToTopLevel",
"(",
"TreePath",
"path",
",",
"Class",
"<",
"T",
">",
"klass",
")",
"{",
"if",
"(",
"path",
"!=",
"null",
")",
"{",
"do",
"{",
"path",
"=",
"path",
".",
"getParentPath"... | Given a TreePath, finds the first enclosing node of the given type and returns the path from
the enclosing node to the top-level {@code CompilationUnitTree}. | [
"Given",
"a",
"TreePath",
"finds",
"the",
"first",
"enclosing",
"node",
"of",
"the",
"given",
"type",
"and",
"returns",
"the",
"path",
"from",
"the",
"enclosing",
"node",
"to",
"the",
"top",
"-",
"level",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/util/ASTHelpers.java#L340-L347 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/mediasource/inline/InlineRendition.java | InlineRendition.getScaledDimension | private Dimension getScaledDimension(Dimension originalDimension) {
"""
Checks if the current binary is an image and has to be scaled. In this case the destination dimension is returned.
@return Scaled destination or null if no scaling is required. If a destination object with both
width and height set to -1 is ... | java | private Dimension getScaledDimension(Dimension originalDimension) {
// check if image has to be rescaled
Dimension requestedDimension = getRequestedDimension();
boolean scaleWidth = (requestedDimension.getWidth() > 0
&& requestedDimension.getWidth() != originalDimension.getWidth());
boolean sca... | [
"private",
"Dimension",
"getScaledDimension",
"(",
"Dimension",
"originalDimension",
")",
"{",
"// check if image has to be rescaled",
"Dimension",
"requestedDimension",
"=",
"getRequestedDimension",
"(",
")",
";",
"boolean",
"scaleWidth",
"=",
"(",
"requestedDimension",
".... | Checks if the current binary is an image and has to be scaled. In this case the destination dimension is returned.
@return Scaled destination or null if no scaling is required. If a destination object with both
width and height set to -1 is returned, a scaling is required but not possible with the given source
object. | [
"Checks",
"if",
"the",
"current",
"binary",
"is",
"an",
"image",
"and",
"has",
"to",
"be",
"scaled",
".",
"In",
"this",
"case",
"the",
"destination",
"dimension",
"is",
"returned",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/mediasource/inline/InlineRendition.java#L150-L187 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java | DiagnosticsInner.getSiteAnalysis | public DiagnosticAnalysisInner getSiteAnalysis(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) {
"""
Get Site Analysis.
Get Site Analysis.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param diagnosticC... | java | public DiagnosticAnalysisInner getSiteAnalysis(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) {
return getSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName).toBlocking().single().body();
} | [
"public",
"DiagnosticAnalysisInner",
"getSiteAnalysis",
"(",
"String",
"resourceGroupName",
",",
"String",
"siteName",
",",
"String",
"diagnosticCategory",
",",
"String",
"analysisName",
")",
"{",
"return",
"getSiteAnalysisWithServiceResponseAsync",
"(",
"resourceGroupName",
... | Get Site Analysis.
Get Site Analysis.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param diagnosticCategory Diagnostic Category
@param analysisName Analysis Name
@throws IllegalArgumentException thrown if parameters fail the validation
@throws DefaultErr... | [
"Get",
"Site",
"Analysis",
".",
"Get",
"Site",
"Analysis",
"."
] | 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/DiagnosticsInner.java#L534-L536 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java | CmsSitemapController.removeModelPage | public void removeModelPage(final CmsUUID id, final AsyncCallback<Void> asyncCallback) {
"""
Removes a model page from the sitemap's configuration.<p>
@param id the structure id of the model page
@param asyncCallback the callback to call when done
"""
CmsRpcAction<Void> action = new CmsRpcAction... | java | public void removeModelPage(final CmsUUID id, final AsyncCallback<Void> asyncCallback) {
CmsRpcAction<Void> action = new CmsRpcAction<Void>() {
@Override
public void execute() {
start(200, true);
getService().removeModelPage(getEntryPoint(), id, this);
... | [
"public",
"void",
"removeModelPage",
"(",
"final",
"CmsUUID",
"id",
",",
"final",
"AsyncCallback",
"<",
"Void",
">",
"asyncCallback",
")",
"{",
"CmsRpcAction",
"<",
"Void",
">",
"action",
"=",
"new",
"CmsRpcAction",
"<",
"Void",
">",
"(",
")",
"{",
"@",
... | Removes a model page from the sitemap's configuration.<p>
@param id the structure id of the model page
@param asyncCallback the callback to call when done | [
"Removes",
"a",
"model",
"page",
"from",
"the",
"sitemap",
"s",
"configuration",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java#L1838-L1861 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java | SDBaseOps.assign | public SDVariable assign(String name, SDVariable in, Number value) {
"""
Return an array with equal shape to the input, but all elements set to 'value'
@param name Name of the output variable
@param in Input variable
@param value Value to set
@return Output variable
"""
SDVariable ret = f().a... | java | public SDVariable assign(String name, SDVariable in, Number value) {
SDVariable ret = f().assign(in, value);
return updateVariableNameAndReference(ret, name);
} | [
"public",
"SDVariable",
"assign",
"(",
"String",
"name",
",",
"SDVariable",
"in",
",",
"Number",
"value",
")",
"{",
"SDVariable",
"ret",
"=",
"f",
"(",
")",
".",
"assign",
"(",
"in",
",",
"value",
")",
";",
"return",
"updateVariableNameAndReference",
"(",
... | Return an array with equal shape to the input, but all elements set to 'value'
@param name Name of the output variable
@param in Input variable
@param value Value to set
@return Output variable | [
"Return",
"an",
"array",
"with",
"equal",
"shape",
"to",
"the",
"input",
"but",
"all",
"elements",
"set",
"to",
"value"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L204-L207 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java | CommerceCountryPersistenceImpl.findAll | @Override
public List<CommerceCountry> findAll(int start, int end) {
"""
Returns a range of all the commerce countries.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set.... | java | @Override
public List<CommerceCountry> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceCountry",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce countries.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>st... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"countries",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceCountryPersistenceImpl.java#L4996-L4999 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/registry/MalisisRegistry.java | MalisisRegistry.onPostSetBlock | public static void onPostSetBlock(ISetBlockCallback callback, CallbackOption<ISetBlockCallbackPredicate> option) {
"""
Registers a {@link ISetBlockCallback} with the specified {@link CallbackOption} to be called before a {@link Block} is placed in the
world.
@param callback the callback
@param option the opti... | java | public static void onPostSetBlock(ISetBlockCallback callback, CallbackOption<ISetBlockCallbackPredicate> option)
{
postSetBlockRegistry.registerCallback(callback, option);
} | [
"public",
"static",
"void",
"onPostSetBlock",
"(",
"ISetBlockCallback",
"callback",
",",
"CallbackOption",
"<",
"ISetBlockCallbackPredicate",
">",
"option",
")",
"{",
"postSetBlockRegistry",
".",
"registerCallback",
"(",
"callback",
",",
"option",
")",
";",
"}"
] | Registers a {@link ISetBlockCallback} with the specified {@link CallbackOption} to be called before a {@link Block} is placed in the
world.
@param callback the callback
@param option the option | [
"Registers",
"a",
"{",
"@link",
"ISetBlockCallback",
"}",
"with",
"the",
"specified",
"{",
"@link",
"CallbackOption",
"}",
"to",
"be",
"called",
"before",
"a",
"{",
"@link",
"Block",
"}",
"is",
"placed",
"in",
"the",
"world",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/registry/MalisisRegistry.java#L187-L190 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCrossConnectionsInner.java | ExpressRouteCrossConnectionsInner.listRoutesTableSummary | public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner listRoutesTableSummary(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) {
"""
Gets the route table summary associated with the express route cross connection in a resource group.
@param resourceGroup... | java | public ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner listRoutesTableSummary(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) {
return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).toBloc... | [
"public",
"ExpressRouteCrossConnectionsRoutesTableSummaryListResultInner",
"listRoutesTableSummary",
"(",
"String",
"resourceGroupName",
",",
"String",
"crossConnectionName",
",",
"String",
"peeringName",
",",
"String",
"devicePath",
")",
"{",
"return",
"listRoutesTableSummaryWit... | Gets the route table summary associated with the express route cross connection in a resource group.
@param resourceGroupName The name of the resource group.
@param crossConnectionName The name of the ExpressRouteCrossConnection.
@param peeringName The name of the peering.
@param devicePath The path of the device.
@th... | [
"Gets",
"the",
"route",
"table",
"summary",
"associated",
"with",
"the",
"express",
"route",
"cross",
"connection",
"in",
"a",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCrossConnectionsInner.java#L1106-L1108 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionSpecificationOptionValuePersistenceImpl.java | CPDefinitionSpecificationOptionValuePersistenceImpl.removeByC_CSO | @Override
public void removeByC_CSO(long CPDefinitionId, long CPSpecificationOptionId) {
"""
Removes all the cp definition specification option values where CPDefinitionId = ? and CPSpecificationOptionId = ? from the database.
@param CPDefinitionId the cp definition ID
@param CPSpecificationOptionId t... | java | @Override
public void removeByC_CSO(long CPDefinitionId, long CPSpecificationOptionId) {
for (CPDefinitionSpecificationOptionValue cpDefinitionSpecificationOptionValue : findByC_CSO(
CPDefinitionId, CPSpecificationOptionId, QueryUtil.ALL_POS,
QueryUtil.ALL_POS, null)) {
remove(cpDefinitionSpecificationOpt... | [
"@",
"Override",
"public",
"void",
"removeByC_CSO",
"(",
"long",
"CPDefinitionId",
",",
"long",
"CPSpecificationOptionId",
")",
"{",
"for",
"(",
"CPDefinitionSpecificationOptionValue",
"cpDefinitionSpecificationOptionValue",
":",
"findByC_CSO",
"(",
"CPDefinitionId",
",",
... | Removes all the cp definition specification option values where CPDefinitionId = ? and CPSpecificationOptionId = ? from the database.
@param CPDefinitionId the cp definition ID
@param CPSpecificationOptionId the cp specification option ID | [
"Removes",
"all",
"the",
"cp",
"definition",
"specification",
"option",
"values",
"where",
"CPDefinitionId",
"=",
"?",
";",
"and",
"CPSpecificationOptionId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionSpecificationOptionValuePersistenceImpl.java#L4698-L4705 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuPointerGetAttributes | public static int cuPointerGetAttributes(int numAttributes, int attributes[], Pointer data, CUdeviceptr ptr) {
"""
Returns information about a pointer.<br>
<br>
The supported attributes are (refer to ::cuPointerGetAttribute for attribute descriptions and restrictions):
<ul>
<li>CU_POINTER_ATTRIBUTE_CONTEXT</li... | java | public static int cuPointerGetAttributes(int numAttributes, int attributes[], Pointer data, CUdeviceptr ptr)
{
return checkResult(cuPointerGetAttributesNative(numAttributes, attributes, data, ptr));
} | [
"public",
"static",
"int",
"cuPointerGetAttributes",
"(",
"int",
"numAttributes",
",",
"int",
"attributes",
"[",
"]",
",",
"Pointer",
"data",
",",
"CUdeviceptr",
"ptr",
")",
"{",
"return",
"checkResult",
"(",
"cuPointerGetAttributesNative",
"(",
"numAttributes",
"... | Returns information about a pointer.<br>
<br>
The supported attributes are (refer to ::cuPointerGetAttribute for attribute descriptions and restrictions):
<ul>
<li>CU_POINTER_ATTRIBUTE_CONTEXT</li>
<li>CU_POINTER_ATTRIBUTE_MEMORY_TYPE</li>
<li>CU_POINTER_ATTRIBUTE_DEVICE_POINTER</li>
<li>CU_POINTER_ATTRIBUTE_HOST_POINT... | [
"Returns",
"information",
"about",
"a",
"pointer",
".",
"<br",
">",
"<br",
">",
"The",
"supported",
"attributes",
"are",
"(",
"refer",
"to",
"::",
"cuPointerGetAttribute",
"for",
"attribute",
"descriptions",
"and",
"restrictions",
")",
":",
"<ul",
">",
"<li",
... | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L14334-L14337 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java | ProviderUtil.loadProvider | protected static void loadProvider(final URL url, final ClassLoader cl) {
"""
Loads an individual Provider implementation. This method is really only useful for the OSGi bundle activator and
this class itself.
@param url the URL to the provider properties file
@param cl the ClassLoader to load the provider cl... | java | protected static void loadProvider(final URL url, final ClassLoader cl) {
try {
final Properties props = PropertiesUtil.loadClose(url.openStream(), url);
if (validVersion(props.getProperty(API_VERSION))) {
final Provider provider = new Provider(props, url, cl);
... | [
"protected",
"static",
"void",
"loadProvider",
"(",
"final",
"URL",
"url",
",",
"final",
"ClassLoader",
"cl",
")",
"{",
"try",
"{",
"final",
"Properties",
"props",
"=",
"PropertiesUtil",
".",
"loadClose",
"(",
"url",
".",
"openStream",
"(",
")",
",",
"url"... | Loads an individual Provider implementation. This method is really only useful for the OSGi bundle activator and
this class itself.
@param url the URL to the provider properties file
@param cl the ClassLoader to load the provider classes with | [
"Loads",
"an",
"individual",
"Provider",
"implementation",
".",
"This",
"method",
"is",
"really",
"only",
"useful",
"for",
"the",
"OSGi",
"bundle",
"activator",
"and",
"this",
"class",
"itself",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/util/ProviderUtil.java#L84-L95 |
rey5137/material | material/src/main/java/com/rey/material/widget/EditText.java | EditText.setCompoundDrawablesRelativeWithIntrinsicBounds | @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public void setCompoundDrawablesRelativeWithIntrinsicBounds (Drawable start, Drawable top, Drawable end, Drawable bottom) {
"""
Sets the Drawables (if any) to appear to the start of, above, to the end
of, and below the text. Use {@code null} if you do not want a Dra... | java | @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public void setCompoundDrawablesRelativeWithIntrinsicBounds (Drawable start, Drawable top, Drawable end, Drawable bottom){
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1)
mInputView.setCompoundDrawablesRelativeWithIntrinsicBounds(start, top, end, bott... | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"JELLY_BEAN_MR1",
")",
"public",
"void",
"setCompoundDrawablesRelativeWithIntrinsicBounds",
"(",
"Drawable",
"start",
",",
"Drawable",
"top",
",",
"Drawable",
"end",
",",
"Drawable",
"bottom",
")",
"{",
"i... | Sets the Drawables (if any) to appear to the start of, above, to the end
of, and below the text. Use {@code null} if you do not want a Drawable
there. The Drawables' bounds will be set to their intrinsic bounds.
<p>
Calling this method will overwrite any Drawables previously set using
{@link #setCompoundDrawables} or r... | [
"Sets",
"the",
"Drawables",
"(",
"if",
"any",
")",
"to",
"appear",
"to",
"the",
"start",
"of",
"above",
"to",
"the",
"end",
"of",
"and",
"below",
"the",
"text",
".",
"Use",
"{",
"@code",
"null",
"}",
"if",
"you",
"do",
"not",
"want",
"a",
"Drawable... | train | https://github.com/rey5137/material/blob/1bbcac2686a0023ef7720d3fe455bb116d115af8/material/src/main/java/com/rey/material/widget/EditText.java#L2739-L2745 |
michael-rapp/AndroidPreferenceActivity | library/src/main/java/de/mrapp/android/preference/activity/adapter/NavigationPreferenceAdapter.java | NavigationPreferenceAdapter.createAdapterDataObserver | @NonNull
private RecyclerView.AdapterDataObserver createAdapterDataObserver() {
"""
Creates and returns a data observer, which allows to adapt the navigation preferences, when
the adapter's underlying data has been changed.
@return The data observer, which has been created, as an instance of the class {@li... | java | @NonNull
private RecyclerView.AdapterDataObserver createAdapterDataObserver() {
return new RecyclerView.AdapterDataObserver() {
@Override
public void onChanged() {
super.onChanged();
updateNavigationPreferences();
}
@Override
... | [
"@",
"NonNull",
"private",
"RecyclerView",
".",
"AdapterDataObserver",
"createAdapterDataObserver",
"(",
")",
"{",
"return",
"new",
"RecyclerView",
".",
"AdapterDataObserver",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onChanged",
"(",
")",
"{",
"super",
... | Creates and returns a data observer, which allows to adapt the navigation preferences, when
the adapter's underlying data has been changed.
@return The data observer, which has been created, as an instance of the class {@link
RecyclerView.AdapterDataObserver}. The data observer may not be null | [
"Creates",
"and",
"returns",
"a",
"data",
"observer",
"which",
"allows",
"to",
"adapt",
"the",
"navigation",
"preferences",
"when",
"the",
"adapter",
"s",
"underlying",
"data",
"has",
"been",
"changed",
"."
] | train | https://github.com/michael-rapp/AndroidPreferenceActivity/blob/0fcde73815b4b3bf6bcb36acd3d5733e301bbba5/library/src/main/java/de/mrapp/android/preference/activity/adapter/NavigationPreferenceAdapter.java#L254-L297 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/cluster/fd/PhiAccrualFailureDetector.java | PhiAccrualFailureDetector.phi | private double phi(long timestampMillis) {
"""
The suspicion level of the accrual failure detector.
If a connection does not have any records in failure detector then it is
considered healthy.
"""
long timeDiffMillis;
double meanMillis;
double stdDeviationMillis;
synchroniz... | java | private double phi(long timestampMillis) {
long timeDiffMillis;
double meanMillis;
double stdDeviationMillis;
synchronized (heartbeatHistory) {
long lastTimestampMillis = lastHeartbeatMillis;
if (lastTimestampMillis == NO_HEARTBEAT_TIMESTAMP) {
re... | [
"private",
"double",
"phi",
"(",
"long",
"timestampMillis",
")",
"{",
"long",
"timeDiffMillis",
";",
"double",
"meanMillis",
";",
"double",
"stdDeviationMillis",
";",
"synchronized",
"(",
"heartbeatHistory",
")",
"{",
"long",
"lastTimestampMillis",
"=",
"lastHeartbe... | The suspicion level of the accrual failure detector.
If a connection does not have any records in failure detector then it is
considered healthy. | [
"The",
"suspicion",
"level",
"of",
"the",
"accrual",
"failure",
"detector",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/cluster/fd/PhiAccrualFailureDetector.java#L109-L126 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/stereo/StereoTool.java | StereoTool.signedDistanceToPlane | public static double signedDistanceToPlane(Vector3d planeNormal, Point3d pointInPlane, Point3d point) {
"""
Given a normalized normal for a plane, any point in that plane, and
a point, will return the distance between the plane and that point.
@param planeNormal the normalized plane normal
@param pointInPlane... | java | public static double signedDistanceToPlane(Vector3d planeNormal, Point3d pointInPlane, Point3d point) {
if (planeNormal == null) return Double.NaN;
Vector3d pointPointDiff = new Vector3d();
pointPointDiff.sub(point, pointInPlane);
return planeNormal.dot(pointPointDiff);
} | [
"public",
"static",
"double",
"signedDistanceToPlane",
"(",
"Vector3d",
"planeNormal",
",",
"Point3d",
"pointInPlane",
",",
"Point3d",
"point",
")",
"{",
"if",
"(",
"planeNormal",
"==",
"null",
")",
"return",
"Double",
".",
"NaN",
";",
"Vector3d",
"pointPointDif... | Given a normalized normal for a plane, any point in that plane, and
a point, will return the distance between the plane and that point.
@param planeNormal the normalized plane normal
@param pointInPlane an arbitrary point in that plane
@param point the point to measure
@return the signed distance to the plane | [
"Given",
"a",
"normalized",
"normal",
"for",
"a",
"plane",
"any",
"point",
"in",
"that",
"plane",
"and",
"a",
"point",
"will",
"return",
"the",
"distance",
"between",
"the",
"plane",
"and",
"that",
"point",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/stereo/StereoTool.java#L367-L373 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceClient.java | TraceServiceClient.batchWriteSpans | public final void batchWriteSpans(String name, List<Span> spans) {
"""
Sends new spans to new or existing traces. You cannot update existing spans.
<p>Sample code:
<pre><code>
try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
ProjectName name = ProjectName.of("[PROJECT]");
List&l... | java | public final void batchWriteSpans(String name, List<Span> spans) {
BatchWriteSpansRequest request =
BatchWriteSpansRequest.newBuilder().setName(name).addAllSpans(spans).build();
batchWriteSpans(request);
} | [
"public",
"final",
"void",
"batchWriteSpans",
"(",
"String",
"name",
",",
"List",
"<",
"Span",
">",
"spans",
")",
"{",
"BatchWriteSpansRequest",
"request",
"=",
"BatchWriteSpansRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"name",
")",
".",
"ad... | Sends new spans to new or existing traces. You cannot update existing spans.
<p>Sample code:
<pre><code>
try (TraceServiceClient traceServiceClient = TraceServiceClient.create()) {
ProjectName name = ProjectName.of("[PROJECT]");
List<Span> spans = new ArrayList<>();
traceServiceClient.batchWriteSpans(name... | [
"Sends",
"new",
"spans",
"to",
"new",
"or",
"existing",
"traces",
".",
"You",
"cannot",
"update",
"existing",
"spans",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-trace/src/main/java/com/google/cloud/trace/v2/TraceServiceClient.java#L205-L210 |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/resources/ConfigurationBuilder.java | ConfigurationBuilder.setMinimumEntropy | public ConfigurationBuilder setMinimumEntropy(BigDecimal seconds_to_crack, String guess_type) {
"""
Sets the minimum entropy based on time to crack, and a specific guess type.
<br>
If you are specifying a cracking hardware cost, you should set that prior to calling this.
@param seconds_to_crack Value in secon... | java | public ConfigurationBuilder setMinimumEntropy(BigDecimal seconds_to_crack, String guess_type)
{
BigDecimal guesses_per_second;
if(guessTypes != null)
guesses_per_second = BigDecimal.valueOf(guessTypes.get(guess_type));
else
guesses_per_second = BigDecimal.valueOf(getD... | [
"public",
"ConfigurationBuilder",
"setMinimumEntropy",
"(",
"BigDecimal",
"seconds_to_crack",
",",
"String",
"guess_type",
")",
"{",
"BigDecimal",
"guesses_per_second",
";",
"if",
"(",
"guessTypes",
"!=",
"null",
")",
"guesses_per_second",
"=",
"BigDecimal",
".",
"val... | Sets the minimum entropy based on time to crack, and a specific guess type.
<br>
If you are specifying a cracking hardware cost, you should set that prior to calling this.
@param seconds_to_crack Value in seconds that you want to consider the minimum for a password to be considered good
@param guess_type The guess typ... | [
"Sets",
"the",
"minimum",
"entropy",
"based",
"on",
"time",
"to",
"crack",
"and",
"a",
"specific",
"guess",
"type",
".",
"<br",
">",
"If",
"you",
"are",
"specifying",
"a",
"cracking",
"hardware",
"cost",
"you",
"should",
"set",
"that",
"prior",
"to",
"ca... | train | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/resources/ConfigurationBuilder.java#L316-L328 |
etnetera/seb | src/main/java/cz/etnetera/seb/configuration/BasicSebConfiguration.java | BasicSebConfiguration.getDefaultDriver | protected WebDriver getDefaultDriver(DesiredCapabilities caps) {
"""
Returns default {@link WebDriver} instance. Override this for different
value.
@param caps
The non null desired capabilities.
@return The driver
"""
String hubUrl = getHubUrl();
if (hubUrl == null) {
return new FirefoxDriver(caps... | java | protected WebDriver getDefaultDriver(DesiredCapabilities caps) {
String hubUrl = getHubUrl();
if (hubUrl == null) {
return new FirefoxDriver(caps);
}
try {
return new RemoteWebDriver(new URL(hubUrl), caps);
} catch (MalformedURLException e) {
throw new SebException("Unable to construct remote webdriv... | [
"protected",
"WebDriver",
"getDefaultDriver",
"(",
"DesiredCapabilities",
"caps",
")",
"{",
"String",
"hubUrl",
"=",
"getHubUrl",
"(",
")",
";",
"if",
"(",
"hubUrl",
"==",
"null",
")",
"{",
"return",
"new",
"FirefoxDriver",
"(",
"caps",
")",
";",
"}",
"try... | Returns default {@link WebDriver} instance. Override this for different
value.
@param caps
The non null desired capabilities.
@return The driver | [
"Returns",
"default",
"{",
"@link",
"WebDriver",
"}",
"instance",
".",
"Override",
"this",
"for",
"different",
"value",
"."
] | train | https://github.com/etnetera/seb/blob/6aed29c7726db12f440c60cfd253de229064ed04/src/main/java/cz/etnetera/seb/configuration/BasicSebConfiguration.java#L165-L175 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/MediaApi.java | MediaApi.asyncPutOnHold | public ApiSuccessResponse asyncPutOnHold(String id, PutOnHoldData putOnHoldData) throws ApiException {
"""
Put the interaction chat on hold
Put the interaction chat on hold.
@param id The ID of the interaction. (required)
@param putOnHoldData (required)
@return ApiSuccessResponse
@throws ApiException If fail... | java | public ApiSuccessResponse asyncPutOnHold(String id, PutOnHoldData putOnHoldData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = asyncPutOnHoldWithHttpInfo(id, putOnHoldData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"asyncPutOnHold",
"(",
"String",
"id",
",",
"PutOnHoldData",
"putOnHoldData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"asyncPutOnHoldWithHttpInfo",
"(",
"id",
",",
"putOnHoldData",
... | Put the interaction chat on hold
Put the interaction chat on hold.
@param id The ID of the interaction. (required)
@param putOnHoldData (required)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Put",
"the",
"interaction",
"chat",
"on",
"hold",
"Put",
"the",
"interaction",
"chat",
"on",
"hold",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/MediaApi.java#L875-L878 |
CenturyLinkCloud/mdw | mdw-common/src/com/centurylink/mdw/dataaccess/DatabaseAccess.java | DatabaseAccess.runSelect | public ResultSet runSelect(String logMessage, String query, Object[] arguments) throws SQLException {
"""
Ordinarily db query logging is at TRACE level. Use this method
to log queries at DEBUG level.
"""
long before = System.currentTimeMillis();
try {
return runSelect(query, argum... | java | public ResultSet runSelect(String logMessage, String query, Object[] arguments) throws SQLException {
long before = System.currentTimeMillis();
try {
return runSelect(query, arguments);
}
finally {
if (logger.isDebugEnabled()) {
long after = System... | [
"public",
"ResultSet",
"runSelect",
"(",
"String",
"logMessage",
",",
"String",
"query",
",",
"Object",
"[",
"]",
"arguments",
")",
"throws",
"SQLException",
"{",
"long",
"before",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"try",
"{",
"return",... | Ordinarily db query logging is at TRACE level. Use this method
to log queries at DEBUG level. | [
"Ordinarily",
"db",
"query",
"logging",
"is",
"at",
"TRACE",
"level",
".",
"Use",
"this",
"method",
"to",
"log",
"queries",
"at",
"DEBUG",
"level",
"."
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/dataaccess/DatabaseAccess.java#L436-L447 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polyline.java | Polyline.isCloseTo | public boolean isCloseTo(GeoPoint point, double tolerance, MapView mapView) {
"""
Detection is done is screen coordinates.
@param point
@param tolerance in pixels
@return true if the Polyline is close enough to the point.
"""
return getCloseTo(point, tolerance, mapView) != null;
} | java | public boolean isCloseTo(GeoPoint point, double tolerance, MapView mapView) {
return getCloseTo(point, tolerance, mapView) != null;
} | [
"public",
"boolean",
"isCloseTo",
"(",
"GeoPoint",
"point",
",",
"double",
"tolerance",
",",
"MapView",
"mapView",
")",
"{",
"return",
"getCloseTo",
"(",
"point",
",",
"tolerance",
",",
"mapView",
")",
"!=",
"null",
";",
"}"
] | Detection is done is screen coordinates.
@param point
@param tolerance in pixels
@return true if the Polyline is close enough to the point. | [
"Detection",
"is",
"done",
"is",
"screen",
"coordinates",
"."
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polyline.java#L176-L178 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworks.java | PrepareRoutingSubnetworks.detectNodeRemovedForAllEncoders | boolean detectNodeRemovedForAllEncoders(EdgeExplorer edgeExplorerAllEdges, int nodeIndex) {
"""
This method checks if the node is removed or inaccessible for ALL encoders.
@return true if no edges are reachable from the specified nodeIndex for any flag encoder.
"""
// we could implement a 'fast chec... | java | boolean detectNodeRemovedForAllEncoders(EdgeExplorer edgeExplorerAllEdges, int nodeIndex) {
// we could implement a 'fast check' for several previously marked removed nodes via GHBitSet
// removedNodesPerVehicle. The problem is that we would need long-indices but BitSet only supports int (due to nodeIn... | [
"boolean",
"detectNodeRemovedForAllEncoders",
"(",
"EdgeExplorer",
"edgeExplorerAllEdges",
",",
"int",
"nodeIndex",
")",
"{",
"// we could implement a 'fast check' for several previously marked removed nodes via GHBitSet ",
"// removedNodesPerVehicle. The problem is that we would need long-ind... | This method checks if the node is removed or inaccessible for ALL encoders.
@return true if no edges are reachable from the specified nodeIndex for any flag encoder. | [
"This",
"method",
"checks",
"if",
"the",
"node",
"is",
"removed",
"or",
"inaccessible",
"for",
"ALL",
"encoders",
"."
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworks.java#L257-L272 |
micronaut-projects/micronaut-core | runtime/src/main/java/io/micronaut/discovery/cloud/ComputeInstanceMetadataResolverUtils.java | ComputeInstanceMetadataResolverUtils.populateMetadata | public static void populateMetadata(AbstractComputeInstanceMetadata instanceMetadata, Map<?, ?> metadata) {
"""
Populates the instance instance metadata's {@link AbstractComputeInstanceMetadata#setMetadata(Map)} property.
@param instanceMetadata The instance metadata
@param metadata A map of metadata
"""
... | java | public static void populateMetadata(AbstractComputeInstanceMetadata instanceMetadata, Map<?, ?> metadata) {
if (metadata != null) {
Map<String, String> finalMetadata = new HashMap<>(metadata.size());
for (Map.Entry<?, ?> entry : metadata.entrySet()) {
Object key = entry.g... | [
"public",
"static",
"void",
"populateMetadata",
"(",
"AbstractComputeInstanceMetadata",
"instanceMetadata",
",",
"Map",
"<",
"?",
",",
"?",
">",
"metadata",
")",
"{",
"if",
"(",
"metadata",
"!=",
"null",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
... | Populates the instance instance metadata's {@link AbstractComputeInstanceMetadata#setMetadata(Map)} property.
@param instanceMetadata The instance metadata
@param metadata A map of metadata | [
"Populates",
"the",
"instance",
"instance",
"metadata",
"s",
"{"
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/runtime/src/main/java/io/micronaut/discovery/cloud/ComputeInstanceMetadataResolverUtils.java#L89-L101 |
citrusframework/citrus | modules/citrus-ws/src/main/java/com/consol/citrus/ws/addressing/WsAddressingHeaders.java | WsAddressingHeaders.setMessageId | public void setMessageId(String messageId) {
"""
Sets the message id from uri string.
@param messageId the messageId to set
"""
try {
this.messageId = new URI(messageId);
} catch (URISyntaxException e) {
throw new CitrusRuntimeException("Invalid messageId uri", e);
... | java | public void setMessageId(String messageId) {
try {
this.messageId = new URI(messageId);
} catch (URISyntaxException e) {
throw new CitrusRuntimeException("Invalid messageId uri", e);
}
} | [
"public",
"void",
"setMessageId",
"(",
"String",
"messageId",
")",
"{",
"try",
"{",
"this",
".",
"messageId",
"=",
"new",
"URI",
"(",
"messageId",
")",
";",
"}",
"catch",
"(",
"URISyntaxException",
"e",
")",
"{",
"throw",
"new",
"CitrusRuntimeException",
"... | Sets the message id from uri string.
@param messageId the messageId to set | [
"Sets",
"the",
"message",
"id",
"from",
"uri",
"string",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-ws/src/main/java/com/consol/citrus/ws/addressing/WsAddressingHeaders.java#L146-L152 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/gen/StorableGenerator.java | StorableGenerator.lookupMethod | private static Method lookupMethod(Class type, String name, Class... args) {
"""
/*
private static Method lookupMethod(Class type, MethodInfo mi) {
MethodDesc desc = mi.getMethodDescriptor();
TypeDesc[] params = desc.getParameterTypes();
Class[] args;
if (params == null || params.length == 0) {
args = null... | java | private static Method lookupMethod(Class type, String name, Class... args) {
try {
return type.getMethod(name, args);
} catch (NoSuchMethodException e) {
Error error = new NoSuchMethodError();
error.initCause(e);
throw error;
}
} | [
"private",
"static",
"Method",
"lookupMethod",
"(",
"Class",
"type",
",",
"String",
"name",
",",
"Class",
"...",
"args",
")",
"{",
"try",
"{",
"return",
"type",
".",
"getMethod",
"(",
"name",
",",
"args",
")",
";",
"}",
"catch",
"(",
"NoSuchMethodExcepti... | /*
private static Method lookupMethod(Class type, MethodInfo mi) {
MethodDesc desc = mi.getMethodDescriptor();
TypeDesc[] params = desc.getParameterTypes();
Class[] args;
if (params == null || params.length == 0) {
args = null;
} else {
args = new Class[params.length];
for (int i=0; i<args.length; i++) {
args[i] = par... | [
"/",
"*",
"private",
"static",
"Method",
"lookupMethod",
"(",
"Class",
"type",
"MethodInfo",
"mi",
")",
"{",
"MethodDesc",
"desc",
"=",
"mi",
".",
"getMethodDescriptor",
"()",
";",
"TypeDesc",
"[]",
"params",
"=",
"desc",
".",
"getParameterTypes",
"()",
";",... | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/gen/StorableGenerator.java#L1856-L1864 |
diffplug/JMatIO | src/main/java/ca/mjdsystems/jmatio/types/MLStructure.java | MLStructure.getField | public MLArray getField(String name, int m, int n) {
"""
Gets a value of the field described by name from (m,n)'th struct
in struct array or null if the field doesn't exist.
@param name
@param m
@param n
@return
"""
return getField(name, getIndex(m,n) );
} | java | public MLArray getField(String name, int m, int n)
{
return getField(name, getIndex(m,n) );
} | [
"public",
"MLArray",
"getField",
"(",
"String",
"name",
",",
"int",
"m",
",",
"int",
"n",
")",
"{",
"return",
"getField",
"(",
"name",
",",
"getIndex",
"(",
"m",
",",
"n",
")",
")",
";",
"}"
] | Gets a value of the field described by name from (m,n)'th struct
in struct array or null if the field doesn't exist.
@param name
@param m
@param n
@return | [
"Gets",
"a",
"value",
"of",
"the",
"field",
"described",
"by",
"name",
"from",
"(",
"m",
"n",
")",
"th",
"struct",
"in",
"struct",
"array",
"or",
"null",
"if",
"the",
"field",
"doesn",
"t",
"exist",
"."
] | train | https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/types/MLStructure.java#L186-L189 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SecurityPolicyClient.java | SecurityPolicyClient.getRuleSecurityPolicy | @BetaApi
public final SecurityPolicyRule getRuleSecurityPolicy(Integer priority, String securityPolicy) {
"""
Gets a rule at the specified priority.
<p>Sample code:
<pre><code>
try (SecurityPolicyClient securityPolicyClient = SecurityPolicyClient.create()) {
Integer priority = 0;
ProjectGlobalSecurityPo... | java | @BetaApi
public final SecurityPolicyRule getRuleSecurityPolicy(Integer priority, String securityPolicy) {
GetRuleSecurityPolicyHttpRequest request =
GetRuleSecurityPolicyHttpRequest.newBuilder()
.setPriority(priority)
.setSecurityPolicy(securityPolicy)
.build();
re... | [
"@",
"BetaApi",
"public",
"final",
"SecurityPolicyRule",
"getRuleSecurityPolicy",
"(",
"Integer",
"priority",
",",
"String",
"securityPolicy",
")",
"{",
"GetRuleSecurityPolicyHttpRequest",
"request",
"=",
"GetRuleSecurityPolicyHttpRequest",
".",
"newBuilder",
"(",
")",
".... | Gets a rule at the specified priority.
<p>Sample code:
<pre><code>
try (SecurityPolicyClient securityPolicyClient = SecurityPolicyClient.create()) {
Integer priority = 0;
ProjectGlobalSecurityPolicyName securityPolicy = ProjectGlobalSecurityPolicyName.of("[PROJECT]", "[SECURITY_POLICY]");
SecurityPolicyRule response ... | [
"Gets",
"a",
"rule",
"at",
"the",
"specified",
"priority",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/SecurityPolicyClient.java#L516-L525 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.saveAliases | public void saveAliases(CmsRequestContext context, CmsResource resource, List<CmsAlias> aliases)
throws CmsException {
"""
Saves the aliases for a given resource.<p>
This method completely replaces any existing aliases for the same structure id.
@param context the request context
@param resource the res... | java | public void saveAliases(CmsRequestContext context, CmsResource resource, List<CmsAlias> aliases)
throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
if ((aliases.size() > 0) && !(resource.getStructureId().equals(aliases.get(0).getStructureId()))) {
... | [
"public",
"void",
"saveAliases",
"(",
"CmsRequestContext",
"context",
",",
"CmsResource",
"resource",
",",
"List",
"<",
"CmsAlias",
">",
"aliases",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"con... | Saves the aliases for a given resource.<p>
This method completely replaces any existing aliases for the same structure id.
@param context the request context
@param resource the resource for which the aliases should be written
@param aliases the list of aliases to write, where all aliases must have the same structure... | [
"Saves",
"the",
"aliases",
"for",
"a",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L5872-L5891 |
scribejava/scribejava | scribejava-core/src/main/java/com/github/scribejava/core/model/OAuthRequest.java | OAuthRequest.addOAuthParameter | public void addOAuthParameter(String key, String value) {
"""
Adds an OAuth parameter.
@param key name of the parameter
@param value value of the parameter
@throws IllegalArgumentException if the parameter is not an OAuth parameter
"""
oauthParameters.put(checkKey(key), value);
} | java | public void addOAuthParameter(String key, String value) {
oauthParameters.put(checkKey(key), value);
} | [
"public",
"void",
"addOAuthParameter",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"oauthParameters",
".",
"put",
"(",
"checkKey",
"(",
"key",
")",
",",
"value",
")",
";",
"}"
] | Adds an OAuth parameter.
@param key name of the parameter
@param value value of the parameter
@throws IllegalArgumentException if the parameter is not an OAuth parameter | [
"Adds",
"an",
"OAuth",
"parameter",
"."
] | train | https://github.com/scribejava/scribejava/blob/030d76872fe371a84b5d05c6c3c33c34e8f611f1/scribejava-core/src/main/java/com/github/scribejava/core/model/OAuthRequest.java#L58-L60 |
gallandarakhneorg/afc | core/maths/mathphysics/src/main/java/org/arakhne/afc/math/physics/MeasureUnitUtil.java | MeasureUnitUtil.toMetersPerSecond | @Pure
public static double toMetersPerSecond(double value, SpeedUnit inputUnit) {
"""
Convert the given value expressed in the given unit to meters per second.
@param value is the value to convert
@param inputUnit is the unit of the {@code value}
@return the result of the convertion.
"""
switch (inputU... | java | @Pure
public static double toMetersPerSecond(double value, SpeedUnit inputUnit) {
switch (inputUnit) {
case KILOMETERS_PER_HOUR:
return 3.6 * value;
case MILLIMETERS_PER_SECOND:
return value / 1000.;
case METERS_PER_SECOND:
default:
}
return value;
} | [
"@",
"Pure",
"public",
"static",
"double",
"toMetersPerSecond",
"(",
"double",
"value",
",",
"SpeedUnit",
"inputUnit",
")",
"{",
"switch",
"(",
"inputUnit",
")",
"{",
"case",
"KILOMETERS_PER_HOUR",
":",
"return",
"3.6",
"*",
"value",
";",
"case",
"MILLIMETERS_... | Convert the given value expressed in the given unit to meters per second.
@param value is the value to convert
@param inputUnit is the unit of the {@code value}
@return the result of the convertion. | [
"Convert",
"the",
"given",
"value",
"expressed",
"in",
"the",
"given",
"unit",
"to",
"meters",
"per",
"second",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathphysics/src/main/java/org/arakhne/afc/math/physics/MeasureUnitUtil.java#L620-L631 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/manifest/BaseRenderer.java | BaseRenderer.addCell | public Cell addCell(Row row, String label) {
"""
Adds a cell to the grid row.
@param row List row.
@param label Label text for cell.
@return Newly created cell.
"""
Cell cell = new Cell(label);
row.addChild(cell);
return cell;
} | java | public Cell addCell(Row row, String label) {
Cell cell = new Cell(label);
row.addChild(cell);
return cell;
} | [
"public",
"Cell",
"addCell",
"(",
"Row",
"row",
",",
"String",
"label",
")",
"{",
"Cell",
"cell",
"=",
"new",
"Cell",
"(",
"label",
")",
";",
"row",
".",
"addChild",
"(",
"cell",
")",
";",
"return",
"cell",
";",
"}"
] | Adds a cell to the grid row.
@param row List row.
@param label Label text for cell.
@return Newly created cell. | [
"Adds",
"a",
"cell",
"to",
"the",
"grid",
"row",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/manifest/BaseRenderer.java#L42-L46 |
jayantk/jklol | src/com/jayantkrish/jklol/cli/AbstractCli.java | AbstractCli.createGradientOptimizer | protected GradientOptimizer createGradientOptimizer(int numExamples) {
"""
Creates a gradient-based optimization algorithm based on the
given command-line parameters. To use this method, pass at least
one of {@link CommonOptions#STOCHASTIC_GRADIENT} or
{@link CommonOptions#LBFGS} to the constructor. This method... | java | protected GradientOptimizer createGradientOptimizer(int numExamples) {
if (opts.contains(CommonOptions.STOCHASTIC_GRADIENT) &&
opts.contains(CommonOptions.LBFGS)) {
if (parsedOptions.has(lbfgs)) {
return createLbfgs(numExamples);
} else {
return createStochasticGradientTrainer(nu... | [
"protected",
"GradientOptimizer",
"createGradientOptimizer",
"(",
"int",
"numExamples",
")",
"{",
"if",
"(",
"opts",
".",
"contains",
"(",
"CommonOptions",
".",
"STOCHASTIC_GRADIENT",
")",
"&&",
"opts",
".",
"contains",
"(",
"CommonOptions",
".",
"LBFGS",
")",
"... | Creates a gradient-based optimization algorithm based on the
given command-line parameters. To use this method, pass at least
one of {@link CommonOptions#STOCHASTIC_GRADIENT} or
{@link CommonOptions#LBFGS} to the constructor. This method
allows users to easily select different optimization algorithms
and parameterizati... | [
"Creates",
"a",
"gradient",
"-",
"based",
"optimization",
"algorithm",
"based",
"on",
"the",
"given",
"command",
"-",
"line",
"parameters",
".",
"To",
"use",
"this",
"method",
"pass",
"at",
"least",
"one",
"of",
"{",
"@link",
"CommonOptions#STOCHASTIC_GRADIENT",... | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/cli/AbstractCli.java#L447-L462 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/OutputPropertyUtils.java | OutputPropertyUtils.getBooleanProperty | public static boolean getBooleanProperty(String key, Properties props) {
"""
Searches for the boolean property with the specified key in the property list.
If the key is not found in this property list, the default property list,
and its defaults, recursively, are then checked. The method returns
<code>false</c... | java | public static boolean getBooleanProperty(String key, Properties props)
{
String s = props.getProperty(key);
if (null == s || !s.equals("yes"))
return false;
else
return true;
} | [
"public",
"static",
"boolean",
"getBooleanProperty",
"(",
"String",
"key",
",",
"Properties",
"props",
")",
"{",
"String",
"s",
"=",
"props",
".",
"getProperty",
"(",
"key",
")",
";",
"if",
"(",
"null",
"==",
"s",
"||",
"!",
"s",
".",
"equals",
"(",
... | Searches for the boolean property with the specified key in the property list.
If the key is not found in this property list, the default property list,
and its defaults, recursively, are then checked. The method returns
<code>false</code> if the property is not found, or if the value is other
than "yes".
@param key... | [
"Searches",
"for",
"the",
"boolean",
"property",
"with",
"the",
"specified",
"key",
"in",
"the",
"property",
"list",
".",
"If",
"the",
"key",
"is",
"not",
"found",
"in",
"this",
"property",
"list",
"the",
"default",
"property",
"list",
"and",
"its",
"defau... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/OutputPropertyUtils.java#L49-L58 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/ie/AbstractSequenceClassifier.java | AbstractSequenceClassifier.loadClassifier | public void loadClassifier(File file, Properties props) throws ClassCastException, IOException,
ClassNotFoundException {
"""
Loads a classifier from the file specified. If the file's name ends in .gz,
uses a GZIPInputStream, else uses a regular FileInputStream. This method
closes the File when done.
@p... | java | public void loadClassifier(File file, Properties props) throws ClassCastException, IOException,
ClassNotFoundException {
Timing.startDoing("Loading classifier from " + file.getAbsolutePath());
BufferedInputStream bis;
if (file.getName().endsWith(".gz")) {
bis = new BufferedInputStream(new G... | [
"public",
"void",
"loadClassifier",
"(",
"File",
"file",
",",
"Properties",
"props",
")",
"throws",
"ClassCastException",
",",
"IOException",
",",
"ClassNotFoundException",
"{",
"Timing",
".",
"startDoing",
"(",
"\"Loading classifier from \"",
"+",
"file",
".",
"get... | Loads a classifier from the file specified. If the file's name ends in .gz,
uses a GZIPInputStream, else uses a regular FileInputStream. This method
closes the File when done.
@param file
Loads a classifier from this file.
@param props
Properties in this object will be used to overwrite those
specified in the serializ... | [
"Loads",
"a",
"classifier",
"from",
"the",
"file",
"specified",
".",
"If",
"the",
"file",
"s",
"name",
"ends",
"in",
".",
"gz",
"uses",
"a",
"GZIPInputStream",
"else",
"uses",
"a",
"regular",
"FileInputStream",
".",
"This",
"method",
"closes",
"the",
"File... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ie/AbstractSequenceClassifier.java#L1649-L1661 |
javagl/CommonUI | src/main/java/de/javagl/common/ui/closeable/CloseableTab.java | CloseableTab.addTo | public static void addTo(
JTabbedPane tabbedPane, String title, JComponent component,
CloseCallback closeCallback) {
"""
Adds a {@link CloseableTab} with the given title and component to
the given tabbed pane. The given {@link CloseCallback} will be
consulted to decide whether the tab may be c... | java | public static void addTo(
JTabbedPane tabbedPane, String title, JComponent component,
CloseCallback closeCallback)
{
int index = tabbedPane.getTabCount();
tabbedPane.addTab(title, component);
tabbedPane.setTabComponentAt(
index, new CloseableTab(tabbedPane... | [
"public",
"static",
"void",
"addTo",
"(",
"JTabbedPane",
"tabbedPane",
",",
"String",
"title",
",",
"JComponent",
"component",
",",
"CloseCallback",
"closeCallback",
")",
"{",
"int",
"index",
"=",
"tabbedPane",
".",
"getTabCount",
"(",
")",
";",
"tabbedPane",
... | Adds a {@link CloseableTab} with the given title and component to
the given tabbed pane. The given {@link CloseCallback} will be
consulted to decide whether the tab may be closed
@param tabbedPane The tabbed pane
@param title The title of the tab
@param component The component in the tab
@param closeCallback The {@lin... | [
"Adds",
"a",
"{",
"@link",
"CloseableTab",
"}",
"with",
"the",
"given",
"title",
"and",
"component",
"to",
"the",
"given",
"tabbed",
"pane",
".",
"The",
"given",
"{",
"@link",
"CloseCallback",
"}",
"will",
"be",
"consulted",
"to",
"decide",
"whether",
"the... | train | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/closeable/CloseableTab.java#L94-L103 |
wcm-io-caravan/caravan-hal | docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java | GenerateHalDocsJsonMojo.hasJsonSchemaFile | private boolean hasJsonSchemaFile(ZipFile jarFile, Class<?> modelClass) throws IOException {
"""
Gets bundle header/mainfest entry Caravan-HalDocs-DomainPath from given JAR file.
@param jarFile JAR file
@return Header value or null
@throws IOException
"""
String path = JsonSchemaBundleTracker.SCHEMA_CLA... | java | private boolean hasJsonSchemaFile(ZipFile jarFile, Class<?> modelClass) throws IOException {
String path = JsonSchemaBundleTracker.SCHEMA_CLASSPATH_PREFIX + "/" + modelClass.getName() + ".json";
return jarFile.getEntry(path) != null;
} | [
"private",
"boolean",
"hasJsonSchemaFile",
"(",
"ZipFile",
"jarFile",
",",
"Class",
"<",
"?",
">",
"modelClass",
")",
"throws",
"IOException",
"{",
"String",
"path",
"=",
"JsonSchemaBundleTracker",
".",
"SCHEMA_CLASSPATH_PREFIX",
"+",
"\"/\"",
"+",
"modelClass",
"... | Gets bundle header/mainfest entry Caravan-HalDocs-DomainPath from given JAR file.
@param jarFile JAR file
@return Header value or null
@throws IOException | [
"Gets",
"bundle",
"header",
"/",
"mainfest",
"entry",
"Caravan",
"-",
"HalDocs",
"-",
"DomainPath",
"from",
"given",
"JAR",
"file",
"."
] | train | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java#L304-L307 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmetryAxes.java | SymmetryAxes.addAxis | public void addAxis(Matrix4d axis, int order, SymmetryType type) {
"""
Adds a new axis of symmetry to the bottom level of the tree
@param axis the new axis of symmetry found
@param order number of parts that this axis divides the structure in
@param type indicates whether the axis has OPEN or CLOSED symmetry
... | java | public void addAxis(Matrix4d axis, int order, SymmetryType type) {
axes.add(new Axis(axis,order,type,axes.size(),0));
} | [
"public",
"void",
"addAxis",
"(",
"Matrix4d",
"axis",
",",
"int",
"order",
",",
"SymmetryType",
"type",
")",
"{",
"axes",
".",
"add",
"(",
"new",
"Axis",
"(",
"axis",
",",
"order",
",",
"type",
",",
"axes",
".",
"size",
"(",
")",
",",
"0",
")",
"... | Adds a new axis of symmetry to the bottom level of the tree
@param axis the new axis of symmetry found
@param order number of parts that this axis divides the structure in
@param type indicates whether the axis has OPEN or CLOSED symmetry | [
"Adds",
"a",
"new",
"axis",
"of",
"symmetry",
"to",
"the",
"bottom",
"level",
"of",
"the",
"tree"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmetryAxes.java#L205-L207 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Model.java | Model.toJson | public String toJson(boolean pretty, String... attributeNames) {
"""
Generates a JSON document from content of this model.
@param pretty pretty format (human readable), or one line text.
@param attributeNames list of attributes to include. No arguments == include all attributes.
@return generated JSON.
"... | java | public String toJson(boolean pretty, String... attributeNames) {
StringBuilder sb = new StringBuilder();
toJsonP(sb, pretty, "", attributeNames);
return sb.toString();
} | [
"public",
"String",
"toJson",
"(",
"boolean",
"pretty",
",",
"String",
"...",
"attributeNames",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"toJsonP",
"(",
"sb",
",",
"pretty",
",",
"\"\"",
",",
"attributeNames",
")",
";",
... | Generates a JSON document from content of this model.
@param pretty pretty format (human readable), or one line text.
@param attributeNames list of attributes to include. No arguments == include all attributes.
@return generated JSON. | [
"Generates",
"a",
"JSON",
"document",
"from",
"content",
"of",
"this",
"model",
"."
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Model.java#L1069-L1073 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_recommendedDNSRecords_GET | public ArrayList<OvhRecord> domain_recommendedDNSRecords_GET(String domain) throws IOException {
"""
Recommended domain DNS records
REST: GET /email/domain/{domain}/recommendedDNSRecords
@param domain [required] Name of your domain name
"""
String qPath = "/email/domain/{domain}/recommendedDNSRecords";
... | java | public ArrayList<OvhRecord> domain_recommendedDNSRecords_GET(String domain) throws IOException {
String qPath = "/email/domain/{domain}/recommendedDNSRecords";
StringBuilder sb = path(qPath, domain);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t4);
} | [
"public",
"ArrayList",
"<",
"OvhRecord",
">",
"domain_recommendedDNSRecords_GET",
"(",
"String",
"domain",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{domain}/recommendedDNSRecords\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath... | Recommended domain DNS records
REST: GET /email/domain/{domain}/recommendedDNSRecords
@param domain [required] Name of your domain name | [
"Recommended",
"domain",
"DNS",
"records"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L1414-L1419 |
netplex/json-smart-v2 | json-smart/src/main/java/net/minidev/json/parser/JSONParser.java | JSONParser.parse | public <T> T parse(Reader in, JsonReaderI<T> mapper) throws ParseException {
"""
use to return Primitive Type, or String, Or JsonObject or JsonArray
generated by a ContainerFactory
"""
return getPStream().parse(in, mapper);
} | java | public <T> T parse(Reader in, JsonReaderI<T> mapper) throws ParseException {
return getPStream().parse(in, mapper);
} | [
"public",
"<",
"T",
">",
"T",
"parse",
"(",
"Reader",
"in",
",",
"JsonReaderI",
"<",
"T",
">",
"mapper",
")",
"throws",
"ParseException",
"{",
"return",
"getPStream",
"(",
")",
".",
"parse",
"(",
"in",
",",
"mapper",
")",
";",
"}"
] | use to return Primitive Type, or String, Or JsonObject or JsonArray
generated by a ContainerFactory | [
"use",
"to",
"return",
"Primitive",
"Type",
"or",
"String",
"Or",
"JsonObject",
"or",
"JsonArray",
"generated",
"by",
"a",
"ContainerFactory"
] | train | https://github.com/netplex/json-smart-v2/blob/bfb3daef039e22a7bbff5f76bf14ea23330cd70e/json-smart/src/main/java/net/minidev/json/parser/JSONParser.java#L246-L248 |
Coreoz/Wisp | src/main/java/com/coreoz/wisp/LongRunningJobMonitor.java | LongRunningJobMonitor.detectLongRunningJob | boolean detectLongRunningJob(long currentTime, Job job) {
"""
Check whether a job is running for too long or not.
@return true if the is running for too long, else false.
Returned value is made available for testing purposes.
"""
if(job.status() == JobStatus.RUNNING && !longRunningJobs.containsKey(job)) ... | java | boolean detectLongRunningJob(long currentTime, Job job) {
if(job.status() == JobStatus.RUNNING && !longRunningJobs.containsKey(job)) {
int jobExecutionsCount = job.executionsCount();
Long jobStartedtimeInMillis = job.lastExecutionStartedTimeInMillis();
Thread threadRunningJob = job.threadRunningJob();
if... | [
"boolean",
"detectLongRunningJob",
"(",
"long",
"currentTime",
",",
"Job",
"job",
")",
"{",
"if",
"(",
"job",
".",
"status",
"(",
")",
"==",
"JobStatus",
".",
"RUNNING",
"&&",
"!",
"longRunningJobs",
".",
"containsKey",
"(",
"job",
")",
")",
"{",
"int",
... | Check whether a job is running for too long or not.
@return true if the is running for too long, else false.
Returned value is made available for testing purposes. | [
"Check",
"whether",
"a",
"job",
"is",
"running",
"for",
"too",
"long",
"or",
"not",
"."
] | train | https://github.com/Coreoz/Wisp/blob/6d5de3b88fbe259e327296eea167b18cf41c7641/src/main/java/com/coreoz/wisp/LongRunningJobMonitor.java#L81-L110 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/transform/fft/GDiscreteFourierTransformOps.java | GDiscreteFourierTransformOps.realToComplex | public static void realToComplex(GrayF real , ImageInterleaved complex ) {
"""
Converts a regular image into a complex interleaved image with the imaginary component set to zero.
@param real (Input) Regular image.
@param complex (Output) Equivalent complex image.
"""
if( complex instanceof InterleavedF32... | java | public static void realToComplex(GrayF real , ImageInterleaved complex ) {
if( complex instanceof InterleavedF32 ) {
DiscreteFourierTransformOps.realToComplex((GrayF32) real, (InterleavedF32) complex);
} else if( complex instanceof InterleavedF64 ) {
DiscreteFourierTransformOps.realToComplex((GrayF64) real, (... | [
"public",
"static",
"void",
"realToComplex",
"(",
"GrayF",
"real",
",",
"ImageInterleaved",
"complex",
")",
"{",
"if",
"(",
"complex",
"instanceof",
"InterleavedF32",
")",
"{",
"DiscreteFourierTransformOps",
".",
"realToComplex",
"(",
"(",
"GrayF32",
")",
"real",
... | Converts a regular image into a complex interleaved image with the imaginary component set to zero.
@param real (Input) Regular image.
@param complex (Output) Equivalent complex image. | [
"Converts",
"a",
"regular",
"image",
"into",
"a",
"complex",
"interleaved",
"image",
"with",
"the",
"imaginary",
"component",
"set",
"to",
"zero",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/fft/GDiscreteFourierTransformOps.java#L105-L113 |
looly/hutool | hutool-cron/src/main/java/cn/hutool/cron/TaskTable.java | TaskTable.updatePattern | public boolean updatePattern(String id, CronPattern pattern) {
"""
更新某个Task的定时规则
@param id Task的ID
@param pattern 新的表达式
@return 是否更新成功,如果id对应的规则不存在则不更新
@since 4.0.10
"""
final Lock writeLock = lock.writeLock();
try {
writeLock.lock();
final int index = ids.indexOf(id);
if (index > -1) {... | java | public boolean updatePattern(String id, CronPattern pattern) {
final Lock writeLock = lock.writeLock();
try {
writeLock.lock();
final int index = ids.indexOf(id);
if (index > -1) {
patterns.set(index, pattern);
return true;
}
} finally {
writeLock.unlock();
}
return false;
... | [
"public",
"boolean",
"updatePattern",
"(",
"String",
"id",
",",
"CronPattern",
"pattern",
")",
"{",
"final",
"Lock",
"writeLock",
"=",
"lock",
".",
"writeLock",
"(",
")",
";",
"try",
"{",
"writeLock",
".",
"lock",
"(",
")",
";",
"final",
"int",
"index",
... | 更新某个Task的定时规则
@param id Task的ID
@param pattern 新的表达式
@return 是否更新成功,如果id对应的规则不存在则不更新
@since 4.0.10 | [
"更新某个Task的定时规则"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-cron/src/main/java/cn/hutool/cron/TaskTable.java#L96-L109 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/activerecord/DbPro.java | DbPro.batchSave | public int[] batchSave(List<? extends Model> modelList, int batchSize) {
"""
Batch save models using the "insert into ..." sql generated by the first model in modelList.
Ensure all the models can use the same sql as the first model.
"""
if (modelList == null || modelList.size() == 0)
return new i... | java | public int[] batchSave(List<? extends Model> modelList, int batchSize) {
if (modelList == null || modelList.size() == 0)
return new int[0];
Model model = modelList.get(0);
Map<String, Object> attrs = model._getAttrs();
int index = 0;
StringBuilder columns = new StringBuilder(... | [
"public",
"int",
"[",
"]",
"batchSave",
"(",
"List",
"<",
"?",
"extends",
"Model",
">",
"modelList",
",",
"int",
"batchSize",
")",
"{",
"if",
"(",
"modelList",
"==",
"null",
"||",
"modelList",
".",
"size",
"(",
")",
"==",
"0",
")",
"return",
"new",
... | Batch save models using the "insert into ..." sql generated by the first model in modelList.
Ensure all the models can use the same sql as the first model. | [
"Batch",
"save",
"models",
"using",
"the",
"insert",
"into",
"...",
"sql",
"generated",
"by",
"the",
"first",
"model",
"in",
"modelList",
".",
"Ensure",
"all",
"the",
"models",
"can",
"use",
"the",
"same",
"sql",
"as",
"the",
"first",
"model",
"."
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/DbPro.java#L1123-L1150 |
sockeqwe/mosby | mvp/src/main/java/com/hannesdorfmann/mosby3/mvp/MvpBasePresenter.java | MvpBasePresenter.ifViewAttached | protected final void ifViewAttached(boolean exceptionIfViewNotAttached, ViewAction<V> action) {
"""
Executes the passed Action only if the View is attached.
If no View is attached, either an exception is thrown (if parameter exceptionIfViewNotAttached
is true) or the action is just not executed (no exception thr... | java | protected final void ifViewAttached(boolean exceptionIfViewNotAttached, ViewAction<V> action) {
final V view = viewRef == null ? null : viewRef.get();
if (view != null) {
action.run(view);
} else if (exceptionIfViewNotAttached) {
throw new IllegalStateException(
"No View attached to Pr... | [
"protected",
"final",
"void",
"ifViewAttached",
"(",
"boolean",
"exceptionIfViewNotAttached",
",",
"ViewAction",
"<",
"V",
">",
"action",
")",
"{",
"final",
"V",
"view",
"=",
"viewRef",
"==",
"null",
"?",
"null",
":",
"viewRef",
".",
"get",
"(",
")",
";",
... | Executes the passed Action only if the View is attached.
If no View is attached, either an exception is thrown (if parameter exceptionIfViewNotAttached
is true) or the action is just not executed (no exception thrown).
Note that if no view is attached, this will not re-execute the given action if the View gets
re-attac... | [
"Executes",
"the",
"passed",
"Action",
"only",
"if",
"the",
"View",
"is",
"attached",
".",
"If",
"no",
"View",
"is",
"attached",
"either",
"an",
"exception",
"is",
"thrown",
"(",
"if",
"parameter",
"exceptionIfViewNotAttached",
"is",
"true",
")",
"or",
"the"... | train | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/mvp/src/main/java/com/hannesdorfmann/mosby3/mvp/MvpBasePresenter.java#L118-L126 |
chemouna/Decor | decor/src/main/java/com/mounacheikhna/decor/DecorLayoutInflater.java | DecorLayoutInflater.onCreateView | @Override
protected View onCreateView(String name, AttributeSet attrs) throws ClassNotFoundException {
"""
The LayoutInflater onCreateView is the fourth port of call for LayoutInflation.
BUT only for none CustomViews.
Basically if this method doesn't inflate the View nothing probably will.
"""
//... | java | @Override
protected View onCreateView(String name, AttributeSet attrs) throws ClassNotFoundException {
// This mimics the {@code PhoneLayoutInflater} in the way it tries to inflate the base
// classes, if this fails its pretty certain the app will fail at this point.
View view = null;
... | [
"@",
"Override",
"protected",
"View",
"onCreateView",
"(",
"String",
"name",
",",
"AttributeSet",
"attrs",
")",
"throws",
"ClassNotFoundException",
"{",
"// This mimics the {@code PhoneLayoutInflater} in the way it tries to inflate the base",
"// classes, if this fails its pretty cer... | The LayoutInflater onCreateView is the fourth port of call for LayoutInflation.
BUT only for none CustomViews.
Basically if this method doesn't inflate the View nothing probably will. | [
"The",
"LayoutInflater",
"onCreateView",
"is",
"the",
"fourth",
"port",
"of",
"call",
"for",
"LayoutInflation",
".",
"BUT",
"only",
"for",
"none",
"CustomViews",
".",
"Basically",
"if",
"this",
"method",
"doesn",
"t",
"inflate",
"the",
"View",
"nothing",
"prob... | train | https://github.com/chemouna/Decor/blob/82b1c1be3c7769e0b63c6eb16f0c01055fb3e4ca/decor/src/main/java/com/mounacheikhna/decor/DecorLayoutInflater.java#L130-L146 |
aws/aws-sdk-java | aws-java-sdk-codestar/src/main/java/com/amazonaws/services/codestar/model/CreateProjectRequest.java | CreateProjectRequest.withTags | public CreateProjectRequest withTags(java.util.Map<String, String> tags) {
"""
<p>
The tags created for the project.
</p>
@param tags
The tags created for the project.
@return Returns a reference to this object so that method calls can be chained together.
"""
setTags(tags);
return this;... | java | public CreateProjectRequest withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"CreateProjectRequest",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The tags created for the project.
</p>
@param tags
The tags created for the project.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"tags",
"created",
"for",
"the",
"project",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-codestar/src/main/java/com/amazonaws/services/codestar/model/CreateProjectRequest.java#L399-L402 |
gsi-upm/BeastTool | beast-tool/src/main/java/es/upm/dit/gsi/beast/reader/Reader.java | Reader.createFileWriter | protected static FileWriter createFileWriter(String scenarioName,
String aux_package_path, String dest_dir) throws BeastException {
"""
Method to get the file writer required for the .story files
@param scenarioName
@param aux_package_path
@param dest_dir
@return The file writer that generates th... | java | protected static FileWriter createFileWriter(String scenarioName,
String aux_package_path, String dest_dir) throws BeastException {
try {
return new FileWriter(new File(createFolder(aux_package_path,
dest_dir), scenarioName + ".story"));
} catch (IOException e... | [
"protected",
"static",
"FileWriter",
"createFileWriter",
"(",
"String",
"scenarioName",
",",
"String",
"aux_package_path",
",",
"String",
"dest_dir",
")",
"throws",
"BeastException",
"{",
"try",
"{",
"return",
"new",
"FileWriter",
"(",
"new",
"File",
"(",
"createF... | Method to get the file writer required for the .story files
@param scenarioName
@param aux_package_path
@param dest_dir
@return The file writer that generates the .story files for each test
@throws BeastException | [
"Method",
"to",
"get",
"the",
"file",
"writer",
"required",
"for",
"the",
".",
"story",
"files"
] | train | https://github.com/gsi-upm/BeastTool/blob/cc7fdc75cb818c5d60802aaf32c27829e0ca144c/beast-tool/src/main/java/es/upm/dit/gsi/beast/reader/Reader.java#L342-L353 |
liferay/com-liferay-commerce | commerce-api/src/main/java/com/liferay/commerce/service/persistence/CommerceOrderUtil.java | CommerceOrderUtil.findByUUID_G | public static CommerceOrder findByUUID_G(String uuid, long groupId)
throws com.liferay.commerce.exception.NoSuchOrderException {
"""
Returns the commerce order where uuid = ? and groupId = ? or throws a {@link NoSuchOrderException} if it could not be found.
@param uuid the uuid
@param groupId the gro... | java | public static CommerceOrder findByUUID_G(String uuid, long groupId)
throws com.liferay.commerce.exception.NoSuchOrderException {
return getPersistence().findByUUID_G(uuid, groupId);
} | [
"public",
"static",
"CommerceOrder",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"com",
".",
"liferay",
".",
"commerce",
".",
"exception",
".",
"NoSuchOrderException",
"{",
"return",
"getPersistence",
"(",
")",
".",
"findByUUID_... | Returns the commerce order where uuid = ? and groupId = ? or throws a {@link NoSuchOrderException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce order
@throws NoSuchOrderException if a matching commerce order could not be found | [
"Returns",
"the",
"commerce",
"order",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchOrderException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-api/src/main/java/com/liferay/commerce/service/persistence/CommerceOrderUtil.java#L278-L281 |
Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/TieredBlockStore.java | TieredBlockStore.commitBlockInternal | private BlockStoreLocation commitBlockInternal(long sessionId, long blockId)
throws BlockAlreadyExistsException, InvalidWorkerStateException, BlockDoesNotExistException,
IOException {
"""
Commits a temp block.
@param sessionId the id of session
@param blockId the id of block
@return destination lo... | java | private BlockStoreLocation commitBlockInternal(long sessionId, long blockId)
throws BlockAlreadyExistsException, InvalidWorkerStateException, BlockDoesNotExistException,
IOException {
long lockId = mLockManager.lockBlock(sessionId, blockId, BlockLockType.WRITE);
try {
// When committing TempBl... | [
"private",
"BlockStoreLocation",
"commitBlockInternal",
"(",
"long",
"sessionId",
",",
"long",
"blockId",
")",
"throws",
"BlockAlreadyExistsException",
",",
"InvalidWorkerStateException",
",",
"BlockDoesNotExistException",
",",
"IOException",
"{",
"long",
"lockId",
"=",
"... | Commits a temp block.
@param sessionId the id of session
@param blockId the id of block
@return destination location to move the block
@throws BlockDoesNotExistException if block id can not be found in temporary blocks
@throws BlockAlreadyExistsException if block id already exists in committed blocks
@throws InvalidWo... | [
"Commits",
"a",
"temp",
"block",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/TieredBlockStore.java#L587-L620 |
xiancloud/xian | xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/StackTraceFilter.java | StackTraceFilter.getStackTrace | public static String getStackTrace(Throwable t, int ref) {
"""
Get the stack trace by selecting the {@link Throwable} using a reference position. Intermediate throwables will be
printed with just their header.
@param t the throwable
@param ref throwable reference position, see {@link #getThrowable(List, int)}... | java | public static String getStackTrace(Throwable t, int ref) {
StringWriter sw = new StringWriter();
printStackTrace(t, sw, ref);
return sw.getBuffer().toString();
} | [
"public",
"static",
"String",
"getStackTrace",
"(",
"Throwable",
"t",
",",
"int",
"ref",
")",
"{",
"StringWriter",
"sw",
"=",
"new",
"StringWriter",
"(",
")",
";",
"printStackTrace",
"(",
"t",
",",
"sw",
",",
"ref",
")",
";",
"return",
"sw",
".",
"getB... | Get the stack trace by selecting the {@link Throwable} using a reference position. Intermediate throwables will be
printed with just their header.
@param t the throwable
@param ref throwable reference position, see {@link #getThrowable(List, int)}.
@return String containing the stack trace.
@since 1.11.1 | [
"Get",
"the",
"stack",
"trace",
"by",
"selecting",
"the",
"{",
"@link",
"Throwable",
"}",
"using",
"a",
"reference",
"position",
".",
"Intermediate",
"throwables",
"will",
"be",
"printed",
"with",
"just",
"their",
"header",
"."
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/StackTraceFilter.java#L277-L283 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ServicesApi.java | ServicesApi.setHipChat | public void setHipChat(Object projectIdOrPath, String token, String room, String server) throws GitLabApiException {
"""
Activates HipChatService notifications.
<pre><code>GitLab Endpoint: PUT /projects/:id/services/hipchat</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance ho... | java | public void setHipChat(Object projectIdOrPath, String token, String room, String server) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("token", token)
.withParam("room", room)
.withParam("server", server);
put(Response... | [
"public",
"void",
"setHipChat",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"token",
",",
"String",
"room",
",",
"String",
"server",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
"withPara... | Activates HipChatService notifications.
<pre><code>GitLab Endpoint: PUT /projects/:id/services/hipchat</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param token for authentication
@param room HipChatService Room
@param server ... | [
"Activates",
"HipChatService",
"notifications",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ServicesApi.java#L129-L135 |
sdaschner/jaxrs-analyzer | src/main/java/com/sebastian_daschner/jaxrs_analyzer/analysis/results/ResultInterpreter.java | ResultInterpreter.addMediaTypes | private void addMediaTypes(final MethodResult methodResult, final ClassResult classResult, final ResourceMethod resourceMethod) {
"""
Adds the request and response media type information to the resource method.
@param methodResult The method result
@param classResult The class result
@param resourceMetho... | java | private void addMediaTypes(final MethodResult methodResult, final ClassResult classResult, final ResourceMethod resourceMethod) {
// accept media types -> inherit
resourceMethod.getRequestMediaTypes().addAll(methodResult.getRequestMediaTypes());
if (resourceMethod.getRequestMediaTypes().isEmpty(... | [
"private",
"void",
"addMediaTypes",
"(",
"final",
"MethodResult",
"methodResult",
",",
"final",
"ClassResult",
"classResult",
",",
"final",
"ResourceMethod",
"resourceMethod",
")",
"{",
"// accept media types -> inherit",
"resourceMethod",
".",
"getRequestMediaTypes",
"(",
... | Adds the request and response media type information to the resource method.
@param methodResult The method result
@param classResult The class result
@param resourceMethod The resource method | [
"Adds",
"the",
"request",
"and",
"response",
"media",
"type",
"information",
"to",
"the",
"resource",
"method",
"."
] | train | https://github.com/sdaschner/jaxrs-analyzer/blob/4ac62942202d05632977d6c14d3cd7e2d27e2b9b/src/main/java/com/sebastian_daschner/jaxrs_analyzer/analysis/results/ResultInterpreter.java#L240-L254 |
WiQuery/wiquery | wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/datepicker/InlineDatePicker.java | InlineDatePicker.setDate | public void setDate(AjaxRequestTarget ajaxRequestTarget, DateOption dateOption) {
"""
Method to set the date of the datepicker within the ajax request
@param ajaxRequestTarget
@param dateOption
Date to set
"""
ajaxRequestTarget.appendJavaScript(this.setDate(dateOption).render().toString());
} | java | public void setDate(AjaxRequestTarget ajaxRequestTarget, DateOption dateOption)
{
ajaxRequestTarget.appendJavaScript(this.setDate(dateOption).render().toString());
} | [
"public",
"void",
"setDate",
"(",
"AjaxRequestTarget",
"ajaxRequestTarget",
",",
"DateOption",
"dateOption",
")",
"{",
"ajaxRequestTarget",
".",
"appendJavaScript",
"(",
"this",
".",
"setDate",
"(",
"dateOption",
")",
".",
"render",
"(",
")",
".",
"toString",
"(... | Method to set the date of the datepicker within the ajax request
@param ajaxRequestTarget
@param dateOption
Date to set | [
"Method",
"to",
"set",
"the",
"date",
"of",
"the",
"datepicker",
"within",
"the",
"ajax",
"request"
] | train | https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/datepicker/InlineDatePicker.java#L1319-L1322 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/MessageUtils.java | MessageUtils.getMessage | public static FacesMessage getMessage(String bundleBaseName, Locale locale, String messageId, Object params[]) {
"""
Retrieve the message from a specific bundle. It does not look on application message bundle
or default message bundle. If it is required to look on those bundles use getMessageFromBundle instead
... | java | public static FacesMessage getMessage(String bundleBaseName, Locale locale, String messageId, Object params[])
{
if (bundleBaseName == null)
{
throw new NullPointerException(
"Unable to locate ResourceBundle: bundle is null");
}
ResourceBundle bundle = ResourceBundle... | [
"public",
"static",
"FacesMessage",
"getMessage",
"(",
"String",
"bundleBaseName",
",",
"Locale",
"locale",
",",
"String",
"messageId",
",",
"Object",
"params",
"[",
"]",
")",
"{",
"if",
"(",
"bundleBaseName",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPoi... | Retrieve the message from a specific bundle. It does not look on application message bundle
or default message bundle. If it is required to look on those bundles use getMessageFromBundle instead
@param bundleBaseName baseName of ResourceBundle to load localized messages
@param locale current locale
@param messageId id... | [
"Retrieve",
"the",
"message",
"from",
"a",
"specific",
"bundle",
".",
"It",
"does",
"not",
"look",
"on",
"application",
"message",
"bundle",
"or",
"default",
"message",
"bundle",
".",
"If",
"it",
"is",
"required",
"to",
"look",
"on",
"those",
"bundles",
"u... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/MessageUtils.java#L511-L522 |
acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/spout/AmBaseSpout.java | AmBaseSpout.emitWithNoKeyIdAndGrouping | protected void emitWithNoKeyIdAndGrouping(StreamMessage message, String groupingKey) {
"""
Not use this class's key history function, and not use MessageId(Id identify by storm).<br>
Send message to downstream component with grouping key.<br>
Use following situation.
<ol>
<li>Not use this class's key history f... | java | protected void emitWithNoKeyIdAndGrouping(StreamMessage message, String groupingKey)
{
this.getCollector().emit(new Values(groupingKey, message));
} | [
"protected",
"void",
"emitWithNoKeyIdAndGrouping",
"(",
"StreamMessage",
"message",
",",
"String",
"groupingKey",
")",
"{",
"this",
".",
"getCollector",
"(",
")",
".",
"emit",
"(",
"new",
"Values",
"(",
"groupingKey",
",",
"message",
")",
")",
";",
"}"
] | Not use this class's key history function, and not use MessageId(Id identify by storm).<br>
Send message to downstream component with grouping key.<br>
Use following situation.
<ol>
<li>Not use this class's key history function.</li>
<li>Not use storm's fault detect function.</li>
</ol>
@param message sending message
... | [
"Not",
"use",
"this",
"class",
"s",
"key",
"history",
"function",
"and",
"not",
"use",
"MessageId",
"(",
"Id",
"identify",
"by",
"storm",
")",
".",
"<br",
">",
"Send",
"message",
"to",
"downstream",
"component",
"with",
"grouping",
"key",
".",
"<br",
">"... | train | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/spout/AmBaseSpout.java#L372-L375 |
forge/furnace | proxy/src/main/java/org/jboss/forge/furnace/proxy/ProxyTypeInspector.java | ProxyTypeInspector.superclassHierarchyContains | public static boolean superclassHierarchyContains(Class<?> haystack, Class<?> needle) {
"""
Search the given {@link Class} hierarchy for the specified {@link Class}.
"""
Class<?> superclass = haystack;
while (superclass != null && superclass != needle)
{
superclass = superclass.getSu... | java | public static boolean superclassHierarchyContains(Class<?> haystack, Class<?> needle)
{
Class<?> superclass = haystack;
while (superclass != null && superclass != needle)
{
superclass = superclass.getSuperclass();
}
return superclass == needle;
} | [
"public",
"static",
"boolean",
"superclassHierarchyContains",
"(",
"Class",
"<",
"?",
">",
"haystack",
",",
"Class",
"<",
"?",
">",
"needle",
")",
"{",
"Class",
"<",
"?",
">",
"superclass",
"=",
"haystack",
";",
"while",
"(",
"superclass",
"!=",
"null",
... | Search the given {@link Class} hierarchy for the specified {@link Class}. | [
"Search",
"the",
"given",
"{"
] | train | https://github.com/forge/furnace/blob/bbe6deaa3c0d85ba43daa3e2f7d486f2dad21e0a/proxy/src/main/java/org/jboss/forge/furnace/proxy/ProxyTypeInspector.java#L66-L74 |
leancloud/java-sdk-all | android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/hwid/SignOutApi.java | SignOutApi.onConnect | @Override
public void onConnect(int rst, HuaweiApiClient client) {
"""
HuaweiApiClient 连接结果回调
@param rst 结果码
@param client HuaweiApiClient 实例
"""
if (client == null || !ApiClientMgr.INST.isConnect(client)) {
HMSAgentLog.e("client not connted");
onSignOutResult(rst... | java | @Override
public void onConnect(int rst, HuaweiApiClient client) {
if (client == null || !ApiClientMgr.INST.isConnect(client)) {
HMSAgentLog.e("client not connted");
onSignOutResult(rst, null);
return;
}
PendingResult<SignOutResult> signOutResult ... | [
"@",
"Override",
"public",
"void",
"onConnect",
"(",
"int",
"rst",
",",
"HuaweiApiClient",
"client",
")",
"{",
"if",
"(",
"client",
"==",
"null",
"||",
"!",
"ApiClientMgr",
".",
"INST",
".",
"isConnect",
"(",
"client",
")",
")",
"{",
"HMSAgentLog",
".",
... | HuaweiApiClient 连接结果回调
@param rst 结果码
@param client HuaweiApiClient 实例 | [
"HuaweiApiClient",
"连接结果回调"
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/hwid/SignOutApi.java#L47-L84 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/ServerCommsDiagnosticModule.java | ServerCommsDiagnosticModule.dumpMEtoMEConversation | private void dumpMEtoMEConversation(IncidentStream is, Conversation conv) {
"""
Dumps the particulars of a ME to ME client side conversation.
@param is the incident stream to log information to.
@param conv the conversation we want to dump.
"""
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEna... | java | private void dumpMEtoMEConversation(IncidentStream is, Conversation conv)
{
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "dumpMEtoMEConversation", new Object[]{is, conv});
//Get the conversation state and use it to find out what we can.
final Conversa... | [
"private",
"void",
"dumpMEtoMEConversation",
"(",
"IncidentStream",
"is",
",",
"Conversation",
"conv",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
... | Dumps the particulars of a ME to ME client side conversation.
@param is the incident stream to log information to.
@param conv the conversation we want to dump. | [
"Dumps",
"the",
"particulars",
"of",
"a",
"ME",
"to",
"ME",
"client",
"side",
"conversation",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/ServerCommsDiagnosticModule.java#L251-L271 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/debug/cli/ShellFactory.java | ShellFactory.createSubshell | public static Shell createSubshell(String pathElement, Shell parent, String appName, Object mainHandler) {
"""
Facade method facilitating the creation of subshell.
Subshell is created and run inside Command method and shares the same IO and naming strtategy.
Run the obtained Shell with commandLoop().
@param... | java | public static Shell createSubshell(String pathElement, Shell parent, String appName, Object mainHandler) {
return createSubshell(pathElement, parent, appName, mainHandler, new EmptyMultiMap<String, Object>());
} | [
"public",
"static",
"Shell",
"createSubshell",
"(",
"String",
"pathElement",
",",
"Shell",
"parent",
",",
"String",
"appName",
",",
"Object",
"mainHandler",
")",
"{",
"return",
"createSubshell",
"(",
"pathElement",
",",
"parent",
",",
"appName",
",",
"mainHandle... | Facade method facilitating the creation of subshell.
Subshell is created and run inside Command method and shares the same IO and naming strtategy.
Run the obtained Shell with commandLoop().
@param pathElement sub-prompt
@param parent Shell to be subshell'd
@param appName The app name string
@param mainHandler Comman... | [
"Facade",
"method",
"facilitating",
"the",
"creation",
"of",
"subshell",
".",
"Subshell",
"is",
"created",
"and",
"run",
"inside",
"Command",
"method",
"and",
"shares",
"the",
"same",
"IO",
"and",
"naming",
"strtategy",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/debug/cli/ShellFactory.java#L150-L152 |
wisdom-framework/wisdom | core/content-manager/src/main/java/org/wisdom/content/bodyparsers/BodyParserForm.java | BodyParserForm.invoke | @Override
public <T> T invoke(Context context, Class<T> classOfT) {
"""
Creates a object of class T from a form sent in the request.
@param context The context
@param classOfT The class we expect
@param <T> the class ot the object to build
@return the object, {@code null} if the object cannot be bu... | java | @Override
public <T> T invoke(Context context, Class<T> classOfT) {
return invoke(context, classOfT, null);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"invoke",
"(",
"Context",
"context",
",",
"Class",
"<",
"T",
">",
"classOfT",
")",
"{",
"return",
"invoke",
"(",
"context",
",",
"classOfT",
",",
"null",
")",
";",
"}"
] | Creates a object of class T from a form sent in the request.
@param context The context
@param classOfT The class we expect
@param <T> the class ot the object to build
@return the object, {@code null} if the object cannot be built. | [
"Creates",
"a",
"object",
"of",
"class",
"T",
"from",
"a",
"form",
"sent",
"in",
"the",
"request",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/content-manager/src/main/java/org/wisdom/content/bodyparsers/BodyParserForm.java#L157-L160 |
UrielCh/ovh-java-sdk | ovh-java-sdk-service/src/main/java/net/minidev/ovh/api/ApiOvhService.java | ApiOvhService.serviceId_renew_GET | public ArrayList<OvhRenewDescription> serviceId_renew_GET(String serviceId, Boolean includeOptions) throws IOException {
"""
List possible renews for this service
REST: GET /service/{serviceId}/renew
@param serviceId [required] Service Id
@param includeOptions [required] Include service's option(s)
API bet... | java | public ArrayList<OvhRenewDescription> serviceId_renew_GET(String serviceId, Boolean includeOptions) throws IOException {
String qPath = "/service/{serviceId}/renew";
StringBuilder sb = path(qPath, serviceId);
query(sb, "includeOptions", includeOptions);
String resp = exec(qPath, "GET", sb.toString(), null);
r... | [
"public",
"ArrayList",
"<",
"OvhRenewDescription",
">",
"serviceId_renew_GET",
"(",
"String",
"serviceId",
",",
"Boolean",
"includeOptions",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/service/{serviceId}/renew\"",
";",
"StringBuilder",
"sb",
"=",
"... | List possible renews for this service
REST: GET /service/{serviceId}/renew
@param serviceId [required] Service Id
@param includeOptions [required] Include service's option(s)
API beta | [
"List",
"possible",
"renews",
"for",
"this",
"service"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-service/src/main/java/net/minidev/ovh/api/ApiOvhService.java#L91-L97 |
premium-minds/pm-wicket-utils | src/main/java/com/premiumminds/webapp/wicket/drawer/DrawerManager.java | DrawerManager.replaceLast | public void replaceLast(AbstractDrawer newDrawer, AjaxRequestTarget target) {
"""
Replaces the topmost open drawer with a new one. If there is no open drawer, this method does nothing.
This method requires an AJAX request. DrawerManager does not support swapping drawers during page construction.
@param newDraw... | java | public void replaceLast(AbstractDrawer newDrawer, AjaxRequestTarget target) {
if (!drawers.isEmpty()) {
ListItem last = drawers.getFirst();
last.drawer.replaceWith(newDrawer);
last.drawer = newDrawer;
newDrawer.setManager(this);
target.add(newDrawer);
}
} | [
"public",
"void",
"replaceLast",
"(",
"AbstractDrawer",
"newDrawer",
",",
"AjaxRequestTarget",
"target",
")",
"{",
"if",
"(",
"!",
"drawers",
".",
"isEmpty",
"(",
")",
")",
"{",
"ListItem",
"last",
"=",
"drawers",
".",
"getFirst",
"(",
")",
";",
"last",
... | Replaces the topmost open drawer with a new one. If there is no open drawer, this method does nothing.
This method requires an AJAX request. DrawerManager does not support swapping drawers during page construction.
@param newDrawer
The new drawer to open. Cannot be null.
@param target
The current AJAX target. Cannot b... | [
"Replaces",
"the",
"topmost",
"open",
"drawer",
"with",
"a",
"new",
"one",
".",
"If",
"there",
"is",
"no",
"open",
"drawer",
"this",
"method",
"does",
"nothing",
".",
"This",
"method",
"requires",
"an",
"AJAX",
"request",
".",
"DrawerManager",
"does",
"not... | train | https://github.com/premium-minds/pm-wicket-utils/blob/ed28f4bfb2084dfb2649d9fa283754cb76894d2d/src/main/java/com/premiumminds/webapp/wicket/drawer/DrawerManager.java#L220-L228 |
virgo47/javasimon | core/src/main/java/org/javasimon/utils/SimonUtils.java | SimonUtils.calculateCounterAggregate | public static CounterAggregate calculateCounterAggregate(Simon simon, SimonFilter filter) {
"""
Aggregate statistics from all counters in hierarchy that pass specified filter. Filter is applied
to all simons in the hierarchy of all types. If a simon is rejected by filter its children are not considered.
Simons a... | java | public static CounterAggregate calculateCounterAggregate(Simon simon, SimonFilter filter) {
CounterAggregate aggregate = new CounterAggregate();
aggregateCounters(aggregate, simon,
filter != null ? filter : SimonFilter.ACCEPT_ALL_FILTER);
return aggregate;
} | [
"public",
"static",
"CounterAggregate",
"calculateCounterAggregate",
"(",
"Simon",
"simon",
",",
"SimonFilter",
"filter",
")",
"{",
"CounterAggregate",
"aggregate",
"=",
"new",
"CounterAggregate",
"(",
")",
";",
"aggregateCounters",
"(",
"aggregate",
",",
"simon",
"... | Aggregate statistics from all counters in hierarchy that pass specified filter. Filter is applied
to all simons in the hierarchy of all types. If a simon is rejected by filter its children are not considered.
Simons are aggregated in the top-bottom fashion, i.e. parent simons are aggregated before children.
@param sim... | [
"Aggregate",
"statistics",
"from",
"all",
"counters",
"in",
"hierarchy",
"that",
"pass",
"specified",
"filter",
".",
"Filter",
"is",
"applied",
"to",
"all",
"simons",
"in",
"the",
"hierarchy",
"of",
"all",
"types",
".",
"If",
"a",
"simon",
"is",
"rejected",
... | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/core/src/main/java/org/javasimon/utils/SimonUtils.java#L448-L454 |
Twitter4J/Twitter4J | twitter4j-core/src/internal-json/java/twitter4j/JSONImplFactory.java | JSONImplFactory.createUrlEntity | public static URLEntity createUrlEntity(int start, int end, String url, String expandedURL, String displayURL) {
"""
static factory method for twitter-text-java
@return url entity
@since Twitter4J 2.2.6
"""
return new URLEntityJSONImpl(start, end, url, expandedURL, displayURL);
} | java | public static URLEntity createUrlEntity(int start, int end, String url, String expandedURL, String displayURL) {
return new URLEntityJSONImpl(start, end, url, expandedURL, displayURL);
} | [
"public",
"static",
"URLEntity",
"createUrlEntity",
"(",
"int",
"start",
",",
"int",
"end",
",",
"String",
"url",
",",
"String",
"expandedURL",
",",
"String",
"displayURL",
")",
"{",
"return",
"new",
"URLEntityJSONImpl",
"(",
"start",
",",
"end",
",",
"url",... | static factory method for twitter-text-java
@return url entity
@since Twitter4J 2.2.6 | [
"static",
"factory",
"method",
"for",
"twitter",
"-",
"text",
"-",
"java"
] | train | https://github.com/Twitter4J/Twitter4J/blob/8376fade8d557896bb9319fb46e39a55b134b166/twitter4j-core/src/internal-json/java/twitter4j/JSONImplFactory.java#L295-L297 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/graph/SparkComputationGraph.java | SparkComputationGraph.scoreExamplesMultiDataSet | public JavaDoubleRDD scoreExamplesMultiDataSet(JavaRDD<MultiDataSet> data, boolean includeRegularizationTerms) {
"""
Score the examples individually, using the default batch size {@link #DEFAULT_EVAL_SCORE_BATCH_SIZE}. Unlike {@link #calculateScore(JavaRDD, boolean)},
this method returns a score for each example ... | java | public JavaDoubleRDD scoreExamplesMultiDataSet(JavaRDD<MultiDataSet> data, boolean includeRegularizationTerms) {
return scoreExamplesMultiDataSet(data, includeRegularizationTerms, DEFAULT_EVAL_SCORE_BATCH_SIZE);
} | [
"public",
"JavaDoubleRDD",
"scoreExamplesMultiDataSet",
"(",
"JavaRDD",
"<",
"MultiDataSet",
">",
"data",
",",
"boolean",
"includeRegularizationTerms",
")",
"{",
"return",
"scoreExamplesMultiDataSet",
"(",
"data",
",",
"includeRegularizationTerms",
",",
"DEFAULT_EVAL_SCORE_... | Score the examples individually, using the default batch size {@link #DEFAULT_EVAL_SCORE_BATCH_SIZE}. Unlike {@link #calculateScore(JavaRDD, boolean)},
this method returns a score for each example separately. If scoring is needed for specific examples use either
{@link #scoreExamples(JavaPairRDD, boolean)} or {@link #s... | [
"Score",
"the",
"examples",
"individually",
"using",
"the",
"default",
"batch",
"size",
"{",
"@link",
"#DEFAULT_EVAL_SCORE_BATCH_SIZE",
"}",
".",
"Unlike",
"{",
"@link",
"#calculateScore",
"(",
"JavaRDD",
"boolean",
")",
"}",
"this",
"method",
"returns",
"a",
"s... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/graph/SparkComputationGraph.java#L466-L468 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/play/PlayUIServer.java | PlayUIServer.autoAttachStatsStorageBySessionId | public void autoAttachStatsStorageBySessionId(Function<String, StatsStorage> statsStorageProvider) {
"""
Auto-attach StatsStorage if an unknown session ID is passed as URL path parameter in multi-session mode
@param statsStorageProvider function that returns a StatsStorage containing the given session ID
"""
... | java | public void autoAttachStatsStorageBySessionId(Function<String, StatsStorage> statsStorageProvider) {
if (statsStorageProvider != null) {
this.statsStorageLoader = new StatsStorageLoader(statsStorageProvider);
}
} | [
"public",
"void",
"autoAttachStatsStorageBySessionId",
"(",
"Function",
"<",
"String",
",",
"StatsStorage",
">",
"statsStorageProvider",
")",
"{",
"if",
"(",
"statsStorageProvider",
"!=",
"null",
")",
"{",
"this",
".",
"statsStorageLoader",
"=",
"new",
"StatsStorage... | Auto-attach StatsStorage if an unknown session ID is passed as URL path parameter in multi-session mode
@param statsStorageProvider function that returns a StatsStorage containing the given session ID | [
"Auto",
"-",
"attach",
"StatsStorage",
"if",
"an",
"unknown",
"session",
"ID",
"is",
"passed",
"as",
"URL",
"path",
"parameter",
"in",
"multi",
"-",
"session",
"mode"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/play/PlayUIServer.java#L135-L139 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java | PatternBox.controlsStateChangeThroughControllerSmallMolecule | public static Pattern controlsStateChangeThroughControllerSmallMolecule(Blacklist blacklist) {
"""
Pattern for an entity is producing a small molecule, and the small molecule controls state
change of another molecule.
@param blacklist a skip-list of ubiquitous molecules
@return the pattern
"""
Pattern p... | java | public static Pattern controlsStateChangeThroughControllerSmallMolecule(Blacklist blacklist)
{
Pattern p = new Pattern(SequenceEntityReference.class, "upper controller ER");
p.add(linkedER(true), "upper controller ER", "upper controller generic ER");
p.add(erToPE(), "upper controller generic ER", "upper controll... | [
"public",
"static",
"Pattern",
"controlsStateChangeThroughControllerSmallMolecule",
"(",
"Blacklist",
"blacklist",
")",
"{",
"Pattern",
"p",
"=",
"new",
"Pattern",
"(",
"SequenceEntityReference",
".",
"class",
",",
"\"upper controller ER\"",
")",
";",
"p",
".",
"add",... | Pattern for an entity is producing a small molecule, and the small molecule controls state
change of another molecule.
@param blacklist a skip-list of ubiquitous molecules
@return the pattern | [
"Pattern",
"for",
"an",
"entity",
"is",
"producing",
"a",
"small",
"molecule",
"and",
"the",
"small",
"molecule",
"controls",
"state",
"change",
"of",
"another",
"molecule",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L204-L235 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java | ExpressionUtils.eqConst | public static <D> Predicate eqConst(Expression<D> left, D constant) {
"""
Create a {@code left == constant} expression
@param <D> type of expressions
@param left lhs of expression
@param constant rhs of expression
@return left == constant
"""
return eq(left, ConstantImpl.create(constant));
} | java | public static <D> Predicate eqConst(Expression<D> left, D constant) {
return eq(left, ConstantImpl.create(constant));
} | [
"public",
"static",
"<",
"D",
">",
"Predicate",
"eqConst",
"(",
"Expression",
"<",
"D",
">",
"left",
",",
"D",
"constant",
")",
"{",
"return",
"eq",
"(",
"left",
",",
"ConstantImpl",
".",
"create",
"(",
"constant",
")",
")",
";",
"}"
] | Create a {@code left == constant} expression
@param <D> type of expressions
@param left lhs of expression
@param constant rhs of expression
@return left == constant | [
"Create",
"a",
"{",
"@code",
"left",
"==",
"constant",
"}",
"expression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java#L469-L471 |
vkostyukov/la4j | src/main/java/org/la4j/Vector.java | Vector.fromCSV | public static Vector fromCSV(String csv) {
"""
Parses {@link Vector} from the given CSV string.
@param csv the CSV string representing a vector
@return a parsed vector
"""
StringTokenizer tokenizer = new StringTokenizer(csv, ", ");
int estimatedLength = csv.length() / (5 + 2) + 1; // 5 sy... | java | public static Vector fromCSV(String csv) {
StringTokenizer tokenizer = new StringTokenizer(csv, ", ");
int estimatedLength = csv.length() / (5 + 2) + 1; // 5 symbols per element "0.000"
// 2 symbols for delimiter ", "
Vector result = Dens... | [
"public",
"static",
"Vector",
"fromCSV",
"(",
"String",
"csv",
")",
"{",
"StringTokenizer",
"tokenizer",
"=",
"new",
"StringTokenizer",
"(",
"csv",
",",
"\", \"",
")",
";",
"int",
"estimatedLength",
"=",
"csv",
".",
"length",
"(",
")",
"/",
"(",
"5",
"+"... | Parses {@link Vector} from the given CSV string.
@param csv the CSV string representing a vector
@return a parsed vector | [
"Parses",
"{",
"@link",
"Vector",
"}",
"from",
"the",
"given",
"CSV",
"string",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Vector.java#L120-L137 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/history/HistoryStore.java | HistoryStore.updateAndAdd | public synchronized void updateAndAdd(JmxRequest pJmxReq, JSONObject pJson) {
"""
Update the history store with the value of an an read, write or execute operation. Also, the timestamp
of the insertion is recorded. Also, the recorded history values are added to the given json value.
@param pJmxReq request for ... | java | public synchronized void updateAndAdd(JmxRequest pJmxReq, JSONObject pJson) {
long timestamp = System.currentTimeMillis() / 1000;
pJson.put(KEY_TIMESTAMP,timestamp);
RequestType type = pJmxReq.getType();
HistoryUpdater updater = historyUpdaters.get(type);
if (updater != null) {... | [
"public",
"synchronized",
"void",
"updateAndAdd",
"(",
"JmxRequest",
"pJmxReq",
",",
"JSONObject",
"pJson",
")",
"{",
"long",
"timestamp",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"/",
"1000",
";",
"pJson",
".",
"put",
"(",
"KEY_TIMESTAMP",
",",
"t... | Update the history store with the value of an an read, write or execute operation. Also, the timestamp
of the insertion is recorded. Also, the recorded history values are added to the given json value.
@param pJmxReq request for which an entry should be added in this history store
@param pJson the JSONObject to which ... | [
"Update",
"the",
"history",
"store",
"with",
"the",
"value",
"of",
"an",
"an",
"read",
"write",
"or",
"execute",
"operation",
".",
"Also",
"the",
"timestamp",
"of",
"the",
"insertion",
"is",
"recorded",
".",
"Also",
"the",
"recorded",
"history",
"values",
... | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/history/HistoryStore.java#L139-L148 |
JodaOrg/joda-money | src/main/java/org/joda/money/format/MoneyFormatterBuilder.java | MoneyFormatterBuilder.appendAmount | public MoneyFormatterBuilder appendAmount(MoneyAmountStyle style) {
"""
Appends the amount to the builder using the specified amount style.
<p>
The amount is the value itself, such as '12.34'.
<p>
The amount style allows the formatting of the number to be controlled in detail.
This includes the characters for... | java | public MoneyFormatterBuilder appendAmount(MoneyAmountStyle style) {
MoneyFormatter.checkNotNull(style, "MoneyAmountStyle must not be null");
AmountPrinterParser pp = new AmountPrinterParser(style);
return appendInternal(pp, pp);
} | [
"public",
"MoneyFormatterBuilder",
"appendAmount",
"(",
"MoneyAmountStyle",
"style",
")",
"{",
"MoneyFormatter",
".",
"checkNotNull",
"(",
"style",
",",
"\"MoneyAmountStyle must not be null\"",
")",
";",
"AmountPrinterParser",
"pp",
"=",
"new",
"AmountPrinterParser",
"(",... | Appends the amount to the builder using the specified amount style.
<p>
The amount is the value itself, such as '12.34'.
<p>
The amount style allows the formatting of the number to be controlled in detail.
This includes the characters for positive, negative, decimal, grouping and whether
to output the absolute or signe... | [
"Appends",
"the",
"amount",
"to",
"the",
"builder",
"using",
"the",
"specified",
"amount",
"style",
".",
"<p",
">",
"The",
"amount",
"is",
"the",
"value",
"itself",
"such",
"as",
"12",
".",
"34",
".",
"<p",
">",
"The",
"amount",
"style",
"allows",
"the... | train | https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/format/MoneyFormatterBuilder.java#L92-L96 |
zeroturnaround/zt-exec | src/main/java/org/zeroturnaround/exec/stream/PumpStreamHandler.java | PumpStreamHandler.createPump | protected Thread createPump(InputStream is, OutputStream os) {
"""
Creates a stream pumper to copy the given input stream to the given
output stream.
@param is the input stream to copy from
@param os the output stream to copy into
@return the stream pumper thread
"""
return createPump(is, os, false, ... | java | protected Thread createPump(InputStream is, OutputStream os) {
return createPump(is, os, false, false);
} | [
"protected",
"Thread",
"createPump",
"(",
"InputStream",
"is",
",",
"OutputStream",
"os",
")",
"{",
"return",
"createPump",
"(",
"is",
",",
"os",
",",
"false",
",",
"false",
")",
";",
"}"
] | Creates a stream pumper to copy the given input stream to the given
output stream.
@param is the input stream to copy from
@param os the output stream to copy into
@return the stream pumper thread | [
"Creates",
"a",
"stream",
"pumper",
"to",
"copy",
"the",
"given",
"input",
"stream",
"to",
"the",
"given",
"output",
"stream",
"."
] | train | https://github.com/zeroturnaround/zt-exec/blob/6c3b93b99bf3c69c9f41d6350bf7707005b6a4cd/src/main/java/org/zeroturnaround/exec/stream/PumpStreamHandler.java#L311-L313 |
daimajia/AndroidImageSlider | library/src/main/java/com/daimajia/slider/library/SliderLayout.java | SliderLayout.startAutoCycle | public void startAutoCycle(long delay,long duration,boolean autoRecover) {
"""
start auto cycle.
@param delay delay time
@param duration animation duration time.
@param autoRecover if recover after user touches the slider.
"""
if(mCycleTimer != null) mCycleTimer.cancel();
if(mCycleTask != nu... | java | public void startAutoCycle(long delay,long duration,boolean autoRecover){
if(mCycleTimer != null) mCycleTimer.cancel();
if(mCycleTask != null) mCycleTask.cancel();
if(mResumingTask != null) mResumingTask.cancel();
if(mResumingTimer != null) mResumingTimer.cancel();
mSliderDuratio... | [
"public",
"void",
"startAutoCycle",
"(",
"long",
"delay",
",",
"long",
"duration",
",",
"boolean",
"autoRecover",
")",
"{",
"if",
"(",
"mCycleTimer",
"!=",
"null",
")",
"mCycleTimer",
".",
"cancel",
"(",
")",
";",
"if",
"(",
"mCycleTask",
"!=",
"null",
"... | start auto cycle.
@param delay delay time
@param duration animation duration time.
@param autoRecover if recover after user touches the slider. | [
"start",
"auto",
"cycle",
"."
] | train | https://github.com/daimajia/AndroidImageSlider/blob/e318cabdef668de985efdcc45ca304e2ac6f58b5/library/src/main/java/com/daimajia/slider/library/SliderLayout.java#L258-L275 |
ironjacamar/ironjacamar | sjc/src/main/java/org/ironjacamar/sjc/Main.java | Main.configurationBoolean | private static boolean configurationBoolean(Properties properties, String key, boolean defaultValue) {
"""
Get configuration boolean
@param properties The properties
@param key The key
@param defaultValue The default value
@return The value
"""
if (properties != null)
{
if (properties.... | java | private static boolean configurationBoolean(Properties properties, String key, boolean defaultValue)
{
if (properties != null)
{
if (properties.containsKey(key))
return Boolean.valueOf(properties.getProperty(key));
}
return defaultValue;
} | [
"private",
"static",
"boolean",
"configurationBoolean",
"(",
"Properties",
"properties",
",",
"String",
"key",
",",
"boolean",
"defaultValue",
")",
"{",
"if",
"(",
"properties",
"!=",
"null",
")",
"{",
"if",
"(",
"properties",
".",
"containsKey",
"(",
"key",
... | Get configuration boolean
@param properties The properties
@param key The key
@param defaultValue The default value
@return The value | [
"Get",
"configuration",
"boolean"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/sjc/src/main/java/org/ironjacamar/sjc/Main.java#L445-L454 |
UrielCh/ovh-java-sdk | ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java | ApiOvhPrice.dedicated_server_firewall_firewallModel_GET | public OvhPrice dedicated_server_firewall_firewallModel_GET(net.minidev.ovh.api.price.dedicated.server.OvhFirewallEnum firewallModel) throws IOException {
"""
Get price of available firewall models
REST: GET /price/dedicated/server/firewall/{firewallModel}
@param firewallModel [required] Model of firewall
... | java | public OvhPrice dedicated_server_firewall_firewallModel_GET(net.minidev.ovh.api.price.dedicated.server.OvhFirewallEnum firewallModel) throws IOException {
String qPath = "/price/dedicated/server/firewall/{firewallModel}";
StringBuilder sb = path(qPath, firewallModel);
String resp = exec(qPath, "GET", sb.toString(... | [
"public",
"OvhPrice",
"dedicated_server_firewall_firewallModel_GET",
"(",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"price",
".",
"dedicated",
".",
"server",
".",
"OvhFirewallEnum",
"firewallModel",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"... | Get price of available firewall models
REST: GET /price/dedicated/server/firewall/{firewallModel}
@param firewallModel [required] Model of firewall | [
"Get",
"price",
"of",
"available",
"firewall",
"models"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java#L115-L120 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java | CmsDefaultXmlContentHandler.initDefaultValues | protected void initDefaultValues(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException {
"""
Initializes the default values for this content handler.<p>
Using the default values from the appinfo node, it's possible to have more
sophisticated logic for generating the defaults then just... | java | protected void initDefaultValues(Element root, CmsXmlContentDefinition contentDefinition) throws CmsXmlException {
Iterator<Element> i = CmsXmlGenericWrapper.elementIterator(root, APPINFO_DEFAULT);
while (i.hasNext()) {
// iterate all "default" elements in the "defaults" node
El... | [
"protected",
"void",
"initDefaultValues",
"(",
"Element",
"root",
",",
"CmsXmlContentDefinition",
"contentDefinition",
")",
"throws",
"CmsXmlException",
"{",
"Iterator",
"<",
"Element",
">",
"i",
"=",
"CmsXmlGenericWrapper",
".",
"elementIterator",
"(",
"root",
",",
... | Initializes the default values for this content handler.<p>
Using the default values from the appinfo node, it's possible to have more
sophisticated logic for generating the defaults then just using the XML schema "default"
attribute.<p>
@param root the "defaults" element from the appinfo node of the XML content defi... | [
"Initializes",
"the",
"default",
"values",
"for",
"this",
"content",
"handler",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java#L2416-L2430 |
google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/libcore/reflect/Types.java | Types.appendTypeName | @ObjectiveCName("appendTypeName:class:")
public static void appendTypeName(StringBuilder out, Class<?> c) {
"""
Appends the best {@link #toString} name for {@code c} to {@code out}.
This works around the fact that {@link Class#getName} is lousy for
primitive arrays (it writes "[C" instead of "char[]") and {@... | java | @ObjectiveCName("appendTypeName:class:")
public static void appendTypeName(StringBuilder out, Class<?> c) {
int dimensions = 0;
while (c.isArray()) {
c = c.getComponentType();
dimensions++;
}
out.append(c.getName());
for (int d = 0; d < dimensions; d++... | [
"@",
"ObjectiveCName",
"(",
"\"appendTypeName:class:\"",
")",
"public",
"static",
"void",
"appendTypeName",
"(",
"StringBuilder",
"out",
",",
"Class",
"<",
"?",
">",
"c",
")",
"{",
"int",
"dimensions",
"=",
"0",
";",
"while",
"(",
"c",
".",
"isArray",
"(",... | Appends the best {@link #toString} name for {@code c} to {@code out}.
This works around the fact that {@link Class#getName} is lousy for
primitive arrays (it writes "[C" instead of "char[]") and {@link
Class#getCanonicalName()} is lousy for nested classes (it uses a "."
separator rather than a "$" separator). | [
"Appends",
"the",
"best",
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/libcore/reflect/Types.java#L104-L115 |
alkacon/opencms-core | src/org/opencms/gwt/shared/CmsUserSettingsBean.java | CmsUserSettingsBean.addSetting | public void addSetting(String value, CmsXmlContentProperty config, boolean basic) {
"""
Adds a user setting.<p>
@param value the current value of the user setting
@param config the configuration for the user setting
@param basic true if this is a basic user setting
"""
m_values.put(config.getNa... | java | public void addSetting(String value, CmsXmlContentProperty config, boolean basic) {
m_values.put(config.getName(), value);
m_settingConfiguration.put(config.getName(), config);
if (basic) {
m_basicOptions.add(config.getName());
}
} | [
"public",
"void",
"addSetting",
"(",
"String",
"value",
",",
"CmsXmlContentProperty",
"config",
",",
"boolean",
"basic",
")",
"{",
"m_values",
".",
"put",
"(",
"config",
".",
"getName",
"(",
")",
",",
"value",
")",
";",
"m_settingConfiguration",
".",
"put",
... | Adds a user setting.<p>
@param value the current value of the user setting
@param config the configuration for the user setting
@param basic true if this is a basic user setting | [
"Adds",
"a",
"user",
"setting",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/shared/CmsUserSettingsBean.java#L72-L79 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.getIterationAsync | public Observable<Iteration> getIterationAsync(UUID projectId, UUID iterationId) {
"""
Get a specific iteration.
@param projectId The id of the project the iteration belongs to
@param iterationId The id of the iteration to get
@throws IllegalArgumentException thrown if parameters fail the validation
@return ... | java | public Observable<Iteration> getIterationAsync(UUID projectId, UUID iterationId) {
return getIterationWithServiceResponseAsync(projectId, iterationId).map(new Func1<ServiceResponse<Iteration>, Iteration>() {
@Override
public Iteration call(ServiceResponse<Iteration> response) {
... | [
"public",
"Observable",
"<",
"Iteration",
">",
"getIterationAsync",
"(",
"UUID",
"projectId",
",",
"UUID",
"iterationId",
")",
"{",
"return",
"getIterationWithServiceResponseAsync",
"(",
"projectId",
",",
"iterationId",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
... | Get a specific iteration.
@param projectId The id of the project the iteration belongs to
@param iterationId The id of the iteration to get
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Iteration object | [
"Get",
"a",
"specific",
"iteration",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L1989-L1996 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java | SimpleDocTreeVisitor.visitDocRoot | @Override
public R visitDocRoot(DocRootTree node, P p) {
"""
{@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction}
"""
return defaultAction(node, p);
} | java | @Override
public R visitDocRoot(DocRootTree node, P p) {
return defaultAction(node, p);
} | [
"@",
"Override",
"public",
"R",
"visitDocRoot",
"(",
"DocRootTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"defaultAction",
"(",
"node",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction} | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"calls",
"{",
"@code",
"defaultAction",
"}",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java#L165-L168 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.