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 |
|---|---|---|---|---|---|---|---|---|---|---|
yanzhenjie/AndPermission | support/src/main/java/com/yanzhenjie/permission/AndPermission.java | AndPermission.hasAlwaysDeniedPermission | public static boolean hasAlwaysDeniedPermission(Fragment fragment, List<String> deniedPermissions) {
"""
Some privileges permanently disabled, may need to set up in the execute.
@param fragment {@link Fragment}.
@param deniedPermissions one or more permissions.
@return true, other wise is false.
"""
... | java | public static boolean hasAlwaysDeniedPermission(Fragment fragment, List<String> deniedPermissions) {
return hasAlwaysDeniedPermission(new SupportFragmentSource(fragment), deniedPermissions);
} | [
"public",
"static",
"boolean",
"hasAlwaysDeniedPermission",
"(",
"Fragment",
"fragment",
",",
"List",
"<",
"String",
">",
"deniedPermissions",
")",
"{",
"return",
"hasAlwaysDeniedPermission",
"(",
"new",
"SupportFragmentSource",
"(",
"fragment",
")",
",",
"deniedPermi... | Some privileges permanently disabled, may need to set up in the execute.
@param fragment {@link Fragment}.
@param deniedPermissions one or more permissions.
@return true, other wise is false. | [
"Some",
"privileges",
"permanently",
"disabled",
"may",
"need",
"to",
"set",
"up",
"in",
"the",
"execute",
"."
] | train | https://github.com/yanzhenjie/AndPermission/blob/bbfaaecdb8ecf0f2aa270d80c0b88d022dddda7c/support/src/main/java/com/yanzhenjie/permission/AndPermission.java#L106-L108 |
i-net-software/jlessc | src/com/inet/lib/less/Operation.java | Operation.doubleValue | private double doubleValue( double left, double right ) {
"""
Calculate the number value of two operands if possible.
@param left the left
@param right the right
@return the result.
"""
switch( operator ) {
case '+':
return left + right;
case '-':
... | java | private double doubleValue( double left, double right ) {
switch( operator ) {
case '+':
return left + right;
case '-':
return left - right;
case '*':
return left * right;
case '/':
return left / righ... | [
"private",
"double",
"doubleValue",
"(",
"double",
"left",
",",
"double",
"right",
")",
"{",
"switch",
"(",
"operator",
")",
"{",
"case",
"'",
"'",
":",
"return",
"left",
"+",
"right",
";",
"case",
"'",
"'",
":",
"return",
"left",
"-",
"right",
";",
... | Calculate the number value of two operands if possible.
@param left the left
@param right the right
@return the result. | [
"Calculate",
"the",
"number",
"value",
"of",
"two",
"operands",
"if",
"possible",
"."
] | train | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/Operation.java#L358-L371 |
mabe02/lanterna | src/main/java/com/googlecode/lanterna/bundle/LanternaThemes.java | LanternaThemes.registerTheme | public static void registerTheme(String name, Theme theme) {
"""
Registers a {@link Theme} with this class under a certain name so that calling
{@link #getRegisteredTheme(String)} on that name will return this theme and calling
{@link #getRegisteredThemes()} will return a collection including this name.
@param ... | java | public static void registerTheme(String name, Theme theme) {
if(theme == null) {
throw new IllegalArgumentException("Name cannot be null");
}
else if(name.isEmpty()) {
throw new IllegalArgumentException("Name cannot be empty");
}
Theme result = REGISTERED_... | [
"public",
"static",
"void",
"registerTheme",
"(",
"String",
"name",
",",
"Theme",
"theme",
")",
"{",
"if",
"(",
"theme",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Name cannot be null\"",
")",
";",
"}",
"else",
"if",
"(",
"... | Registers a {@link Theme} with this class under a certain name so that calling
{@link #getRegisteredTheme(String)} on that name will return this theme and calling
{@link #getRegisteredThemes()} will return a collection including this name.
@param name Name to register the theme under
@param theme Theme to register with... | [
"Registers",
"a",
"{"
] | train | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/bundle/LanternaThemes.java#L79-L90 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newAssertionException | public static AssertionException newAssertionException(Throwable cause, String message, Object... args) {
"""
Constructs and initializes a new {@link AssertionException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Th... | java | public static AssertionException newAssertionException(Throwable cause, String message, Object... args) {
return new AssertionException(format(message, args), cause);
} | [
"public",
"static",
"AssertionException",
"newAssertionException",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"AssertionException",
"(",
"format",
"(",
"message",
",",
"args",
")",
",",
"cause",
... | Constructs and initializes a new {@link AssertionException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throwable} identified as the reason this {@link AssertionException} was thrown.
@param message {@link String} describing... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"AssertionException",
"}",
"with",
"the",
"given",
"{",
"@link",
"Throwable",
"cause",
"}",
"and",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Objec... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L257-L259 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/XMLProperties.java | XMLProperties.setProperties | public Properties setProperties(String pGroupKey, Properties pProperties) {
"""
Sets the properties in the given properties group.
Existing properties in the same group, will not be removed, unless they
are replaced by new values.
Any existing properties in the same group that was replaced, are
returned. If no... | java | public Properties setProperties(String pGroupKey, Properties pProperties) {
XMLProperties old = new XMLProperties();
String groupKey = pGroupKey;
if (groupKey.charAt(groupKey.length()) != '.') {
groupKey += ".";
}
Iterator iterator = pProperties.entrySet().iterator();
... | [
"public",
"Properties",
"setProperties",
"(",
"String",
"pGroupKey",
",",
"Properties",
"pProperties",
")",
"{",
"XMLProperties",
"old",
"=",
"new",
"XMLProperties",
"(",
")",
";",
"String",
"groupKey",
"=",
"pGroupKey",
";",
"if",
"(",
"groupKey",
".",
"charA... | Sets the properties in the given properties group.
Existing properties in the same group, will not be removed, unless they
are replaced by new values.
Any existing properties in the same group that was replaced, are
returned. If no properties are replaced, <CODE>null<CODE> is
returned.
@param pGroupKey the group key
@... | [
"Sets",
"the",
"properties",
"in",
"the",
"given",
"properties",
"group",
".",
"Existing",
"properties",
"in",
"the",
"same",
"group",
"will",
"not",
"be",
"removed",
"unless",
"they",
"are",
"replaced",
"by",
"new",
"values",
".",
"Any",
"existing",
"proper... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/XMLProperties.java#L954-L974 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/ClassUtils.java | ClassUtils.getName | public static String getName(final Class<?> cls, final String valueIfNull) {
"""
<p>Null-safe version of <code>aClass.getName()</code></p>
@param cls the class for which to get the class name; may be null
@param valueIfNull the return value if <code>cls</code> is <code>null</code>
@return the class name or {@... | java | public static String getName(final Class<?> cls, final String valueIfNull) {
return cls == null ? valueIfNull : cls.getName();
} | [
"public",
"static",
"String",
"getName",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
",",
"final",
"String",
"valueIfNull",
")",
"{",
"return",
"cls",
"==",
"null",
"?",
"valueIfNull",
":",
"cls",
".",
"getName",
"(",
")",
";",
"}"
] | <p>Null-safe version of <code>aClass.getName()</code></p>
@param cls the class for which to get the class name; may be null
@param valueIfNull the return value if <code>cls</code> is <code>null</code>
@return the class name or {@code valueIfNull}
@since 3.7
@see Class#getName() | [
"<p",
">",
"Null",
"-",
"safe",
"version",
"of",
"<code",
">",
"aClass",
".",
"getName",
"()",
"<",
"/",
"code",
">",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/ClassUtils.java#L316-L318 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.overlayBytes | private int overlayBytes(byte[] data, int inOffset, int inLength, int inIndex) {
"""
Utility method to overlay the input bytes into the parse buffers,
starting at the input index and moving forward as needed.
@param data
@param inOffset
@param inLength
@param inIndex
@return index of last buffer updated
... | java | private int overlayBytes(byte[] data, int inOffset, int inLength, int inIndex) {
int length = inLength;
int offset = inOffset;
int index = inIndex;
WsByteBuffer buffer = this.parseBuffers[index];
if (-1 == length) {
length = data.length;
}
while (index... | [
"private",
"int",
"overlayBytes",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"inOffset",
",",
"int",
"inLength",
",",
"int",
"inIndex",
")",
"{",
"int",
"length",
"=",
"inLength",
";",
"int",
"offset",
"=",
"inOffset",
";",
"int",
"index",
"=",
"inInde... | Utility method to overlay the input bytes into the parse buffers,
starting at the input index and moving forward as needed.
@param data
@param inOffset
@param inLength
@param inIndex
@return index of last buffer updated | [
"Utility",
"method",
"to",
"overlay",
"the",
"input",
"bytes",
"into",
"the",
"parse",
"buffers",
"starting",
"at",
"the",
"input",
"index",
"and",
"moving",
"forward",
"as",
"needed",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L1267-L1290 |
mnlipp/jgrapes | examples/src/org/jgrapes/http/demo/httpserver/WsEchoServer.java | WsEchoServer.onUpgraded | @Handler
public void onUpgraded(Upgraded event, IOSubchannel channel) {
"""
Handle upgrade confirmation.
@param event the event
@param channel the channel
"""
if (!openChannels.contains(channel)) {
return;
}
channel.respond(Output.from("/Greetings!", true));
} | java | @Handler
public void onUpgraded(Upgraded event, IOSubchannel channel) {
if (!openChannels.contains(channel)) {
return;
}
channel.respond(Output.from("/Greetings!", true));
} | [
"@",
"Handler",
"public",
"void",
"onUpgraded",
"(",
"Upgraded",
"event",
",",
"IOSubchannel",
"channel",
")",
"{",
"if",
"(",
"!",
"openChannels",
".",
"contains",
"(",
"channel",
")",
")",
"{",
"return",
";",
"}",
"channel",
".",
"respond",
"(",
"Outpu... | Handle upgrade confirmation.
@param event the event
@param channel the channel | [
"Handle",
"upgrade",
"confirmation",
"."
] | train | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/examples/src/org/jgrapes/http/demo/httpserver/WsEchoServer.java#L86-L92 |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/config/builder/patch/PatchedRuntimeEnvironmentBuilder.java | PatchedRuntimeEnvironmentBuilder.getDefaultInMemory | public static RuntimeEnvironmentBuilder getDefaultInMemory() {
"""
Provides default configuration of <code>RuntimeEnvironmentBuilder</code> that is based on.
<ul>
<li>DefaultRuntimeEnvironment</li>
</ul>
but it does not have persistence for process engine configured so it will only store process instances in m... | java | public static RuntimeEnvironmentBuilder getDefaultInMemory() {
// PATCHED from: RuntimeEnvironmentBuilder builder = new RuntimeEnvironmentBuilder(new DefaultRuntimeEnvironment(null, false));
RuntimeEnvironmentBuilder builder = new PatchedRuntimeEnvironmentBuilder(new PatchedRuntimeEnvironment());
... | [
"public",
"static",
"RuntimeEnvironmentBuilder",
"getDefaultInMemory",
"(",
")",
"{",
"// PATCHED from: RuntimeEnvironmentBuilder builder = new RuntimeEnvironmentBuilder(new DefaultRuntimeEnvironment(null, false));",
"RuntimeEnvironmentBuilder",
"builder",
"=",
"new",
"PatchedRuntimeEnvironm... | Provides default configuration of <code>RuntimeEnvironmentBuilder</code> that is based on.
<ul>
<li>DefaultRuntimeEnvironment</li>
</ul>
but it does not have persistence for process engine configured so it will only store process instances in memory
@return new instance of <code>RuntimeEnvironmentBuilder</code> that i... | [
"Provides",
"default",
"configuration",
"of",
"<code",
">",
"RuntimeEnvironmentBuilder<",
"/",
"code",
">",
"that",
"is",
"based",
"on",
".",
"<ul",
">",
"<li",
">",
"DefaultRuntimeEnvironment<",
"/",
"li",
">",
"<",
"/",
"ul",
">",
"but",
"it",
"does",
"n... | train | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/config/builder/patch/PatchedRuntimeEnvironmentBuilder.java#L151-L159 |
MindscapeHQ/raygun4android | provider/src/main/java/com.mindscapehq.android.raygun4android/services/RUMPostService.java | RUMPostService.postRUM | private static int postRUM(String apiKey, String jsonPayload) {
"""
Raw post method that delivers a pre-built RUM payload to the Raygun API.
@param apiKey The API key of the app to deliver to
@param jsonPayload The JSON representation of a ??? to be delivered over HTTPS.
@return HTTP result code - 202 if... | java | private static int postRUM(String apiKey, String jsonPayload) {
try {
if (validateApiKey(apiKey)) {
String endpoint = RaygunSettings.getRUMEndpoint();
MediaType MEDIA_TYPE_JSON = MediaType.parse("application/json; charset=utf-8");
OkHttpClient client = new OkHttpClient.Builder()
... | [
"private",
"static",
"int",
"postRUM",
"(",
"String",
"apiKey",
",",
"String",
"jsonPayload",
")",
"{",
"try",
"{",
"if",
"(",
"validateApiKey",
"(",
"apiKey",
")",
")",
"{",
"String",
"endpoint",
"=",
"RaygunSettings",
".",
"getRUMEndpoint",
"(",
")",
";"... | Raw post method that delivers a pre-built RUM payload to the Raygun API.
@param apiKey The API key of the app to deliver to
@param jsonPayload The JSON representation of a ??? to be delivered over HTTPS.
@return HTTP result code - 202 if successful, 403 if API key invalid, 400 if bad message (invalid properties) | [
"Raw",
"post",
"method",
"that",
"delivers",
"a",
"pre",
"-",
"built",
"RUM",
"payload",
"to",
"the",
"Raygun",
"API",
"."
] | train | https://github.com/MindscapeHQ/raygun4android/blob/227231f9b8aca1cafa5b6518a388d128e37d35fe/provider/src/main/java/com.mindscapehq.android.raygun4android/services/RUMPostService.java#L63-L101 |
fabric8io/kubernetes-client | kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/OperationSupport.java | OperationSupport.handleResponse | protected <T> T handleResponse(Request.Builder requestBuilder, Class<T> type) throws ExecutionException, InterruptedException, KubernetesClientException, IOException {
"""
Send an http request and handle the response.
@param requestBuilder Request Builder object
@param type type of resource
@param <T> templat... | java | protected <T> T handleResponse(Request.Builder requestBuilder, Class<T> type) throws ExecutionException, InterruptedException, KubernetesClientException, IOException {
return handleResponse(requestBuilder, type, Collections.<String, String>emptyMap());
} | [
"protected",
"<",
"T",
">",
"T",
"handleResponse",
"(",
"Request",
".",
"Builder",
"requestBuilder",
",",
"Class",
"<",
"T",
">",
"type",
")",
"throws",
"ExecutionException",
",",
"InterruptedException",
",",
"KubernetesClientException",
",",
"IOException",
"{",
... | Send an http request and handle the response.
@param requestBuilder Request Builder object
@param type type of resource
@param <T> template argument provided
@return Returns a de-serialized object as api server response of provided type.
@throws ExecutionException Execution Exception
@throws InterruptedException Inte... | [
"Send",
"an",
"http",
"request",
"and",
"handle",
"the",
"response",
"."
] | train | https://github.com/fabric8io/kubernetes-client/blob/141668a882ed8e902c045a5cd0a80f14bd17d132/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/dsl/base/OperationSupport.java#L346-L348 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/SortedBugCollection.java | SortedBugCollection.addAll | public void addAll(Collection<BugInstance> collection, boolean updateActiveTime) {
"""
Add a Collection of BugInstances to this BugCollection object.
@param collection
the Collection of BugInstances to add
@param updateActiveTime
true if active time of added BugInstances should be updated to
match collectio... | java | public void addAll(Collection<BugInstance> collection, boolean updateActiveTime) {
for (BugInstance warning : collection) {
add(warning, updateActiveTime);
}
} | [
"public",
"void",
"addAll",
"(",
"Collection",
"<",
"BugInstance",
">",
"collection",
",",
"boolean",
"updateActiveTime",
")",
"{",
"for",
"(",
"BugInstance",
"warning",
":",
"collection",
")",
"{",
"add",
"(",
"warning",
",",
"updateActiveTime",
")",
";",
"... | Add a Collection of BugInstances to this BugCollection object.
@param collection
the Collection of BugInstances to add
@param updateActiveTime
true if active time of added BugInstances should be updated to
match collection: false if not | [
"Add",
"a",
"Collection",
"of",
"BugInstances",
"to",
"this",
"BugCollection",
"object",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SortedBugCollection.java#L207-L211 |
strator-dev/greenpepper | greenpepper-open/extensions-external/ognl/src/main/java/com/greenpepper/extensions/ognl/OgnlExpression.java | OgnlExpression.onUnresolvedExpression | public static OgnlExpression onUnresolvedExpression( String expression, Object... targets ) {
"""
<p>onUnresolvedExpression.</p>
@param expression a {@link java.lang.String} object.
@param targets a {@link java.lang.Object} object.
@return a {@link com.greenpepper.extensions.ognl.OgnlExpression} object.
"... | java | public static OgnlExpression onUnresolvedExpression( String expression, Object... targets )
{
OgnlResolution resolver = new OgnlResolution( expression );
return new OgnlExpression( resolver.expressionsListToResolve(), targets );
} | [
"public",
"static",
"OgnlExpression",
"onUnresolvedExpression",
"(",
"String",
"expression",
",",
"Object",
"...",
"targets",
")",
"{",
"OgnlResolution",
"resolver",
"=",
"new",
"OgnlResolution",
"(",
"expression",
")",
";",
"return",
"new",
"OgnlExpression",
"(",
... | <p>onUnresolvedExpression.</p>
@param expression a {@link java.lang.String} object.
@param targets a {@link java.lang.Object} object.
@return a {@link com.greenpepper.extensions.ognl.OgnlExpression} object. | [
"<p",
">",
"onUnresolvedExpression",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-open/extensions-external/ognl/src/main/java/com/greenpepper/extensions/ognl/OgnlExpression.java#L81-L86 |
ironjacamar/ironjacamar | deployers/src/main/java/org/ironjacamar/deployers/common/AbstractResourceAdapterDeployer.java | AbstractResourceAdapterDeployer.findManagedConnectionFactory | private String findManagedConnectionFactory(String className, Connector connector) {
"""
Find the ManagedConnectionFactory class
@param className The initial class name
@param connector The metadata
@return The ManagedConnectionFactory
"""
for (org.ironjacamar.common.api.metadata.spec.ConnectionDefini... | java | private String findManagedConnectionFactory(String className, Connector connector)
{
for (org.ironjacamar.common.api.metadata.spec.ConnectionDefinition cd :
connector.getResourceadapter().getOutboundResourceadapter().getConnectionDefinitions())
{
if (className.equals(cd.getManagedC... | [
"private",
"String",
"findManagedConnectionFactory",
"(",
"String",
"className",
",",
"Connector",
"connector",
")",
"{",
"for",
"(",
"org",
".",
"ironjacamar",
".",
"common",
".",
"api",
".",
"metadata",
".",
"spec",
".",
"ConnectionDefinition",
"cd",
":",
"c... | Find the ManagedConnectionFactory class
@param className The initial class name
@param connector The metadata
@return The ManagedConnectionFactory | [
"Find",
"the",
"ManagedConnectionFactory",
"class"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/deployers/src/main/java/org/ironjacamar/deployers/common/AbstractResourceAdapterDeployer.java#L654-L664 |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/EvaluatorManager.java | EvaluatorManager.onEvaluatorException | public void onEvaluatorException(final EvaluatorException exception) {
"""
EvaluatorException will trigger is FailedEvaluator and state transition to FAILED.
@param exception on the EvaluatorRuntime
"""
synchronized (this.evaluatorDescriptor) {
if (this.stateManager.isCompleted()) {
LOG.l... | java | public void onEvaluatorException(final EvaluatorException exception) {
synchronized (this.evaluatorDescriptor) {
if (this.stateManager.isCompleted()) {
LOG.log(Level.FINE,
"Ignoring an exception received for Evaluator {0} which is already in state {1}.",
new Object[] {this.get... | [
"public",
"void",
"onEvaluatorException",
"(",
"final",
"EvaluatorException",
"exception",
")",
"{",
"synchronized",
"(",
"this",
".",
"evaluatorDescriptor",
")",
"{",
"if",
"(",
"this",
".",
"stateManager",
".",
"isCompleted",
"(",
")",
")",
"{",
"LOG",
".",
... | EvaluatorException will trigger is FailedEvaluator and state transition to FAILED.
@param exception on the EvaluatorRuntime | [
"EvaluatorException",
"will",
"trigger",
"is",
"FailedEvaluator",
"and",
"state",
"transition",
"to",
"FAILED",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/EvaluatorManager.java#L334-L383 |
liyiorg/weixin-popular | src/main/java/weixin/popular/util/JsUtil.java | JsUtil.generateConfigSignature | public static String generateConfigSignature(String noncestr,String jsapi_ticket,String timestamp,String url) {
"""
生成 config接口 signature
@param noncestr noncestr
@param jsapi_ticket jsapi_ticket
@param timestamp timestamp
@param url url
@return sign
"""
Map<String, String> map = new HashMap<String, St... | java | public static String generateConfigSignature(String noncestr,String jsapi_ticket,String timestamp,String url){
Map<String, String> map = new HashMap<String, String>();
map.put("noncestr", noncestr);
map.put("jsapi_ticket", jsapi_ticket);
map.put("timestamp", timestamp);
map.put("url", url);
Map<St... | [
"public",
"static",
"String",
"generateConfigSignature",
"(",
"String",
"noncestr",
",",
"String",
"jsapi_ticket",
",",
"String",
"timestamp",
",",
"String",
"url",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"=",
"new",
"HashMap",
"<",
"Strin... | 生成 config接口 signature
@param noncestr noncestr
@param jsapi_ticket jsapi_ticket
@param timestamp timestamp
@param url url
@return sign | [
"生成",
"config接口",
"signature"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/util/JsUtil.java#L80-L90 |
prestodb/presto | presto-accumulo/src/main/java/com/facebook/presto/accumulo/io/AccumuloRecordSet.java | AccumuloRecordSet.getScanAuthorizations | private static Authorizations getScanAuthorizations(ConnectorSession session, AccumuloSplit split, Connector connector, String username)
throws AccumuloException, AccumuloSecurityException {
"""
Gets the scanner authorizations to use for scanning tables.
<p>
In order of priority: session username aut... | java | private static Authorizations getScanAuthorizations(ConnectorSession session, AccumuloSplit split, Connector connector, String username)
throws AccumuloException, AccumuloSecurityException
{
String sessionScanUser = AccumuloSessionProperties.getScanUsername(session);
if (sessionScanUser ... | [
"private",
"static",
"Authorizations",
"getScanAuthorizations",
"(",
"ConnectorSession",
"session",
",",
"AccumuloSplit",
"split",
",",
"Connector",
"connector",
",",
"String",
"username",
")",
"throws",
"AccumuloException",
",",
"AccumuloSecurityException",
"{",
"String"... | Gets the scanner authorizations to use for scanning tables.
<p>
In order of priority: session username authorizations, then table property, then the default connector auths.
@param session Current session
@param split Accumulo split
@param connector Accumulo connector
@param username Accumulo username
@return Scan aut... | [
"Gets",
"the",
"scanner",
"authorizations",
"to",
"use",
"for",
"scanning",
"tables",
".",
"<p",
">",
"In",
"order",
"of",
"priority",
":",
"session",
"username",
"authorizations",
"then",
"table",
"property",
"then",
"the",
"default",
"connector",
"auths",
".... | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-accumulo/src/main/java/com/facebook/presto/accumulo/io/AccumuloRecordSet.java#L116-L137 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineExtensionsInner.java | VirtualMachineExtensionsInner.beginUpdate | public VirtualMachineExtensionInner beginUpdate(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) {
"""
The operation to update the extension.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine... | java | public VirtualMachineExtensionInner beginUpdate(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionUpdate extensionParameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).toBlocking().single().body();
} | [
"public",
"VirtualMachineExtensionInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmName",
",",
"String",
"vmExtensionName",
",",
"VirtualMachineExtensionUpdate",
"extensionParameters",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
... | The operation to update the extension.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine where the extension should be updated.
@param vmExtensionName The name of the virtual machine extension.
@param extensionParameters Parameters supplied to the Update Virtual Mac... | [
"The",
"operation",
"to",
"update",
"the",
"extension",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineExtensionsInner.java#L372-L374 |
aoindustries/semanticcms-core-model | src/main/java/com/semanticcms/core/model/Node.java | Node.getLabel | public String getLabel() {
"""
Gets a short description, useful for links and lists, for this node.
This default implementation calls {@link #appendLabel(java.lang.Appendable)}, thus you *must*
override at least this method or {@link #appendLabel(java.lang.Appendable)}.
@throws StackOverflowError if {@link ... | java | public String getLabel() {
StringBuilder sb = new StringBuilder();
try {
appendLabel(sb);
} catch(IOException e) {
throw new AssertionError("Should not happen because using StringBuilder", e);
}
return sb.toString();
} | [
"public",
"String",
"getLabel",
"(",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"try",
"{",
"appendLabel",
"(",
"sb",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new",
"AssertionError",
"(",
"\... | Gets a short description, useful for links and lists, for this node.
This default implementation calls {@link #appendLabel(java.lang.Appendable)}, thus you *must*
override at least this method or {@link #appendLabel(java.lang.Appendable)}.
@throws StackOverflowError if {@link #appendLabel(java.lang.Appendable)} not o... | [
"Gets",
"a",
"short",
"description",
"useful",
"for",
"links",
"and",
"lists",
"for",
"this",
"node",
"."
] | train | https://github.com/aoindustries/semanticcms-core-model/blob/14bdbe3f3d69b2b337129c5b1afcaa9e87cb5624/src/main/java/com/semanticcms/core/model/Node.java#L254-L262 |
kongchen/swagger-maven-plugin | src/main/java/com/github/kongchen/swagger/docgen/reader/ModelModifier.java | ModelModifier.processProperty | private void processProperty(ApiModelProperty apiModelPropertyAnnotation, Model model) {
"""
Remove property from {@link Model} for provided {@link ApiModelProperty}.
@param apiModelPropertyAnnotation annotation
@param model model with properties
"""
if (apiModelPropertyAnnotation == null) {
... | java | private void processProperty(ApiModelProperty apiModelPropertyAnnotation, Model model) {
if (apiModelPropertyAnnotation == null) {
return;
}
String apiModelPropertyAccess = apiModelPropertyAnnotation.access();
String apiModelPropertyName = apiModelPropertyAnnotation.name();
... | [
"private",
"void",
"processProperty",
"(",
"ApiModelProperty",
"apiModelPropertyAnnotation",
",",
"Model",
"model",
")",
"{",
"if",
"(",
"apiModelPropertyAnnotation",
"==",
"null",
")",
"{",
"return",
";",
"}",
"String",
"apiModelPropertyAccess",
"=",
"apiModelPropert... | Remove property from {@link Model} for provided {@link ApiModelProperty}.
@param apiModelPropertyAnnotation annotation
@param model model with properties | [
"Remove",
"property",
"from",
"{"
] | train | https://github.com/kongchen/swagger-maven-plugin/blob/0709b035ef45e1cb13189cd7f949c52c10557747/src/main/java/com/github/kongchen/swagger/docgen/reader/ModelModifier.java#L126-L144 |
ops4j/org.ops4j.pax.logging | pax-logging-log4j2/src/main/java/org/ops4j/pax/logging/log4j2/internal/PaxLoggingServiceImpl.java | PaxLoggingServiceImpl.getService | public Object getService( final Bundle bundle, ServiceRegistration registration ) {
"""
/*
use local class to delegate calls to underlying instance while keeping bundle reference
"""
class ManagedPaxLoggingService
implements PaxLoggingService, LogService, ManagedService
{
... | java | public Object getService( final Bundle bundle, ServiceRegistration registration )
{
class ManagedPaxLoggingService
implements PaxLoggingService, LogService, ManagedService
{
private final String fqcn = getClass().getName();
public void log( int level, String mess... | [
"public",
"Object",
"getService",
"(",
"final",
"Bundle",
"bundle",
",",
"ServiceRegistration",
"registration",
")",
"{",
"class",
"ManagedPaxLoggingService",
"implements",
"PaxLoggingService",
",",
"LogService",
",",
"ManagedService",
"{",
"private",
"final",
"String",... | /*
use local class to delegate calls to underlying instance while keeping bundle reference | [
"/",
"*",
"use",
"local",
"class",
"to",
"delegate",
"calls",
"to",
"underlying",
"instance",
"while",
"keeping",
"bundle",
"reference"
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-log4j2/src/main/java/org/ops4j/pax/logging/log4j2/internal/PaxLoggingServiceImpl.java#L384-L436 |
mozilla/rhino | src/org/mozilla/javascript/FunctionObject.java | FunctionObject.addAsConstructor | public void addAsConstructor(Scriptable scope, Scriptable prototype) {
"""
Define this function as a JavaScript constructor.
<p>
Sets up the "prototype" and "constructor" properties. Also
calls setParent and setPrototype with appropriate values.
Then adds the function object as a property of the given scope, u... | java | public void addAsConstructor(Scriptable scope, Scriptable prototype)
{
initAsConstructor(scope, prototype);
defineProperty(scope, prototype.getClassName(),
this, ScriptableObject.DONTENUM);
} | [
"public",
"void",
"addAsConstructor",
"(",
"Scriptable",
"scope",
",",
"Scriptable",
"prototype",
")",
"{",
"initAsConstructor",
"(",
"scope",
",",
"prototype",
")",
";",
"defineProperty",
"(",
"scope",
",",
"prototype",
".",
"getClassName",
"(",
")",
",",
"th... | Define this function as a JavaScript constructor.
<p>
Sets up the "prototype" and "constructor" properties. Also
calls setParent and setPrototype with appropriate values.
Then adds the function object as a property of the given scope, using
<code>prototype.getClassName()</code>
as the name of the property.
@param scop... | [
"Define",
"this",
"function",
"as",
"a",
"JavaScript",
"constructor",
".",
"<p",
">",
"Sets",
"up",
"the",
"prototype",
"and",
"constructor",
"properties",
".",
"Also",
"calls",
"setParent",
"and",
"setPrototype",
"with",
"appropriate",
"values",
".",
"Then",
... | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/FunctionObject.java#L322-L327 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FileSystem.java | FileSystem.setDefaultUri | public static void setDefaultUri(Configuration conf, String uri) {
"""
Set the default filesystem URI in a configuration.
@param conf the configuration to alter
@param uri the new default filesystem uri
"""
setDefaultUri(conf, URI.create(fixName(uri)));
} | java | public static void setDefaultUri(Configuration conf, String uri) {
setDefaultUri(conf, URI.create(fixName(uri)));
} | [
"public",
"static",
"void",
"setDefaultUri",
"(",
"Configuration",
"conf",
",",
"String",
"uri",
")",
"{",
"setDefaultUri",
"(",
"conf",
",",
"URI",
".",
"create",
"(",
"fixName",
"(",
"uri",
")",
")",
")",
";",
"}"
] | Set the default filesystem URI in a configuration.
@param conf the configuration to alter
@param uri the new default filesystem uri | [
"Set",
"the",
"default",
"filesystem",
"URI",
"in",
"a",
"configuration",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileSystem.java#L132-L134 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/map/impl/MapServiceContextImpl.java | MapServiceContextImpl.destroyPartitionsAndMapContainer | private void destroyPartitionsAndMapContainer(MapContainer mapContainer) {
"""
Destroys the map data on local partition threads and waits for
{@value #DESTROY_TIMEOUT_SECONDS} seconds
for each partition segment destruction to complete.
@param mapContainer the map container to destroy
"""
final Lis... | java | private void destroyPartitionsAndMapContainer(MapContainer mapContainer) {
final List<LocalRetryableExecution> executions = new ArrayList<>();
for (PartitionContainer container : partitionContainers) {
final MapPartitionDestroyOperation op = new MapPartitionDestroyOperation(container, mapCo... | [
"private",
"void",
"destroyPartitionsAndMapContainer",
"(",
"MapContainer",
"mapContainer",
")",
"{",
"final",
"List",
"<",
"LocalRetryableExecution",
">",
"executions",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"PartitionContainer",
"container",
":"... | Destroys the map data on local partition threads and waits for
{@value #DESTROY_TIMEOUT_SECONDS} seconds
for each partition segment destruction to complete.
@param mapContainer the map container to destroy | [
"Destroys",
"the",
"map",
"data",
"on",
"local",
"partition",
"threads",
"and",
"waits",
"for",
"{",
"@value",
"#DESTROY_TIMEOUT_SECONDS",
"}",
"seconds",
"for",
"each",
"partition",
"segment",
"destruction",
"to",
"complete",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/MapServiceContextImpl.java#L412-L430 |
jbundle/jbundle | thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageHeader.java | BaseMessageHeader.createMessageHeader | public static BaseMessageHeader createMessageHeader(String strMessageHeaderClassName, String strQueueName, String strQueueType, Object source, Map<String,Object> properties) {
"""
Setup this message given this internal data structure.
@param data The data in an intermediate format.
"""
BaseMessageHead... | java | public static BaseMessageHeader createMessageHeader(String strMessageHeaderClassName, String strQueueName, String strQueueType, Object source, Map<String,Object> properties)
{
BaseMessageHeader messageHeader = (BaseMessageHeader)ClassServiceUtility.getClassService().makeObjectFromClassName(strMessageHeaderC... | [
"public",
"static",
"BaseMessageHeader",
"createMessageHeader",
"(",
"String",
"strMessageHeaderClassName",
",",
"String",
"strQueueName",
",",
"String",
"strQueueType",
",",
"Object",
"source",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
... | Setup this message given this internal data structure.
@param data The data in an intermediate format. | [
"Setup",
"this",
"message",
"given",
"this",
"internal",
"data",
"structure",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageHeader.java#L361-L367 |
spring-cloud/spring-cloud-netflix | spring-cloud-netflix-ribbon/src/main/java/org/springframework/cloud/netflix/ribbon/RibbonUtils.java | RibbonUtils.updateToSecureConnectionIfNeeded | static URI updateToSecureConnectionIfNeeded(URI uri, ServiceInstance ribbonServer) {
"""
Replace the scheme to the secure variant if needed. If the
{@link #unsecureSchemeMapping} map contains the uri scheme and
{@link #isSecure(IClientConfig, ServerIntrospector, Server)} is true, update the
scheme. This assumes... | java | static URI updateToSecureConnectionIfNeeded(URI uri, ServiceInstance ribbonServer) {
String scheme = uri.getScheme();
if (StringUtils.isEmpty(scheme)) {
scheme = "http";
}
if (!StringUtils.isEmpty(uri.toString())
&& unsecureSchemeMapping.containsKey(scheme) && ribbonServer.isSecure()) {
return upgra... | [
"static",
"URI",
"updateToSecureConnectionIfNeeded",
"(",
"URI",
"uri",
",",
"ServiceInstance",
"ribbonServer",
")",
"{",
"String",
"scheme",
"=",
"uri",
".",
"getScheme",
"(",
")",
";",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"scheme",
")",
")",
"{",... | Replace the scheme to the secure variant if needed. If the
{@link #unsecureSchemeMapping} map contains the uri scheme and
{@link #isSecure(IClientConfig, ServerIntrospector, Server)} is true, update the
scheme. This assumes the uri is already encoded to avoid double encoding.
@param uri to modify if required
@param rib... | [
"Replace",
"the",
"scheme",
"to",
"the",
"secure",
"variant",
"if",
"needed",
".",
"If",
"the",
"{"
] | train | https://github.com/spring-cloud/spring-cloud-netflix/blob/03b1e326ce5971c41239890dc71cae616366cff8/spring-cloud-netflix-ribbon/src/main/java/org/springframework/cloud/netflix/ribbon/RibbonUtils.java#L134-L146 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getExplodedArray | @Nonnull
public static String [] getExplodedArray (final char cSep, @Nullable final String sElements) {
"""
Take a concatenated String and return the passed String array of all elements
in the passed string, using specified separator char.
@param cSep
The separator to use.
@param sElements
The concatenate... | java | @Nonnull
public static String [] getExplodedArray (final char cSep, @Nullable final String sElements)
{
return getExplodedArray (cSep, sElements, -1);
} | [
"@",
"Nonnull",
"public",
"static",
"String",
"[",
"]",
"getExplodedArray",
"(",
"final",
"char",
"cSep",
",",
"@",
"Nullable",
"final",
"String",
"sElements",
")",
"{",
"return",
"getExplodedArray",
"(",
"cSep",
",",
"sElements",
",",
"-",
"1",
")",
";",
... | Take a concatenated String and return the passed String array of all elements
in the passed string, using specified separator char.
@param cSep
The separator to use.
@param sElements
The concatenated String to convert. May be <code>null</code> or empty.
@return The passed collection and never <code>null</code>. | [
"Take",
"a",
"concatenated",
"String",
"and",
"return",
"the",
"passed",
"String",
"array",
"of",
"all",
"elements",
"in",
"the",
"passed",
"string",
"using",
"specified",
"separator",
"char",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L1963-L1967 |
Crab2died/Excel4J | src/main/java/com/github/crab2died/ExcelUtils.java | ExcelUtils.readCSV2Objects | public <T> List<T> readCSV2Objects(InputStream is, Class<T> clazz) {
"""
基于注解读取CSV文件
@param is 待读取文件输入流
@param clazz 待绑定的类(绑定属性注解{@link com.github.crab2died.annotation.ExcelField})
@return 返回转换为设置绑定的java对象集合
@throws Excel4jReadException exception
"""
try {
return readCSVByMapHandl... | java | public <T> List<T> readCSV2Objects(InputStream is, Class<T> clazz) {
try {
return readCSVByMapHandler(is, clazz);
} catch (Excel4JException | IOException e) {
throw new Excel4jReadException("read CSV Error: ", e);
}
} | [
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"readCSV2Objects",
"(",
"InputStream",
"is",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"try",
"{",
"return",
"readCSVByMapHandler",
"(",
"is",
",",
"clazz",
")",
";",
"}",
"catch",
"(",
"Excel4JEx... | 基于注解读取CSV文件
@param is 待读取文件输入流
@param clazz 待绑定的类(绑定属性注解{@link com.github.crab2died.annotation.ExcelField})
@return 返回转换为设置绑定的java对象集合
@throws Excel4jReadException exception | [
"基于注解读取CSV文件"
] | train | https://github.com/Crab2died/Excel4J/blob/2ab0a3b8226a69ff868c3ead6e724f3a774f5f77/src/main/java/com/github/crab2died/ExcelUtils.java#L1529-L1536 |
linkedin/PalDB | paldb/src/main/java/com/linkedin/paldb/api/Configuration.java | Configuration.getShort | public short getShort(String key, short defaultValue) {
"""
Gets the short value for <code>key</code> or <code>defaultValue</code> if not found.
@param key key to get value for
@param defaultValue default value if key not found
@return value or <code>defaultValue</code> if not found
"""
if (containsKe... | java | public short getShort(String key, short defaultValue) {
if (containsKey(key)) {
return Short.parseShort(get(key));
} else {
return defaultValue;
}
} | [
"public",
"short",
"getShort",
"(",
"String",
"key",
",",
"short",
"defaultValue",
")",
"{",
"if",
"(",
"containsKey",
"(",
"key",
")",
")",
"{",
"return",
"Short",
".",
"parseShort",
"(",
"get",
"(",
"key",
")",
")",
";",
"}",
"else",
"{",
"return",... | Gets the short value for <code>key</code> or <code>defaultValue</code> if not found.
@param key key to get value for
@param defaultValue default value if key not found
@return value or <code>defaultValue</code> if not found | [
"Gets",
"the",
"short",
"value",
"for",
"<code",
">",
"key<",
"/",
"code",
">",
"or",
"<code",
">",
"defaultValue<",
"/",
"code",
">",
"if",
"not",
"found",
"."
] | train | https://github.com/linkedin/PalDB/blob/d05ccdd3f67855eb2675dbd82599f19aa7a9f650/paldb/src/main/java/com/linkedin/paldb/api/Configuration.java#L198-L204 |
drinkjava2/jDialects | core/src/main/java/com/github/drinkjava2/jdialects/TableModelUtils.java | TableModelUtils.model2JavaSrc | public static String model2JavaSrc(TableModel model, boolean linkStyle, boolean activeRecord, String packageName) {
"""
Convert a TablemModel instance to Java entity class source code
@param model
The TableModel instance
@param linkStyle
if true, create linked style setter, otherwise create normal
setter
@... | java | public static String model2JavaSrc(TableModel model, boolean linkStyle, boolean activeRecord, String packageName) {
return TableModelUtilsOfJavaSrc.modelToJavaSourceCode(model, linkStyle, activeRecord, packageName);
} | [
"public",
"static",
"String",
"model2JavaSrc",
"(",
"TableModel",
"model",
",",
"boolean",
"linkStyle",
",",
"boolean",
"activeRecord",
",",
"String",
"packageName",
")",
"{",
"return",
"TableModelUtilsOfJavaSrc",
".",
"modelToJavaSourceCode",
"(",
"model",
",",
"li... | Convert a TablemModel instance to Java entity class source code
@param model
The TableModel instance
@param linkStyle
if true, create linked style setter, otherwise create normal
setter
@param activeRecord
if true, build a jSqlBox ActiveRecord Entity class, otherwise
build a POJO class
@param packageName
Optional, the... | [
"Convert",
"a",
"TablemModel",
"instance",
"to",
"Java",
"entity",
"class",
"source",
"code"
] | train | https://github.com/drinkjava2/jDialects/blob/1c165f09c6042a599b681c279024abcc1b848b88/core/src/main/java/com/github/drinkjava2/jdialects/TableModelUtils.java#L120-L122 |
aol/cyclops | cyclops-reactor-integration/src/main/java/cyclops/companion/reactor/Monos.java | Monos.firstSuccess | @SafeVarargs
public static <T> Mono<T> firstSuccess(Mono<T>... fts) {
"""
Select the first Future to return with a successful result
<pre>
{@code
Mono<Integer> ft = Mono.empty();
Mono<Integer> result = Monos.firstSuccess(Mono.deferred(()->1),ft);
ft.complete(10);
result.get() //1
}
</pre>
@param... | java | @SafeVarargs
public static <T> Mono<T> firstSuccess(Mono<T>... fts) {
return Mono.from(Future.firstSuccess(futures(fts)));
} | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"Mono",
"<",
"T",
">",
"firstSuccess",
"(",
"Mono",
"<",
"T",
">",
"...",
"fts",
")",
"{",
"return",
"Mono",
".",
"from",
"(",
"Future",
".",
"firstSuccess",
"(",
"futures",
"(",
"fts",
")",
")... | Select the first Future to return with a successful result
<pre>
{@code
Mono<Integer> ft = Mono.empty();
Mono<Integer> result = Monos.firstSuccess(Mono.deferred(()->1),ft);
ft.complete(10);
result.get() //1
}
</pre>
@param fts Monos to race
@return First Mono to return with a result | [
"Select",
"the",
"first",
"Future",
"to",
"return",
"with",
"a",
"successful",
"result"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops-reactor-integration/src/main/java/cyclops/companion/reactor/Monos.java#L192-L196 |
deeplearning4j/deeplearning4j | datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java | ArrowConverter.providerForVectors | public static DictionaryProvider providerForVectors(List<FieldVector> vectors,List<Field> fields) {
"""
Provide a value look up dictionary based on the
given set of input {@link FieldVector} s for
reading and writing to arrow streams
@param vectors the vectors to use as a lookup
@return the associated {@link D... | java | public static DictionaryProvider providerForVectors(List<FieldVector> vectors,List<Field> fields) {
Dictionary[] dictionaries = new Dictionary[vectors.size()];
for(int i = 0; i < vectors.size(); i++) {
DictionaryEncoding dictionary = fields.get(i).getDictionary();
if(dictionary =... | [
"public",
"static",
"DictionaryProvider",
"providerForVectors",
"(",
"List",
"<",
"FieldVector",
">",
"vectors",
",",
"List",
"<",
"Field",
">",
"fields",
")",
"{",
"Dictionary",
"[",
"]",
"dictionaries",
"=",
"new",
"Dictionary",
"[",
"vectors",
".",
"size",
... | Provide a value look up dictionary based on the
given set of input {@link FieldVector} s for
reading and writing to arrow streams
@param vectors the vectors to use as a lookup
@return the associated {@link DictionaryProvider} for the given
input {@link FieldVector} list | [
"Provide",
"a",
"value",
"look",
"up",
"dictionary",
"based",
"on",
"the",
"given",
"set",
"of",
"input",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java#L555-L565 |
james-hu/jabb-core | src/main/java/net/sf/jabb/cache/AbstractEhCachedKeyValueRepository.java | AbstractEhCachedKeyValueRepository.replaceWithSelfPopulatingCacheIfNot | protected SelfPopulatingCache replaceWithSelfPopulatingCacheIfNot(Ehcache ehcache, CacheEntryFactory factory) {
"""
Replace the cache with a SelfPopulatingCache decorated one if this has not been done yet.
The cacheLoaderTimeoutMillis of the original cache will be used as the timeoutMillis of the BlockingCache.
... | java | protected SelfPopulatingCache replaceWithSelfPopulatingCacheIfNot(Ehcache ehcache, CacheEntryFactory factory){
if (ehcache instanceof SelfPopulatingCache){
return (SelfPopulatingCache) ehcache;
}
SelfPopulatingCache selfPopulatingCache = new SelfPopulatingCache(ehcache, factory);
selfPopulatingCache.setTi... | [
"protected",
"SelfPopulatingCache",
"replaceWithSelfPopulatingCacheIfNot",
"(",
"Ehcache",
"ehcache",
",",
"CacheEntryFactory",
"factory",
")",
"{",
"if",
"(",
"ehcache",
"instanceof",
"SelfPopulatingCache",
")",
"{",
"return",
"(",
"SelfPopulatingCache",
")",
"ehcache",
... | Replace the cache with a SelfPopulatingCache decorated one if this has not been done yet.
The cacheLoaderTimeoutMillis of the original cache will be used as the timeoutMillis of the BlockingCache.
@param ehcache the original cache
@param factory the cache entry value factory
@return a BlockingCache wrapping the ori... | [
"Replace",
"the",
"cache",
"with",
"a",
"SelfPopulatingCache",
"decorated",
"one",
"if",
"this",
"has",
"not",
"been",
"done",
"yet",
".",
"The",
"cacheLoaderTimeoutMillis",
"of",
"the",
"original",
"cache",
"will",
"be",
"used",
"as",
"the",
"timeoutMillis",
... | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/cache/AbstractEhCachedKeyValueRepository.java#L173-L183 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionPersistenceImpl.java | CPOptionPersistenceImpl.findAll | @Override
public List<CPOption> findAll(int start, int end) {
"""
Returns a range of all the cp options.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0<... | java | @Override
public List<CPOption> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPOption",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the cp options.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</cod... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"options",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionPersistenceImpl.java#L3170-L3173 |
hawkular/hawkular-agent | hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SecurityDomainJBossASClient.java | SecurityDomainJBossASClient.securityDomainHasLoginModule | public boolean securityDomainHasLoginModule(String domainName, String moduleName) throws Exception {
"""
Check if a certain login module is present inside the passed security domain
@param domainName Name of the security domain
@param moduleName Name of the Login module - wich usually is it FQCN
@return True if... | java | public boolean securityDomainHasLoginModule(String domainName, String moduleName) throws Exception {
Address addr = Address.root().add(SUBSYSTEM, SUBSYSTEM_SECURITY, SECURITY_DOMAIN, domainName);
addr.add(AUTHENTICATION, CLASSIC);
addr.add(LOGIN_MODULE, moduleName);
ModelNode request = c... | [
"public",
"boolean",
"securityDomainHasLoginModule",
"(",
"String",
"domainName",
",",
"String",
"moduleName",
")",
"throws",
"Exception",
"{",
"Address",
"addr",
"=",
"Address",
".",
"root",
"(",
")",
".",
"add",
"(",
"SUBSYSTEM",
",",
"SUBSYSTEM_SECURITY",
","... | Check if a certain login module is present inside the passed security domain
@param domainName Name of the security domain
@param moduleName Name of the Login module - wich usually is it FQCN
@return True if the module is present
@throws Exception any error | [
"Check",
"if",
"a",
"certain",
"login",
"module",
"is",
"present",
"inside",
"the",
"passed",
"security",
"domain"
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SecurityDomainJBossASClient.java#L406-L413 |
iipc/webarchive-commons | src/main/java/org/archive/util/Recorder.java | Recorder.getContentReplayPrefixString | public String getContentReplayPrefixString(int size, Charset cs) {
"""
Return a short prefix of the presumed-textual content as a String.
@param size max length of String to return
@return String prefix, or empty String (with logged exception) on any error
"""
try {
InputStreamReader is... | java | public String getContentReplayPrefixString(int size, Charset cs) {
try {
InputStreamReader isr = new InputStreamReader(getContentReplayInputStream(), cs);
char[] chars = new char[size];
int count = isr.read(chars);
isr.close();
if (count > 0) {
... | [
"public",
"String",
"getContentReplayPrefixString",
"(",
"int",
"size",
",",
"Charset",
"cs",
")",
"{",
"try",
"{",
"InputStreamReader",
"isr",
"=",
"new",
"InputStreamReader",
"(",
"getContentReplayInputStream",
"(",
")",
",",
"cs",
")",
";",
"char",
"[",
"]"... | Return a short prefix of the presumed-textual content as a String.
@param size max length of String to return
@return String prefix, or empty String (with logged exception) on any error | [
"Return",
"a",
"short",
"prefix",
"of",
"the",
"presumed",
"-",
"textual",
"content",
"as",
"a",
"String",
"."
] | train | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/util/Recorder.java#L509-L524 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/utils/FileUtils.java | FileUtils.deleteDirOnExit | public static void deleteDirOnExit(final File dir) {
"""
Delete a directory recursively. This method will delete all files and subdirectories.
@param dir Directory to delete
@return If no error occurs, true is returned. false otherwise.
"""
if (dir.isDirectory()) {
final String[] childr... | java | public static void deleteDirOnExit(final File dir) {
if (dir.isDirectory()) {
final String[] children = dir.list();
for (int i = 0; i < children.length; i++) {
deleteDirOnExit(new File(dir, children[i]));
}
}
// The directory is now empty so d... | [
"public",
"static",
"void",
"deleteDirOnExit",
"(",
"final",
"File",
"dir",
")",
"{",
"if",
"(",
"dir",
".",
"isDirectory",
"(",
")",
")",
"{",
"final",
"String",
"[",
"]",
"children",
"=",
"dir",
".",
"list",
"(",
")",
";",
"for",
"(",
"int",
"i",... | Delete a directory recursively. This method will delete all files and subdirectories.
@param dir Directory to delete
@return If no error occurs, true is returned. false otherwise. | [
"Delete",
"a",
"directory",
"recursively",
".",
"This",
"method",
"will",
"delete",
"all",
"files",
"and",
"subdirectories",
"."
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/utils/FileUtils.java#L100-L110 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/PartialMerkleTree.java | PartialMerkleTree.buildFromLeaves | public static PartialMerkleTree buildFromLeaves(NetworkParameters params, byte[] includeBits, List<Sha256Hash> allLeafHashes) {
"""
Calculates a PMT given the list of leaf hashes and which leaves need to be included. The relevant interior hashes
are calculated and a new PMT returned.
"""
// Calculate ... | java | public static PartialMerkleTree buildFromLeaves(NetworkParameters params, byte[] includeBits, List<Sha256Hash> allLeafHashes) {
// Calculate height of the tree.
int height = 0;
while (getTreeWidth(allLeafHashes.size(), height) > 1)
height++;
List<Boolean> bitList = new ArrayL... | [
"public",
"static",
"PartialMerkleTree",
"buildFromLeaves",
"(",
"NetworkParameters",
"params",
",",
"byte",
"[",
"]",
"includeBits",
",",
"List",
"<",
"Sha256Hash",
">",
"allLeafHashes",
")",
"{",
"// Calculate height of the tree.",
"int",
"height",
"=",
"0",
";",
... | Calculates a PMT given the list of leaf hashes and which leaves need to be included. The relevant interior hashes
are calculated and a new PMT returned. | [
"Calculates",
"a",
"PMT",
"given",
"the",
"list",
"of",
"leaf",
"hashes",
"and",
"which",
"leaves",
"need",
"to",
"be",
"included",
".",
"The",
"relevant",
"interior",
"hashes",
"are",
"calculated",
"and",
"a",
"new",
"PMT",
"returned",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/PartialMerkleTree.java#L89-L102 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/FieldListener.java | FieldListener.doSetData | public int doSetData(Object objData, boolean bDisplayOption, int iMoveMode) {
"""
Move the physical binary data to this field.
@param objData the raw data to set the basefield to.
@param bDisplayOption If true, display the change.
@param iMoveMode The type of move being done (init/read/screen).
@return The err... | java | public int doSetData(Object objData, boolean bDisplayOption, int iMoveMode)
{
int iErrorCode = DBConstants.NORMAL_RETURN;
FieldListener nextListener = (FieldListener)this.getNextValidListener(iMoveMode);
if (nextListener != null)
{
boolean bOldState = nextListener.setEnab... | [
"public",
"int",
"doSetData",
"(",
"Object",
"objData",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"int",
"iErrorCode",
"=",
"DBConstants",
".",
"NORMAL_RETURN",
";",
"FieldListener",
"nextListener",
"=",
"(",
"FieldListener",
")",
"thi... | Move the physical binary data to this field.
@param objData the raw data to set the basefield to.
@param bDisplayOption If true, display the change.
@param iMoveMode The type of move being done (init/read/screen).
@return The error code (or NORMAL_RETURN if okay). | [
"Move",
"the",
"physical",
"binary",
"data",
"to",
"this",
"field",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/FieldListener.java#L195-L208 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/edge/GGradientToEdgeFeatures.java | GGradientToEdgeFeatures.direction2 | static public <D extends ImageGray<D>>
void direction2( D derivX , D derivY , GrayF32 angle ) {
"""
Computes the edge orientation using the {@link Math#atan2} function.
@param derivX Derivative along x-axis. Not modified.
@param derivY Derivative along y-axis. Not modified.
@param angle Edge orientation in r... | java | static public <D extends ImageGray<D>>
void direction2( D derivX , D derivY , GrayF32 angle )
{
if( derivX instanceof GrayF32) {
GradientToEdgeFeatures.direction2((GrayF32)derivX,(GrayF32)derivY,angle);
} else if( derivX instanceof GrayS16) {
GradientToEdgeFeatures.direction2((GrayS16)derivX,(GrayS16)derivY... | [
"static",
"public",
"<",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"void",
"direction2",
"(",
"D",
"derivX",
",",
"D",
"derivY",
",",
"GrayF32",
"angle",
")",
"{",
"if",
"(",
"derivX",
"instanceof",
"GrayF32",
")",
"{",
"GradientToEdgeFeatures",
"... | Computes the edge orientation using the {@link Math#atan2} function.
@param derivX Derivative along x-axis. Not modified.
@param derivY Derivative along y-axis. Not modified.
@param angle Edge orientation in radians (-pi to pi). | [
"Computes",
"the",
"edge",
"orientation",
"using",
"the",
"{",
"@link",
"Math#atan2",
"}",
"function",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/edge/GGradientToEdgeFeatures.java#L104-L116 |
jbundle/jbundle | thin/base/screen/cal/sample/remote/src/main/java/org/jbundle/thin/base/screen/cal/sample/multitask/CalendarProduct.java | CalendarProduct.changeRemoteDate | public void changeRemoteDate(Application application, String strParams, CachedItem productItem, Date dateStart, Date dateEnd) {
"""
Change the date of the actual data.
Override this to change the date.
"""
productItem.setStatus(productItem.getStatus() | (1 << 3) | (1 << 2) | (1 << 1));
if (ap... | java | public void changeRemoteDate(Application application, String strParams, CachedItem productItem, Date dateStart, Date dateEnd)
{
productItem.setStatus(productItem.getStatus() | (1 << 3) | (1 << 2) | (1 << 1));
if (application == null)
application = BaseApplet.getSharedInstance().getAppli... | [
"public",
"void",
"changeRemoteDate",
"(",
"Application",
"application",
",",
"String",
"strParams",
",",
"CachedItem",
"productItem",
",",
"Date",
"dateStart",
",",
"Date",
"dateEnd",
")",
"{",
"productItem",
".",
"setStatus",
"(",
"productItem",
".",
"getStatus"... | Change the date of the actual data.
Override this to change the date. | [
"Change",
"the",
"date",
"of",
"the",
"actual",
"data",
".",
"Override",
"this",
"to",
"change",
"the",
"date",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/cal/sample/remote/src/main/java/org/jbundle/thin/base/screen/cal/sample/multitask/CalendarProduct.java#L93-L100 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java | CPDefinitionLinkPersistenceImpl.findAll | @Override
public List<CPDefinitionLink> findAll(int start, int end) {
"""
Returns a range of all the cp definition links.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result se... | java | @Override
public List<CPDefinitionLink> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionLink",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the cp definition links.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>s... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"definition",
"links",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionLinkPersistenceImpl.java#L4737-L4740 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.getEntityRole | public EntityRole getEntityRole(UUID appId, String versionId, UUID entityId, UUID roleId) {
"""
Get one entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId entity ID.
@param roleId entity role ID.
@throws IllegalArgumentException thrown if parame... | java | public EntityRole getEntityRole(UUID appId, String versionId, UUID entityId, UUID roleId) {
return getEntityRoleWithServiceResponseAsync(appId, versionId, entityId, roleId).toBlocking().single().body();
} | [
"public",
"EntityRole",
"getEntityRole",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"entityId",
",",
"UUID",
"roleId",
")",
"{",
"return",
"getEntityRoleWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"entityId",
",",
"roleId",
... | Get one entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param entityId entity ID.
@param roleId entity role ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
@throws... | [
"Get",
"one",
"entity",
"role",
"for",
"a",
"given",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L10742-L10744 |
m-m-m/util | datatype/src/main/java/net/sf/mmm/util/datatype/api/phone/PhoneCountryCode.java | PhoneCountryCode.parseCountryCode | private static int parseCountryCode(String countryCode) {
"""
This method parses a {@link PhoneCountryCode} given as {@link String} to its {@link #getCountryCode() int
representation}.
@param countryCode is the {@link PhoneCountryCode} as {@link String}.
@return the {@link PhoneCountryCode} as int.
"""
... | java | private static int parseCountryCode(String countryCode) {
String normalized = countryCode;
if (normalized.startsWith(InternationalCallPrefix.PREFIX_PLUS)) {
normalized = normalized.substring(1);
} else if (normalized.startsWith(InternationalCallPrefix.PREFIX_00)) {
normalized = normalized.subst... | [
"private",
"static",
"int",
"parseCountryCode",
"(",
"String",
"countryCode",
")",
"{",
"String",
"normalized",
"=",
"countryCode",
";",
"if",
"(",
"normalized",
".",
"startsWith",
"(",
"InternationalCallPrefix",
".",
"PREFIX_PLUS",
")",
")",
"{",
"normalized",
... | This method parses a {@link PhoneCountryCode} given as {@link String} to its {@link #getCountryCode() int
representation}.
@param countryCode is the {@link PhoneCountryCode} as {@link String}.
@return the {@link PhoneCountryCode} as int. | [
"This",
"method",
"parses",
"a",
"{",
"@link",
"PhoneCountryCode",
"}",
"given",
"as",
"{",
"@link",
"String",
"}",
"to",
"its",
"{",
"@link",
"#getCountryCode",
"()",
"int",
"representation",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/datatype/src/main/java/net/sf/mmm/util/datatype/api/phone/PhoneCountryCode.java#L68-L87 |
sarl/sarl | main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/wizards/importproject/MavenImportUtils.java | MavenImportUtils.forceSimplePom | static void forceSimplePom(File projectDir, IProgressMonitor monitor) throws IOException {
"""
Force the pom file of a project to be "simple".
@param projectDir the folder in which the pom file is located.
@param monitor the progress monitor.
@throws IOException if the pom file cannot be changed.
"""
fi... | java | static void forceSimplePom(File projectDir, IProgressMonitor monitor) throws IOException {
final File pomFile = new File(projectDir, POM_FILE);
if (pomFile.exists()) {
final SubMonitor submon = SubMonitor.convert(monitor, 4);
final File savedPomFile = new File(projectDir, POM_BACKUP_FILE);
if (savedPomFile... | [
"static",
"void",
"forceSimplePom",
"(",
"File",
"projectDir",
",",
"IProgressMonitor",
"monitor",
")",
"throws",
"IOException",
"{",
"final",
"File",
"pomFile",
"=",
"new",
"File",
"(",
"projectDir",
",",
"POM_FILE",
")",
";",
"if",
"(",
"pomFile",
".",
"ex... | Force the pom file of a project to be "simple".
@param projectDir the folder in which the pom file is located.
@param monitor the progress monitor.
@throws IOException if the pom file cannot be changed. | [
"Force",
"the",
"pom",
"file",
"of",
"a",
"project",
"to",
"be",
"simple",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/wizards/importproject/MavenImportUtils.java#L186-L210 |
httl/httl | httl/src/main/java/httl/spi/engines/DefaultEngine.java | DefaultEngine.parseTemplate | public Template parseTemplate(String source, Object parameterTypes) throws ParseException {
"""
Parse string template.
@param source - template source
@return template instance
@throws IOException - If an I/O error occurs
@throws ParseException - If the template cannot be parsed
@see #getEngine()
"""... | java | public Template parseTemplate(String source, Object parameterTypes) throws ParseException {
String name = "/$" + Digest.getMD5(source);
if (!hasResource(name)) {
stringLoader.add(name, source);
}
try {
return getTemplate(name, parameterTypes);
} catch (IOE... | [
"public",
"Template",
"parseTemplate",
"(",
"String",
"source",
",",
"Object",
"parameterTypes",
")",
"throws",
"ParseException",
"{",
"String",
"name",
"=",
"\"/$\"",
"+",
"Digest",
".",
"getMD5",
"(",
"source",
")",
";",
"if",
"(",
"!",
"hasResource",
"(",... | Parse string template.
@param source - template source
@return template instance
@throws IOException - If an I/O error occurs
@throws ParseException - If the template cannot be parsed
@see #getEngine() | [
"Parse",
"string",
"template",
"."
] | train | https://github.com/httl/httl/blob/e13e00f4ab41252a8f53d6dafd4a6610be9dcaad/httl/src/main/java/httl/spi/engines/DefaultEngine.java#L278-L288 |
JodaOrg/joda-time | src/main/java/org/joda/time/DateTime.java | DateTime.withDurationAdded | public DateTime withDurationAdded(long durationToAdd, int scalar) {
"""
Returns a copy of this datetime with the specified duration added.
<p>
If the addition is zero, then <code>this</code> is returned.
@param durationToAdd the duration to add to this one
@param scalar the amount of times to add, such as ... | java | public DateTime withDurationAdded(long durationToAdd, int scalar) {
if (durationToAdd == 0 || scalar == 0) {
return this;
}
long instant = getChronology().add(getMillis(), durationToAdd, scalar);
return withMillis(instant);
} | [
"public",
"DateTime",
"withDurationAdded",
"(",
"long",
"durationToAdd",
",",
"int",
"scalar",
")",
"{",
"if",
"(",
"durationToAdd",
"==",
"0",
"||",
"scalar",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"long",
"instant",
"=",
"getChronology",
"(",
... | Returns a copy of this datetime with the specified duration added.
<p>
If the addition is zero, then <code>this</code> is returned.
@param durationToAdd the duration to add to this one
@param scalar the amount of times to add, such as -1 to subtract once
@return a copy of this datetime with the duration added
@throw... | [
"Returns",
"a",
"copy",
"of",
"this",
"datetime",
"with",
"the",
"specified",
"duration",
"added",
".",
"<p",
">",
"If",
"the",
"addition",
"is",
"zero",
"then",
"<code",
">",
"this<",
"/",
"code",
">",
"is",
"returned",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateTime.java#L897-L903 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/windows/WindowsProcessOutputHandler.java | WindowsProcessOutputHandler.updateFaxJob | public void updateFaxJob(FaxClientSpi faxClientSpi,FaxJob faxJob,ProcessOutput processOutput,FaxActionType faxActionType) {
"""
Updates the fax job based on the data from the process output.
@param faxClientSpi
The fax client SPI
@param faxJob
The fax job object
@param processOutput
The process outpu... | java | public void updateFaxJob(FaxClientSpi faxClientSpi,FaxJob faxJob,ProcessOutput processOutput,FaxActionType faxActionType)
{
//get output
String output=WindowsFaxClientSpiHelper.getOutputPart(processOutput,Fax4jExeConstants.FAX_JOB_ID_OUTPUT_PREFIX.toString());
if(output!=null)
{
... | [
"public",
"void",
"updateFaxJob",
"(",
"FaxClientSpi",
"faxClientSpi",
",",
"FaxJob",
"faxJob",
",",
"ProcessOutput",
"processOutput",
",",
"FaxActionType",
"faxActionType",
")",
"{",
"//get output",
"String",
"output",
"=",
"WindowsFaxClientSpiHelper",
".",
"getOutputP... | Updates the fax job based on the data from the process output.
@param faxClientSpi
The fax client SPI
@param faxJob
The fax job object
@param processOutput
The process output
@param faxActionType
The fax action type | [
"Updates",
"the",
"fax",
"job",
"based",
"on",
"the",
"data",
"from",
"the",
"process",
"output",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/windows/WindowsProcessOutputHandler.java#L41-L54 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/container/impl/metadata/BpmPlatformXmlParse.java | BpmPlatformXmlParse.parseJobExecutor | protected void parseJobExecutor(Element element, JobExecutorXmlImpl jobExecutorXml) {
"""
parse a <code><job-executor .../></code> element and add it to the list of parsed elements
"""
List<JobAcquisitionXml> jobAcquisitions = new ArrayList<JobAcquisitionXml>();
Map<String, String> properties = ... | java | protected void parseJobExecutor(Element element, JobExecutorXmlImpl jobExecutorXml) {
List<JobAcquisitionXml> jobAcquisitions = new ArrayList<JobAcquisitionXml>();
Map<String, String> properties = new HashMap<String, String>();
for (Element childElement : element.elements()) {
if(JOB_ACQUISITION.eq... | [
"protected",
"void",
"parseJobExecutor",
"(",
"Element",
"element",
",",
"JobExecutorXmlImpl",
"jobExecutorXml",
")",
"{",
"List",
"<",
"JobAcquisitionXml",
">",
"jobAcquisitions",
"=",
"new",
"ArrayList",
"<",
"JobAcquisitionXml",
">",
"(",
")",
";",
"Map",
"<",
... | parse a <code><job-executor .../></code> element and add it to the list of parsed elements | [
"parse",
"a",
"<code",
">",
"<",
";",
"job",
"-",
"executor",
"...",
"/",
">",
";",
"<",
"/",
"code",
">",
"element",
"and",
"add",
"it",
"to",
"the",
"list",
"of",
"parsed",
"elements"
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/container/impl/metadata/BpmPlatformXmlParse.java#L82-L101 |
vtatai/srec | core/src/main/java/com/github/srec/command/method/MethodCommand.java | MethodCommand.asBigDecimal | protected BigDecimal asBigDecimal(String name, Map<String, Value> params) {
"""
Gets a parameter value as a Java Boolean.
@param name The parameter name
@param params The parameters
@return The boolean
"""
return coerceToBigDecimal(params.get(name));
} | java | protected BigDecimal asBigDecimal(String name, Map<String, Value> params) {
return coerceToBigDecimal(params.get(name));
} | [
"protected",
"BigDecimal",
"asBigDecimal",
"(",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"Value",
">",
"params",
")",
"{",
"return",
"coerceToBigDecimal",
"(",
"params",
".",
"get",
"(",
"name",
")",
")",
";",
"}"
] | Gets a parameter value as a Java Boolean.
@param name The parameter name
@param params The parameters
@return The boolean | [
"Gets",
"a",
"parameter",
"value",
"as",
"a",
"Java",
"Boolean",
"."
] | train | https://github.com/vtatai/srec/blob/87fa6754a6a5f8569ef628db4d149eea04062568/core/src/main/java/com/github/srec/command/method/MethodCommand.java#L185-L187 |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelCoder.java | JsonModelCoder.getList | public List<T> getList(InputStream stream, OnJsonObjectAddListener listener)
throws IOException, JsonFormatException {
"""
Attempts to parse the given data as {@link List} of objects.
Accepts {@link OnJsonObjectAddListener}; allows you to peek various intermittent instances as parsing goes.
@param stream JS... | java | public List<T> getList(InputStream stream, OnJsonObjectAddListener listener)
throws IOException, JsonFormatException {
JsonPullParser parser = JsonPullParser.newParser(stream);
return getList(parser, listener);
} | [
"public",
"List",
"<",
"T",
">",
"getList",
"(",
"InputStream",
"stream",
",",
"OnJsonObjectAddListener",
"listener",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"JsonPullParser",
"parser",
"=",
"JsonPullParser",
".",
"newParser",
"(",
"stream",
... | Attempts to parse the given data as {@link List} of objects.
Accepts {@link OnJsonObjectAddListener}; allows you to peek various intermittent instances as parsing goes.
@param stream JSON-formatted data
@param listener {@link OnJsonObjectAddListener} to notify
@return {@link List} of objects
@throws IOException
@throw... | [
"Attempts",
"to",
"parse",
"the",
"given",
"data",
"as",
"{",
"@link",
"List",
"}",
"of",
"objects",
".",
"Accepts",
"{",
"@link",
"OnJsonObjectAddListener",
"}",
";",
"allows",
"you",
"to",
"peek",
"various",
"intermittent",
"instances",
"as",
"parsing",
"g... | train | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelCoder.java#L98-L102 |
Azure/azure-sdk-for-java | eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventSubscriptionsInner.java | EventSubscriptionsInner.listByResourceAsync | public Observable<List<EventSubscriptionInner>> listByResourceAsync(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName) {
"""
List all event subscriptions for a specific topic.
List all event subscriptions that have been created for a specific topic.
@param resourc... | java | public Observable<List<EventSubscriptionInner>> listByResourceAsync(String resourceGroupName, String providerNamespace, String resourceTypeName, String resourceName) {
return listByResourceWithServiceResponseAsync(resourceGroupName, providerNamespace, resourceTypeName, resourceName).map(new Func1<ServiceRespons... | [
"public",
"Observable",
"<",
"List",
"<",
"EventSubscriptionInner",
">",
">",
"listByResourceAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"providerNamespace",
",",
"String",
"resourceTypeName",
",",
"String",
"resourceName",
")",
"{",
"return",
"listByRe... | List all event subscriptions for a specific topic.
List all event subscriptions that have been created for a specific topic.
@param resourceGroupName The name of the resource group within the user's subscription.
@param providerNamespace Namespace of the provider of the topic
@param resourceTypeName Name of the resour... | [
"List",
"all",
"event",
"subscriptions",
"for",
"a",
"specific",
"topic",
".",
"List",
"all",
"event",
"subscriptions",
"that",
"have",
"been",
"created",
"for",
"a",
"specific",
"topic",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_05_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_05_01_preview/implementation/EventSubscriptionsInner.java#L1597-L1604 |
fengwenyi/JavaLib | src/main/java/com/fengwenyi/javalib/util/RSAUtil.java | RSAUtil.privateKeyEncrypt | public static String privateKeyEncrypt(String key, String plainText) throws NoSuchAlgorithmException,
InvalidKeySpecException, NoSuchPaddingException, UnsupportedEncodingException, BadPaddingException,
IllegalBlockSizeException, InvalidKeyException {
"""
私钥加密
@param key [ellipsis]
@param ... | java | public static String privateKeyEncrypt(String key, String plainText) throws NoSuchAlgorithmException,
InvalidKeySpecException, NoSuchPaddingException, UnsupportedEncodingException, BadPaddingException,
IllegalBlockSizeException, InvalidKeyException {
PrivateKey privateKey = commonGetPriv... | [
"public",
"static",
"String",
"privateKeyEncrypt",
"(",
"String",
"key",
",",
"String",
"plainText",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeySpecException",
",",
"NoSuchPaddingException",
",",
"UnsupportedEncodingException",
",",
"BadPaddingException",
",... | 私钥加密
@param key [ellipsis]
@param plainText [ellipsis]
@return [ellipsis]
@throws NoSuchAlgorithmException [ellipsis]
@throws InvalidKeySpecException [ellipsis]
@throws NoSuchPaddingException [ellipsis]
@throws UnsupportedEncodingException [ellipsis]
@throws BadPaddingException [ellipsis]
@throws IllegalBlockSizeExcept... | [
"私钥加密"
] | train | https://github.com/fengwenyi/JavaLib/blob/14838b13fb11c024e41be766aa3e13ead4be1703/src/main/java/com/fengwenyi/javalib/util/RSAUtil.java#L74-L83 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/ArrayFunctions.java | ArrayFunctions.arrayContains | public static Expression arrayContains(JsonArray array, Expression value) {
"""
Returned expression results in true if the array contains value.
"""
return arrayContains(x(array), value);
} | java | public static Expression arrayContains(JsonArray array, Expression value) {
return arrayContains(x(array), value);
} | [
"public",
"static",
"Expression",
"arrayContains",
"(",
"JsonArray",
"array",
",",
"Expression",
"value",
")",
"{",
"return",
"arrayContains",
"(",
"x",
"(",
"array",
")",
",",
"value",
")",
";",
"}"
] | Returned expression results in true if the array contains value. | [
"Returned",
"expression",
"results",
"in",
"true",
"if",
"the",
"array",
"contains",
"value",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/ArrayFunctions.java#L125-L127 |
ben-manes/caffeine | caffeine/src/main/java/com/github/benmanes/caffeine/cache/MpscGrowableArrayQueue.java | BaseMpscLinkedArrayQueue.offerSlowPath | private int offerSlowPath(long mask, long pIndex, long producerLimit) {
"""
We do not inline resize into this method because we do not resize on fill.
"""
int result;
final long cIndex = lvConsumerIndex();
long bufferCapacity = getCurrentBufferCapacity(mask);
result = 0;// 0 - goto pIndex CAS
... | java | private int offerSlowPath(long mask, long pIndex, long producerLimit) {
int result;
final long cIndex = lvConsumerIndex();
long bufferCapacity = getCurrentBufferCapacity(mask);
result = 0;// 0 - goto pIndex CAS
if (cIndex + bufferCapacity > pIndex) {
if (!casProducerLimit(producerLimit, cIndex... | [
"private",
"int",
"offerSlowPath",
"(",
"long",
"mask",
",",
"long",
"pIndex",
",",
"long",
"producerLimit",
")",
"{",
"int",
"result",
";",
"final",
"long",
"cIndex",
"=",
"lvConsumerIndex",
"(",
")",
";",
"long",
"bufferCapacity",
"=",
"getCurrentBufferCapac... | We do not inline resize into this method because we do not resize on fill. | [
"We",
"do",
"not",
"inline",
"resize",
"into",
"this",
"method",
"because",
"we",
"do",
"not",
"resize",
"on",
"fill",
"."
] | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/caffeine/src/main/java/com/github/benmanes/caffeine/cache/MpscGrowableArrayQueue.java#L268-L289 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/BusinessExceptionMappingStrategy.java | BusinessExceptionMappingStrategy.mapCSITransactionRolledBackException | @Override
public Exception mapCSITransactionRolledBackException
(EJSDeployedSupport s, CSITransactionRolledbackException ex)
throws com.ibm.websphere.csi.CSIException {
"""
This method is specifically designed for use during EJSContainer
postInvoke proce... | java | @Override
public Exception mapCSITransactionRolledBackException
(EJSDeployedSupport s, CSITransactionRolledbackException ex)
throws com.ibm.websphere.csi.CSIException
{
Throwable cause = null;
Exception causeEx = null;
// If the in... | [
"@",
"Override",
"public",
"Exception",
"mapCSITransactionRolledBackException",
"(",
"EJSDeployedSupport",
"s",
",",
"CSITransactionRolledbackException",
"ex",
")",
"throws",
"com",
".",
"ibm",
".",
"websphere",
".",
"csi",
".",
"CSIException",
"{",
"Throwable",
"caus... | This method is specifically designed for use during EJSContainer
postInvoke processing. It maps the internal exception indicating
a rollback has occurred to the appropriate one for the interface
(i.e. local, remote, business, etc). <p> | [
"This",
"method",
"is",
"specifically",
"designed",
"for",
"use",
"during",
"EJSContainer",
"postInvoke",
"processing",
".",
"It",
"maps",
"the",
"internal",
"exception",
"indicating",
"a",
"rollback",
"has",
"occurred",
"to",
"the",
"appropriate",
"one",
"for",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/BusinessExceptionMappingStrategy.java#L539-L589 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/text/RbnfScannerProviderImpl.java | RbnfScannerProviderImpl.get | @Deprecated
public RbnfLenientScanner get(ULocale locale, String extras) {
"""
Returns a collation-based scanner.
Only primary differences are treated as significant. This means that case
differences, accent differences, alternate spellings of the same letter
(e.g., ae and a-umlaut in German), ignorable ... | java | @Deprecated
public RbnfLenientScanner get(ULocale locale, String extras) {
RbnfLenientScanner result = null;
String key = locale.toString() + "/" + extras;
synchronized(cache) {
result = cache.get(key);
if (result != null) {
return result;
... | [
"@",
"Deprecated",
"public",
"RbnfLenientScanner",
"get",
"(",
"ULocale",
"locale",
",",
"String",
"extras",
")",
"{",
"RbnfLenientScanner",
"result",
"=",
"null",
";",
"String",
"key",
"=",
"locale",
".",
"toString",
"(",
")",
"+",
"\"/\"",
"+",
"extras",
... | Returns a collation-based scanner.
Only primary differences are treated as significant. This means that case
differences, accent differences, alternate spellings of the same letter
(e.g., ae and a-umlaut in German), ignorable characters, etc. are ignored in
matching the text. In many cases, numerals will be accepted... | [
"Returns",
"a",
"collation",
"-",
"based",
"scanner",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/text/RbnfScannerProviderImpl.java#L76-L91 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.crossEntropy | public static <E> double crossEntropy(Counter<E> from, Counter<E> to) {
"""
Note that this implementation doesn't normalize the "from" Counter. It
does, however, normalize the "to" Counter. Result is meaningless if any of
the counts are negative.
@return The cross entropy of H(from, to)
"""
double to... | java | public static <E> double crossEntropy(Counter<E> from, Counter<E> to) {
double tot2 = to.totalCount();
double result = 0.0;
for (E key : from.keySet()) {
double count1 = from.getCount(key);
if (count1 == 0.0) {
continue;
}
double count2 = to.getCount(key);
doub... | [
"public",
"static",
"<",
"E",
">",
"double",
"crossEntropy",
"(",
"Counter",
"<",
"E",
">",
"from",
",",
"Counter",
"<",
"E",
">",
"to",
")",
"{",
"double",
"tot2",
"=",
"to",
".",
"totalCount",
"(",
")",
";",
"double",
"result",
"=",
"0.0",
";",
... | Note that this implementation doesn't normalize the "from" Counter. It
does, however, normalize the "to" Counter. Result is meaningless if any of
the counts are negative.
@return The cross entropy of H(from, to) | [
"Note",
"that",
"this",
"implementation",
"doesn",
"t",
"normalize",
"the",
"from",
"Counter",
".",
"It",
"does",
"however",
"normalize",
"the",
"to",
"Counter",
".",
"Result",
"is",
"meaningless",
"if",
"any",
"of",
"the",
"counts",
"are",
"negative",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1177-L1193 |
aws/aws-sdk-java | aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/InitiateAuthRequest.java | InitiateAuthRequest.withAuthParameters | public InitiateAuthRequest withAuthParameters(java.util.Map<String, String> authParameters) {
"""
<p>
The authentication parameters. These are inputs corresponding to the <code>AuthFlow</code> that you are invoking.
The required values depend on the value of <code>AuthFlow</code>:
</p>
<ul>
<li>
<p>
For <co... | java | public InitiateAuthRequest withAuthParameters(java.util.Map<String, String> authParameters) {
setAuthParameters(authParameters);
return this;
} | [
"public",
"InitiateAuthRequest",
"withAuthParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"authParameters",
")",
"{",
"setAuthParameters",
"(",
"authParameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The authentication parameters. These are inputs corresponding to the <code>AuthFlow</code> that you are invoking.
The required values depend on the value of <code>AuthFlow</code>:
</p>
<ul>
<li>
<p>
For <code>USER_SRP_AUTH</code>: <code>USERNAME</code> (required), <code>SRP_A</code> (required),
<code>SECRET_HASH</c... | [
"<p",
">",
"The",
"authentication",
"parameters",
".",
"These",
"are",
"inputs",
"corresponding",
"to",
"the",
"<code",
">",
"AuthFlow<",
"/",
"code",
">",
"that",
"you",
"are",
"invoking",
".",
"The",
"required",
"values",
"depend",
"on",
"the",
"value",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/InitiateAuthRequest.java#L878-L881 |
apache/incubator-druid | extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java | FixedBucketsHistogram.getCumulativeCount | private double getCumulativeCount(double cutoff, boolean fromStart) {
"""
Get a sum of bucket counts from either the start of a histogram's range or end, up to a specified cutoff value.
For example, if I have the following histogram with a range of 0-40, with 4 buckets and
per-bucket counts of 5, 2, 10, and 7:... | java | private double getCumulativeCount(double cutoff, boolean fromStart)
{
int cutoffBucket = (int) ((cutoff - lowerLimit) / bucketSize);
double count = 0;
if (fromStart) {
for (int i = 0; i <= cutoffBucket; i++) {
if (i == cutoffBucket) {
double bucketStart = i * bucketSize + lowerLim... | [
"private",
"double",
"getCumulativeCount",
"(",
"double",
"cutoff",
",",
"boolean",
"fromStart",
")",
"{",
"int",
"cutoffBucket",
"=",
"(",
"int",
")",
"(",
"(",
"cutoff",
"-",
"lowerLimit",
")",
"/",
"bucketSize",
")",
";",
"double",
"count",
"=",
"0",
... | Get a sum of bucket counts from either the start of a histogram's range or end, up to a specified cutoff value.
For example, if I have the following histogram with a range of 0-40, with 4 buckets and
per-bucket counts of 5, 2, 10, and 7:
| 5 | 2 | 24 | 7 |
0 10 20 30 40
Calling ... | [
"Get",
"a",
"sum",
"of",
"bucket",
"counts",
"from",
"either",
"the",
"start",
"of",
"a",
"histogram",
"s",
"range",
"or",
"end",
"up",
"to",
"a",
"specified",
"cutoff",
"value",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogram.java#L527-L554 |
real-logic/agrona | agrona/src/main/java/org/agrona/generation/CompilerUtil.java | CompilerUtil.compileInMemory | public static Class<?> compileInMemory(final String className, final Map<String, CharSequence> sources)
throws ClassNotFoundException {
"""
Compile a {@link Map} of source files in-memory resulting in a {@link Class} which is named.
@param className to return after compilation.
@param sources to be c... | java | public static Class<?> compileInMemory(final String className, final Map<String, CharSequence> sources)
throws ClassNotFoundException
{
final JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
if (null == compiler)
{
throw new IllegalStateException("JDK require... | [
"public",
"static",
"Class",
"<",
"?",
">",
"compileInMemory",
"(",
"final",
"String",
"className",
",",
"final",
"Map",
"<",
"String",
",",
"CharSequence",
">",
"sources",
")",
"throws",
"ClassNotFoundException",
"{",
"final",
"JavaCompiler",
"compiler",
"=",
... | Compile a {@link Map} of source files in-memory resulting in a {@link Class} which is named.
@param className to return after compilation.
@param sources to be compiled.
@return the named class that is the result of the compilation.
@throws ClassNotFoundException of the named class cannot be found. | [
"Compile",
"a",
"{",
"@link",
"Map",
"}",
"of",
"source",
"files",
"in",
"-",
"memory",
"resulting",
"in",
"a",
"{",
"@link",
"Class",
"}",
"which",
"is",
"named",
"."
] | train | https://github.com/real-logic/agrona/blob/d1ea76e6e3598cd6a0d34879687652ef123f639b/agrona/src/main/java/org/agrona/generation/CompilerUtil.java#L50-L66 |
OpenNTF/JavascriptAggregator | jaggr-service/src/main/java/com/ibm/jaggr/service/impl/resource/BundleResourceFactory.java | BundleResourceFactory.getNBRPath | protected String getNBRPath(String bundle, URI uri) {
"""
Extracts the path of the file resource from a uri with the <code>namedbundleresource<code> scheme.
Supports backwards compatibility for names from 1.0.0 release (for now).
@param bundle The name of the bundle within the uri from {@link BundleResourceF... | java | protected String getNBRPath(String bundle, URI uri) {
String path = uri.getPath();
return path.startsWith("/" + bundle) ? path.substring(bundle.length() + 1) : path; //$NON-NLS-1$
} | [
"protected",
"String",
"getNBRPath",
"(",
"String",
"bundle",
",",
"URI",
"uri",
")",
"{",
"String",
"path",
"=",
"uri",
".",
"getPath",
"(",
")",
";",
"return",
"path",
".",
"startsWith",
"(",
"\"/\"",
"+",
"bundle",
")",
"?",
"path",
".",
"substring"... | Extracts the path of the file resource from a uri with the <code>namedbundleresource<code> scheme.
Supports backwards compatibility for names from 1.0.0 release (for now).
@param bundle The name of the bundle within the uri from {@link BundleResourceFactory#getNBRBundleName(URI)}
@param uri The uri with a <code>named... | [
"Extracts",
"the",
"path",
"of",
"the",
"file",
"resource",
"from",
"a",
"uri",
"with",
"the",
"<code",
">",
"namedbundleresource<code",
">",
"scheme",
"."
] | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-service/src/main/java/com/ibm/jaggr/service/impl/resource/BundleResourceFactory.java#L206-L209 |
m-m-m/util | nls/src/main/java/net/sf/mmm/util/nls/impl/DefaultNlsTemplateResolver.java | DefaultNlsTemplateResolver.initTemplatesForNlsBundles | protected void initTemplatesForNlsBundles(Map<String, NlsTemplate> map) {
"""
This method initializes the {@link NlsTemplate}s for reverse lookup for {@link NlsBundle}s.
@param map the {@link Map} where to {@link Map#put(Object, Object) register} the {@link NlsTemplate}s by
their {@link net.sf.mmm.util.nls.api... | java | protected void initTemplatesForNlsBundles(Map<String, NlsTemplate> map) {
if (this.bundleFactory instanceof AbstractNlsBundleFactory) {
Collection<? extends NlsBundleDescriptor> bundleDescriptors = ((AbstractNlsBundleFactory) this.bundleFactory).getNlsBundleDescriptors();
for (NlsBundleDescriptor descr... | [
"protected",
"void",
"initTemplatesForNlsBundles",
"(",
"Map",
"<",
"String",
",",
"NlsTemplate",
">",
"map",
")",
"{",
"if",
"(",
"this",
".",
"bundleFactory",
"instanceof",
"AbstractNlsBundleFactory",
")",
"{",
"Collection",
"<",
"?",
"extends",
"NlsBundleDescri... | This method initializes the {@link NlsTemplate}s for reverse lookup for {@link NlsBundle}s.
@param map the {@link Map} where to {@link Map#put(Object, Object) register} the {@link NlsTemplate}s by
their {@link net.sf.mmm.util.nls.api.NlsMessage#getInternationalizedMessage() i18n message}. | [
"This",
"method",
"initializes",
"the",
"{",
"@link",
"NlsTemplate",
"}",
"s",
"for",
"reverse",
"lookup",
"for",
"{",
"@link",
"NlsBundle",
"}",
"s",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/nls/src/main/java/net/sf/mmm/util/nls/impl/DefaultNlsTemplateResolver.java#L121-L135 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/web/SeleniumDriverSetup.java | SeleniumDriverSetup.connectToDriverForAt | public boolean connectToDriverForAt(String browser, String url)
throws MalformedURLException {
"""
Connects SeleniumHelper to a remote web driver, without specifying browser version.
@param browser name of browser to connect to.
@param url url to connect to browser.
@return true.
@throws MalformedU... | java | public boolean connectToDriverForAt(String browser, String url)
throws MalformedURLException {
return connectToDriverForVersionOnAt(browser, "", Platform.ANY.name(), url);
} | [
"public",
"boolean",
"connectToDriverForAt",
"(",
"String",
"browser",
",",
"String",
"url",
")",
"throws",
"MalformedURLException",
"{",
"return",
"connectToDriverForVersionOnAt",
"(",
"browser",
",",
"\"\"",
",",
"Platform",
".",
"ANY",
".",
"name",
"(",
")",
... | Connects SeleniumHelper to a remote web driver, without specifying browser version.
@param browser name of browser to connect to.
@param url url to connect to browser.
@return true.
@throws MalformedURLException if supplied url can not be transformed to URL. | [
"Connects",
"SeleniumHelper",
"to",
"a",
"remote",
"web",
"driver",
"without",
"specifying",
"browser",
"version",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/web/SeleniumDriverSetup.java#L111-L114 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/CostRateTableFactory.java | CostRateTableFactory.process | public void process(Resource resource, int index, byte[] data) {
"""
Creates a CostRateTable instance from a block of data.
@param resource parent resource
@param index cost rate table index
@param data data block
"""
CostRateTable result = new CostRateTable();
if (data != null)
{
... | java | public void process(Resource resource, int index, byte[] data)
{
CostRateTable result = new CostRateTable();
if (data != null)
{
for (int i = 16; i + 44 <= data.length; i += 44)
{
Rate standardRate = new Rate(MPPUtility.getDouble(data, i), TimeUnit.HOURS);
... | [
"public",
"void",
"process",
"(",
"Resource",
"resource",
",",
"int",
"index",
",",
"byte",
"[",
"]",
"data",
")",
"{",
"CostRateTable",
"result",
"=",
"new",
"CostRateTable",
"(",
")",
";",
"if",
"(",
"data",
"!=",
"null",
")",
"{",
"for",
"(",
"int... | Creates a CostRateTable instance from a block of data.
@param resource parent resource
@param index cost rate table index
@param data data block | [
"Creates",
"a",
"CostRateTable",
"instance",
"from",
"a",
"block",
"of",
"data",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/CostRateTableFactory.java#L48-L88 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowControllerFactory.java | FlowControllerFactory.getSharedFlowsForRequest | public Map/*< String, SharedFlowController >*/ getSharedFlowsForRequest( RequestContext context )
throws ClassNotFoundException, InstantiationException, IllegalAccessException {
"""
Get the map of shared flows for the given request. The map is derived from the shared flows
that are declared (through ... | java | public Map/*< String, SharedFlowController >*/ getSharedFlowsForRequest( RequestContext context )
throws ClassNotFoundException, InstantiationException, IllegalAccessException
{
String path = InternalUtils.getDecodedServletPath( context.getHttpRequest() );
return getSharedFlowsForPath( c... | [
"public",
"Map",
"/*< String, SharedFlowController >*/",
"getSharedFlowsForRequest",
"(",
"RequestContext",
"context",
")",
"throws",
"ClassNotFoundException",
",",
"InstantiationException",
",",
"IllegalAccessException",
"{",
"String",
"path",
"=",
"InternalUtils",
".",
"get... | Get the map of shared flows for the given request. The map is derived from the shared flows
that are declared (through the <code>sharedFlowRefs</code> attribute of
{@link org.apache.beehive.netui.pageflow.annotations.Jpf.Controller @Jpf.Controller}) in the
page flow for the request.
@param context a {@link Reques... | [
"Get",
"the",
"map",
"of",
"shared",
"flows",
"for",
"the",
"given",
"request",
".",
"The",
"map",
"is",
"derived",
"from",
"the",
"shared",
"flows",
"that",
"are",
"declared",
"(",
"through",
"the",
"<code",
">",
"sharedFlowRefs<",
"/",
"code",
">",
"at... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowControllerFactory.java#L452-L457 |
mapsforge/mapsforge | mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java | MapFile.readLabels | @Override
public MapReadResult readLabels(Tile tile) {
"""
Reads only labels for tile.
@param tile tile for which data is requested.
@return label data for the tile.
"""
return readMapData(tile, tile, Selector.LABELS);
} | java | @Override
public MapReadResult readLabels(Tile tile) {
return readMapData(tile, tile, Selector.LABELS);
} | [
"@",
"Override",
"public",
"MapReadResult",
"readLabels",
"(",
"Tile",
"tile",
")",
"{",
"return",
"readMapData",
"(",
"tile",
",",
"tile",
",",
"Selector",
".",
"LABELS",
")",
";",
"}"
] | Reads only labels for tile.
@param tile tile for which data is requested.
@return label data for the tile. | [
"Reads",
"only",
"labels",
"for",
"tile",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java#L837-L840 |
haifengl/smile | core/src/main/java/smile/validation/Validation.java | Validation.cv | public static <T> double cv(int k, RegressionTrainer<T> trainer, T[] x, double[] y, RegressionMeasure measure) {
"""
Cross validation of a regression model.
@param <T> the data type of input objects.
@param k k-fold cross validation.
@param trainer a regression model trainer that is properly parameterized.
@... | java | public static <T> double cv(int k, RegressionTrainer<T> trainer, T[] x, double[] y, RegressionMeasure measure) {
if (k < 2) {
throw new IllegalArgumentException("Invalid k for k-fold cross validation: " + k);
}
int n = x.length;
double[] predictions = new double[n];
... | [
"public",
"static",
"<",
"T",
">",
"double",
"cv",
"(",
"int",
"k",
",",
"RegressionTrainer",
"<",
"T",
">",
"trainer",
",",
"T",
"[",
"]",
"x",
",",
"double",
"[",
"]",
"y",
",",
"RegressionMeasure",
"measure",
")",
"{",
"if",
"(",
"k",
"<",
"2"... | Cross validation of a regression model.
@param <T> the data type of input objects.
@param k k-fold cross validation.
@param trainer a regression model trainer that is properly parameterized.
@param x the test data set.
@param y the test data response values.
@param measure the performance measure of regression.
@retur... | [
"Cross",
"validation",
"of",
"a",
"regression",
"model",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/validation/Validation.java#L484-L505 |
Impetus/Kundera | src/kundera-neo4j/src/main/java/com/impetus/client/neo4j/GraphEntityMapper.java | GraphEntityMapper.populateNodeProperties | private void populateNodeProperties(Object entity, EntityMetadata m, Node node) {
"""
Populates Node properties from Entity object
@param entity
@param m
@param node
"""
MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
m.getPersistenc... | java | private void populateNodeProperties(Object entity, EntityMetadata m, Node node)
{
MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
m.getPersistenceUnit());
EntityType entityType = metaModel.entity(m.getEntityClazz());
// Iterat... | [
"private",
"void",
"populateNodeProperties",
"(",
"Object",
"entity",
",",
"EntityMetadata",
"m",
",",
"Node",
"node",
")",
"{",
"MetamodelImpl",
"metaModel",
"=",
"(",
"MetamodelImpl",
")",
"kunderaMetadata",
".",
"getApplicationMetadata",
"(",
")",
".",
"getMeta... | Populates Node properties from Entity object
@param entity
@param m
@param node | [
"Populates",
"Node",
"properties",
"from",
"Entity",
"object"
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-neo4j/src/main/java/com/impetus/client/neo4j/GraphEntityMapper.java#L328-L351 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularDistortBase_F64.java | EquirectangularDistortBase_F64.setDirection | public void setDirection(double yaw, double pitch, double roll ) {
"""
Specifies the rotation offset from the canonical location using yaw and pitch.
@param yaw Radian from -pi to pi
@param pitch Radian from -pi/2 to pi/2
@param roll Radian from -pi to pi
"""
ConvertRotation3D_F64.eulerToMatrix(EulerType.... | java | public void setDirection(double yaw, double pitch, double roll ) {
ConvertRotation3D_F64.eulerToMatrix(EulerType.YZX,pitch,yaw,roll,R);
} | [
"public",
"void",
"setDirection",
"(",
"double",
"yaw",
",",
"double",
"pitch",
",",
"double",
"roll",
")",
"{",
"ConvertRotation3D_F64",
".",
"eulerToMatrix",
"(",
"EulerType",
".",
"YZX",
",",
"pitch",
",",
"yaw",
",",
"roll",
",",
"R",
")",
";",
"}"
] | Specifies the rotation offset from the canonical location using yaw and pitch.
@param yaw Radian from -pi to pi
@param pitch Radian from -pi/2 to pi/2
@param roll Radian from -pi to pi | [
"Specifies",
"the",
"rotation",
"offset",
"from",
"the",
"canonical",
"location",
"using",
"yaw",
"and",
"pitch",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/distort/spherical/EquirectangularDistortBase_F64.java#L69-L71 |
drewnoakes/metadata-extractor | Source/com/drew/lang/RandomAccessReader.java | RandomAccessReader.getNullTerminatedString | @NotNull
public String getNullTerminatedString(int index, int maxLengthBytes, @NotNull Charset charset) throws IOException {
"""
Creates a String from the _data buffer starting at the specified index,
and ending where <code>byte=='\0'</code> or where <code>length==maxLength</code>.
@param index Th... | java | @NotNull
public String getNullTerminatedString(int index, int maxLengthBytes, @NotNull Charset charset) throws IOException
{
return new String(getNullTerminatedBytes(index, maxLengthBytes), charset.name());
} | [
"@",
"NotNull",
"public",
"String",
"getNullTerminatedString",
"(",
"int",
"index",
",",
"int",
"maxLengthBytes",
",",
"@",
"NotNull",
"Charset",
"charset",
")",
"throws",
"IOException",
"{",
"return",
"new",
"String",
"(",
"getNullTerminatedBytes",
"(",
"index",
... | Creates a String from the _data buffer starting at the specified index,
and ending where <code>byte=='\0'</code> or where <code>length==maxLength</code>.
@param index The index within the buffer at which to start reading the string.
@param maxLengthBytes The maximum number of bytes to read. If a zero-byte is... | [
"Creates",
"a",
"String",
"from",
"the",
"_data",
"buffer",
"starting",
"at",
"the",
"specified",
"index",
"and",
"ending",
"where",
"<code",
">",
"byte",
"==",
"\\",
"0",
"<",
"/",
"code",
">",
"or",
"where",
"<code",
">",
"length",
"==",
"maxLength<",
... | train | https://github.com/drewnoakes/metadata-extractor/blob/a958e0b61b50e590731b3be1dca8df8e21ebd43c/Source/com/drew/lang/RandomAccessReader.java#L404-L408 |
haifengl/smile | data/src/main/java/smile/data/parser/ArffParser.java | ArffParser.getNextToken | private void getNextToken(StreamTokenizer tokenizer) throws IOException, ParseException {
"""
Gets next token, checking for a premature and of line.
@throws IllegalStateException if it finds a premature end of line
"""
if (tokenizer.nextToken() == StreamTokenizer.TT_EOL) {
throw new Pars... | java | private void getNextToken(StreamTokenizer tokenizer) throws IOException, ParseException {
if (tokenizer.nextToken() == StreamTokenizer.TT_EOL) {
throw new ParseException("premature end of line", tokenizer.lineno());
}
if (tokenizer.ttype == StreamTokenizer.TT_EOF) {
throw... | [
"private",
"void",
"getNextToken",
"(",
"StreamTokenizer",
"tokenizer",
")",
"throws",
"IOException",
",",
"ParseException",
"{",
"if",
"(",
"tokenizer",
".",
"nextToken",
"(",
")",
"==",
"StreamTokenizer",
".",
"TT_EOL",
")",
"{",
"throw",
"new",
"ParseExceptio... | Gets next token, checking for a premature and of line.
@throws IllegalStateException if it finds a premature end of line | [
"Gets",
"next",
"token",
"checking",
"for",
"a",
"premature",
"and",
"of",
"line",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/data/src/main/java/smile/data/parser/ArffParser.java#L164-L175 |
gitblit/fathom | fathom-x509/src/main/java/fathom/x509/X509Utils.java | X509Utils.getPrivateKey | public static PrivateKey getPrivateKey(String alias, File storeFile, String storePassword) {
"""
Retrieves the private key for the specified alias from the certificate
store.
@param alias
@param storeFile
@param storePassword
@return the private key
"""
try {
KeyStore store = openKey... | java | public static PrivateKey getPrivateKey(String alias, File storeFile, String storePassword) {
try {
KeyStore store = openKeyStore(storeFile, storePassword);
PrivateKey key = (PrivateKey) store.getKey(alias, storePassword.toCharArray());
return key;
} catch (Exception e... | [
"public",
"static",
"PrivateKey",
"getPrivateKey",
"(",
"String",
"alias",
",",
"File",
"storeFile",
",",
"String",
"storePassword",
")",
"{",
"try",
"{",
"KeyStore",
"store",
"=",
"openKeyStore",
"(",
"storeFile",
",",
"storePassword",
")",
";",
"PrivateKey",
... | Retrieves the private key for the specified alias from the certificate
store.
@param alias
@param storeFile
@param storePassword
@return the private key | [
"Retrieves",
"the",
"private",
"key",
"for",
"the",
"specified",
"alias",
"from",
"the",
"certificate",
"store",
"."
] | train | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-x509/src/main/java/fathom/x509/X509Utils.java#L415-L423 |
roboconf/roboconf-platform | core/roboconf-target-docker/src/main/java/net/roboconf/target/docker/internal/DockerUtils.java | DockerUtils.findImageByIdOrByTag | public static Image findImageByIdOrByTag( String name, DockerClient dockerClient ) {
"""
Finds an image by ID or by tag.
@param name an image ID or a tag name (can be null)
@param dockerClient a Docker client (not null)
@return an image, or null if none matched
"""
Image image = null;
if( ! Utils.isEmp... | java | public static Image findImageByIdOrByTag( String name, DockerClient dockerClient ) {
Image image = null;
if( ! Utils.isEmptyOrWhitespaces( name )) {
Logger logger = Logger.getLogger( DockerUtils.class.getName());
List<Image> images = dockerClient.listImagesCmd().exec();
if(( image = DockerUtils.findImage... | [
"public",
"static",
"Image",
"findImageByIdOrByTag",
"(",
"String",
"name",
",",
"DockerClient",
"dockerClient",
")",
"{",
"Image",
"image",
"=",
"null",
";",
"if",
"(",
"!",
"Utils",
".",
"isEmptyOrWhitespaces",
"(",
"name",
")",
")",
"{",
"Logger",
"logger... | Finds an image by ID or by tag.
@param name an image ID or a tag name (can be null)
@param dockerClient a Docker client (not null)
@return an image, or null if none matched | [
"Finds",
"an",
"image",
"by",
"ID",
"or",
"by",
"tag",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-docker/src/main/java/net/roboconf/target/docker/internal/DockerUtils.java#L118-L132 |
Azure/azure-sdk-for-java | datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/AccountsInner.java | AccountsInner.createAsync | public Observable<DataLakeStoreAccountInner> createAsync(String resourceGroupName, String accountName, CreateDataLakeStoreAccountParameters parameters) {
"""
Creates the specified Data Lake Store account.
@param resourceGroupName The name of the Azure resource group.
@param accountName The name of the Data Lak... | java | public Observable<DataLakeStoreAccountInner> createAsync(String resourceGroupName, String accountName, CreateDataLakeStoreAccountParameters parameters) {
return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1<ServiceResponse<DataLakeStoreAccountInner>, DataLakeStoreAccou... | [
"public",
"Observable",
"<",
"DataLakeStoreAccountInner",
">",
"createAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"CreateDataLakeStoreAccountParameters",
"parameters",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"resourceGroup... | Creates the specified Data Lake Store account.
@param resourceGroupName The name of the Azure resource group.
@param accountName The name of the Data Lake Store account.
@param parameters Parameters supplied to create the Data Lake Store account.
@throws IllegalArgumentException thrown if parameters fail the validatio... | [
"Creates",
"the",
"specified",
"Data",
"Lake",
"Store",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/AccountsInner.java#L666-L673 |
ops4j/org.ops4j.pax.wicket | service/src/main/java/org/ops4j/pax/wicket/internal/filter/FilterDelegator.java | FilterDelegator.doFilter | public void doFilter(Filter[] superFilter, ServletRequest servletRequest, ServletResponse servletResponse)
throws ServletException, IOException {
"""
<p>doFilter.</p>
@param superFilter an array of {@link javax.servlet.Filter} objects.
@param servletRequest a {@link javax.servlet.ServletRequest} object... | java | public void doFilter(Filter[] superFilter, ServletRequest servletRequest, ServletResponse servletResponse)
throws ServletException, IOException {
List<Filter> filters = new ArrayList<Filter>();
if (superFilter != null && superFilter.length > 0) {
// First add all superfilter...
... | [
"public",
"void",
"doFilter",
"(",
"Filter",
"[",
"]",
"superFilter",
",",
"ServletRequest",
"servletRequest",
",",
"ServletResponse",
"servletResponse",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"List",
"<",
"Filter",
">",
"filters",
"=",
"new",... | <p>doFilter.</p>
@param superFilter an array of {@link javax.servlet.Filter} objects.
@param servletRequest a {@link javax.servlet.ServletRequest} object.
@param servletResponse a {@link javax.servlet.ServletResponse} object.
@throws javax.servlet.ServletException if any.
@throws java.io.IOException if any. | [
"<p",
">",
"doFilter",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ops4j/org.ops4j.pax.wicket/blob/ef7cb4bdf918e9e61ec69789b9c690567616faa9/service/src/main/java/org/ops4j/pax/wicket/internal/filter/FilterDelegator.java#L96-L106 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/CmsMultiSelectBox.java | CmsMultiSelectBox.getTitle | protected String getTitle(String option, String defaultValue) {
"""
Helper method to get the title for a given select option.<p>
@param option the select option value
@param defaultValue the value to return when no title for the value was found
@return the title for the select option
"""
if ((o... | java | protected String getTitle(String option, String defaultValue) {
if ((option != null) && m_titles.containsKey(option)) {
return m_titles.get(option);
}
return defaultValue;
} | [
"protected",
"String",
"getTitle",
"(",
"String",
"option",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"(",
"option",
"!=",
"null",
")",
"&&",
"m_titles",
".",
"containsKey",
"(",
"option",
")",
")",
"{",
"return",
"m_titles",
".",
"get",
"(",
... | Helper method to get the title for a given select option.<p>
@param option the select option value
@param defaultValue the value to return when no title for the value was found
@return the title for the select option | [
"Helper",
"method",
"to",
"get",
"the",
"title",
"for",
"a",
"given",
"select",
"option",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/CmsMultiSelectBox.java#L364-L370 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java | TrainingsImpl.createTagWithServiceResponseAsync | public Observable<ServiceResponse<Tag>> createTagWithServiceResponseAsync(UUID projectId, String name, CreateTagOptionalParameter createTagOptionalParameter) {
"""
Create a tag for the project.
@param projectId The project id
@param name The tag name
@param createTagOptionalParameter the object representing t... | java | public Observable<ServiceResponse<Tag>> createTagWithServiceResponseAsync(UUID projectId, String name, CreateTagOptionalParameter createTagOptionalParameter) {
if (projectId == null) {
throw new IllegalArgumentException("Parameter projectId is required and cannot be null.");
}
if (na... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Tag",
">",
">",
"createTagWithServiceResponseAsync",
"(",
"UUID",
"projectId",
",",
"String",
"name",
",",
"CreateTagOptionalParameter",
"createTagOptionalParameter",
")",
"{",
"if",
"(",
"projectId",
"==",
"null",... | Create a tag for the project.
@param projectId The project id
@param name The tag name
@param createTagOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Tag object | [
"Create",
"a",
"tag",
"for",
"the",
"project",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/customvision/training/src/main/java/com/microsoft/azure/cognitiveservices/vision/customvision/training/implementation/TrainingsImpl.java#L331-L344 |
google/closure-compiler | src/com/google/javascript/rhino/jstype/JSTypeRegistry.java | JSTypeRegistry.createTemplatizedType | public TemplatizedType createTemplatizedType(
ObjectType baseType, Map<TemplateType, JSType> templatizedTypes) {
"""
Creates a templatized instance of the specified type. Only ObjectTypes
can currently be templatized; extend the logic in this function when
more types can be templatized.
@param baseType t... | java | public TemplatizedType createTemplatizedType(
ObjectType baseType, Map<TemplateType, JSType> templatizedTypes) {
ImmutableList.Builder<JSType> builder = ImmutableList.builder();
TemplateTypeMap baseTemplateTypeMap = baseType.getTemplateTypeMap();
for (TemplateType key : baseTemplateTypeMap.getUnfilled... | [
"public",
"TemplatizedType",
"createTemplatizedType",
"(",
"ObjectType",
"baseType",
",",
"Map",
"<",
"TemplateType",
",",
"JSType",
">",
"templatizedTypes",
")",
"{",
"ImmutableList",
".",
"Builder",
"<",
"JSType",
">",
"builder",
"=",
"ImmutableList",
".",
"buil... | Creates a templatized instance of the specified type. Only ObjectTypes
can currently be templatized; extend the logic in this function when
more types can be templatized.
@param baseType the type to be templatized.
@param templatizedTypes a map from TemplateType to corresponding JSType
value. Any unfilled TemplateType... | [
"Creates",
"a",
"templatized",
"instance",
"of",
"the",
"specified",
"type",
".",
"Only",
"ObjectTypes",
"can",
"currently",
"be",
"templatized",
";",
"extend",
"the",
"logic",
"in",
"this",
"function",
"when",
"more",
"types",
"can",
"be",
"templatized",
"."
... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/JSTypeRegistry.java#L1909-L1919 |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parsePropertyDeclaration | private Decl.Property parsePropertyDeclaration(Tuple<Modifier> modifiers) {
"""
Parse a <i>property declaration</i> which has the form:
<pre>
ProeprtyDeclaration ::= "property" Parameters "->" Parameters (WhereClause)*
PropertyClause ::= "where" Expr
</pre>
"""
EnclosingScope scope = new EnclosingScope... | java | private Decl.Property parsePropertyDeclaration(Tuple<Modifier> modifiers) {
EnclosingScope scope = new EnclosingScope();
int start = index;
match(Property);
Identifier name = parseIdentifier();
Tuple<Template.Variable> template = parseOptionalTemplate(scope);
Tuple<Decl.Variable> parameters = parseParameter... | [
"private",
"Decl",
".",
"Property",
"parsePropertyDeclaration",
"(",
"Tuple",
"<",
"Modifier",
">",
"modifiers",
")",
"{",
"EnclosingScope",
"scope",
"=",
"new",
"EnclosingScope",
"(",
")",
";",
"int",
"start",
"=",
"index",
";",
"match",
"(",
"Property",
")... | Parse a <i>property declaration</i> which has the form:
<pre>
ProeprtyDeclaration ::= "property" Parameters "->" Parameters (WhereClause)*
PropertyClause ::= "where" Expr
</pre> | [
"Parse",
"a",
"<i",
">",
"property",
"declaration<",
"/",
"i",
">",
"which",
"has",
"the",
"form",
":"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L360-L372 |
apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/source/extractor/partition/Partitioner.java | Partitioner.getGlobalPartition | public Partition getGlobalPartition(long previousWatermark) {
"""
Get the global partition of the whole data set, which has the global low and high watermarks
@param previousWatermark previous watermark for computing the low watermark of current run
@return a Partition instance
"""
ExtractType extractT... | java | public Partition getGlobalPartition(long previousWatermark) {
ExtractType extractType =
ExtractType.valueOf(state.getProp(ConfigurationKeys.SOURCE_QUERYBASED_EXTRACT_TYPE).toUpperCase());
WatermarkType watermarkType = WatermarkType.valueOf(
state.getProp(ConfigurationKeys.SOURCE_QUERYBASED_WATER... | [
"public",
"Partition",
"getGlobalPartition",
"(",
"long",
"previousWatermark",
")",
"{",
"ExtractType",
"extractType",
"=",
"ExtractType",
".",
"valueOf",
"(",
"state",
".",
"getProp",
"(",
"ConfigurationKeys",
".",
"SOURCE_QUERYBASED_EXTRACT_TYPE",
")",
".",
"toUpper... | Get the global partition of the whole data set, which has the global low and high watermarks
@param previousWatermark previous watermark for computing the low watermark of current run
@return a Partition instance | [
"Get",
"the",
"global",
"partition",
"of",
"the",
"whole",
"data",
"set",
"which",
"has",
"the",
"global",
"low",
"and",
"high",
"watermarks"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/partition/Partitioner.java#L95-L108 |
dropwizard-bundles/dropwizard-redirect-bundle | src/main/java/io/dropwizard/bundles/redirect/HttpsRedirect.java | HttpsRedirect.getRedirectUrl | private String getRedirectUrl(HttpServletRequest request, String newScheme) {
"""
Return the full URL that should be redirected to including query parameters.
"""
String serverName = request.getServerName();
String uri = request.getRequestURI();
StringBuilder redirect = new StringBuilder(100);
... | java | private String getRedirectUrl(HttpServletRequest request, String newScheme) {
String serverName = request.getServerName();
String uri = request.getRequestURI();
StringBuilder redirect = new StringBuilder(100);
redirect.append(newScheme);
redirect.append("://");
redirect.append(serverName);
... | [
"private",
"String",
"getRedirectUrl",
"(",
"HttpServletRequest",
"request",
",",
"String",
"newScheme",
")",
"{",
"String",
"serverName",
"=",
"request",
".",
"getServerName",
"(",
")",
";",
"String",
"uri",
"=",
"request",
".",
"getRequestURI",
"(",
")",
";"... | Return the full URL that should be redirected to including query parameters. | [
"Return",
"the",
"full",
"URL",
"that",
"should",
"be",
"redirected",
"to",
"including",
"query",
"parameters",
"."
] | train | https://github.com/dropwizard-bundles/dropwizard-redirect-bundle/blob/73d484dfe81d75355bed31b541adbefab25e8f7f/src/main/java/io/dropwizard/bundles/redirect/HttpsRedirect.java#L68-L85 |
UrielCh/ovh-java-sdk | ovh-java-sdk-newAccount/src/main/java/net/minidev/ovh/api/ApiOvhNewAccount.java | ApiOvhNewAccount.countries_GET | public ArrayList<OvhCountryEnum> countries_GET(OvhOvhCompanyEnum ovhCompany, OvhOvhSubsidiaryEnum ovhSubsidiary) throws IOException {
"""
All available countries for an ovh company and an ovh subsidiary
REST: GET /newAccount/countries
@param ovhCompany [required]
@param ovhSubsidiary [required]
"""
Stri... | java | public ArrayList<OvhCountryEnum> countries_GET(OvhOvhCompanyEnum ovhCompany, OvhOvhSubsidiaryEnum ovhSubsidiary) throws IOException {
String qPath = "/newAccount/countries";
StringBuilder sb = path(qPath);
query(sb, "ovhCompany", ovhCompany);
query(sb, "ovhSubsidiary", ovhSubsidiary);
String resp = execN(qPat... | [
"public",
"ArrayList",
"<",
"OvhCountryEnum",
">",
"countries_GET",
"(",
"OvhOvhCompanyEnum",
"ovhCompany",
",",
"OvhOvhSubsidiaryEnum",
"ovhSubsidiary",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/newAccount/countries\"",
";",
"StringBuilder",
"sb",
... | All available countries for an ovh company and an ovh subsidiary
REST: GET /newAccount/countries
@param ovhCompany [required]
@param ovhSubsidiary [required] | [
"All",
"available",
"countries",
"for",
"an",
"ovh",
"company",
"and",
"an",
"ovh",
"subsidiary"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-newAccount/src/main/java/net/minidev/ovh/api/ApiOvhNewAccount.java#L53-L60 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.syncLog | File syncLog(long stamp, final long startTxId, final URL url, String name, File tmpFile)
throws IOException {
"""
Synchronize a log segment from another JournalNode. The log is
downloaded from the provided URL into a temporary location on disk
"""
final File[] localPaths = new File[] { tmpFile };
... | java | File syncLog(long stamp, final long startTxId, final URL url, String name, File tmpFile)
throws IOException {
final File[] localPaths = new File[] { tmpFile };
// TODO add security if needed.
LOG.info("Synchronizing log " + name + " from " + url);
boolean success = false;
try {
Transfer... | [
"File",
"syncLog",
"(",
"long",
"stamp",
",",
"final",
"long",
"startTxId",
",",
"final",
"URL",
"url",
",",
"String",
"name",
",",
"File",
"tmpFile",
")",
"throws",
"IOException",
"{",
"final",
"File",
"[",
"]",
"localPaths",
"=",
"new",
"File",
"[",
... | Synchronize a log segment from another JournalNode. The log is
downloaded from the provided URL into a temporary location on disk | [
"Synchronize",
"a",
"log",
"segment",
"from",
"another",
"JournalNode",
".",
"The",
"log",
"is",
"downloaded",
"from",
"the",
"provided",
"URL",
"into",
"a",
"temporary",
"location",
"on",
"disk"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L1178-L1200 |
wisdom-framework/wisdom | extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/CSRFServiceImpl.java | CSRFServiceImpl.compareTokens | @Override
public boolean compareTokens(String a, String b) {
"""
Compares to token.
@param a the first token
@param b the second token
@return {@code true} if the token are equal, {@code false} otherwise
"""
if (isSignedToken()) {
return crypto.compareSignedTokens(a, b);
} ... | java | @Override
public boolean compareTokens(String a, String b) {
if (isSignedToken()) {
return crypto.compareSignedTokens(a, b);
} else {
return crypto.constantTimeEquals(a, b);
}
} | [
"@",
"Override",
"public",
"boolean",
"compareTokens",
"(",
"String",
"a",
",",
"String",
"b",
")",
"{",
"if",
"(",
"isSignedToken",
"(",
")",
")",
"{",
"return",
"crypto",
".",
"compareSignedTokens",
"(",
"a",
",",
"b",
")",
";",
"}",
"else",
"{",
"... | Compares to token.
@param a the first token
@param b the second token
@return {@code true} if the token are equal, {@code false} otherwise | [
"Compares",
"to",
"token",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/CSRFServiceImpl.java#L218-L225 |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/numbers/NumbersClient.java | NumbersClient.linkNumber | public void linkNumber(String msisdn, String country, String appId) throws IOException, NexmoClientException {
"""
Link a given Nexmo Virtual Number to a Nexmo Application with the given ID.
@param msisdn The Nexmo Virtual Number to be updated.
@param country The country for the given msisdn.
@param appId ... | java | public void linkNumber(String msisdn, String country, String appId) throws IOException, NexmoClientException {
UpdateNumberRequest request = new UpdateNumberRequest(msisdn, country);
request.setVoiceCallbackType(UpdateNumberRequest.CallbackType.APP);
request.setVoiceCallbackValue(appId);
... | [
"public",
"void",
"linkNumber",
"(",
"String",
"msisdn",
",",
"String",
"country",
",",
"String",
"appId",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"UpdateNumberRequest",
"request",
"=",
"new",
"UpdateNumberRequest",
"(",
"msisdn",
",",
"cou... | Link a given Nexmo Virtual Number to a Nexmo Application with the given ID.
@param msisdn The Nexmo Virtual Number to be updated.
@param country The country for the given msisdn.
@param appId The ID for the Nexmo Application to be associated with the number.
@throws IOException if an error occurs contactin... | [
"Link",
"a",
"given",
"Nexmo",
"Virtual",
"Number",
"to",
"a",
"Nexmo",
"Application",
"with",
"the",
"given",
"ID",
"."
] | train | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/numbers/NumbersClient.java#L136-L141 |
xmlunit/xmlunit | xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XpathNodeTracker.java | XpathNodeTracker.visitedNode | protected void visitedNode(Node visited, String value) {
"""
Invoked by {@link #visited visited} when visited is an element,
text, CDATA section, comment or processing instruction.
@param visited the visited node - Unit tests call this with
null values, so it is not safe to assume it will never be null.
It w... | java | protected void visitedNode(Node visited, String value) {
levels.getLast().trackNode(visited, value);
} | [
"protected",
"void",
"visitedNode",
"(",
"Node",
"visited",
",",
"String",
"value",
")",
"{",
"levels",
".",
"getLast",
"(",
")",
".",
"trackNode",
"(",
"visited",
",",
"value",
")",
";",
"}"
] | Invoked by {@link #visited visited} when visited is an element,
text, CDATA section, comment or processing instruction.
@param visited the visited node - Unit tests call this with
null values, so it is not safe to assume it will never be null.
It will never be null when the {@link #visited visited} method
delegates he... | [
"Invoked",
"by",
"{",
"@link",
"#visited",
"visited",
"}",
"when",
"visited",
"is",
"an",
"element",
"text",
"CDATA",
"section",
"comment",
"or",
"processing",
"instruction",
"."
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XpathNodeTracker.java#L188-L190 |
JodaOrg/joda-time | src/main/java/org/joda/time/Period.java | Period.plusWeeks | public Period plusWeeks(int weeks) {
"""
Returns a new period plus the specified number of weeks added.
<p>
This period instance is immutable and unaffected by this method call.
@param weeks the amount of weeks to add, may be negative
@return the new period plus the increased weeks
@throws UnsupportedOpera... | java | public Period plusWeeks(int weeks) {
if (weeks == 0) {
return this;
}
int[] values = getValues(); // cloned
getPeriodType().addIndexedField(this, PeriodType.WEEK_INDEX, values, weeks);
return new Period(values, getPeriodType());
} | [
"public",
"Period",
"plusWeeks",
"(",
"int",
"weeks",
")",
"{",
"if",
"(",
"weeks",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"int",
"[",
"]",
"values",
"=",
"getValues",
"(",
")",
";",
"// cloned",
"getPeriodType",
"(",
")",
".",
"addIndexedF... | Returns a new period plus the specified number of weeks added.
<p>
This period instance is immutable and unaffected by this method call.
@param weeks the amount of weeks to add, may be negative
@return the new period plus the increased weeks
@throws UnsupportedOperationException if the field is not supported | [
"Returns",
"a",
"new",
"period",
"plus",
"the",
"specified",
"number",
"of",
"weeks",
"added",
".",
"<p",
">",
"This",
"period",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Period.java#L1105-L1112 |
lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toCharacter | public static Character toCharacter(Object o, Character defaultValue) {
"""
cast a Object to a Character Object(reference type)
@param o Object to cast
@param defaultValue
@return casted Character Object
"""
if (o instanceof Character) return (Character) o;
if (defaultValue != null) return new Character... | java | public static Character toCharacter(Object o, Character defaultValue) {
if (o instanceof Character) return (Character) o;
if (defaultValue != null) return new Character(toCharValue(o, defaultValue.charValue()));
char res = toCharValue(o, Character.MIN_VALUE);
if (res == Character.MIN_VALUE) return defaultValue;
r... | [
"public",
"static",
"Character",
"toCharacter",
"(",
"Object",
"o",
",",
"Character",
"defaultValue",
")",
"{",
"if",
"(",
"o",
"instanceof",
"Character",
")",
"return",
"(",
"Character",
")",
"o",
";",
"if",
"(",
"defaultValue",
"!=",
"null",
")",
"return... | cast a Object to a Character Object(reference type)
@param o Object to cast
@param defaultValue
@return casted Character Object | [
"cast",
"a",
"Object",
"to",
"a",
"Character",
"Object",
"(",
"reference",
"type",
")"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L1186-L1193 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataStorage.java | DataStorage.recoverTransitionRead | void recoverTransitionRead(DataNode datanode, int namespaceId, NamespaceInfo nsInfo,
Collection<File> dataDirs, StartupOption startOpt, String nameserviceId) throws IOException {
"""
recoverTransitionRead for a specific Name Space
@param datanode DataNode
@param namespaceId name space Id
@param nsInfo N... | java | void recoverTransitionRead(DataNode datanode, int namespaceId, NamespaceInfo nsInfo,
Collection<File> dataDirs, StartupOption startOpt, String nameserviceId) throws IOException {
// First ensure datanode level format/snapshot/rollback is completed
// recoverTransitionRead(datanode, nsInfo, dataDirs, start... | [
"void",
"recoverTransitionRead",
"(",
"DataNode",
"datanode",
",",
"int",
"namespaceId",
",",
"NamespaceInfo",
"nsInfo",
",",
"Collection",
"<",
"File",
">",
"dataDirs",
",",
"StartupOption",
"startOpt",
",",
"String",
"nameserviceId",
")",
"throws",
"IOException",
... | recoverTransitionRead for a specific Name Space
@param datanode DataNode
@param namespaceId name space Id
@param nsInfo Namespace info of namenode corresponding to the Name Space
@param dataDirs Storage directories
@param startOpt startup option
@throws IOException on error | [
"recoverTransitionRead",
"for",
"a",
"specific",
"Name",
"Space"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataStorage.java#L301-L331 |
aws/aws-sdk-java | aws-java-sdk-lex/src/main/java/com/amazonaws/services/lexruntime/model/PostTextResult.java | PostTextResult.withSessionAttributes | public PostTextResult withSessionAttributes(java.util.Map<String, String> sessionAttributes) {
"""
<p>
A map of key-value pairs representing the session-specific context information.
</p>
@param sessionAttributes
A map of key-value pairs representing the session-specific context information.
@return Returns... | java | public PostTextResult withSessionAttributes(java.util.Map<String, String> sessionAttributes) {
setSessionAttributes(sessionAttributes);
return this;
} | [
"public",
"PostTextResult",
"withSessionAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"sessionAttributes",
")",
"{",
"setSessionAttributes",
"(",
"sessionAttributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A map of key-value pairs representing the session-specific context information.
</p>
@param sessionAttributes
A map of key-value pairs representing the session-specific context information.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"A",
"map",
"of",
"key",
"-",
"value",
"pairs",
"representing",
"the",
"session",
"-",
"specific",
"context",
"information",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-lex/src/main/java/com/amazonaws/services/lexruntime/model/PostTextResult.java#L368-L371 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.updateRegexEntityModel | public OperationStatus updateRegexEntityModel(UUID appId, String versionId, UUID regexEntityId, RegexModelUpdateObject regexEntityUpdateObject) {
"""
Updates the regex entity model .
@param appId The application ID.
@param versionId The version ID.
@param regexEntityId The regex entity extractor ID.
@param r... | java | public OperationStatus updateRegexEntityModel(UUID appId, String versionId, UUID regexEntityId, RegexModelUpdateObject regexEntityUpdateObject) {
return updateRegexEntityModelWithServiceResponseAsync(appId, versionId, regexEntityId, regexEntityUpdateObject).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"updateRegexEntityModel",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"regexEntityId",
",",
"RegexModelUpdateObject",
"regexEntityUpdateObject",
")",
"{",
"return",
"updateRegexEntityModelWithServiceResponseAsync",
"(",
"appId",... | Updates the regex entity model .
@param appId The application ID.
@param versionId The version ID.
@param regexEntityId The regex entity extractor ID.
@param regexEntityUpdateObject An object containing the new entity name and regex pattern.
@throws IllegalArgumentException thrown if parameters fail the validation
@th... | [
"Updates",
"the",
"regex",
"entity",
"model",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L10271-L10273 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/ConfigUtils.java | ConfigUtils.propertiesToTypedConfig | public static Config propertiesToTypedConfig(Properties properties, Optional<String> prefix) {
"""
Convert all the keys that start with a <code>prefix</code> in {@link Properties} to a
{@link Config} instance. The method also tries to guess the types of properties.
<p>
This method will throw an exception if (... | java | public static Config propertiesToTypedConfig(Properties properties, Optional<String> prefix) {
Map<String, Object> typedProps = guessPropertiesTypes(properties);
ImmutableMap.Builder<String, Object> immutableMapBuilder = ImmutableMap.builder();
for (Map.Entry<String, Object> entry : typedProps.entrySet()) {... | [
"public",
"static",
"Config",
"propertiesToTypedConfig",
"(",
"Properties",
"properties",
",",
"Optional",
"<",
"String",
">",
"prefix",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"typedProps",
"=",
"guessPropertiesTypes",
"(",
"properties",
")",
";",
... | Convert all the keys that start with a <code>prefix</code> in {@link Properties} to a
{@link Config} instance. The method also tries to guess the types of properties.
<p>
This method will throw an exception if (1) the {@link Object#toString()} method of any two keys in the
{@link Properties} objects returns the same {... | [
"Convert",
"all",
"the",
"keys",
"that",
"start",
"with",
"a",
"<code",
">",
"prefix<",
"/",
"code",
">",
"in",
"{",
"@link",
"Properties",
"}",
"to",
"a",
"{",
"@link",
"Config",
"}",
"instance",
".",
"The",
"method",
"also",
"tries",
"to",
"guess",
... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ConfigUtils.java#L264-L273 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/KeyVaultCredentials.java | KeyVaultCredentials.isValidChallenge | private static boolean isValidChallenge(String authenticateHeader, String authChallengePrefix) {
"""
Verifies whether a challenge is bearer or not.
@param authenticateHeader
the authentication header containing all the challenges.
@param authChallengePrefix
the authentication challenge name.
@return
"""... | java | private static boolean isValidChallenge(String authenticateHeader, String authChallengePrefix) {
if (authenticateHeader != null && !authenticateHeader.isEmpty()
&& authenticateHeader.toLowerCase().startsWith(authChallengePrefix.toLowerCase())) {
return true;
}
return ... | [
"private",
"static",
"boolean",
"isValidChallenge",
"(",
"String",
"authenticateHeader",
",",
"String",
"authChallengePrefix",
")",
"{",
"if",
"(",
"authenticateHeader",
"!=",
"null",
"&&",
"!",
"authenticateHeader",
".",
"isEmpty",
"(",
")",
"&&",
"authenticateHead... | Verifies whether a challenge is bearer or not.
@param authenticateHeader
the authentication header containing all the challenges.
@param authChallengePrefix
the authentication challenge name.
@return | [
"Verifies",
"whether",
"a",
"challenge",
"is",
"bearer",
"or",
"not",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/KeyVaultCredentials.java#L258-L264 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/schema/SchemaService.java | SchemaService.getApplication | public ApplicationDefinition getApplication(String appName) {
"""
Return the {@link ApplicationDefinition} for the application in the default tenant.
Null is returned if no application is found with the given name in the default
tenant.
@return The {@link ApplicationDefinition} for the given application or nu... | java | public ApplicationDefinition getApplication(String appName) {
checkServiceState();
Tenant tenant = TenantService.instance().getDefaultTenant();
return getApplicationDefinition(tenant, appName);
} | [
"public",
"ApplicationDefinition",
"getApplication",
"(",
"String",
"appName",
")",
"{",
"checkServiceState",
"(",
")",
";",
"Tenant",
"tenant",
"=",
"TenantService",
".",
"instance",
"(",
")",
".",
"getDefaultTenant",
"(",
")",
";",
"return",
"getApplicationDefin... | Return the {@link ApplicationDefinition} for the application in the default tenant.
Null is returned if no application is found with the given name in the default
tenant.
@return The {@link ApplicationDefinition} for the given application or null if no
no application such application is defined in the default tenant.
... | [
"Return",
"the",
"{",
"@link",
"ApplicationDefinition",
"}",
"for",
"the",
"application",
"in",
"the",
"default",
"tenant",
".",
"Null",
"is",
"returned",
"if",
"no",
"application",
"is",
"found",
"with",
"the",
"given",
"name",
"in",
"the",
"default",
"tena... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/schema/SchemaService.java#L165-L169 |
logic-ng/LogicNG | src/main/java/org/logicng/datastructures/EncodingResult.java | EncodingResult.resultForMiniSat | public static EncodingResult resultForMiniSat(final FormulaFactory f, final MiniSat miniSat) {
"""
Constructs a new result which adds the result directly to a given MiniSat solver.
@param f the formula factory
@param miniSat the solver
@return the result
"""
return new EncodingResult(f, miniSat, n... | java | public static EncodingResult resultForMiniSat(final FormulaFactory f, final MiniSat miniSat) {
return new EncodingResult(f, miniSat, null);
} | [
"public",
"static",
"EncodingResult",
"resultForMiniSat",
"(",
"final",
"FormulaFactory",
"f",
",",
"final",
"MiniSat",
"miniSat",
")",
"{",
"return",
"new",
"EncodingResult",
"(",
"f",
",",
"miniSat",
",",
"null",
")",
";",
"}"
] | Constructs a new result which adds the result directly to a given MiniSat solver.
@param f the formula factory
@param miniSat the solver
@return the result | [
"Constructs",
"a",
"new",
"result",
"which",
"adds",
"the",
"result",
"directly",
"to",
"a",
"given",
"MiniSat",
"solver",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/datastructures/EncodingResult.java#L88-L90 |
davidmoten/geo | geo/src/main/java/com/github/davidmoten/geo/GeoHash.java | GeoHash.refineInterval | private static void refineInterval(double[] interval, int cd, int mask) {
"""
Refines interval by a factor or 2 in either the 0 or 1 ordinate.
@param interval
two entry array of double values
@param cd
used with mask
@param mask
used with cd
"""
if ((cd & mask) != 0)
interval[0] = (... | java | private static void refineInterval(double[] interval, int cd, int mask) {
if ((cd & mask) != 0)
interval[0] = (interval[0] + interval[1]) / 2;
else
interval[1] = (interval[0] + interval[1]) / 2;
} | [
"private",
"static",
"void",
"refineInterval",
"(",
"double",
"[",
"]",
"interval",
",",
"int",
"cd",
",",
"int",
"mask",
")",
"{",
"if",
"(",
"(",
"cd",
"&",
"mask",
")",
"!=",
"0",
")",
"interval",
"[",
"0",
"]",
"=",
"(",
"interval",
"[",
"0",... | Refines interval by a factor or 2 in either the 0 or 1 ordinate.
@param interval
two entry array of double values
@param cd
used with mask
@param mask
used with cd | [
"Refines",
"interval",
"by",
"a",
"factor",
"or",
"2",
"in",
"either",
"the",
"0",
"or",
"1",
"ordinate",
"."
] | train | https://github.com/davidmoten/geo/blob/e90d2f406133cd9b60d54a3e6bdb7423d7fcce37/geo/src/main/java/com/github/davidmoten/geo/GeoHash.java#L464-L469 |
xdcrafts/flower | flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapDotApi.java | MapDotApi.dotGetUnsafe | public static Object dotGetUnsafe(final Map map, final String pathString) {
"""
Get object value by path.
@param map subject
@param pathString nodes to walk in map
@return value
"""
return dotGetUnsafe(map, Object.class, pathString);
} | java | public static Object dotGetUnsafe(final Map map, final String pathString) {
return dotGetUnsafe(map, Object.class, pathString);
} | [
"public",
"static",
"Object",
"dotGetUnsafe",
"(",
"final",
"Map",
"map",
",",
"final",
"String",
"pathString",
")",
"{",
"return",
"dotGetUnsafe",
"(",
"map",
",",
"Object",
".",
"class",
",",
"pathString",
")",
";",
"}"
] | Get object value by path.
@param map subject
@param pathString nodes to walk in map
@return value | [
"Get",
"object",
"value",
"by",
"path",
"."
] | train | https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapDotApi.java#L126-L128 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/sampling/SystematicSampling.java | SystematicSampling.randomSampling | public static FlatDataCollection randomSampling(FlatDataList idList, int n, boolean randomizeRecords) {
"""
Samples n ids by using Systematic Sampling
@param idList
@param n
@param randomizeRecords
@return
"""
FlatDataList sampledIds = new FlatDataList();
int populationN = idList... | java | public static FlatDataCollection randomSampling(FlatDataList idList, int n, boolean randomizeRecords) {
FlatDataList sampledIds = new FlatDataList();
int populationN = idList.size();
Object[] keys = idList.toArray();
if(randomizeRecords) {
PHPMethods.<Object... | [
"public",
"static",
"FlatDataCollection",
"randomSampling",
"(",
"FlatDataList",
"idList",
",",
"int",
"n",
",",
"boolean",
"randomizeRecords",
")",
"{",
"FlatDataList",
"sampledIds",
"=",
"new",
"FlatDataList",
"(",
")",
";",
"int",
"populationN",
"=",
"idList",
... | Samples n ids by using Systematic Sampling
@param idList
@param n
@param randomizeRecords
@return | [
"Samples",
"n",
"ids",
"by",
"using",
"Systematic",
"Sampling"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/sampling/SystematicSampling.java#L39-L62 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java | ImageDeformPointMLS_F32.computeWeights | void computeWeights(Cache cache, float v_x, float v_y) {
"""
Computes the weight/influence of each control point when distorting point v.
@param cache Cache for the grid point
@param v_x undistorted grid coordinate of cached point.
@param v_y undistorted grid coordinate of cached point.
"""
float[] weight... | java | void computeWeights(Cache cache, float v_x, float v_y) {
float[] weights = cache.weights.data;
// first compute the weights
float totalWeight = 0.0f;
for (int i = 0; i < controls.size(); i++) {
Control c = controls.get(i);
float d2 = c.p.distance2(v_x, v_y);
// check for the special case
if( d2 == ... | [
"void",
"computeWeights",
"(",
"Cache",
"cache",
",",
"float",
"v_x",
",",
"float",
"v_y",
")",
"{",
"float",
"[",
"]",
"weights",
"=",
"cache",
".",
"weights",
".",
"data",
";",
"// first compute the weights",
"float",
"totalWeight",
"=",
"0.0f",
";",
"fo... | Computes the weight/influence of each control point when distorting point v.
@param cache Cache for the grid point
@param v_x undistorted grid coordinate of cached point.
@param v_y undistorted grid coordinate of cached point. | [
"Computes",
"the",
"weight",
"/",
"influence",
"of",
"each",
"control",
"point",
"when",
"distorting",
"point",
"v",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/distort/mls/ImageDeformPointMLS_F32.java#L259-L279 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.