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 |
|---|---|---|---|---|---|---|---|---|---|---|
google/error-prone | check_api/src/main/java/com/google/errorprone/matchers/Matchers.java | Matchers.ignoreParens | public static Matcher<ExpressionTree> ignoreParens(final Matcher<ExpressionTree> innerMatcher) {
"""
Ignores any number of parenthesis wrapping an expression and then applies the passed matcher to
that expression. For example, the passed matcher would be applied to {@code value} in {@code
(((value)))}.
"""
... | java | public static Matcher<ExpressionTree> ignoreParens(final Matcher<ExpressionTree> innerMatcher) {
return new Matcher<ExpressionTree>() {
@Override
public boolean matches(ExpressionTree expressionTree, VisitorState state) {
return innerMatcher.matches((ExpressionTree) stripParentheses(expressionTr... | [
"public",
"static",
"Matcher",
"<",
"ExpressionTree",
">",
"ignoreParens",
"(",
"final",
"Matcher",
"<",
"ExpressionTree",
">",
"innerMatcher",
")",
"{",
"return",
"new",
"Matcher",
"<",
"ExpressionTree",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean... | Ignores any number of parenthesis wrapping an expression and then applies the passed matcher to
that expression. For example, the passed matcher would be applied to {@code value} in {@code
(((value)))}. | [
"Ignores",
"any",
"number",
"of",
"parenthesis",
"wrapping",
"an",
"expression",
"and",
"then",
"applies",
"the",
"passed",
"matcher",
"to",
"that",
"expression",
".",
"For",
"example",
"the",
"passed",
"matcher",
"would",
"be",
"applied",
"to",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L675-L682 |
ltsopensource/light-task-scheduler | lts-core/src/main/java/com/github/ltsopensource/core/commons/utils/WebUtils.java | WebUtils.doPost | public static String doPost(String url, String ctype, byte[] content, int connectTimeout, int readTimeout) throws IOException {
"""
执行HTTP POST请求。
@param url 请求地址
@param ctype 请求类型
@param content 请求字节数组
@return 响应字符串
"""
return _doPost(url, ctype, content, connectTimeout, readTimeout, null)... | java | public static String doPost(String url, String ctype, byte[] content, int connectTimeout, int readTimeout) throws IOException {
return _doPost(url, ctype, content, connectTimeout, readTimeout, null);
} | [
"public",
"static",
"String",
"doPost",
"(",
"String",
"url",
",",
"String",
"ctype",
",",
"byte",
"[",
"]",
"content",
",",
"int",
"connectTimeout",
",",
"int",
"readTimeout",
")",
"throws",
"IOException",
"{",
"return",
"_doPost",
"(",
"url",
",",
"ctype... | 执行HTTP POST请求。
@param url 请求地址
@param ctype 请求类型
@param content 请求字节数组
@return 响应字符串 | [
"执行HTTP",
"POST请求。"
] | train | https://github.com/ltsopensource/light-task-scheduler/blob/64d3aa000ff5022be5e94f511b58f405e5f4c8eb/lts-core/src/main/java/com/github/ltsopensource/core/commons/utils/WebUtils.java#L85-L87 |
resilience4j/resilience4j | resilience4j-ratelimiter/src/main/java/io/github/resilience4j/ratelimiter/internal/AtomicRateLimiter.java | AtomicRateLimiter.compareAndSet | private boolean compareAndSet(final State current, final State next) {
"""
Atomically sets the value to the given updated value
if the current value {@code ==} the expected value.
It differs from {@link AtomicReference#updateAndGet(UnaryOperator)} by constant back off.
It means that after one try to {@link Atom... | java | private boolean compareAndSet(final State current, final State next) {
if (state.compareAndSet(current, next)) {
return true;
}
parkNanos(1); // back-off
return false;
} | [
"private",
"boolean",
"compareAndSet",
"(",
"final",
"State",
"current",
",",
"final",
"State",
"next",
")",
"{",
"if",
"(",
"state",
".",
"compareAndSet",
"(",
"current",
",",
"next",
")",
")",
"{",
"return",
"true",
";",
"}",
"parkNanos",
"(",
"1",
"... | Atomically sets the value to the given updated value
if the current value {@code ==} the expected value.
It differs from {@link AtomicReference#updateAndGet(UnaryOperator)} by constant back off.
It means that after one try to {@link AtomicReference#compareAndSet(Object, Object)}
this method will wait for a while before... | [
"Atomically",
"sets",
"the",
"value",
"to",
"the",
"given",
"updated",
"value",
"if",
"the",
"current",
"value",
"{",
"@code",
"==",
"}",
"the",
"expected",
"value",
".",
"It",
"differs",
"from",
"{",
"@link",
"AtomicReference#updateAndGet",
"(",
"UnaryOperato... | train | https://github.com/resilience4j/resilience4j/blob/fa843d30f531c00f0c3dc218b65a7f2bb51af336/resilience4j-ratelimiter/src/main/java/io/github/resilience4j/ratelimiter/internal/AtomicRateLimiter.java#L172-L178 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/SSOAuthenticator.java | SSOAuthenticator.createAuthenticationData | private AuthenticationData createAuthenticationData(HttpServletRequest req, HttpServletResponse res, String token, String oid) {
"""
Create an authentication data for ltpaToken
@param ssoToken
@return authenticationData
"""
AuthenticationData authenticationData = new WSAuthenticationData();
... | java | private AuthenticationData createAuthenticationData(HttpServletRequest req, HttpServletResponse res, String token, String oid) {
AuthenticationData authenticationData = new WSAuthenticationData();
authenticationData.set(AuthenticationData.HTTP_SERVLET_REQUEST, req);
authenticationData.set(Authen... | [
"private",
"AuthenticationData",
"createAuthenticationData",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
",",
"String",
"token",
",",
"String",
"oid",
")",
"{",
"AuthenticationData",
"authenticationData",
"=",
"new",
"WSAuthenticationData",
"(",
... | Create an authentication data for ltpaToken
@param ssoToken
@return authenticationData | [
"Create",
"an",
"authentication",
"data",
"for",
"ltpaToken"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/SSOAuthenticator.java#L222-L234 |
structurizr/java | structurizr-core/src/com/structurizr/view/ViewSet.java | ViewSet.createDeploymentView | public DeploymentView createDeploymentView(String key, String description) {
"""
Creates a deployment view.
@param key the key for the deployment view (must be unique)
@param description a description of the view
@return a DeploymentView object
@throws IllegalArgumentEx... | java | public DeploymentView createDeploymentView(String key, String description) {
assertThatTheViewKeyIsSpecifiedAndUnique(key);
DeploymentView view = new DeploymentView(model, key, description);
view.setViewSet(this);
deploymentViews.add(view);
return view;
} | [
"public",
"DeploymentView",
"createDeploymentView",
"(",
"String",
"key",
",",
"String",
"description",
")",
"{",
"assertThatTheViewKeyIsSpecifiedAndUnique",
"(",
"key",
")",
";",
"DeploymentView",
"view",
"=",
"new",
"DeploymentView",
"(",
"model",
",",
"key",
",",... | Creates a deployment view.
@param key the key for the deployment view (must be unique)
@param description a description of the view
@return a DeploymentView object
@throws IllegalArgumentException if the key is not unique | [
"Creates",
"a",
"deployment",
"view",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/view/ViewSet.java#L197-L204 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.validateMoney | public static <T extends CharSequence> T validateMoney(T value, String errorMsg) throws ValidateException {
"""
验证是否为货币
@param <T> 字符串类型
@param value 值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常
"""
if (false == isMoney(value)) {
throw new ValidateException(errorMsg);
... | java | public static <T extends CharSequence> T validateMoney(T value, String errorMsg) throws ValidateException {
if (false == isMoney(value)) {
throw new ValidateException(errorMsg);
}
return value;
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"validateMoney",
"(",
"T",
"value",
",",
"String",
"errorMsg",
")",
"throws",
"ValidateException",
"{",
"if",
"(",
"false",
"==",
"isMoney",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"... | 验证是否为货币
@param <T> 字符串类型
@param value 值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常 | [
"验证是否为货币"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L598-L604 |
playn/playn | core/src/playn/core/Keyboard.java | Keyboard.isKey | public static Function<Event, KeyEvent> isKey (final Key key) {
"""
Returns a collector function for key events for {@code key}. Use it to obtain only events for
a particular key like so:
<pre>{@code
Input.keyboardEvents.collect(Keyboard.isKey(Key.X)).connect(event -> {
// handle the 'x' key being pressed or... | java | public static Function<Event, KeyEvent> isKey (final Key key) {
return new Function<Event, KeyEvent>() {
public KeyEvent apply (Event event) {
return isKey(key, event);
}
};
} | [
"public",
"static",
"Function",
"<",
"Event",
",",
"KeyEvent",
">",
"isKey",
"(",
"final",
"Key",
"key",
")",
"{",
"return",
"new",
"Function",
"<",
"Event",
",",
"KeyEvent",
">",
"(",
")",
"{",
"public",
"KeyEvent",
"apply",
"(",
"Event",
"event",
")"... | Returns a collector function for key events for {@code key}. Use it to obtain only events for
a particular key like so:
<pre>{@code
Input.keyboardEvents.collect(Keyboard.isKey(Key.X)).connect(event -> {
// handle the 'x' key being pressed or released
});
}</pre> | [
"Returns",
"a",
"collector",
"function",
"for",
"key",
"events",
"for",
"{",
"@code",
"key",
"}",
".",
"Use",
"it",
"to",
"obtain",
"only",
"events",
"for",
"a",
"particular",
"key",
"like",
"so",
":"
] | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/core/src/playn/core/Keyboard.java#L159-L165 |
motown-io/motown | domain/command-authorization/src/main/java/io/motown/domain/commandauthorization/repositories/CommandAuthorizationRepository.java | CommandAuthorizationRepository.createOrUpdate | public CommandAuthorization createOrUpdate(String chargingStationId, String userIdentity, Class commandClass) {
"""
Creates or updates a {@code CommandAuthorization} based on charging station id, user identity and command class.
@param chargingStationId charging station identifier.
@param userIdentity ... | java | public CommandAuthorization createOrUpdate(String chargingStationId, String userIdentity, Class commandClass) {
EntityManager em = getEntityManager();
EntityTransaction tx = null;
try {
tx = em.getTransaction();
tx.begin();
CommandAuthorization storedCommand... | [
"public",
"CommandAuthorization",
"createOrUpdate",
"(",
"String",
"chargingStationId",
",",
"String",
"userIdentity",
",",
"Class",
"commandClass",
")",
"{",
"EntityManager",
"em",
"=",
"getEntityManager",
"(",
")",
";",
"EntityTransaction",
"tx",
"=",
"null",
";",... | Creates or updates a {@code CommandAuthorization} based on charging station id, user identity and command class.
@param chargingStationId charging station identifier.
@param userIdentity user identity (user name).
@param commandClass command class.
@return (updated) command authorization. | [
"Creates",
"or",
"updates",
"a",
"{",
"@code",
"CommandAuthorization",
"}",
"based",
"on",
"charging",
"station",
"id",
"user",
"identity",
"and",
"command",
"class",
"."
] | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/domain/command-authorization/src/main/java/io/motown/domain/commandauthorization/repositories/CommandAuthorizationRepository.java#L59-L80 |
OpenHFT/Chronicle-Map | src/main/java/net/openhft/chronicle/hash/impl/util/math/Precision.java | Precision.isEquals | public static boolean isEquals(double x, double y, double eps) {
"""
Returns {@code true} if there is no double value strictly between the
arguments or the difference between them is within the range of allowed
error (inclusive).
@param x First value.
@param y Second value.
@param eps Amount of allowed ... | java | public static boolean isEquals(double x, double y, double eps) {
return isEquals(x, y, 1) || Math.abs(y - x) <= eps;
} | [
"public",
"static",
"boolean",
"isEquals",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"eps",
")",
"{",
"return",
"isEquals",
"(",
"x",
",",
"y",
",",
"1",
")",
"||",
"Math",
".",
"abs",
"(",
"y",
"-",
"x",
")",
"<=",
"eps",
";",
"}"... | Returns {@code true} if there is no double value strictly between the
arguments or the difference between them is within the range of allowed
error (inclusive).
@param x First value.
@param y Second value.
@param eps Amount of allowed absolute error.
@return {@code true} if the values are two adjacent floating poi... | [
"Returns",
"{",
"@code",
"true",
"}",
"if",
"there",
"is",
"no",
"double",
"value",
"strictly",
"between",
"the",
"arguments",
"or",
"the",
"difference",
"between",
"them",
"is",
"within",
"the",
"range",
"of",
"allowed",
"error",
"(",
"inclusive",
")",
".... | train | https://github.com/OpenHFT/Chronicle-Map/blob/0b09733cc96302f96be4394a261699eeb021fe37/src/main/java/net/openhft/chronicle/hash/impl/util/math/Precision.java#L47-L49 |
lucee/Lucee | core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java | AbstrCFMLScriptTransformer.ifStatement | private final Statement ifStatement(Data data) throws TemplateException {
"""
Liest ein if Statement ein. <br />
EBNF:<br />
<code>spaces condition spaces ")" spaces block {"else if" spaces "(" elseifStatement spaces }
[("else" spaces "(" | "else ") elseStatement spaces];</code>
@return if Statement
@throw... | java | private final Statement ifStatement(Data data) throws TemplateException {
if (!data.srcCode.forwardIfCurrent("if", '(')) return null;
Position line = data.srcCode.getPosition();
Body body = new BodyBase(data.factory);
Condition cont = new Condition(data.factory, condition(data), body, line, null);
if (!data.src... | [
"private",
"final",
"Statement",
"ifStatement",
"(",
"Data",
"data",
")",
"throws",
"TemplateException",
"{",
"if",
"(",
"!",
"data",
".",
"srcCode",
".",
"forwardIfCurrent",
"(",
"\"if\"",
",",
"'",
"'",
")",
")",
"return",
"null",
";",
"Position",
"line"... | Liest ein if Statement ein. <br />
EBNF:<br />
<code>spaces condition spaces ")" spaces block {"else if" spaces "(" elseifStatement spaces }
[("else" spaces "(" | "else ") elseStatement spaces];</code>
@return if Statement
@throws TemplateException | [
"Liest",
"ein",
"if",
"Statement",
"ein",
".",
"<br",
"/",
">",
"EBNF",
":",
"<br",
"/",
">",
"<code",
">",
"spaces",
"condition",
"spaces",
")",
"spaces",
"block",
"{",
"else",
"if",
"spaces",
"(",
"elseifStatement",
"spaces",
"}",
"[",
"(",
"else",
... | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java#L256-L281 |
fcrepo4-exts/fcrepo-camel-toolbox | fcrepo-ldpath/src/main/java/org/fcrepo/camel/ldpath/ClientFactory.java | ClientFactory.createClient | public static ClientConfiguration createClient(final DataProvider provider) {
"""
Configure a linked data client suitable for use with a Fedora Repository.
@param provider Provider to enable on the client
@return a configuration for use with an LDClient
"""
return createClient(null, null, emptyList()... | java | public static ClientConfiguration createClient(final DataProvider provider) {
return createClient(null, null, emptyList(), singletonList(provider));
} | [
"public",
"static",
"ClientConfiguration",
"createClient",
"(",
"final",
"DataProvider",
"provider",
")",
"{",
"return",
"createClient",
"(",
"null",
",",
"null",
",",
"emptyList",
"(",
")",
",",
"singletonList",
"(",
"provider",
")",
")",
";",
"}"
] | Configure a linked data client suitable for use with a Fedora Repository.
@param provider Provider to enable on the client
@return a configuration for use with an LDClient | [
"Configure",
"a",
"linked",
"data",
"client",
"suitable",
"for",
"use",
"with",
"a",
"Fedora",
"Repository",
"."
] | train | https://github.com/fcrepo4-exts/fcrepo-camel-toolbox/blob/9e0cf220937b2d5c050e0e071f0cdc4c7a084c0f/fcrepo-ldpath/src/main/java/org/fcrepo/camel/ldpath/ClientFactory.java#L61-L63 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java | DocTreeScanner.visitSerial | @Override
public R visitSerial(SerialTree node, P p) {
"""
{@inheritDoc} This implementation scans the children in left to right order.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of scanning
"""
return scan(node.getDescription(), p);
} | java | @Override
public R visitSerial(SerialTree node, P p) {
return scan(node.getDescription(), p);
} | [
"@",
"Override",
"public",
"R",
"visitSerial",
"(",
"SerialTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"scan",
"(",
"node",
".",
"getDescription",
"(",
")",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation scans the children in left to right order.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of scanning | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"scans",
"the",
"children",
"in",
"left",
"to",
"right",
"order",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java#L384-L387 |
TheHortonMachine/hortonmachine | dbs/src/main/java/jsqlite/Database.java | Database.create_aggregate | public void create_aggregate( String name, int nargs, Function f ) {
"""
Create aggregate function.
@param name the name of the new function
@param nargs number of arguments to function
@param f interface of function
"""
synchronized (this) {
_create_aggregate(name, nargs, f);
... | java | public void create_aggregate( String name, int nargs, Function f ) {
synchronized (this) {
_create_aggregate(name, nargs, f);
}
} | [
"public",
"void",
"create_aggregate",
"(",
"String",
"name",
",",
"int",
"nargs",
",",
"Function",
"f",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"_create_aggregate",
"(",
"name",
",",
"nargs",
",",
"f",
")",
";",
"}",
"}"
] | Create aggregate function.
@param name the name of the new function
@param nargs number of arguments to function
@param f interface of function | [
"Create",
"aggregate",
"function",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/jsqlite/Database.java#L469-L473 |
forge/core | ui/impl/src/main/java/org/jboss/forge/addon/ui/impl/input/InputComponentFactoryImpl.java | InputComponentFactoryImpl.preconfigureInput | public void preconfigureInput(InputComponent<?, ?> input, WithAttributes atts) {
"""
Pre-configure input based on WithAttributes info if annotation exists
"""
if (atts != null)
{
input.setEnabled(atts.enabled());
input.setLabel(atts.label());
input.setRequired(atts.requir... | java | public void preconfigureInput(InputComponent<?, ?> input, WithAttributes atts)
{
if (atts != null)
{
input.setEnabled(atts.enabled());
input.setLabel(atts.label());
input.setRequired(atts.required());
input.setRequiredMessage(atts.requiredMessage());
input.set... | [
"public",
"void",
"preconfigureInput",
"(",
"InputComponent",
"<",
"?",
",",
"?",
">",
"input",
",",
"WithAttributes",
"atts",
")",
"{",
"if",
"(",
"atts",
"!=",
"null",
")",
"{",
"input",
".",
"setEnabled",
"(",
"atts",
".",
"enabled",
"(",
")",
")",
... | Pre-configure input based on WithAttributes info if annotation exists | [
"Pre",
"-",
"configure",
"input",
"based",
"on",
"WithAttributes",
"info",
"if",
"annotation",
"exists"
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/ui/impl/src/main/java/org/jboss/forge/addon/ui/impl/input/InputComponentFactoryImpl.java#L118-L148 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/DatabaseSpec.java | DatabaseSpec.insertOnMongoTable | @Given("^I insert into MongoDB database '(.+?)' and collection '(.+?)' the document from schema '(.+?)'$")
public void insertOnMongoTable(String dataBase, String collection, String document) throws Exception {
"""
Insert document in a MongoDB table.
@param dataBase Mongo database
@param collection Mongo ... | java | @Given("^I insert into MongoDB database '(.+?)' and collection '(.+?)' the document from schema '(.+?)'$")
public void insertOnMongoTable(String dataBase, String collection, String document) throws Exception {
String retrievedDoc = commonspec.retrieveData(document, "json");
commonspec.getMongoDBClie... | [
"@",
"Given",
"(",
"\"^I insert into MongoDB database '(.+?)' and collection '(.+?)' the document from schema '(.+?)'$\"",
")",
"public",
"void",
"insertOnMongoTable",
"(",
"String",
"dataBase",
",",
"String",
"collection",
",",
"String",
"document",
")",
"throws",
"Exception",... | Insert document in a MongoDB table.
@param dataBase Mongo database
@param collection Mongo collection
@param document document used for schema | [
"Insert",
"document",
"in",
"a",
"MongoDB",
"table",
"."
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/DatabaseSpec.java#L338-L343 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java | CommerceOrderPersistenceImpl.findByGroupId | @Override
public List<CommerceOrder> findByGroupId(long groupId) {
"""
Returns all the commerce orders where groupId = ?.
@param groupId the group ID
@return the matching commerce orders
"""
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceOrder> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceOrder",
">",
"findByGroupId",
"(",
"long",
"groupId",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce orders where groupId = ?.
@param groupId the group ID
@return the matching commerce orders | [
"Returns",
"all",
"the",
"commerce",
"orders",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderPersistenceImpl.java#L1510-L1513 |
spotify/async-google-pubsub-client | src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java | Pubsub.getSubscription | public PubsubFuture<Subscription> getSubscription(final String canonicalSubscriptionName) {
"""
Get a Pub/Sub subscription.
@param canonicalSubscriptionName The canonical (including project) name of the subscription to get.
@return A future that is completed when this request is completed. The future will be c... | java | public PubsubFuture<Subscription> getSubscription(final String canonicalSubscriptionName) {
validateCanonicalSubscription(canonicalSubscriptionName);
return get("get subscription", canonicalSubscriptionName, readJson(Subscription.class));
} | [
"public",
"PubsubFuture",
"<",
"Subscription",
">",
"getSubscription",
"(",
"final",
"String",
"canonicalSubscriptionName",
")",
"{",
"validateCanonicalSubscription",
"(",
"canonicalSubscriptionName",
")",
";",
"return",
"get",
"(",
"\"get subscription\"",
",",
"canonical... | Get a Pub/Sub subscription.
@param canonicalSubscriptionName The canonical (including project) name of the subscription to get.
@return A future that is completed when this request is completed. The future will be completed with {@code null}
if the response is 404. | [
"Get",
"a",
"Pub",
"/",
"Sub",
"subscription",
"."
] | train | https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L443-L446 |
Whiley/WhileyCompiler | src/main/java/wyil/check/FlowTypeCheck.java | FlowTypeCheck.checkAssume | private Environment checkAssume(Stmt.Assume stmt, Environment environment, EnclosingScope scope) {
"""
Type check an assume statement. This requires checking that the expression
being assumed is well-formed and has boolean type. An assume statement can
affect the resulting environment in certain cases, such as w... | java | private Environment checkAssume(Stmt.Assume stmt, Environment environment, EnclosingScope scope) {
return checkCondition(stmt.getCondition(), true, environment);
} | [
"private",
"Environment",
"checkAssume",
"(",
"Stmt",
".",
"Assume",
"stmt",
",",
"Environment",
"environment",
",",
"EnclosingScope",
"scope",
")",
"{",
"return",
"checkCondition",
"(",
"stmt",
".",
"getCondition",
"(",
")",
",",
"true",
",",
"environment",
"... | Type check an assume statement. This requires checking that the expression
being assumed is well-formed and has boolean type. An assume statement can
affect the resulting environment in certain cases, such as when a type test
is assert. For example, after <code>assert x is int</code> the environment
will regard <code>x... | [
"Type",
"check",
"an",
"assume",
"statement",
".",
"This",
"requires",
"checking",
"that",
"the",
"expression",
"being",
"assumed",
"is",
"well",
"-",
"formed",
"and",
"has",
"boolean",
"type",
".",
"An",
"assume",
"statement",
"can",
"affect",
"the",
"resul... | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/check/FlowTypeCheck.java#L371-L373 |
quattor/pan | panc/src/main/java/org/quattor/pan/ttemplate/BuildContext.java | BuildContext.replaceGlobalVariable | public GlobalVariable replaceGlobalVariable(String name, Element value,
boolean finalFlag) {
"""
Replaces the given global variable with the given value. The flag
indicates whether or not the variable should be marked as final. Note,
however, that this routine does not respect the final flag and replaces
the... | java | public GlobalVariable replaceGlobalVariable(String name, Element value,
boolean finalFlag) {
assert (name != null);
GlobalVariable oldVariable = globalVariables.get(name);
GlobalVariable newVariable = new GlobalVariable(finalFlag, value);
globalVariables.put(name, newVariable);
return oldVariable;
} | [
"public",
"GlobalVariable",
"replaceGlobalVariable",
"(",
"String",
"name",
",",
"Element",
"value",
",",
"boolean",
"finalFlag",
")",
"{",
"assert",
"(",
"name",
"!=",
"null",
")",
";",
"GlobalVariable",
"oldVariable",
"=",
"globalVariables",
".",
"get",
"(",
... | Replaces the given global variable with the given value. The flag
indicates whether or not the variable should be marked as final. Note,
however, that this routine does not respect the final flag and replaces
the value unconditionally. The function returns the old value of the
variable or null if it didn't exist. | [
"Replaces",
"the",
"given",
"global",
"variable",
"with",
"the",
"given",
"value",
".",
"The",
"flag",
"indicates",
"whether",
"or",
"not",
"the",
"variable",
"should",
"be",
"marked",
"as",
"final",
".",
"Note",
"however",
"that",
"this",
"routine",
"does",... | train | https://github.com/quattor/pan/blob/009934a603dd0c08d3fa4bb7d9389c380a916f54/panc/src/main/java/org/quattor/pan/ttemplate/BuildContext.java#L633-L642 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/GeneralizedCounter.java | GeneralizedCounter.incrementCount1D | public void incrementCount1D(K o, double count) {
"""
Equivalent to <code>{@link #incrementCount}({o}, count)</code>;
only works for a depth 1 GeneralizedCounter.
"""
if (depth > 1) {
wrongDepth();
}
addToTotal(count);
if (tempMDouble == null) {
tempMDouble = new MutableD... | java | public void incrementCount1D(K o, double count) {
if (depth > 1) {
wrongDepth();
}
addToTotal(count);
if (tempMDouble == null) {
tempMDouble = new MutableDouble();
}
tempMDouble.set(count);
MutableDouble oldMDouble = (MutableDouble) map.put(o, tempMDouble);
if... | [
"public",
"void",
"incrementCount1D",
"(",
"K",
"o",
",",
"double",
"count",
")",
"{",
"if",
"(",
"depth",
">",
"1",
")",
"{",
"wrongDepth",
"(",
")",
";",
"}",
"addToTotal",
"(",
"count",
")",
";",
"if",
"(",
"tempMDouble",
"==",
"null",
")",
"{",... | Equivalent to <code>{@link #incrementCount}({o}, count)</code>;
only works for a depth 1 GeneralizedCounter. | [
"Equivalent",
"to",
"<code",
">",
"{"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/GeneralizedCounter.java#L542-L561 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InterfaceEndpointsInner.java | InterfaceEndpointsInner.createOrUpdateAsync | public Observable<InterfaceEndpointInner> createOrUpdateAsync(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) {
"""
Creates or updates an interface endpoint in the specified resource group.
@param resourceGroupName The name of the resource group.
@param interfaceEndpo... | java | public Observable<InterfaceEndpointInner> createOrUpdateAsync(String resourceGroupName, String interfaceEndpointName, InterfaceEndpointInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, interfaceEndpointName, parameters).map(new Func1<ServiceResponse<InterfaceEndpointInner>, In... | [
"public",
"Observable",
"<",
"InterfaceEndpointInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"interfaceEndpointName",
",",
"InterfaceEndpointInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"reso... | Creates or updates an interface endpoint in the specified resource group.
@param resourceGroupName The name of the resource group.
@param interfaceEndpointName The name of the interface endpoint.
@param parameters Parameters supplied to the create or update interface endpoint operation
@throws IllegalArgumentException... | [
"Creates",
"or",
"updates",
"an",
"interface",
"endpoint",
"in",
"the",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/InterfaceEndpointsInner.java#L460-L467 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsADESessionCache.java | CmsADESessionCache.getCache | public static CmsADESessionCache getCache(HttpServletRequest request, CmsObject cms) {
"""
Gets the session cache for the current session.<p>
In case the request is not editable, <code>null</code> will be returned.<p>
@param request the current request
@param cms the current CMS context
@return the ADE ses... | java | public static CmsADESessionCache getCache(HttpServletRequest request, CmsObject cms) {
CmsADESessionCache cache = (CmsADESessionCache)request.getSession().getAttribute(
CmsADESessionCache.SESSION_ATTR_ADE_CACHE);
if (cache == null) {
cache = new CmsADESessionCache(cms, request);... | [
"public",
"static",
"CmsADESessionCache",
"getCache",
"(",
"HttpServletRequest",
"request",
",",
"CmsObject",
"cms",
")",
"{",
"CmsADESessionCache",
"cache",
"=",
"(",
"CmsADESessionCache",
")",
"request",
".",
"getSession",
"(",
")",
".",
"getAttribute",
"(",
"Cm... | Gets the session cache for the current session.<p>
In case the request is not editable, <code>null</code> will be returned.<p>
@param request the current request
@param cms the current CMS context
@return the ADE session cache for the current session | [
"Gets",
"the",
"session",
"cache",
"for",
"the",
"current",
"session",
".",
"<p",
">",
"In",
"case",
"the",
"request",
"is",
"not",
"editable",
"<code",
">",
"null<",
"/",
"code",
">",
"will",
"be",
"returned",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsADESessionCache.java#L212-L221 |
infinispan/infinispan | core/src/main/java/org/infinispan/interceptors/locking/AbstractTxLockingInterceptor.java | AbstractTxLockingInterceptor.lockOrRegisterBackupLock | final KeyAwareLockPromise lockOrRegisterBackupLock(TxInvocationContext<?> ctx, Object key, long lockTimeout)
throws InterruptedException {
"""
The backup (non-primary) owners keep a "backup lock" for each key they received in a lock/prepare command.
Normally there can be many transactions holding the bac... | java | final KeyAwareLockPromise lockOrRegisterBackupLock(TxInvocationContext<?> ctx, Object key, long lockTimeout)
throws InterruptedException {
switch (cdl.getCacheTopology().getDistribution(key).writeOwnership()) {
case PRIMARY:
if (trace) {
getLog().tracef("Acquiring lock... | [
"final",
"KeyAwareLockPromise",
"lockOrRegisterBackupLock",
"(",
"TxInvocationContext",
"<",
"?",
">",
"ctx",
",",
"Object",
"key",
",",
"long",
"lockTimeout",
")",
"throws",
"InterruptedException",
"{",
"switch",
"(",
"cdl",
".",
"getCacheTopology",
"(",
")",
"."... | The backup (non-primary) owners keep a "backup lock" for each key they received in a lock/prepare command.
Normally there can be many transactions holding the backup lock at the same time, but when the secondary owner
becomes a primary owner a new transaction trying to obtain the "real" lock will have to wait for all b... | [
"The",
"backup",
"(",
"non",
"-",
"primary",
")",
"owners",
"keep",
"a",
"backup",
"lock",
"for",
"each",
"key",
"they",
"received",
"in",
"a",
"lock",
"/",
"prepare",
"command",
".",
"Normally",
"there",
"can",
"be",
"many",
"transactions",
"holding",
"... | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/interceptors/locking/AbstractTxLockingInterceptor.java#L66-L82 |
MGunlogson/CuckooFilter4J | src/main/java/com/github/mgunlogson/cuckoofilter4j/FilterTable.java | FilterTable.deleteFromBucket | boolean deleteFromBucket(long i1, long tag) {
"""
Deletes an item from the table if it is found in the bucket
@param i1
bucket index
@param tag
tag
@return true if item was deleted
"""
for (int i = 0; i < CuckooFilter.BUCKET_SIZE; i++) {
if (checkTag(i1, i, tag)) {
deleteTag(i1, i);
ret... | java | boolean deleteFromBucket(long i1, long tag) {
for (int i = 0; i < CuckooFilter.BUCKET_SIZE; i++) {
if (checkTag(i1, i, tag)) {
deleteTag(i1, i);
return true;
}
}
return false;
} | [
"boolean",
"deleteFromBucket",
"(",
"long",
"i1",
",",
"long",
"tag",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"CuckooFilter",
".",
"BUCKET_SIZE",
";",
"i",
"++",
")",
"{",
"if",
"(",
"checkTag",
"(",
"i1",
",",
"i",
",",
"tag",... | Deletes an item from the table if it is found in the bucket
@param i1
bucket index
@param tag
tag
@return true if item was deleted | [
"Deletes",
"an",
"item",
"from",
"the",
"table",
"if",
"it",
"is",
"found",
"in",
"the",
"bucket"
] | train | https://github.com/MGunlogson/CuckooFilter4J/blob/e8472aa150b201f05046d1c81cac5a5ca4348db8/src/main/java/com/github/mgunlogson/cuckoofilter4j/FilterTable.java#L153-L161 |
Drivemode/TypefaceHelper | TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceHelper.java | TypefaceHelper.setTypeface | public View setTypeface(Context context, @LayoutRes int layoutRes, ViewGroup parent, @StringRes int strResId) {
"""
Set the typeface to the all text views belong to the view group.
@param context the context.
@param layoutRes the layout resource id.
@param parent the parent view group to attach the layout.
@pa... | java | public View setTypeface(Context context, @LayoutRes int layoutRes, ViewGroup parent, @StringRes int strResId) {
return setTypeface(context, layoutRes, parent, mApplication.getString(strResId));
} | [
"public",
"View",
"setTypeface",
"(",
"Context",
"context",
",",
"@",
"LayoutRes",
"int",
"layoutRes",
",",
"ViewGroup",
"parent",
",",
"@",
"StringRes",
"int",
"strResId",
")",
"{",
"return",
"setTypeface",
"(",
"context",
",",
"layoutRes",
",",
"parent",
"... | Set the typeface to the all text views belong to the view group.
@param context the context.
@param layoutRes the layout resource id.
@param parent the parent view group to attach the layout.
@param strResId string resource containing typeface name.
@return the view. | [
"Set",
"the",
"typeface",
"to",
"the",
"all",
"text",
"views",
"belong",
"to",
"the",
"view",
"group",
"."
] | train | https://github.com/Drivemode/TypefaceHelper/blob/86bef9ce16b9626b7076559e846db1b9f043c008/TypefaceHelper/src/main/java/com/drivemode/android/typeface/TypefaceHelper.java#L253-L255 |
google/closure-compiler | src/com/google/javascript/rhino/TypeDeclarationsIR.java | TypeDeclarationsIR.namedType | public static TypeDeclarationNode namedType(Iterable<String> segments) {
"""
Produces a tree structure similar to the Rhino AST of a qualified name
expression, under a top-level NAMED_TYPE node.
<p>Example:
<pre>
NAMED_TYPE
NAME goog
STRING ui
STRING Window
</pre>
"""
Iterator<String> segmentsIt ... | java | public static TypeDeclarationNode namedType(Iterable<String> segments) {
Iterator<String> segmentsIt = segments.iterator();
Node node = IR.name(segmentsIt.next());
while (segmentsIt.hasNext()) {
node = IR.getprop(node, IR.string(segmentsIt.next()));
}
return new TypeDeclarationNode(Token.NAMED... | [
"public",
"static",
"TypeDeclarationNode",
"namedType",
"(",
"Iterable",
"<",
"String",
">",
"segments",
")",
"{",
"Iterator",
"<",
"String",
">",
"segmentsIt",
"=",
"segments",
".",
"iterator",
"(",
")",
";",
"Node",
"node",
"=",
"IR",
".",
"name",
"(",
... | Produces a tree structure similar to the Rhino AST of a qualified name
expression, under a top-level NAMED_TYPE node.
<p>Example:
<pre>
NAMED_TYPE
NAME goog
STRING ui
STRING Window
</pre> | [
"Produces",
"a",
"tree",
"structure",
"similar",
"to",
"the",
"Rhino",
"AST",
"of",
"a",
"qualified",
"name",
"expression",
"under",
"a",
"top",
"-",
"level",
"NAMED_TYPE",
"node",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/TypeDeclarationsIR.java#L125-L132 |
RestExpress/PluginExpress | logging/src/main/java/org/restexpress/plugin/logging/LoggingMessageObserver.java | LoggingMessageObserver.createCompleteMessage | protected String createCompleteMessage(Request request, Response response, Timer timer) {
"""
Create the message to be logged when a request is completed successfully.
Sub-classes can override.
@param request
@param response
@param timer
@return a string message.
"""
StringBuilder sb = new StringBu... | java | protected String createCompleteMessage(Request request, Response response, Timer timer)
{
StringBuilder sb = new StringBuilder(request.getEffectiveHttpMethod().toString());
sb.append(" ");
sb.append(request.getUrl());
if (timer != null)
{
sb.append(" responded with ");
sb.append(response.getRe... | [
"protected",
"String",
"createCompleteMessage",
"(",
"Request",
"request",
",",
"Response",
"response",
",",
"Timer",
"timer",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"request",
".",
"getEffectiveHttpMethod",
"(",
")",
".",
"toString",
... | Create the message to be logged when a request is completed successfully.
Sub-classes can override.
@param request
@param response
@param timer
@return a string message. | [
"Create",
"the",
"message",
"to",
"be",
"logged",
"when",
"a",
"request",
"is",
"completed",
"successfully",
".",
"Sub",
"-",
"classes",
"can",
"override",
"."
] | train | https://github.com/RestExpress/PluginExpress/blob/aeb13907c23bf31ef2b2b17ae4c0ca4a6f5bee69/logging/src/main/java/org/restexpress/plugin/logging/LoggingMessageObserver.java#L88-L109 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/reflect/InheritanceUtils.java | InheritanceUtils.distance | public static int distance(final Class<?> child, final Class<?> parent) {
"""
<p>Returns the number of inheritance hops between two classes.</p>
@param child the child class, may be {@code null}
@param parent the parent class, may be {@code null}
@return the number of generations between the child and parent;... | java | public static int distance(final Class<?> child, final Class<?> parent) {
if (child == null || parent == null) {
return -1;
}
if (child.equals(parent)) {
return 0;
}
final Class<?> cParent = child.getSuperclass();
int d = BooleanUtils.toInteger(p... | [
"public",
"static",
"int",
"distance",
"(",
"final",
"Class",
"<",
"?",
">",
"child",
",",
"final",
"Class",
"<",
"?",
">",
"parent",
")",
"{",
"if",
"(",
"child",
"==",
"null",
"||",
"parent",
"==",
"null",
")",
"{",
"return",
"-",
"1",
";",
"}"... | <p>Returns the number of inheritance hops between two classes.</p>
@param child the child class, may be {@code null}
@param parent the parent class, may be {@code null}
@return the number of generations between the child and parent; 0 if the same class;
-1 if the classes are not related as child and parent (includes w... | [
"<p",
">",
"Returns",
"the",
"number",
"of",
"inheritance",
"hops",
"between",
"two",
"classes",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/InheritanceUtils.java#L52-L69 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java | RotationAxis.guessOrderFromAngle | public int guessOrderFromAngle(double threshold, int maxOrder) {
"""
Returns the rotation order o that gives the lowest value of {@code |2PI / o - theta},
given that the value is strictly lower than {@code threshold}, for orders {@code o=1,...,maxOrder}.
"""
double bestDelta = threshold;
int bestOrder = 1... | java | public int guessOrderFromAngle(double threshold, int maxOrder) {
double bestDelta = threshold;
int bestOrder = 1;
for (int order = 2; order < maxOrder; order++) {
double delta = Math.abs(2 * Math.PI / order - theta);
if (delta < bestDelta) {
bestOrder = order;
bestDelta = delta;
}
}
return be... | [
"public",
"int",
"guessOrderFromAngle",
"(",
"double",
"threshold",
",",
"int",
"maxOrder",
")",
"{",
"double",
"bestDelta",
"=",
"threshold",
";",
"int",
"bestOrder",
"=",
"1",
";",
"for",
"(",
"int",
"order",
"=",
"2",
";",
"order",
"<",
"maxOrder",
";... | Returns the rotation order o that gives the lowest value of {@code |2PI / o - theta},
given that the value is strictly lower than {@code threshold}, for orders {@code o=1,...,maxOrder}. | [
"Returns",
"the",
"rotation",
"order",
"o",
"that",
"gives",
"the",
"lowest",
"value",
"of",
"{"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/RotationAxis.java#L209-L220 |
upwork/java-upwork | src/com/Upwork/api/Routers/Activities/Team.java | Team.getList | public JSONObject getList(String company, String team) throws JSONException {
"""
List all oTask/Activity records within a team
@param company Company ID
@throws JSONException If error occurred
@return {@link JSONObject}
"""
return _getByType(company, team, null);
} | java | public JSONObject getList(String company, String team) throws JSONException {
return _getByType(company, team, null);
} | [
"public",
"JSONObject",
"getList",
"(",
"String",
"company",
",",
"String",
"team",
")",
"throws",
"JSONException",
"{",
"return",
"_getByType",
"(",
"company",
",",
"team",
",",
"null",
")",
";",
"}"
] | List all oTask/Activity records within a team
@param company Company ID
@throws JSONException If error occurred
@return {@link JSONObject} | [
"List",
"all",
"oTask",
"/",
"Activity",
"records",
"within",
"a",
"team"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Activities/Team.java#L71-L73 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java | ReceiveMessageActionParser.addSchemaInformationToValidationContext | private void addSchemaInformationToValidationContext(Element messageElement, SchemaValidationContext context) {
"""
Adds information about the validation of the message against a certain schema to the context
@param messageElement The message element to get the configuration from
@param context The context to se... | java | private void addSchemaInformationToValidationContext(Element messageElement, SchemaValidationContext context) {
String schemaValidation = messageElement.getAttribute("schema-validation");
if (StringUtils.hasText(schemaValidation)) {
context.setSchemaValidation(Boolean.valueOf(schemaValidatio... | [
"private",
"void",
"addSchemaInformationToValidationContext",
"(",
"Element",
"messageElement",
",",
"SchemaValidationContext",
"context",
")",
"{",
"String",
"schemaValidation",
"=",
"messageElement",
".",
"getAttribute",
"(",
"\"schema-validation\"",
")",
";",
"if",
"("... | Adds information about the validation of the message against a certain schema to the context
@param messageElement The message element to get the configuration from
@param context The context to set the schema validation configuration to | [
"Adds",
"information",
"about",
"the",
"validation",
"of",
"the",
"message",
"against",
"a",
"certain",
"schema",
"to",
"the",
"context"
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java#L263-L278 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/CmsGalleryController.java | CmsGalleryController.sortGalleries | public void sortGalleries(String sortParams, String filter) {
"""
Sorts the galleries according to given parameters and updates the list.<p>
@param sortParams the sort parameters
@param filter the filter to apply before sorting
"""
List<CmsGalleryFolderBean> galleries;
if (CmsStringUtil.is... | java | public void sortGalleries(String sortParams, String filter) {
List<CmsGalleryFolderBean> galleries;
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(filter)) {
galleries = new ArrayList<CmsGalleryFolderBean>();
for (CmsGalleryFolderBean galleryBean : m_dialogBean.getGalleries()) {
... | [
"public",
"void",
"sortGalleries",
"(",
"String",
"sortParams",
",",
"String",
"filter",
")",
"{",
"List",
"<",
"CmsGalleryFolderBean",
">",
"galleries",
";",
"if",
"(",
"CmsStringUtil",
".",
"isNotEmptyOrWhitespaceOnly",
"(",
"filter",
")",
")",
"{",
"galleries... | Sorts the galleries according to given parameters and updates the list.<p>
@param sortParams the sort parameters
@param filter the filter to apply before sorting | [
"Sorts",
"the",
"galleries",
"according",
"to",
"given",
"parameters",
"and",
"updates",
"the",
"list",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/CmsGalleryController.java#L1392-L1435 |
groupon/odo | proxyui/src/main/java/com/groupon/odo/controllers/EditController.java | EditController.disableResponses | @RequestMapping(value = "api/edit/disable", method = RequestMethod.POST)
public
@ResponseBody
String disableResponses(Model model, int path_id, @RequestParam(defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID) throws Exception {
"""
disables the responses for a given pathname and use... | java | @RequestMapping(value = "api/edit/disable", method = RequestMethod.POST)
public
@ResponseBody
String disableResponses(Model model, int path_id, @RequestParam(defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID) throws Exception {
OverrideService.getInstance().disableAllOverrides(pa... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"api/edit/disable\"",
",",
"method",
"=",
"RequestMethod",
".",
"POST",
")",
"public",
"@",
"ResponseBody",
"String",
"disableResponses",
"(",
"Model",
"model",
",",
"int",
"path_id",
",",
"@",
"RequestParam",
"(",
"... | disables the responses for a given pathname and user id
@param model
@param path_id
@param clientUUID
@return
@throws Exception | [
"disables",
"the",
"responses",
"for",
"a",
"given",
"pathname",
"and",
"user",
"id"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxyui/src/main/java/com/groupon/odo/controllers/EditController.java#L150-L159 |
casmi/casmi | src/main/java/casmi/graphics/Graphics.java | Graphics.setSpotLight | public void setSpotLight(int i, Color color, boolean enableColor, Vector3D v, float nx, float ny, float nz, float angle) {
"""
Sets the color value, position, direction and the angle of the spotlight cone of the No.i spotLight
"""
float spotColor[] = {
(float)color.getRed(),
(flo... | java | public void setSpotLight(int i, Color color, boolean enableColor, Vector3D v, float nx, float ny, float nz, float angle) {
float spotColor[] = {
(float)color.getRed(),
(float)color.getGreen(),
(float)color.getBlue(),
(float)color.getAlpha()
};
float po... | [
"public",
"void",
"setSpotLight",
"(",
"int",
"i",
",",
"Color",
"color",
",",
"boolean",
"enableColor",
",",
"Vector3D",
"v",
",",
"float",
"nx",
",",
"float",
"ny",
",",
"float",
"nz",
",",
"float",
"angle",
")",
"{",
"float",
"spotColor",
"[",
"]",
... | Sets the color value, position, direction and the angle of the spotlight cone of the No.i spotLight | [
"Sets",
"the",
"color",
"value",
"position",
"direction",
"and",
"the",
"angle",
"of",
"the",
"spotlight",
"cone",
"of",
"the",
"No",
".",
"i",
"spotLight"
] | train | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/Graphics.java#L586-L608 |
bbottema/simple-java-mail | modules/simple-java-mail/src/main/java/org/simplejavamail/converter/internal/mimemessage/MimeMessageHelper.java | MimeMessageHelper.setTexts | static void setTexts(final Email email, final MimePart messagePart)
throws MessagingException {
"""
Fills the {@link MimeBodyPart} instance with the content body content (text, html and calendar).
@param email The message in which the content is defined.
@param messagePart The {@link MimeBodyPart} tha... | java | static void setTexts(final Email email, final MimePart messagePart)
throws MessagingException {
if (email.getPlainText() != null) {
messagePart.setText(email.getPlainText(), CHARACTER_ENCODING);
}
if (email.getHTMLText() != null) {
messagePart.setContent(email.getHTMLText(), "text/html; charset=\"" + CHA... | [
"static",
"void",
"setTexts",
"(",
"final",
"Email",
"email",
",",
"final",
"MimePart",
"messagePart",
")",
"throws",
"MessagingException",
"{",
"if",
"(",
"email",
".",
"getPlainText",
"(",
")",
"!=",
"null",
")",
"{",
"messagePart",
".",
"setText",
"(",
... | Fills the {@link MimeBodyPart} instance with the content body content (text, html and calendar).
@param email The message in which the content is defined.
@param messagePart The {@link MimeBodyPart} that will contain the body content (either plain text, HTML text or iCalendar text)
@throws MessagingException Se... | [
"Fills",
"the",
"{",
"@link",
"MimeBodyPart",
"}",
"instance",
"with",
"the",
"content",
"body",
"content",
"(",
"text",
"html",
"and",
"calendar",
")",
"."
] | train | https://github.com/bbottema/simple-java-mail/blob/b03635328aeecd525e35eddfef8f5b9a184559d8/modules/simple-java-mail/src/main/java/org/simplejavamail/converter/internal/mimemessage/MimeMessageHelper.java#L124-L135 |
jenkinsci/blueocean-display-url-plugin | src/main/java/org/jenkinsci/plugins/blueoceandisplayurl/BlueOceanDisplayURLImpl.java | BlueOceanDisplayURLImpl.getFullNameForItemGroup | private static String getFullNameForItemGroup(@Nullable BlueOrganization org, @Nonnull ItemGroup itemGroup) {
"""
Returns full name relative to the <code>BlueOrganization</code> base. Each name is separated by '/'
@param org the organization the item belongs to
@param itemGroup to return the full name of
@ret... | java | private static String getFullNameForItemGroup(@Nullable BlueOrganization org, @Nonnull ItemGroup itemGroup) {
if (itemGroup instanceof Item) {
return getFullNameForItem(org, (Item)itemGroup);
} else {
return itemGroup.getFullName();
}
} | [
"private",
"static",
"String",
"getFullNameForItemGroup",
"(",
"@",
"Nullable",
"BlueOrganization",
"org",
",",
"@",
"Nonnull",
"ItemGroup",
"itemGroup",
")",
"{",
"if",
"(",
"itemGroup",
"instanceof",
"Item",
")",
"{",
"return",
"getFullNameForItem",
"(",
"org",
... | Returns full name relative to the <code>BlueOrganization</code> base. Each name is separated by '/'
@param org the organization the item belongs to
@param itemGroup to return the full name of
@return | [
"Returns",
"full",
"name",
"relative",
"to",
"the",
"<code",
">",
"BlueOrganization<",
"/",
"code",
">",
"base",
".",
"Each",
"name",
"is",
"separated",
"by",
"/"
] | train | https://github.com/jenkinsci/blueocean-display-url-plugin/blob/d6515117712c9b30a32f32bb6e1a977711b9b037/src/main/java/org/jenkinsci/plugins/blueoceandisplayurl/BlueOceanDisplayURLImpl.java#L148-L154 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_tcp_frontend_POST | public OvhFrontendTcp serviceName_tcp_frontend_POST(String serviceName, String[] allowedSource, String[] dedicatedIpfo, Long defaultFarmId, Long defaultSslId, Boolean disabled, String displayName, String port, Boolean ssl, String zone) throws IOException {
"""
Add a new TCP frontend on your IP Load Balancing
RE... | java | public OvhFrontendTcp serviceName_tcp_frontend_POST(String serviceName, String[] allowedSource, String[] dedicatedIpfo, Long defaultFarmId, Long defaultSslId, Boolean disabled, String displayName, String port, Boolean ssl, String zone) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/tcp/frontend";... | [
"public",
"OvhFrontendTcp",
"serviceName_tcp_frontend_POST",
"(",
"String",
"serviceName",
",",
"String",
"[",
"]",
"allowedSource",
",",
"String",
"[",
"]",
"dedicatedIpfo",
",",
"Long",
"defaultFarmId",
",",
"Long",
"defaultSslId",
",",
"Boolean",
"disabled",
",",... | Add a new TCP frontend on your IP Load Balancing
REST: POST /ipLoadbalancing/{serviceName}/tcp/frontend
@param port [required] Port(s) attached to your frontend. Supports single port (numerical value), range (2 dash-delimited increasing ports) and comma-separated list of 'single port' and/or 'range'. Each port must be... | [
"Add",
"a",
"new",
"TCP",
"frontend",
"on",
"your",
"IP",
"Load",
"Balancing"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L1500-L1515 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java | MDAG.cloneTransitionPath | private void cloneTransitionPath(MDAGNode pivotConfluenceNode, String transitionStringToPivotNode, String str) {
"""
从给点节点开始克隆一条路径<br>
Clones a _transition path from a given node.
@param pivotConfluenceNode the MDAGNode that the cloning operation is to be based from
@param transitionStringToPivotNode ... | java | private void cloneTransitionPath(MDAGNode pivotConfluenceNode, String transitionStringToPivotNode, String str)
{
MDAGNode lastTargetNode = pivotConfluenceNode.transition(str); //Will store the last node which was used as the base of a cloning operation
MDAGNode lastClonedNode = null; ... | [
"private",
"void",
"cloneTransitionPath",
"(",
"MDAGNode",
"pivotConfluenceNode",
",",
"String",
"transitionStringToPivotNode",
",",
"String",
"str",
")",
"{",
"MDAGNode",
"lastTargetNode",
"=",
"pivotConfluenceNode",
".",
"transition",
"(",
"str",
")",
";",
"//Will s... | 从给点节点开始克隆一条路径<br>
Clones a _transition path from a given node.
@param pivotConfluenceNode the MDAGNode that the cloning operation is to be based from
@param transitionStringToPivotNode a String which corresponds with a _transition path from souceNode to {@code pivotConfluenceNode}
@param str ... | [
"从给点节点开始克隆一条路径<br",
">",
"Clones",
"a",
"_transition",
"path",
"from",
"a",
"given",
"node",
"."
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L632-L674 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java | FacebookRestClient.feed_publishStoryToUser | public boolean feed_publishStoryToUser(CharSequence title, CharSequence body,
Collection<IFeedImage> images)
throws FacebookException, IOException {
"""
Publish a story to the logged-in user's newsfeed.
@param title the title of the feed story
@param body the body of ... | java | public boolean feed_publishStoryToUser(CharSequence title, CharSequence body,
Collection<IFeedImage> images)
throws FacebookException, IOException {
return feed_publishStoryToUser(title, body, images, null);
} | [
"public",
"boolean",
"feed_publishStoryToUser",
"(",
"CharSequence",
"title",
",",
"CharSequence",
"body",
",",
"Collection",
"<",
"IFeedImage",
">",
"images",
")",
"throws",
"FacebookException",
",",
"IOException",
"{",
"return",
"feed_publishStoryToUser",
"(",
"titl... | Publish a story to the logged-in user's newsfeed.
@param title the title of the feed story
@param body the body of the feed story
@param images (optional) up to four pairs of image URLs and (possibly null) link URLs
@return whether the story was successfully published; false in case of permission error
@see <a href="ht... | [
"Publish",
"a",
"story",
"to",
"the",
"logged",
"-",
"in",
"user",
"s",
"newsfeed",
"."
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L335-L339 |
prestodb/presto | presto-orc/src/main/java/com/facebook/presto/orc/stream/BooleanInputStream.java | BooleanInputStream.getUnsetBits | public int getUnsetBits(int batchSize, boolean[] vector, int offset)
throws IOException {
"""
Sets the vector element to true for the batchSize number of elements starting at offset
if the bit is not set.
"""
int count = 0;
for (int i = offset; i < batchSize + offset; i++) {
... | java | public int getUnsetBits(int batchSize, boolean[] vector, int offset)
throws IOException
{
int count = 0;
for (int i = offset; i < batchSize + offset; i++) {
vector[i] = !nextBit();
count += vector[i] ? 1 : 0;
}
return count;
} | [
"public",
"int",
"getUnsetBits",
"(",
"int",
"batchSize",
",",
"boolean",
"[",
"]",
"vector",
",",
"int",
"offset",
")",
"throws",
"IOException",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"offset",
";",
"i",
"<",
"batchSize",
"... | Sets the vector element to true for the batchSize number of elements starting at offset
if the bit is not set. | [
"Sets",
"the",
"vector",
"element",
"to",
"true",
"for",
"the",
"batchSize",
"number",
"of",
"elements",
"starting",
"at",
"offset",
"if",
"the",
"bit",
"is",
"not",
"set",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-orc/src/main/java/com/facebook/presto/orc/stream/BooleanInputStream.java#L182-L191 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.printCounterComparison | public static <E> void printCounterComparison(Counter<E> a, Counter<E> b, PrintWriter out) {
"""
Prints one or more lines (with a newline at the end) describing the
difference between the two Counters. Great for debugging.
"""
if (a.equals(b)) {
out.println("Counters are equal.");
return;
... | java | public static <E> void printCounterComparison(Counter<E> a, Counter<E> b, PrintWriter out) {
if (a.equals(b)) {
out.println("Counters are equal.");
return;
}
for (E key : a.keySet()) {
double aCount = a.getCount(key);
double bCount = b.getCount(key);
if (Math.abs(aCount... | [
"public",
"static",
"<",
"E",
">",
"void",
"printCounterComparison",
"(",
"Counter",
"<",
"E",
">",
"a",
",",
"Counter",
"<",
"E",
">",
"b",
",",
"PrintWriter",
"out",
")",
"{",
"if",
"(",
"a",
".",
"equals",
"(",
"b",
")",
")",
"{",
"out",
".",
... | Prints one or more lines (with a newline at the end) describing the
difference between the two Counters. Great for debugging. | [
"Prints",
"one",
"or",
"more",
"lines",
"(",
"with",
"a",
"newline",
"at",
"the",
"end",
")",
"describing",
"the",
"difference",
"between",
"the",
"two",
"Counters",
".",
"Great",
"for",
"debugging",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1487-L1510 |
pac4j/pac4j | pac4j-oauth/src/main/java/org/pac4j/oauth/profile/facebook/FacebookProfileDefinition.java | FacebookProfileDefinition.computeAppSecretProof | public String computeAppSecretProof(final String url, final OAuth2AccessToken token, final FacebookConfiguration configuration) {
"""
The code in this method is based on this blog post:
https://www.sammyk.me/the-single-most-important-way-to-make-your-facebook-app-more-secure
and this answer: https://stackoverflo... | java | public String computeAppSecretProof(final String url, final OAuth2AccessToken token, final FacebookConfiguration configuration) {
try {
Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
SecretKeySpec secret_key = new SecretKeySpec(configuration.getSecret().getBytes(StandardCharsets.UTF_8)... | [
"public",
"String",
"computeAppSecretProof",
"(",
"final",
"String",
"url",
",",
"final",
"OAuth2AccessToken",
"token",
",",
"final",
"FacebookConfiguration",
"configuration",
")",
"{",
"try",
"{",
"Mac",
"sha256_HMAC",
"=",
"Mac",
".",
"getInstance",
"(",
"\"Hmac... | The code in this method is based on this blog post:
https://www.sammyk.me/the-single-most-important-way-to-make-your-facebook-app-more-secure
and this answer: https://stackoverflow.com/questions/7124735/hmac-sha256-algorithm-for-signature-calculation
@param url the URL to which we're adding the proof
@param token the ... | [
"The",
"code",
"in",
"this",
"method",
"is",
"based",
"on",
"this",
"blog",
"post",
":",
"https",
":",
"//",
"www",
".",
"sammyk",
".",
"me",
"/",
"the",
"-",
"single",
"-",
"most",
"-",
"important",
"-",
"way",
"-",
"to",
"-",
"make",
"-",
"your... | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-oauth/src/main/java/org/pac4j/oauth/profile/facebook/FacebookProfileDefinition.java#L133-L145 |
cbeust/jcommander | src/main/java/com/beust/jcommander/DefaultUsageFormatter.java | DefaultUsageFormatter.wrapDescription | public void wrapDescription(StringBuilder out, int indent, int currentLineIndent, String description) {
"""
Wrap a potentially long line to the value obtained by calling {@link JCommander#getColumnSize()} on the
underlying commander instance.
@param out the output
@param indent the in... | java | public void wrapDescription(StringBuilder out, int indent, int currentLineIndent, String description) {
int max = commander.getColumnSize();
String[] words = description.split(" ");
int current = currentLineIndent;
for (int i = 0; i < words.length; i++) {
String word = words... | [
"public",
"void",
"wrapDescription",
"(",
"StringBuilder",
"out",
",",
"int",
"indent",
",",
"int",
"currentLineIndent",
",",
"String",
"description",
")",
"{",
"int",
"max",
"=",
"commander",
".",
"getColumnSize",
"(",
")",
";",
"String",
"[",
"]",
"words",... | Wrap a potentially long line to the value obtained by calling {@link JCommander#getColumnSize()} on the
underlying commander instance.
@param out the output
@param indent the indentation in spaces for lines after the first line.
@param currentLineIndent the length of the indentation of the ini... | [
"Wrap",
"a",
"potentially",
"long",
"line",
"to",
"the",
"value",
"obtained",
"by",
"calling",
"{",
"@link",
"JCommander#getColumnSize",
"()",
"}",
"on",
"the",
"underlying",
"commander",
"instance",
"."
] | train | https://github.com/cbeust/jcommander/blob/85cb6f7217e15f62225185ffd97491f34b7b49bb/src/main/java/com/beust/jcommander/DefaultUsageFormatter.java#L320-L341 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/LoggingConfigUtils.java | LoggingConfigUtils.getStringValue | public static String getStringValue(Object newValue, String defaultValue) {
"""
If the value is null, return the defaultValue.
Otherwise return the new value.
"""
if (newValue == null)
return defaultValue;
return (String) newValue;
} | java | public static String getStringValue(Object newValue, String defaultValue) {
if (newValue == null)
return defaultValue;
return (String) newValue;
} | [
"public",
"static",
"String",
"getStringValue",
"(",
"Object",
"newValue",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"newValue",
"==",
"null",
")",
"return",
"defaultValue",
";",
"return",
"(",
"String",
")",
"newValue",
";",
"}"
] | If the value is null, return the defaultValue.
Otherwise return the new value. | [
"If",
"the",
"value",
"is",
"null",
"return",
"the",
"defaultValue",
".",
"Otherwise",
"return",
"the",
"new",
"value",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/LoggingConfigUtils.java#L120-L125 |
Whiley/WhileyCompiler | src/main/java/wyil/check/FlowTypeCheck.java | FlowTypeCheck.checkSwitch | private Environment checkSwitch(Stmt.Switch stmt, Environment environment, EnclosingScope scope)
throws IOException {
"""
Type check a <code>switch</code> statement. This is similar, in some ways, to
the handling of if-statements except that we have n code blocks instead of
just two. Therefore, we check type ... | java | private Environment checkSwitch(Stmt.Switch stmt, Environment environment, EnclosingScope scope)
throws IOException {
// Type check the expression being switched upon
checkExpression(stmt.getCondition(), environment);
// The final environment determines what flow continues after the switch
// statement
Env... | [
"private",
"Environment",
"checkSwitch",
"(",
"Stmt",
".",
"Switch",
"stmt",
",",
"Environment",
"environment",
",",
"EnclosingScope",
"scope",
")",
"throws",
"IOException",
"{",
"// Type check the expression being switched upon",
"checkExpression",
"(",
"stmt",
".",
"g... | Type check a <code>switch</code> statement. This is similar, in some ways, to
the handling of if-statements except that we have n code blocks instead of
just two. Therefore, we check type information through each block, which
produces n potentially different environments and these are all joined
together to produce the... | [
"Type",
"check",
"a",
"<code",
">",
"switch<",
"/",
"code",
">",
"statement",
".",
"This",
"is",
"similar",
"in",
"some",
"ways",
"to",
"the",
"handling",
"of",
"if",
"-",
"statements",
"except",
"that",
"we",
"have",
"n",
"code",
"blocks",
"instead",
... | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/check/FlowTypeCheck.java#L684-L722 |
casmi/casmi | src/main/java/casmi/graphics/color/HSBColor.java | HSBColor.lerpColor | public static Color lerpColor(HSBColor color1, HSBColor color2, double amt) {
"""
Calculates a color or colors between two color at a specific increment.
@param color1
interpolate from this color
@param color2
interpolate to this color
@param amt
between 0.0 and 1.0
@return
The calculated color values.... | java | public static Color lerpColor(HSBColor color1, HSBColor color2, double amt) {
double hue, saturation, brightness, alpha;
hue = color2.hue * amt + color1.hue * (1 - amt);
saturation = color2.saturation * amt + color1.saturation * (1 - amt);
brightness = color2.brightn... | [
"public",
"static",
"Color",
"lerpColor",
"(",
"HSBColor",
"color1",
",",
"HSBColor",
"color2",
",",
"double",
"amt",
")",
"{",
"double",
"hue",
",",
"saturation",
",",
"brightness",
",",
"alpha",
";",
"hue",
"=",
"color2",
".",
"hue",
"*",
"amt",
"+",
... | Calculates a color or colors between two color at a specific increment.
@param color1
interpolate from this color
@param color2
interpolate to this color
@param amt
between 0.0 and 1.0
@return
The calculated color values. | [
"Calculates",
"a",
"color",
"or",
"colors",
"between",
"two",
"color",
"at",
"a",
"specific",
"increment",
"."
] | train | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/color/HSBColor.java#L273-L280 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java | DockerUtils.getParentId | public static String getParentId(String digest, String host) throws IOException {
"""
Get parent digest of an image.
@param digest
@param host
@return
"""
DockerClient dockerClient = null;
try {
dockerClient = getDockerClient(host);
return dockerClient.inspectImageC... | java | public static String getParentId(String digest, String host) throws IOException {
DockerClient dockerClient = null;
try {
dockerClient = getDockerClient(host);
return dockerClient.inspectImageCmd(digest).exec().getParent();
} finally {
closeQuietly(dockerClien... | [
"public",
"static",
"String",
"getParentId",
"(",
"String",
"digest",
",",
"String",
"host",
")",
"throws",
"IOException",
"{",
"DockerClient",
"dockerClient",
"=",
"null",
";",
"try",
"{",
"dockerClient",
"=",
"getDockerClient",
"(",
"host",
")",
";",
"return... | Get parent digest of an image.
@param digest
@param host
@return | [
"Get",
"parent",
"digest",
"of",
"an",
"image",
"."
] | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/pipeline/common/docker/utils/DockerUtils.java#L95-L103 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerIdentityImpl.java | TransformerIdentityImpl.endElement | public void endElement(String uri, String localName, String qName)
throws SAXException {
"""
Receive notification of the end of an element.
<p>By default, do nothing. Application writers may override this
method in a subclass to take specific actions at the end of
each element (such as finalising a... | java | public void endElement(String uri, String localName, String qName)
throws SAXException
{
m_resultContentHandler.endElement(uri, localName, qName);
} | [
"public",
"void",
"endElement",
"(",
"String",
"uri",
",",
"String",
"localName",
",",
"String",
"qName",
")",
"throws",
"SAXException",
"{",
"m_resultContentHandler",
".",
"endElement",
"(",
"uri",
",",
"localName",
",",
"qName",
")",
";",
"}"
] | Receive notification of the end of an element.
<p>By default, do nothing. Application writers may override this
method in a subclass to take specific actions at the end of
each element (such as finalising a tree node or writing
output to a file).</p>
@param uri The Namespace URI, or the empty string if the
element h... | [
"Receive",
"notification",
"of",
"the",
"end",
"of",
"an",
"element",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerIdentityImpl.java#L1099-L1103 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/LocaleUtils.java | LocaleUtils.converterTagLocaleFromString | public static Locale converterTagLocaleFromString(String name) {
"""
Convert locale string used by converter tags to locale.
@param name name of the locale
@return locale specified by the given String
@see org.apache.myfaces.taglib.core.ConvertDateTimeTag#setConverterLocale
@see org.apache.myfaces.taglib.c... | java | public static Locale converterTagLocaleFromString(String name)
{
try
{
Locale locale;
StringTokenizer st = new StringTokenizer(name, "_");
String language = st.nextToken();
if(st.hasMoreTokens())
{
String country = st.nextT... | [
"public",
"static",
"Locale",
"converterTagLocaleFromString",
"(",
"String",
"name",
")",
"{",
"try",
"{",
"Locale",
"locale",
";",
"StringTokenizer",
"st",
"=",
"new",
"StringTokenizer",
"(",
"name",
",",
"\"_\"",
")",
";",
"String",
"language",
"=",
"st",
... | Convert locale string used by converter tags to locale.
@param name name of the locale
@return locale specified by the given String
@see org.apache.myfaces.taglib.core.ConvertDateTimeTag#setConverterLocale
@see org.apache.myfaces.taglib.core.ConvertNumberTag#setConverterLocale | [
"Convert",
"locale",
"string",
"used",
"by",
"converter",
"tags",
"to",
"locale",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/LocaleUtils.java#L109-L144 |
reactor/reactor-netty | src/main/java/reactor/netty/tcp/SslProvider.java | SslProvider.setBootstrap | public static Bootstrap setBootstrap(Bootstrap b, SslProvider sslProvider) {
"""
Add Ssl support on the given client bootstrap
@param b a given bootstrap to enrich
@return an enriched bootstrap
"""
BootstrapHandlers.updateConfiguration(b,
NettyPipeline.SslHandler,
new DeferredSslSupport(sslProvid... | java | public static Bootstrap setBootstrap(Bootstrap b, SslProvider sslProvider) {
BootstrapHandlers.updateConfiguration(b,
NettyPipeline.SslHandler,
new DeferredSslSupport(sslProvider));
return b;
} | [
"public",
"static",
"Bootstrap",
"setBootstrap",
"(",
"Bootstrap",
"b",
",",
"SslProvider",
"sslProvider",
")",
"{",
"BootstrapHandlers",
".",
"updateConfiguration",
"(",
"b",
",",
"NettyPipeline",
".",
"SslHandler",
",",
"new",
"DeferredSslSupport",
"(",
"sslProvid... | Add Ssl support on the given client bootstrap
@param b a given bootstrap to enrich
@return an enriched bootstrap | [
"Add",
"Ssl",
"support",
"on",
"the",
"given",
"client",
"bootstrap",
"@param",
"b",
"a",
"given",
"bootstrap",
"to",
"enrich"
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/tcp/SslProvider.java#L104-L110 |
recommenders/rival | rival-evaluate/src/main/java/net/recommenders/rival/evaluation/metric/ranking/NDCG.java | NDCG.getValueAt | @Override
public double getValueAt(final U user, final int at) {
"""
Method to return the NDCG value at a particular cutoff level for a given
user.
@param user the user
@param at cutoff level
@return the NDCG corresponding to the requested user at the cutoff level
"""
if (userDcgAtCutoff.cont... | java | @Override
public double getValueAt(final U user, final int at) {
if (userDcgAtCutoff.containsKey(at) && userDcgAtCutoff.get(at).containsKey(user)
&& userIdcgAtCutoff.containsKey(at) && userIdcgAtCutoff.get(at).containsKey(user)) {
double idcg = userIdcgAtCutoff.get(at).get(user);... | [
"@",
"Override",
"public",
"double",
"getValueAt",
"(",
"final",
"U",
"user",
",",
"final",
"int",
"at",
")",
"{",
"if",
"(",
"userDcgAtCutoff",
".",
"containsKey",
"(",
"at",
")",
"&&",
"userDcgAtCutoff",
".",
"get",
"(",
"at",
")",
".",
"containsKey",
... | Method to return the NDCG value at a particular cutoff level for a given
user.
@param user the user
@param at cutoff level
@return the NDCG corresponding to the requested user at the cutoff level | [
"Method",
"to",
"return",
"the",
"NDCG",
"value",
"at",
"a",
"particular",
"cutoff",
"level",
"for",
"a",
"given",
"user",
"."
] | train | https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-evaluate/src/main/java/net/recommenders/rival/evaluation/metric/ranking/NDCG.java#L280-L289 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java | SARLQuickfixProvider.fixUnusedAgentCapacity | @Fix(io.sarl.lang.validation.IssueCodes.UNUSED_AGENT_CAPACITY)
public void fixUnusedAgentCapacity(final Issue issue, IssueResolutionAcceptor acceptor) {
"""
Quick fix for "Unused agent capacity".
@param issue the issue.
@param acceptor the quick fix acceptor.
"""
CapacityReferenceRemoveModification.acce... | java | @Fix(io.sarl.lang.validation.IssueCodes.UNUSED_AGENT_CAPACITY)
public void fixUnusedAgentCapacity(final Issue issue, IssueResolutionAcceptor acceptor) {
CapacityReferenceRemoveModification.accept(this, issue, acceptor);
} | [
"@",
"Fix",
"(",
"io",
".",
"sarl",
".",
"lang",
".",
"validation",
".",
"IssueCodes",
".",
"UNUSED_AGENT_CAPACITY",
")",
"public",
"void",
"fixUnusedAgentCapacity",
"(",
"final",
"Issue",
"issue",
",",
"IssueResolutionAcceptor",
"acceptor",
")",
"{",
"CapacityR... | Quick fix for "Unused agent capacity".
@param issue the issue.
@param acceptor the quick fix acceptor. | [
"Quick",
"fix",
"for",
"Unused",
"agent",
"capacity",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L886-L889 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/util/TrustEverythingSSLTrustManager.java | TrustEverythingSSLTrustManager.trustAllSSLCertificates | public static void trustAllSSLCertificates(HttpsURLConnection connection) {
"""
Configures a single HttpsURLConnection to trust all SSL certificates.
@param connection an HttpsURLConnection which will be configured to trust all certs
"""
getTrustingSSLSocketFactory();
connection.setSSLSocket... | java | public static void trustAllSSLCertificates(HttpsURLConnection connection) {
getTrustingSSLSocketFactory();
connection.setSSLSocketFactory(socketFactory);
connection.setHostnameVerifier(new HostnameVerifier() {
public boolean verify(String s, SSLSession sslSession) {
r... | [
"public",
"static",
"void",
"trustAllSSLCertificates",
"(",
"HttpsURLConnection",
"connection",
")",
"{",
"getTrustingSSLSocketFactory",
"(",
")",
";",
"connection",
".",
"setSSLSocketFactory",
"(",
"socketFactory",
")",
";",
"connection",
".",
"setHostnameVerifier",
"(... | Configures a single HttpsURLConnection to trust all SSL certificates.
@param connection an HttpsURLConnection which will be configured to trust all certs | [
"Configures",
"a",
"single",
"HttpsURLConnection",
"to",
"trust",
"all",
"SSL",
"certificates",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/util/TrustEverythingSSLTrustManager.java#L58-L66 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WMessages.java | WMessages.addMessage | public void addMessage(final Message message, final boolean encodeText) {
"""
Adds a message.
<p>
When setting <code>encodeText</code> to <code>false</code>, it then becomes the responsibility of the application
to ensure that the text does not contain any characters which need to be escaped.
</p>
<p>
<b>WAR... | java | public void addMessage(final Message message, final boolean encodeText) {
switch (message.getType()) {
case Message.SUCCESS_MESSAGE:
addMessage(successMessages, message, encodeText);
break;
case Message.INFO_MESSAGE:
addMessage(infoMessages, message, encodeText);
break;
case Message.WARNING... | [
"public",
"void",
"addMessage",
"(",
"final",
"Message",
"message",
",",
"final",
"boolean",
"encodeText",
")",
"{",
"switch",
"(",
"message",
".",
"getType",
"(",
")",
")",
"{",
"case",
"Message",
".",
"SUCCESS_MESSAGE",
":",
"addMessage",
"(",
"successMess... | Adds a message.
<p>
When setting <code>encodeText</code> to <code>false</code>, it then becomes the responsibility of the application
to ensure that the text does not contain any characters which need to be escaped.
</p>
<p>
<b>WARNING:</b> If you are using WMessageBox to display "user entered" or untrusted data, use o... | [
"Adds",
"a",
"message",
".",
"<p",
">",
"When",
"setting",
"<code",
">",
"encodeText<",
"/",
"code",
">",
"to",
"<code",
">",
"false<",
"/",
"code",
">",
"it",
"then",
"becomes",
"the",
"responsibility",
"of",
"the",
"application",
"to",
"ensure",
"that"... | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WMessages.java#L136-L157 |
tianjing/tgtools.web.develop | src/main/java/tgtools/web/develop/util/ValidHelper.java | ValidHelper.validDate | public static void validDate(Long pContent, String pParamName) throws APPErrorException {
"""
验证日期格式 不能为空和必须正值最小值
@param pContent 文本
@param pParamName 参数名称
@throws APPErrorException
"""
if(null==pContent||pContent.longValue()<minDate)
{
throw new APPErrorException(pParamName + " ... | java | public static void validDate(Long pContent, String pParamName) throws APPErrorException {
if(null==pContent||pContent.longValue()<minDate)
{
throw new APPErrorException(pParamName + " 错误的时间值");
}
} | [
"public",
"static",
"void",
"validDate",
"(",
"Long",
"pContent",
",",
"String",
"pParamName",
")",
"throws",
"APPErrorException",
"{",
"if",
"(",
"null",
"==",
"pContent",
"||",
"pContent",
".",
"longValue",
"(",
")",
"<",
"minDate",
")",
"{",
"throw",
"n... | 验证日期格式 不能为空和必须正值最小值
@param pContent 文本
@param pParamName 参数名称
@throws APPErrorException | [
"验证日期格式",
"不能为空和必须正值最小值"
] | train | https://github.com/tianjing/tgtools.web.develop/blob/a18567f3ccf877249f2e33028d1e7c479900e4eb/src/main/java/tgtools/web/develop/util/ValidHelper.java#L48-L53 |
rundeck/rundeck | core/src/main/java/com/dtolabs/shared/resources/ResourceXMLGenerator.java | ResourceXMLGenerator.genEntityCommon | private Element genEntityCommon(final Element root, final ResourceXMLParser.Entity entity) {
"""
Create entity tag based on resourceType of entity, and add common attributes
@param root element
@param entity entity
@return element
"""
final Element tag = root.addElement(entity.getResourceType())... | java | private Element genEntityCommon(final Element root, final ResourceXMLParser.Entity entity) {
final Element tag = root.addElement(entity.getResourceType());
tag.addAttribute(COMMON_NAME, entity.getName());
tag.addAttribute(COMMON_DESCRIPTION, notNull(entity.getProperty(COMMON_DESCRIPTION)));
... | [
"private",
"Element",
"genEntityCommon",
"(",
"final",
"Element",
"root",
",",
"final",
"ResourceXMLParser",
".",
"Entity",
"entity",
")",
"{",
"final",
"Element",
"tag",
"=",
"root",
".",
"addElement",
"(",
"entity",
".",
"getResourceType",
"(",
")",
")",
"... | Create entity tag based on resourceType of entity, and add common attributes
@param root element
@param entity entity
@return element | [
"Create",
"entity",
"tag",
"based",
"on",
"resourceType",
"of",
"entity",
"and",
"add",
"common",
"attributes"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/shared/resources/ResourceXMLGenerator.java#L271-L277 |
protostuff/protostuff | protostuff-xml/src/main/java/io/protostuff/XmlIOUtil.java | XmlIOUtil.mergeFrom | public static <T> void mergeFrom(XMLStreamReader parser, T message, Schema<T> schema)
throws IOException, XMLStreamException, XmlInputException {
"""
Merges the {@code message} from the {@link XMLStreamReader} using the given {@code schema}.
"""
// final String simpleName = schema.message... | java | public static <T> void mergeFrom(XMLStreamReader parser, T message, Schema<T> schema)
throws IOException, XMLStreamException, XmlInputException
{
// final String simpleName = schema.messageName();
if (parser.nextTag() != START_ELEMENT ||
!schema.messageName().equal... | [
"public",
"static",
"<",
"T",
">",
"void",
"mergeFrom",
"(",
"XMLStreamReader",
"parser",
",",
"T",
"message",
",",
"Schema",
"<",
"T",
">",
"schema",
")",
"throws",
"IOException",
",",
"XMLStreamException",
",",
"XmlInputException",
"{",
"// final String simple... | Merges the {@code message} from the {@link XMLStreamReader} using the given {@code schema}. | [
"Merges",
"the",
"{"
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-xml/src/main/java/io/protostuff/XmlIOUtil.java#L297-L321 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/TransparentDataEncryptionActivitiesInner.java | TransparentDataEncryptionActivitiesInner.listByConfigurationAsync | public Observable<List<TransparentDataEncryptionActivityInner>> listByConfigurationAsync(String resourceGroupName, String serverName, String databaseName) {
"""
Returns a database's transparent data encryption operation result.
@param resourceGroupName The name of the resource group that contains the resource. ... | java | public Observable<List<TransparentDataEncryptionActivityInner>> listByConfigurationAsync(String resourceGroupName, String serverName, String databaseName) {
return listByConfigurationWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<List<TransparentDataEncryptio... | [
"public",
"Observable",
"<",
"List",
"<",
"TransparentDataEncryptionActivityInner",
">",
">",
"listByConfigurationAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
")",
"{",
"return",
"listByConfigurationWithServiceRespo... | Returns a database's transparent data encryption operation result.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database for ... | [
"Returns",
"a",
"database",
"s",
"transparent",
"data",
"encryption",
"operation",
"result",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/TransparentDataEncryptionActivitiesInner.java#L99-L106 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/webcontext/ControlBeanContextSupport.java | ControlBeanContextSupport.getResourceAsStream | public InputStream getResourceAsStream(String name, BeanContextChild bcc) throws IllegalArgumentException {
"""
Analagous to <code>java.lang.ClassLoader.getResourceAsStream()</code>,
this method allows a <code>BeanContext</code> implementation
to interpose behavior between the child <code>Component</code>
and u... | java | public InputStream getResourceAsStream(String name, BeanContextChild bcc) throws IllegalArgumentException {
// bcc must be a child of this context
if (!contains(bcc)) {
throw new IllegalArgumentException("Child is not a member of this context");
}
ClassLoader cl = bcc.getCl... | [
"public",
"InputStream",
"getResourceAsStream",
"(",
"String",
"name",
",",
"BeanContextChild",
"bcc",
")",
"throws",
"IllegalArgumentException",
"{",
"// bcc must be a child of this context",
"if",
"(",
"!",
"contains",
"(",
"bcc",
")",
")",
"{",
"throw",
"new",
"I... | Analagous to <code>java.lang.ClassLoader.getResourceAsStream()</code>,
this method allows a <code>BeanContext</code> implementation
to interpose behavior between the child <code>Component</code>
and underlying <code>ClassLoader</code>.
@param name the resource name
@param bcc the specified child
@return an <code>Inpu... | [
"Analagous",
"to",
"<code",
">",
"java",
".",
"lang",
".",
"ClassLoader",
".",
"getResourceAsStream",
"()",
"<",
"/",
"code",
">",
"this",
"method",
"allows",
"a",
"<code",
">",
"BeanContext<",
"/",
"code",
">",
"implementation",
"to",
"interpose",
"behavior... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/webcontext/ControlBeanContextSupport.java#L118-L131 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.Canberra | public static double Canberra(double[] p, double[] q) {
"""
Gets the Canberra distance between two points.
@param p A point in space.
@param q A point in space.
@return The Canberra distance between x and y.
"""
double distance = 0;
for (int i = 0; i < p.length; i++) {
distanc... | java | public static double Canberra(double[] p, double[] q) {
double distance = 0;
for (int i = 0; i < p.length; i++) {
distance += Math.abs(p[i] - q[i]) / (Math.abs(p[i]) + Math.abs(q[i]));
}
return distance;
} | [
"public",
"static",
"double",
"Canberra",
"(",
"double",
"[",
"]",
"p",
",",
"double",
"[",
"]",
"q",
")",
"{",
"double",
"distance",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"p",
".",
"length",
";",
"i",
"++",
")",
"{"... | Gets the Canberra distance between two points.
@param p A point in space.
@param q A point in space.
@return The Canberra distance between x and y. | [
"Gets",
"the",
"Canberra",
"distance",
"between",
"two",
"points",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L132-L140 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java | SparseCpuLevel1.daxpyi | @Override
protected void daxpyi(long N, double alpha, INDArray X, DataBuffer pointers, INDArray Y) {
"""
Adds a scalar multiple of double compressed sparse vector to a full-storage vector.
@param N The number of elements in vector X
@param alpha
@param X a sparse vector
@param pointers A DataBuffer that ... | java | @Override
protected void daxpyi(long N, double alpha, INDArray X, DataBuffer pointers, INDArray Y){
cblas_daxpyi((int) N, alpha, (DoublePointer) X.data().addressPointer(), (IntPointer) pointers.addressPointer(),
(DoublePointer) Y.data().addressPointer());
} | [
"@",
"Override",
"protected",
"void",
"daxpyi",
"(",
"long",
"N",
",",
"double",
"alpha",
",",
"INDArray",
"X",
",",
"DataBuffer",
"pointers",
",",
"INDArray",
"Y",
")",
"{",
"cblas_daxpyi",
"(",
"(",
"int",
")",
"N",
",",
"alpha",
",",
"(",
"DoublePoi... | Adds a scalar multiple of double compressed sparse vector to a full-storage vector.
@param N The number of elements in vector X
@param alpha
@param X a sparse vector
@param pointers A DataBuffer that specifies the indices for the elements of x.
@param Y a dense vector | [
"Adds",
"a",
"scalar",
"multiple",
"of",
"double",
"compressed",
"sparse",
"vector",
"to",
"a",
"full",
"-",
"storage",
"vector",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java#L195-L199 |
greese/dasein-util | src/main/java/org/dasein/util/ConcurrentMultiCache.java | ConcurrentMultiCache.find | public T find(String key, Object val, CacheLoader<T> loader, Object ... args) {
"""
Seeks the item from the cache that is identified by the specified key having
the specified value. If no match is found, the specified loader will be called
with the specified arguments in order to place an instantiated item into ... | java | public T find(String key, Object val, CacheLoader<T> loader, Object ... args) {
ConcurrentCache<Object,T> cache = caches.get(key);
T item;
if( val instanceof BigDecimal ) {
val = ((BigDecimal)val).longValue();
}
item = cache.get(val);
if( item == null && loa... | [
"public",
"T",
"find",
"(",
"String",
"key",
",",
"Object",
"val",
",",
"CacheLoader",
"<",
"T",
">",
"loader",
",",
"Object",
"...",
"args",
")",
"{",
"ConcurrentCache",
"<",
"Object",
",",
"T",
">",
"cache",
"=",
"caches",
".",
"get",
"(",
"key",
... | Seeks the item from the cache that is identified by the specified key having
the specified value. If no match is found, the specified loader will be called
with the specified arguments in order to place an instantiated item into the cache.
@param key the name of the unique identifier attribute whose value you have
@par... | [
"Seeks",
"the",
"item",
"from",
"the",
"cache",
"that",
"is",
"identified",
"by",
"the",
"specified",
"key",
"having",
"the",
"specified",
"value",
".",
"If",
"no",
"match",
"is",
"found",
"the",
"specified",
"loader",
"will",
"be",
"called",
"with",
"the"... | train | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/util/ConcurrentMultiCache.java#L256-L275 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionAddressId.java | RegionAddressId.of | public static RegionAddressId of(String region, String address) {
"""
Returns a region address identity given the region and address names. The address name must be
1-63 characters long and comply with RFC1035. Specifically, the name must match the regular
expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which mean... | java | public static RegionAddressId of(String region, String address) {
return new RegionAddressId(null, region, address);
} | [
"public",
"static",
"RegionAddressId",
"of",
"(",
"String",
"region",
",",
"String",
"address",
")",
"{",
"return",
"new",
"RegionAddressId",
"(",
"null",
",",
"region",
",",
"address",
")",
";",
"}"
] | Returns a region address identity given the region and address names. The address name must be
1-63 characters long and comply with RFC1035. Specifically, the name must match the regular
expression {@code [a-z]([-a-z0-9]*[a-z0-9])?} which means the first character must be a
lowercase letter, and all following character... | [
"Returns",
"a",
"region",
"address",
"identity",
"given",
"the",
"region",
"and",
"address",
"names",
".",
"The",
"address",
"name",
"must",
"be",
"1",
"-",
"63",
"characters",
"long",
"and",
"comply",
"with",
"RFC1035",
".",
"Specifically",
"the",
"name",
... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/RegionAddressId.java#L112-L114 |
davidmarquis/fluent-interface-proxy | src/main/java/com/fluentinterface/beans/ObjectWrapper.java | ObjectWrapper.getMappedValue | public Object getMappedValue(Property property, Object key) {
"""
Returns the value of the specified mapped property from the wrapped object.
@param property the mapped property whose value is to be extracted, cannot be {@code null}
@param key the key of the property value to be extracted, can be {@code n... | java | public Object getMappedValue(Property property, Object key) {
return getMappedValue(object, property, key);
} | [
"public",
"Object",
"getMappedValue",
"(",
"Property",
"property",
",",
"Object",
"key",
")",
"{",
"return",
"getMappedValue",
"(",
"object",
",",
"property",
",",
"key",
")",
";",
"}"
] | Returns the value of the specified mapped property from the wrapped object.
@param property the mapped property whose value is to be extracted, cannot be {@code null}
@param key the key of the property value to be extracted, can be {@code null}
@return the mapped property value
@throws ReflectionException if... | [
"Returns",
"the",
"value",
"of",
"the",
"specified",
"mapped",
"property",
"from",
"the",
"wrapped",
"object",
"."
] | train | https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/beans/ObjectWrapper.java#L284-L286 |
ops4j/org.ops4j.pax.logging | pax-logging-service/src/main/java/org/ops4j/pax/logging/service/internal/PaxLoggingServiceImpl.java | PaxLoggingServiceImpl.setJULLevel | private static void setJULLevel( java.util.logging.Logger logger, String log4jLevelConfig ) {
"""
Set the log level to the specified JUL logger.
@param logger The logger to configure
@param log4jLevelConfig The value contained in the property file. (For example: "ERROR, file")
"""
String crumb[] = log4... | java | private static void setJULLevel( java.util.logging.Logger logger, String log4jLevelConfig )
{
String crumb[] = log4jLevelConfig.split( "," );
if (crumb.length > 0)
{
Level level = log4jLevelToJULLevel( crumb[0].trim() );
logger.setLevel( level );
}
} | [
"private",
"static",
"void",
"setJULLevel",
"(",
"java",
".",
"util",
".",
"logging",
".",
"Logger",
"logger",
",",
"String",
"log4jLevelConfig",
")",
"{",
"String",
"crumb",
"[",
"]",
"=",
"log4jLevelConfig",
".",
"split",
"(",
"\",\"",
")",
";",
"if",
... | Set the log level to the specified JUL logger.
@param logger The logger to configure
@param log4jLevelConfig The value contained in the property file. (For example: "ERROR, file") | [
"Set",
"the",
"log",
"level",
"to",
"the",
"specified",
"JUL",
"logger",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/ops4j/pax/logging/service/internal/PaxLoggingServiceImpl.java#L483-L491 |
OpenBEL/openbel-framework | org.openbel.framework.core/src/main/java/org/openbel/framework/core/protonetwork/ProtoNetworkBuilder.java | ProtoNetworkBuilder.buildProtoNetwork | public int buildProtoNetwork(final ProtoNetwork pn, final Term term) {
"""
Builds the {@link ProtoNetwork} at the {@link Term} level. The found
parameters are handled via
{@link #handleParameter(ProtoNetwork, Parameter)} and indexed against the
term.
@param pn {@link ProtoNetwork}, the proto network
@param ... | java | public int buildProtoNetwork(final ProtoNetwork pn, final Term term) {
int ti = pn.getTermTable().addTerm(term);
List<Integer> pvals = new ArrayList<Integer>();
List<Parameter> ps = term.getAllParametersLeftToRight();
for (Parameter p : ps) {
pvals.add(handleParameter(pn, p... | [
"public",
"int",
"buildProtoNetwork",
"(",
"final",
"ProtoNetwork",
"pn",
",",
"final",
"Term",
"term",
")",
"{",
"int",
"ti",
"=",
"pn",
".",
"getTermTable",
"(",
")",
".",
"addTerm",
"(",
"term",
")",
";",
"List",
"<",
"Integer",
">",
"pvals",
"=",
... | Builds the {@link ProtoNetwork} at the {@link Term} level. The found
parameters are handled via
{@link #handleParameter(ProtoNetwork, Parameter)} and indexed against the
term.
@param pn {@link ProtoNetwork}, the proto network
@param term {@link Term}, the term to evaluate
@return {@code int}, the term index in the {@l... | [
"Builds",
"the",
"{",
"@link",
"ProtoNetwork",
"}",
"at",
"the",
"{",
"@link",
"Term",
"}",
"level",
".",
"The",
"found",
"parameters",
"are",
"handled",
"via",
"{",
"@link",
"#handleParameter",
"(",
"ProtoNetwork",
"Parameter",
")",
"}",
"and",
"indexed",
... | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/protonetwork/ProtoNetworkBuilder.java#L308-L324 |
OpenLiberty/open-liberty | dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/component/_ComponentUtils.java | _ComponentUtils.idsAreEqual | private static boolean idsAreEqual(String id, UIComponent cmp) {
"""
/*
Return true if the specified component matches the provided id. This needs some quirks to handle components whose
id value gets dynamically "tweaked", eg a UIData component whose id gets the current row index appended to it.
"""
... | java | private static boolean idsAreEqual(String id, UIComponent cmp)
{
if (id.equals(cmp.getId()))
{
return true;
}
return false;
} | [
"private",
"static",
"boolean",
"idsAreEqual",
"(",
"String",
"id",
",",
"UIComponent",
"cmp",
")",
"{",
"if",
"(",
"id",
".",
"equals",
"(",
"cmp",
".",
"getId",
"(",
")",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}"
] | /*
Return true if the specified component matches the provided id. This needs some quirks to handle components whose
id value gets dynamically "tweaked", eg a UIData component whose id gets the current row index appended to it. | [
"/",
"*",
"Return",
"true",
"if",
"the",
"specified",
"component",
"matches",
"the",
"provided",
"id",
".",
"This",
"needs",
"some",
"quirks",
"to",
"handle",
"components",
"whose",
"id",
"value",
"gets",
"dynamically",
"tweaked",
"eg",
"a",
"UIData",
"compo... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/component/_ComponentUtils.java#L258-L266 |
j256/simplecsv | src/main/java/com/j256/simplecsv/processor/CsvProcessor.java | CsvProcessor.registerConverter | public <FT> void registerConverter(Class<FT> clazz, Converter<FT, ?> converter) {
"""
Register a converter class for all instances of the class argument. The converter can also be specified with the
{@link CsvColumn#converterClass()} annotation field.
"""
converterMap.put(clazz, converter);
} | java | public <FT> void registerConverter(Class<FT> clazz, Converter<FT, ?> converter) {
converterMap.put(clazz, converter);
} | [
"public",
"<",
"FT",
">",
"void",
"registerConverter",
"(",
"Class",
"<",
"FT",
">",
"clazz",
",",
"Converter",
"<",
"FT",
",",
"?",
">",
"converter",
")",
"{",
"converterMap",
".",
"put",
"(",
"clazz",
",",
"converter",
")",
";",
"}"
] | Register a converter class for all instances of the class argument. The converter can also be specified with the
{@link CsvColumn#converterClass()} annotation field. | [
"Register",
"a",
"converter",
"class",
"for",
"all",
"instances",
"of",
"the",
"class",
"argument",
".",
"The",
"converter",
"can",
"also",
"be",
"specified",
"with",
"the",
"{"
] | train | https://github.com/j256/simplecsv/blob/964fe53073c43e2a311341e3f8fd2c94372f60cb/src/main/java/com/j256/simplecsv/processor/CsvProcessor.java#L117-L119 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/LocationUrl.java | LocationUrl.getLocationsInUsageTypeUrl | public static MozuUrl getLocationsInUsageTypeUrl(String filter, Boolean includeAttributeDefinition, String locationUsageType, Integer pageSize, String responseFields, String sortBy, Integer startIndex) {
"""
Get Resource Url for GetLocationsInUsageType
@param filter A set of filter expressions representing the se... | java | public static MozuUrl getLocationsInUsageTypeUrl(String filter, Boolean includeAttributeDefinition, String locationUsageType, Integer pageSize, String responseFields, String sortBy, Integer startIndex)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/storefront/locationUsageTypes/{locationUsageType}/loca... | [
"public",
"static",
"MozuUrl",
"getLocationsInUsageTypeUrl",
"(",
"String",
"filter",
",",
"Boolean",
"includeAttributeDefinition",
",",
"String",
"locationUsageType",
",",
"Integer",
"pageSize",
",",
"String",
"responseFields",
",",
"String",
"sortBy",
",",
"Integer",
... | Get Resource Url for GetLocationsInUsageType
@param filter A set of filter expressions representing the search parameters for a query. This parameter is optional. Refer to [Sorting and Filtering](../../../../Developer/api-guides/sorting-filtering.htm) for a list of supported filters.
@param includeAttributeDefinition T... | [
"Get",
"Resource",
"Url",
"for",
"GetLocationsInUsageType"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/LocationUrl.java#L43-L54 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java | DefaultFeatureForm.getValue | @Api
public void getValue(String name, UrlAttribute attribute) {
"""
Get an URL value from the form, and place it in <code>attribute</code>.
@param name attribute name
@param attribute attribute to put value
@since 1.11.1
"""
attribute.setValue((String) formWidget.getItem(name).getValue());
} | java | @Api
public void getValue(String name, UrlAttribute attribute) {
attribute.setValue((String) formWidget.getItem(name).getValue());
} | [
"@",
"Api",
"public",
"void",
"getValue",
"(",
"String",
"name",
",",
"UrlAttribute",
"attribute",
")",
"{",
"attribute",
".",
"setValue",
"(",
"(",
"String",
")",
"formWidget",
".",
"getItem",
"(",
"name",
")",
".",
"getValue",
"(",
")",
")",
";",
"}"... | Get an URL value from the form, and place it in <code>attribute</code>.
@param name attribute name
@param attribute attribute to put value
@since 1.11.1 | [
"Get",
"an",
"URL",
"value",
"from",
"the",
"form",
"and",
"place",
"it",
"in",
"<code",
">",
"attribute<",
"/",
"code",
">",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultFeatureForm.java#L740-L743 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/utils/FBUtilities.java | FBUtilities.getProtectedField | public static Field getProtectedField(Class klass, String fieldName) {
"""
Used to get access to protected/private field of the specified class
@param klass - name of the class
@param fieldName - name of the field
@return Field or null on error
"""
Field field;
try
{
fie... | java | public static Field getProtectedField(Class klass, String fieldName)
{
Field field;
try
{
field = klass.getDeclaredField(fieldName);
field.setAccessible(true);
}
catch (Exception e)
{
throw new AssertionError(e);
}
... | [
"public",
"static",
"Field",
"getProtectedField",
"(",
"Class",
"klass",
",",
"String",
"fieldName",
")",
"{",
"Field",
"field",
";",
"try",
"{",
"field",
"=",
"klass",
".",
"getDeclaredField",
"(",
"fieldName",
")",
";",
"field",
".",
"setAccessible",
"(",
... | Used to get access to protected/private field of the specified class
@param klass - name of the class
@param fieldName - name of the field
@return Field or null on error | [
"Used",
"to",
"get",
"access",
"to",
"protected",
"/",
"private",
"field",
"of",
"the",
"specified",
"class"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/FBUtilities.java#L515-L530 |
biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java | Alignments.getPairwiseScorer | static <S extends Sequence<C>, C extends Compound> PairwiseSequenceScorer<S, C> getPairwiseScorer(
S query, S target, PairwiseSequenceScorerType type, GapPenalty gapPenalty,
SubstitutionMatrix<C> subMatrix) {
"""
Factory method which constructs a pairwise sequence scorer.
@param <S> each {@link Sequence} ... | java | static <S extends Sequence<C>, C extends Compound> PairwiseSequenceScorer<S, C> getPairwiseScorer(
S query, S target, PairwiseSequenceScorerType type, GapPenalty gapPenalty,
SubstitutionMatrix<C> subMatrix) {
switch (type) {
default:
case GLOBAL:
return getPairwiseAligner(query, target, PairwiseSequenceA... | [
"static",
"<",
"S",
"extends",
"Sequence",
"<",
"C",
">",
",",
"C",
"extends",
"Compound",
">",
"PairwiseSequenceScorer",
"<",
"S",
",",
"C",
">",
"getPairwiseScorer",
"(",
"S",
"query",
",",
"S",
"target",
",",
"PairwiseSequenceScorerType",
"type",
",",
"... | Factory method which constructs a pairwise sequence scorer.
@param <S> each {@link Sequence} of a pair is of type S
@param <C> each element of a {@link Sequence} is a {@link Compound} of type C
@param query the first {@link Sequence} to score
@param target the second {@link Sequence} to score
@param type chosen type f... | [
"Factory",
"method",
"which",
"constructs",
"a",
"pairwise",
"sequence",
"scorer",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java#L369-L396 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.partialUpdateObject | public JSONObject partialUpdateObject(JSONObject partialObject, String objectID) throws AlgoliaException {
"""
Update partially an object (only update attributes passed in argument), create the object if it does not exist
@param partialObject the object to override
"""
return partialUpdateObject(partial... | java | public JSONObject partialUpdateObject(JSONObject partialObject, String objectID) throws AlgoliaException {
return partialUpdateObject(partialObject, objectID, true, RequestOptions.empty);
} | [
"public",
"JSONObject",
"partialUpdateObject",
"(",
"JSONObject",
"partialObject",
",",
"String",
"objectID",
")",
"throws",
"AlgoliaException",
"{",
"return",
"partialUpdateObject",
"(",
"partialObject",
",",
"objectID",
",",
"true",
",",
"RequestOptions",
".",
"empt... | Update partially an object (only update attributes passed in argument), create the object if it does not exist
@param partialObject the object to override | [
"Update",
"partially",
"an",
"object",
"(",
"only",
"update",
"attributes",
"passed",
"in",
"argument",
")",
"create",
"the",
"object",
"if",
"it",
"does",
"not",
"exist"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L356-L358 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/util/SortHandler.java | SortHandler.compareEntitysWithRespectToProperties | public int compareEntitysWithRespectToProperties(Entity entity1, Entity entity2) {
"""
Compares the two entity data objects.
@param member1 the first member object to be compared
@param member2 the second member object to be compared
@return a negative integer, zero, or a positive integer as the first member ... | java | public int compareEntitysWithRespectToProperties(Entity entity1, Entity entity2) {
List<SortKeyType> sortKeys = sortControl.getSortKeys();
int temp = 0;
for (int i = 0; i < sortKeys.size() && temp == 0; i++) {
SortKeyType sortKey = (SortKeyType) sortKeys.get(i);
String p... | [
"public",
"int",
"compareEntitysWithRespectToProperties",
"(",
"Entity",
"entity1",
",",
"Entity",
"entity2",
")",
"{",
"List",
"<",
"SortKeyType",
">",
"sortKeys",
"=",
"sortControl",
".",
"getSortKeys",
"(",
")",
";",
"int",
"temp",
"=",
"0",
";",
"for",
"... | Compares the two entity data objects.
@param member1 the first member object to be compared
@param member2 the second member object to be compared
@return a negative integer, zero, or a positive integer as the first member object is less than,
equal to, or greater than the second. | [
"Compares",
"the",
"two",
"entity",
"data",
"objects",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/util/SortHandler.java#L59-L75 |
mailin-api/sendinblue-java-mvn | src/main/java/com/sendinblue/Sendinblue.java | Sendinblue.delete_users_list | public String delete_users_list(Map<String, Object> data) {
"""
/*
Delete already existing users in the SendinBlue contacts from the list.
@param {Object} data contains json objects as a key value pair from HashMap.
@options data {Integer} id: Id of list to unlink users from it [Mandatory]
@options data {Array... | java | public String delete_users_list(Map<String, Object> data) {
String id = data.get("id").toString();
Gson gson = new Gson();
String json = gson.toJson(data);
return delete("list/" + id + "/delusers", json);
} | [
"public",
"String",
"delete_users_list",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
")",
"{",
"String",
"id",
"=",
"data",
".",
"get",
"(",
"\"id\"",
")",
".",
"toString",
"(",
")",
";",
"Gson",
"gson",
"=",
"new",
"Gson",
"(",
")",
";"... | /*
Delete already existing users in the SendinBlue contacts from the list.
@param {Object} data contains json objects as a key value pair from HashMap.
@options data {Integer} id: Id of list to unlink users from it [Mandatory]
@options data {Array} users: Email address of the already existing user(s) in the SendinBlue ... | [
"/",
"*",
"Delete",
"already",
"existing",
"users",
"in",
"the",
"SendinBlue",
"contacts",
"from",
"the",
"list",
"."
] | train | https://github.com/mailin-api/sendinblue-java-mvn/blob/3a186b004003450f18d619aa084adc8d75086183/src/main/java/com/sendinblue/Sendinblue.java#L666-L671 |
pressgang-ccms/PressGangCCMSCommonUtilities | src/main/java/org/jboss/pressgang/ccms/utils/common/DateUtils.java | DateUtils.parseDateStrictly | public static Date parseDateStrictly(String str, String... parsePatterns) throws ParseException {
"""
<p>Parses a string representing a date by trying a variety of different parsers.</p>
<p/>
<p>The parse will try each parse pattern in turn.
A parse is only deemed successful if it parses the whole of the input ... | java | public static Date parseDateStrictly(String str, String... parsePatterns) throws ParseException {
return parseDateWithLeniency(str, null, parsePatterns, false);
} | [
"public",
"static",
"Date",
"parseDateStrictly",
"(",
"String",
"str",
",",
"String",
"...",
"parsePatterns",
")",
"throws",
"ParseException",
"{",
"return",
"parseDateWithLeniency",
"(",
"str",
",",
"null",
",",
"parsePatterns",
",",
"false",
")",
";",
"}"
] | <p>Parses a string representing a date by trying a variety of different parsers.</p>
<p/>
<p>The parse will try each parse pattern in turn.
A parse is only deemed successful if it parses the whole of the input string.
If no parse patterns match, a ParseException is thrown.</p>
The parser parses strictly - it does not a... | [
"<p",
">",
"Parses",
"a",
"string",
"representing",
"a",
"date",
"by",
"trying",
"a",
"variety",
"of",
"different",
"parsers",
".",
"<",
"/",
"p",
">",
"<p",
"/",
">",
"<p",
">",
"The",
"parse",
"will",
"try",
"each",
"parse",
"pattern",
"in",
"turn"... | train | https://github.com/pressgang-ccms/PressGangCCMSCommonUtilities/blob/5ebf5ed30a94c34c33f4708caa04a8da99cbb15c/src/main/java/org/jboss/pressgang/ccms/utils/common/DateUtils.java#L94-L96 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java | CommonOps_DDF2.addEquals | public static void addEquals( DMatrix2 a , DMatrix2 b ) {
"""
<p>Performs the following operation:<br>
<br>
a = a + b <br>
a<sub>i</sub> = a<sub>i</sub> + b<sub>i</sub> <br>
</p>
@param a A Vector. Modified.
@param b A Vector. Not modified.
"""
a.a1 += b.a1;
a.a2 += b.a2;
} | java | public static void addEquals( DMatrix2 a , DMatrix2 b ) {
a.a1 += b.a1;
a.a2 += b.a2;
} | [
"public",
"static",
"void",
"addEquals",
"(",
"DMatrix2",
"a",
",",
"DMatrix2",
"b",
")",
"{",
"a",
".",
"a1",
"+=",
"b",
".",
"a1",
";",
"a",
".",
"a2",
"+=",
"b",
".",
"a2",
";",
"}"
] | <p>Performs the following operation:<br>
<br>
a = a + b <br>
a<sub>i</sub> = a<sub>i</sub> + b<sub>i</sub> <br>
</p>
@param a A Vector. Modified.
@param b A Vector. Not modified. | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"a",
"=",
"a",
"+",
"b",
"<br",
">",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"+",
"b<sub",
">",
"i<",
"/",
"sub",
">",... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java#L101-L104 |
apache/incubator-atlas | addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java | HiveMetaStoreBridge.getTableReference | private Referenceable getTableReference(Table hiveTable) throws Exception {
"""
Gets reference for the table
@param hiveTable
@return table reference if exists, else null
@throws Exception
"""
LOG.debug("Getting reference for table {}.{}", hiveTable.getDbName(), hiveTable.getTableName());
... | java | private Referenceable getTableReference(Table hiveTable) throws Exception {
LOG.debug("Getting reference for table {}.{}", hiveTable.getDbName(), hiveTable.getTableName());
String typeName = HiveDataTypes.HIVE_TABLE.getName();
String tblQualifiedName = getTableQualifiedName(getClusterName(), h... | [
"private",
"Referenceable",
"getTableReference",
"(",
"Table",
"hiveTable",
")",
"throws",
"Exception",
"{",
"LOG",
".",
"debug",
"(",
"\"Getting reference for table {}.{}\"",
",",
"hiveTable",
".",
"getDbName",
"(",
")",
",",
"hiveTable",
".",
"getTableName",
"(",
... | Gets reference for the table
@param hiveTable
@return table reference if exists, else null
@throws Exception | [
"Gets",
"reference",
"for",
"the",
"table"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java#L341-L347 |
lucee/Lucee | core/src/main/java/lucee/runtime/type/ArrayImplNS.java | ArrayImplNS.setE | @Override
public Object setE(int key, Object value) throws ExpressionException {
"""
set value at defined position
@param key
@param value
@return defined value
@throws ExpressionException
"""
if (offset + key > arr.length) enlargeCapacity(key);
if (key > size) size = key;
arr[(offset + key) - 1] ... | java | @Override
public Object setE(int key, Object value) throws ExpressionException {
if (offset + key > arr.length) enlargeCapacity(key);
if (key > size) size = key;
arr[(offset + key) - 1] = checkValue(value);
return value;
} | [
"@",
"Override",
"public",
"Object",
"setE",
"(",
"int",
"key",
",",
"Object",
"value",
")",
"throws",
"ExpressionException",
"{",
"if",
"(",
"offset",
"+",
"key",
">",
"arr",
".",
"length",
")",
"enlargeCapacity",
"(",
"key",
")",
";",
"if",
"(",
"key... | set value at defined position
@param key
@param value
@return defined value
@throws ExpressionException | [
"set",
"value",
"at",
"defined",
"position"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/ArrayImplNS.java#L220-L226 |
netty/netty | handler/src/main/java/io/netty/handler/ssl/CipherSuiteConverter.java | CipherSuiteConverter.isJ2OCached | static boolean isJ2OCached(String key, String value) {
"""
Tests if the specified key-value pair has been cached in Java-to-OpenSSL cache.
"""
return value.equals(j2o.get(key));
} | java | static boolean isJ2OCached(String key, String value) {
return value.equals(j2o.get(key));
} | [
"static",
"boolean",
"isJ2OCached",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"return",
"value",
".",
"equals",
"(",
"j2o",
".",
"get",
"(",
"key",
")",
")",
";",
"}"
] | Tests if the specified key-value pair has been cached in Java-to-OpenSSL cache. | [
"Tests",
"if",
"the",
"specified",
"key",
"-",
"value",
"pair",
"has",
"been",
"cached",
"in",
"Java",
"-",
"to",
"-",
"OpenSSL",
"cache",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/CipherSuiteConverter.java#L132-L134 |
apache/spark | common/network-common/src/main/java/org/apache/spark/network/TransportContext.java | TransportContext.createServer | public TransportServer createServer(int port, List<TransportServerBootstrap> bootstraps) {
"""
Create a server which will attempt to bind to a specific port.
"""
return new TransportServer(this, null, port, rpcHandler, bootstraps);
} | java | public TransportServer createServer(int port, List<TransportServerBootstrap> bootstraps) {
return new TransportServer(this, null, port, rpcHandler, bootstraps);
} | [
"public",
"TransportServer",
"createServer",
"(",
"int",
"port",
",",
"List",
"<",
"TransportServerBootstrap",
">",
"bootstraps",
")",
"{",
"return",
"new",
"TransportServer",
"(",
"this",
",",
"null",
",",
"port",
",",
"rpcHandler",
",",
"bootstraps",
")",
";... | Create a server which will attempt to bind to a specific port. | [
"Create",
"a",
"server",
"which",
"will",
"attempt",
"to",
"bind",
"to",
"a",
"specific",
"port",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-common/src/main/java/org/apache/spark/network/TransportContext.java#L150-L152 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/dialog/DateRangePicker.java | DateRangePicker.addChoice | public Dateitem addChoice(DateRange range, boolean isCustom) {
"""
Adds a date range to the choice list.
@param range Date range item
@param isCustom If true, range is a custom item. In this case, if another matching custom
item exists, it will not be added.
@return combo box item that was added (or found if... | java | public Dateitem addChoice(DateRange range, boolean isCustom) {
Dateitem item;
if (isCustom) {
item = findMatchingItem(range);
if (item != null) {
return item;
}
}
item = new Dateitem();
item.setLab... | [
"public",
"Dateitem",
"addChoice",
"(",
"DateRange",
"range",
",",
"boolean",
"isCustom",
")",
"{",
"Dateitem",
"item",
";",
"if",
"(",
"isCustom",
")",
"{",
"item",
"=",
"findMatchingItem",
"(",
"range",
")",
";",
"if",
"(",
"item",
"!=",
"null",
")",
... | Adds a date range to the choice list.
@param range Date range item
@param isCustom If true, range is a custom item. In this case, if another matching custom
item exists, it will not be added.
@return combo box item that was added (or found if duplicate custom item). | [
"Adds",
"a",
"date",
"range",
"to",
"the",
"choice",
"list",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/dialog/DateRangePicker.java#L124-L145 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ExecutableMemberDocImpl.java | ExecutableMemberDocImpl.parameters | public Parameter[] parameters() {
"""
Get argument information.
@see ParameterImpl
@return an array of ParameterImpl, one element per argument
in the order the arguments are present.
"""
// generate the parameters on the fly: they're not cached
List<VarSymbol> params = sym.params();
... | java | public Parameter[] parameters() {
// generate the parameters on the fly: they're not cached
List<VarSymbol> params = sym.params();
Parameter result[] = new Parameter[params.length()];
int i = 0;
for (VarSymbol param : params) {
result[i++] = new ParameterImpl(env, p... | [
"public",
"Parameter",
"[",
"]",
"parameters",
"(",
")",
"{",
"// generate the parameters on the fly: they're not cached",
"List",
"<",
"VarSymbol",
">",
"params",
"=",
"sym",
".",
"params",
"(",
")",
";",
"Parameter",
"result",
"[",
"]",
"=",
"new",
"Parameter... | Get argument information.
@see ParameterImpl
@return an array of ParameterImpl, one element per argument
in the order the arguments are present. | [
"Get",
"argument",
"information",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ExecutableMemberDocImpl.java#L187-L197 |
RKumsher/utils | src/main/java/com/github/rkumsher/date/RandomDateUtils.java | RandomDateUtils.randomMonthDay | public static MonthDay randomMonthDay(MonthDay startInclusive, MonthDay endExclusive) {
"""
Returns a random {@link MonthDay} within the specified range. Includes leap day if the current
year is a leap year.
@param startInclusive the earliest {@link MonthDay} that can be returned
@param endExclusive the upper... | java | public static MonthDay randomMonthDay(MonthDay startInclusive, MonthDay endExclusive) {
return randomMonthDay(startInclusive, endExclusive, Year.now().isLeap());
} | [
"public",
"static",
"MonthDay",
"randomMonthDay",
"(",
"MonthDay",
"startInclusive",
",",
"MonthDay",
"endExclusive",
")",
"{",
"return",
"randomMonthDay",
"(",
"startInclusive",
",",
"endExclusive",
",",
"Year",
".",
"now",
"(",
")",
".",
"isLeap",
"(",
")",
... | Returns a random {@link MonthDay} within the specified range. Includes leap day if the current
year is a leap year.
@param startInclusive the earliest {@link MonthDay} that can be returned
@param endExclusive the upper bound (not included)
@return the random {@link MonthDay}
@throws IllegalArgumentException if startIn... | [
"Returns",
"a",
"random",
"{",
"@link",
"MonthDay",
"}",
"within",
"the",
"specified",
"range",
".",
"Includes",
"leap",
"day",
"if",
"the",
"current",
"year",
"is",
"a",
"leap",
"year",
"."
] | train | https://github.com/RKumsher/utils/blob/fcdb190569cd0288249bf4b46fd418f8c01d1caf/src/main/java/com/github/rkumsher/date/RandomDateUtils.java#L690-L692 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/ChatApi.java | ChatApi.consultByQueue | public ApiSuccessResponse consultByQueue(String id, ConsultData1 consultData) throws ApiException {
"""
Consult with another agent via a queue
Consult with another agent during a chat by sending an consult invitation to the specified queue. A consult occurs in the context of the specified chat, but the customer i... | java | public ApiSuccessResponse consultByQueue(String id, ConsultData1 consultData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = consultByQueueWithHttpInfo(id, consultData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"consultByQueue",
"(",
"String",
"id",
",",
"ConsultData1",
"consultData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"consultByQueueWithHttpInfo",
"(",
"id",
",",
"consultData",
")",... | Consult with another agent via a queue
Consult with another agent during a chat by sending an consult invitation to the specified queue. A consult occurs in the context of the specified chat, but the customer is not aware of the consulting agent. Messages and notifications from the consulting agent are only visible to ... | [
"Consult",
"with",
"another",
"agent",
"via",
"a",
"queue",
"Consult",
"with",
"another",
"agent",
"during",
"a",
"chat",
"by",
"sending",
"an",
"consult",
"invitation",
"to",
"the",
"specified",
"queue",
".",
"A",
"consult",
"occurs",
"in",
"the",
"context"... | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/ChatApi.java#L795-L798 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/jboss/logging/Logger.java | Logger.warnf | public void warnf(String format, Object... params) {
"""
Issue a formatted log message with a level of WARN.
@param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor
@param params the parameters
"""
doLogf(Level.WARN, FQCN, format, params, null... | java | public void warnf(String format, Object... params) {
doLogf(Level.WARN, FQCN, format, params, null);
} | [
"public",
"void",
"warnf",
"(",
"String",
"format",
",",
"Object",
"...",
"params",
")",
"{",
"doLogf",
"(",
"Level",
".",
"WARN",
",",
"FQCN",
",",
"format",
",",
"params",
",",
"null",
")",
";",
"}"
] | Issue a formatted log message with a level of WARN.
@param format the format string as per {@link String#format(String, Object...)} or resource bundle key therefor
@param params the parameters | [
"Issue",
"a",
"formatted",
"log",
"message",
"with",
"a",
"level",
"of",
"WARN",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L1395-L1397 |
xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheListUtil.java | CacheListUtil.set | public static Single<Boolean> set(String cacheKey, int index, Object value) {
"""
update the value of the specified index
@param cacheKey the key for the cached list.
@param index the index of the element you want to update.
@param value the new value for the element.
@return true on success, false on ... | java | public static Single<Boolean> set(String cacheKey, int index, Object value) {
return set(CacheService.CACHE_CONFIG_BEAN, cacheKey, index, value);
} | [
"public",
"static",
"Single",
"<",
"Boolean",
">",
"set",
"(",
"String",
"cacheKey",
",",
"int",
"index",
",",
"Object",
"value",
")",
"{",
"return",
"set",
"(",
"CacheService",
".",
"CACHE_CONFIG_BEAN",
",",
"cacheKey",
",",
"index",
",",
"value",
")",
... | update the value of the specified index
@param cacheKey the key for the cached list.
@param index the index of the element you want to update.
@param value the new value for the element.
@return true on success, false on failure. | [
"update",
"the",
"value",
"of",
"the",
"specified",
"index"
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cache/api/CacheListUtil.java#L186-L188 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/operations/global/ReadResourceHandler.java | ReadResourceHandler.nullSafeReadResource | private static Resource nullSafeReadResource(final OperationContext context, final ImmutableManagementResourceRegistration registry) {
"""
Provides a resource for the current step, either from the context, if the context doesn't have one
and {@code registry} is runtime-only, it creates a dummy resource.
"""
... | java | private static Resource nullSafeReadResource(final OperationContext context, final ImmutableManagementResourceRegistration registry) {
Resource result;
if (registry != null && registry.isRemote()) {
try {
// BES 2015/02/12 (WFCORE-539) -- following comment and use of 'true' ... | [
"private",
"static",
"Resource",
"nullSafeReadResource",
"(",
"final",
"OperationContext",
"context",
",",
"final",
"ImmutableManagementResourceRegistration",
"registry",
")",
"{",
"Resource",
"result",
";",
"if",
"(",
"registry",
"!=",
"null",
"&&",
"registry",
".",
... | Provides a resource for the current step, either from the context, if the context doesn't have one
and {@code registry} is runtime-only, it creates a dummy resource. | [
"Provides",
"a",
"resource",
"for",
"the",
"current",
"step",
"either",
"from",
"the",
"context",
"if",
"the",
"context",
"doesn",
"t",
"have",
"one",
"and",
"{"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/operations/global/ReadResourceHandler.java#L403-L437 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/AbstractLinear.java | AbstractLinear.create_GLOW_Image | protected BufferedImage create_GLOW_Image(final int WIDTH, final int HEIGHT, final Color GLOW_COLOR, final boolean ON) {
"""
Returns an image that simulates a glowing ring which could be used to visualize
a state of the gauge by a color. The LED might be too small if you are not in front
of the screen and so one... | java | protected BufferedImage create_GLOW_Image(final int WIDTH, final int HEIGHT, final Color GLOW_COLOR, final boolean ON) {
return GLOW_FACTORY.createLinearGlow(WIDTH, HEIGHT, GLOW_COLOR, ON);
} | [
"protected",
"BufferedImage",
"create_GLOW_Image",
"(",
"final",
"int",
"WIDTH",
",",
"final",
"int",
"HEIGHT",
",",
"final",
"Color",
"GLOW_COLOR",
",",
"final",
"boolean",
"ON",
")",
"{",
"return",
"GLOW_FACTORY",
".",
"createLinearGlow",
"(",
"WIDTH",
",",
... | Returns an image that simulates a glowing ring which could be used to visualize
a state of the gauge by a color. The LED might be too small if you are not in front
of the screen and so one could see the current state more easy.
@param WIDTH
@param HEIGHT
@param GLOW_COLOR
@param ON
@return an image that simulates a glo... | [
"Returns",
"an",
"image",
"that",
"simulates",
"a",
"glowing",
"ring",
"which",
"could",
"be",
"used",
"to",
"visualize",
"a",
"state",
"of",
"the",
"gauge",
"by",
"a",
"color",
".",
"The",
"LED",
"might",
"be",
"too",
"small",
"if",
"you",
"are",
"not... | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/AbstractLinear.java#L955-L957 |
tingley/snax-xml | src/main/java/net/sundell/snax/SNAXParser.java | SNAXParser.startParsing | public void startParsing(Reader reader, T data) throws XMLStreamException {
"""
Begin incremental parsing of a data stream, represented by a Reader. This will initialize
the parser but will not perform any parsing. Callers should then use hasMoreEvents() and
processEvent() to consume XML events until the docum... | java | public void startParsing(Reader reader, T data) throws XMLStreamException {
checkState(model != null, "No model was set");
init(reader, data);
isIncremental = true;
} | [
"public",
"void",
"startParsing",
"(",
"Reader",
"reader",
",",
"T",
"data",
")",
"throws",
"XMLStreamException",
"{",
"checkState",
"(",
"model",
"!=",
"null",
",",
"\"No model was set\"",
")",
";",
"init",
"(",
"reader",
",",
"data",
")",
";",
"isIncrement... | Begin incremental parsing of a data stream, represented by a Reader. This will initialize
the parser but will not perform any parsing. Callers should then use hasMoreEvents() and
processEvent() to consume XML events until the document has been completely parsed.
@param reader XML content to process
@param data optio... | [
"Begin",
"incremental",
"parsing",
"of",
"a",
"data",
"stream",
"represented",
"by",
"a",
"Reader",
".",
"This",
"will",
"initialize",
"the",
"parser",
"but",
"will",
"not",
"perform",
"any",
"parsing",
".",
"Callers",
"should",
"then",
"use",
"hasMoreEvents",... | train | https://github.com/tingley/snax-xml/blob/73858b9a53136694bc49d5c521d21fa33931e8df/src/main/java/net/sundell/snax/SNAXParser.java#L87-L91 |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/store/ValidationDataGroup.java | ValidationDataGroup.initDataGroup | public void initDataGroup(ParamType paramType, List<ValidationData> lists) {
"""
Init data group.
@param paramType the param type
@param lists the lists
"""
this.paramType = paramType;
lists.forEach(vd -> {
this.addRule(vd);
});
} | java | public void initDataGroup(ParamType paramType, List<ValidationData> lists) {
this.paramType = paramType;
lists.forEach(vd -> {
this.addRule(vd);
});
} | [
"public",
"void",
"initDataGroup",
"(",
"ParamType",
"paramType",
",",
"List",
"<",
"ValidationData",
">",
"lists",
")",
"{",
"this",
".",
"paramType",
"=",
"paramType",
";",
"lists",
".",
"forEach",
"(",
"vd",
"->",
"{",
"this",
".",
"addRule",
"(",
"vd... | Init data group.
@param paramType the param type
@param lists the lists | [
"Init",
"data",
"group",
"."
] | train | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/store/ValidationDataGroup.java#L46-L53 |
line/armeria | examples/annotated-http-service/src/main/java/example/armeria/server/annotated/MessageConverterService.java | MessageConverterService.json3 | @Post("/obj/obj")
@ProducesJson
public Response json3(@RequestObject Request request) {
"""
Returns a {@link Response} object. A {@link Request} is automatically converted by
{@link JacksonRequestConverterFunction}.
<p>If you want to use a custom {@link ObjectMapper} for JSON converters, you can regist... | java | @Post("/obj/obj")
@ProducesJson
public Response json3(@RequestObject Request request) {
return new Response(Response.SUCCESS, request.name());
} | [
"@",
"Post",
"(",
"\"/obj/obj\"",
")",
"@",
"ProducesJson",
"public",
"Response",
"json3",
"(",
"@",
"RequestObject",
"Request",
"request",
")",
"{",
"return",
"new",
"Response",
"(",
"Response",
".",
"SUCCESS",
",",
"request",
".",
"name",
"(",
")",
")",
... | Returns a {@link Response} object. A {@link Request} is automatically converted by
{@link JacksonRequestConverterFunction}.
<p>If you want to use a custom {@link ObjectMapper} for JSON converters, you can register a new
{@link JacksonRequestConverterFunction} with your custom {@link ObjectMapper} when adding an
annota... | [
"Returns",
"a",
"{",
"@link",
"Response",
"}",
"object",
".",
"A",
"{",
"@link",
"Request",
"}",
"is",
"automatically",
"converted",
"by",
"{",
"@link",
"JacksonRequestConverterFunction",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/examples/annotated-http-service/src/main/java/example/armeria/server/annotated/MessageConverterService.java#L86-L90 |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/predefined/PageInBrowserStats.java | PageInBrowserStats.getTotalDomLoadTime | public long getTotalDomLoadTime(final String intervalName, final TimeUnit unit) {
"""
Returns total DOM loads time for given interval and {@link TimeUnit}.
@param intervalName name of the interval
@param unit {@link TimeUnit}
@return total DOM loads time
"""
return unit.transformMillis(totalDomL... | java | public long getTotalDomLoadTime(final String intervalName, final TimeUnit unit) {
return unit.transformMillis(totalDomLoadTime.getValueAsLong(intervalName));
} | [
"public",
"long",
"getTotalDomLoadTime",
"(",
"final",
"String",
"intervalName",
",",
"final",
"TimeUnit",
"unit",
")",
"{",
"return",
"unit",
".",
"transformMillis",
"(",
"totalDomLoadTime",
".",
"getValueAsLong",
"(",
"intervalName",
")",
")",
";",
"}"
] | Returns total DOM loads time for given interval and {@link TimeUnit}.
@param intervalName name of the interval
@param unit {@link TimeUnit}
@return total DOM loads time | [
"Returns",
"total",
"DOM",
"loads",
"time",
"for",
"given",
"interval",
"and",
"{",
"@link",
"TimeUnit",
"}",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/predefined/PageInBrowserStats.java#L164-L166 |
knowm/XChange | xchange-core/src/main/java/org/knowm/xchange/utils/retries/Retries.java | Retries.callWithRetries | public static <V> V callWithRetries(
int nAttempts,
int initialRetrySec,
Callable<V> action,
IPredicate<Exception> retryableException)
throws Exception {
"""
Allows a client to attempt a call and retry a finite amount of times if the exception thrown is
the right kind. The retries ba... | java | public static <V> V callWithRetries(
int nAttempts,
int initialRetrySec,
Callable<V> action,
IPredicate<Exception> retryableException)
throws Exception {
int retryDelaySec = initialRetrySec;
for (int attemptsLeftAfterThis = nAttempts - 1;
attemptsLeftAfterThis >= 0;
... | [
"public",
"static",
"<",
"V",
">",
"V",
"callWithRetries",
"(",
"int",
"nAttempts",
",",
"int",
"initialRetrySec",
",",
"Callable",
"<",
"V",
">",
"action",
",",
"IPredicate",
"<",
"Exception",
">",
"retryableException",
")",
"throws",
"Exception",
"{",
"int... | Allows a client to attempt a call and retry a finite amount of times if the exception thrown is
the right kind. The retries back off exponentially.
@param nAttempts Number of attempts before giving up
@param initialRetrySec Number of seconds to wait before trying again on the first retry.
@param action A callable or l... | [
"Allows",
"a",
"client",
"to",
"attempt",
"a",
"call",
"and",
"retry",
"a",
"finite",
"amount",
"of",
"times",
"if",
"the",
"exception",
"thrown",
"is",
"the",
"right",
"kind",
".",
"The",
"retries",
"back",
"off",
"exponentially",
"."
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-core/src/main/java/org/knowm/xchange/utils/retries/Retries.java#L28-L52 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/icon/provider/ConnectedIconsProvider.java | ConnectedIconsProvider.getConnections | private int getConnections(IBlockAccess world, BlockPos pos, EnumFacing facing) {
"""
Determines the connections available at this position for the specified <b>side</b>.
@param world the world
@param pos the pos
@param facing the facing
@return the connections
"""
Block block = world.getBlockState(pos... | java | private int getConnections(IBlockAccess world, BlockPos pos, EnumFacing facing)
{
Block block = world.getBlockState(pos).getBlock();
int connection = 0;
for (int i = 0; i < 4; i++)
{
if (world.getBlockState(pos.offset(sides[facing.getIndex()][i])).getBlock() == block)
connection |= (1 << i);
}
retur... | [
"private",
"int",
"getConnections",
"(",
"IBlockAccess",
"world",
",",
"BlockPos",
"pos",
",",
"EnumFacing",
"facing",
")",
"{",
"Block",
"block",
"=",
"world",
".",
"getBlockState",
"(",
"pos",
")",
".",
"getBlock",
"(",
")",
";",
"int",
"connection",
"="... | Determines the connections available at this position for the specified <b>side</b>.
@param world the world
@param pos the pos
@param facing the facing
@return the connections | [
"Determines",
"the",
"connections",
"available",
"at",
"this",
"position",
"for",
"the",
"specified",
"<b",
">",
"side<",
"/",
"b",
">",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/icon/provider/ConnectedIconsProvider.java#L162-L172 |
mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.has | @Override
public boolean has(int index, Scriptable start) {
"""
Returns true if the property index is defined.
@param index the numeric index for the property
@param start the object in which the lookup began
@return true if and only if the property was found in the object
"""
if (externalData... | java | @Override
public boolean has(int index, Scriptable start)
{
if (externalData != null) {
return (index < externalData.getArrayLength());
}
return null != slotMap.query(null, index);
} | [
"@",
"Override",
"public",
"boolean",
"has",
"(",
"int",
"index",
",",
"Scriptable",
"start",
")",
"{",
"if",
"(",
"externalData",
"!=",
"null",
")",
"{",
"return",
"(",
"index",
"<",
"externalData",
".",
"getArrayLength",
"(",
")",
")",
";",
"}",
"ret... | Returns true if the property index is defined.
@param index the numeric index for the property
@param start the object in which the lookup began
@return true if and only if the property was found in the object | [
"Returns",
"true",
"if",
"the",
"property",
"index",
"is",
"defined",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L428-L435 |
logic-ng/LogicNG | src/main/java/org/logicng/bdds/jbuddy/BDDKernel.java | BDDKernel.exists | public int exists(final int r, final int var) {
"""
Existential quantifier elimination for the variables in {@code var}.
@param r the BDD root node
@param var the variables to eliminate
@return the BDD with the eliminated variables
"""
final int res;
if (var < 2)
return r;
varset2vartabl... | java | public int exists(final int r, final int var) {
final int res;
if (var < 2)
return r;
varset2vartable(var);
initRef();
res = quantRec(r, Operand.OR, var << 3);
return res;
} | [
"public",
"int",
"exists",
"(",
"final",
"int",
"r",
",",
"final",
"int",
"var",
")",
"{",
"final",
"int",
"res",
";",
"if",
"(",
"var",
"<",
"2",
")",
"return",
"r",
";",
"varset2vartable",
"(",
"var",
")",
";",
"initRef",
"(",
")",
";",
"res",
... | Existential quantifier elimination for the variables in {@code var}.
@param r the BDD root node
@param var the variables to eliminate
@return the BDD with the eliminated variables | [
"Existential",
"quantifier",
"elimination",
"for",
"the",
"variables",
"in",
"{"
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/bdds/jbuddy/BDDKernel.java#L741-L749 |
Squarespace/cldr | runtime/src/main/java/com/squarespace/cldr/dates/CalendarFormatterBase.java | CalendarFormatterBase.formatField | public void formatField(ZonedDateTime datetime, String pattern, StringBuilder buffer) {
"""
Formats a single field, based on the first character in the pattern string,
with repeated characters indicating the field width.
"""
int length = pattern.length();
if (length == 0) {
return;
}
//... | java | public void formatField(ZonedDateTime datetime, String pattern, StringBuilder buffer) {
int length = pattern.length();
if (length == 0) {
return;
}
// Current position in pattern
int i = 0;
// Skip over prefix indicating we want to format a single field.
if (pattern.charAt(i) == '+')... | [
"public",
"void",
"formatField",
"(",
"ZonedDateTime",
"datetime",
",",
"String",
"pattern",
",",
"StringBuilder",
"buffer",
")",
"{",
"int",
"length",
"=",
"pattern",
".",
"length",
"(",
")",
";",
"if",
"(",
"length",
"==",
"0",
")",
"{",
"return",
";",... | Formats a single field, based on the first character in the pattern string,
with repeated characters indicating the field width. | [
"Formats",
"a",
"single",
"field",
"based",
"on",
"the",
"first",
"character",
"in",
"the",
"pattern",
"string",
"with",
"repeated",
"characters",
"indicating",
"the",
"field",
"width",
"."
] | train | https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/runtime/src/main/java/com/squarespace/cldr/dates/CalendarFormatterBase.java#L255-L283 |
indeedeng/util | util-core/src/main/java/com/indeed/util/core/sort/Quicksortables.java | Quicksortables.binarySearch | public static int binarySearch(Quicksortable qs, int size) {
"""
the compare function on Quicksortable will always pass -1 as the second index, swap function is never called
"""
int low = 0;
int high = size-1;
while (low <= high) {
int mid = (low + high) >> 1;
i... | java | public static int binarySearch(Quicksortable qs, int size) {
int low = 0;
int high = size-1;
while (low <= high) {
int mid = (low + high) >> 1;
int cmp = qs.compare(mid, -1);
if (cmp < 0)
low = mid + 1;
else if (cmp > 0)
h... | [
"public",
"static",
"int",
"binarySearch",
"(",
"Quicksortable",
"qs",
",",
"int",
"size",
")",
"{",
"int",
"low",
"=",
"0",
";",
"int",
"high",
"=",
"size",
"-",
"1",
";",
"while",
"(",
"low",
"<=",
"high",
")",
"{",
"int",
"mid",
"=",
"(",
"low... | the compare function on Quicksortable will always pass -1 as the second index, swap function is never called | [
"the",
"compare",
"function",
"on",
"Quicksortable",
"will",
"always",
"pass",
"-",
"1",
"as",
"the",
"second",
"index",
"swap",
"function",
"is",
"never",
"called"
] | train | https://github.com/indeedeng/util/blob/332008426cf14b57e7fc3e817d9423e3f84fb922/util-core/src/main/java/com/indeed/util/core/sort/Quicksortables.java#L381-L397 |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/storage/CredentialsManager.java | CredentialsManager.getCredentials | public void getCredentials(@NonNull final BaseCallback<Credentials, CredentialsManagerException> callback) {
"""
Retrieves the credentials from the storage and refresh them if they have already expired.
It will fail with {@link CredentialsManagerException} if the saved access_token or id_token is null,
or if the... | java | public void getCredentials(@NonNull final BaseCallback<Credentials, CredentialsManagerException> callback) {
String accessToken = storage.retrieveString(KEY_ACCESS_TOKEN);
final String refreshToken = storage.retrieveString(KEY_REFRESH_TOKEN);
String idToken = storage.retrieveString(KEY_ID_TOKEN)... | [
"public",
"void",
"getCredentials",
"(",
"@",
"NonNull",
"final",
"BaseCallback",
"<",
"Credentials",
",",
"CredentialsManagerException",
">",
"callback",
")",
"{",
"String",
"accessToken",
"=",
"storage",
".",
"retrieveString",
"(",
"KEY_ACCESS_TOKEN",
")",
";",
... | Retrieves the credentials from the storage and refresh them if they have already expired.
It will fail with {@link CredentialsManagerException} if the saved access_token or id_token is null,
or if the tokens have already expired and the refresh_token is null.
@param callback the callback that will receive a valid {@li... | [
"Retrieves",
"the",
"credentials",
"from",
"the",
"storage",
"and",
"refresh",
"them",
"if",
"they",
"have",
"already",
"expired",
".",
"It",
"will",
"fail",
"with",
"{",
"@link",
"CredentialsManagerException",
"}",
"if",
"the",
"saved",
"access_token",
"or",
... | train | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/storage/CredentialsManager.java#L66-L101 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.