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 |
|---|---|---|---|---|---|---|---|---|---|---|
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/stat/ns/nsacl_stats.java | nsacl_stats.get | public static nsacl_stats get(nitro_service service, String aclname) throws Exception {
"""
Use this API to fetch statistics of nsacl_stats resource of given name .
"""
nsacl_stats obj = new nsacl_stats();
obj.set_aclname(aclname);
nsacl_stats response = (nsacl_stats) obj.stat_resource(service);
return... | java | public static nsacl_stats get(nitro_service service, String aclname) throws Exception{
nsacl_stats obj = new nsacl_stats();
obj.set_aclname(aclname);
nsacl_stats response = (nsacl_stats) obj.stat_resource(service);
return response;
} | [
"public",
"static",
"nsacl_stats",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"aclname",
")",
"throws",
"Exception",
"{",
"nsacl_stats",
"obj",
"=",
"new",
"nsacl_stats",
"(",
")",
";",
"obj",
".",
"set_aclname",
"(",
"aclname",
")",
";",
"nsacl_... | Use this API to fetch statistics of nsacl_stats resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"statistics",
"of",
"nsacl_stats",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/stat/ns/nsacl_stats.java#L279-L284 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/FindingReplacing.java | FindingReplacing.setBetns | public NegateMultiPos<S, Integer, Integer> setBetns(int leftIndex, int rightIndex) {
"""
Sets the substring in given left index and right index as the delegate string
<p><b>The look result same as {@link StrMatcher#finder()}'s behavior</b>
@see StrMatcher#finder()
@param leftIndex
@param rightIndex
@return
... | java | public NegateMultiPos<S, Integer, Integer> setBetns(int leftIndex, int rightIndex) {
return new NegateMultiPos<S, Integer, Integer>(leftIndex, rightIndex) {
@Override protected S result() {
return delegateQueue('I', left, right, pos, position, null, plusminus, filltgt);
}
};
} | [
"public",
"NegateMultiPos",
"<",
"S",
",",
"Integer",
",",
"Integer",
">",
"setBetns",
"(",
"int",
"leftIndex",
",",
"int",
"rightIndex",
")",
"{",
"return",
"new",
"NegateMultiPos",
"<",
"S",
",",
"Integer",
",",
"Integer",
">",
"(",
"leftIndex",
",",
"... | Sets the substring in given left index and right index as the delegate string
<p><b>The look result same as {@link StrMatcher#finder()}'s behavior</b>
@see StrMatcher#finder()
@param leftIndex
@param rightIndex
@return | [
"Sets",
"the",
"substring",
"in",
"given",
"left",
"index",
"and",
"right",
"index",
"as",
"the",
"delegate",
"string",
"<p",
">",
"<b",
">",
"The",
"look",
"result",
"same",
"as",
"{",
"@link",
"StrMatcher#finder",
"()",
"}",
"s",
"behavior<",
"/",
"b",... | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/FindingReplacing.java#L327-L334 |
arquillian/arquillian-core | config/impl-base/src/main/java/org/jboss/arquillian/config/impl/extension/StringPropertyReplacer.java | StringPropertyReplacer.replaceProperties | public static String replaceProperties(final String string) {
"""
Go through the input string and replace any occurrence of ${p} with
the System.getProtocolProperty(p) value. If there is no such property p defined,
then the ${p} reference will remain unchanged.
<p>
If the property reference is of the form ${p:... | java | public static String replaceProperties(final String string) {
Properties props = System.getProperties();
for (Map.Entry<String, String> var : System.getenv().entrySet()) {
String propKey = ENV_VAR_BASE_PROPERTY_KEY + var.getKey();
// honor overridden environment variable (primari... | [
"public",
"static",
"String",
"replaceProperties",
"(",
"final",
"String",
"string",
")",
"{",
"Properties",
"props",
"=",
"System",
".",
"getProperties",
"(",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
">",
"var",
":",
"Sys... | Go through the input string and replace any occurrence of ${p} with
the System.getProtocolProperty(p) value. If there is no such property p defined,
then the ${p} reference will remain unchanged.
<p>
If the property reference is of the form ${p:v} and there is no such property p,
then the default value v will be return... | [
"Go",
"through",
"the",
"input",
"string",
"and",
"replace",
"any",
"occurrence",
"of",
"$",
"{",
"p",
"}",
"with",
"the",
"System",
".",
"getProtocolProperty",
"(",
"p",
")",
"value",
".",
"If",
"there",
"is",
"no",
"such",
"property",
"p",
"defined",
... | train | https://github.com/arquillian/arquillian-core/blob/a85b91789b80cc77e0f0c2e2abac65c2255c0a81/config/impl-base/src/main/java/org/jboss/arquillian/config/impl/extension/StringPropertyReplacer.java#L95-L105 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.license_windows_new_duration_GET | public OvhOrder license_windows_new_duration_GET(String duration, String ip, OvhLicenseTypeEnum serviceType, OvhWindowsSqlVersionEnum sqlVersion, OvhWindowsOsVersionEnum version) throws IOException {
"""
Get prices and contracts information
REST: GET /order/license/windows/new/{duration}
@param serviceType [re... | java | public OvhOrder license_windows_new_duration_GET(String duration, String ip, OvhLicenseTypeEnum serviceType, OvhWindowsSqlVersionEnum sqlVersion, OvhWindowsOsVersionEnum version) throws IOException {
String qPath = "/order/license/windows/new/{duration}";
StringBuilder sb = path(qPath, duration);
query(sb, "ip", ... | [
"public",
"OvhOrder",
"license_windows_new_duration_GET",
"(",
"String",
"duration",
",",
"String",
"ip",
",",
"OvhLicenseTypeEnum",
"serviceType",
",",
"OvhWindowsSqlVersionEnum",
"sqlVersion",
",",
"OvhWindowsOsVersionEnum",
"version",
")",
"throws",
"IOException",
"{",
... | Get prices and contracts information
REST: GET /order/license/windows/new/{duration}
@param serviceType [required] # DEPRECATED # The kind of service on which this license will be used # Will not be used, keeped only for compatibility #
@param sqlVersion [required] The SQL Server version to enable on this license Wind... | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L1259-L1268 |
lucee/Lucee | core/src/main/java/lucee/runtime/reflection/Reflector.java | Reflector.isInstaneOf | public static boolean isInstaneOf(Class src, Class trg) {
"""
check if Class is instanceof a a other Class
@param src Class to check
@param trg is Class of?
@return is Class Class of...
"""
if (src.isArray() && trg.isArray()) {
return isInstaneOf(src.getComponentType(), trg.getComponentType());
}
... | java | public static boolean isInstaneOf(Class src, Class trg) {
if (src.isArray() && trg.isArray()) {
return isInstaneOf(src.getComponentType(), trg.getComponentType());
}
if (src == trg) return true;
// Interface
if (trg.isInterface()) {
return _checkInterfaces(src, trg);
}
// Extends
while (src != null... | [
"public",
"static",
"boolean",
"isInstaneOf",
"(",
"Class",
"src",
",",
"Class",
"trg",
")",
"{",
"if",
"(",
"src",
".",
"isArray",
"(",
")",
"&&",
"trg",
".",
"isArray",
"(",
")",
")",
"{",
"return",
"isInstaneOf",
"(",
"src",
".",
"getComponentType",... | check if Class is instanceof a a other Class
@param src Class to check
@param trg is Class of?
@return is Class Class of... | [
"check",
"if",
"Class",
"is",
"instanceof",
"a",
"a",
"other",
"Class"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/reflection/Reflector.java#L159-L177 |
kohsuke/args4j | args4j/src/org/kohsuke/args4j/OptionHandlerRegistry.java | OptionHandlerRegistry.createOptionHandler | @SuppressWarnings("unchecked")
protected OptionHandler createOptionHandler(CmdLineParser parser, OptionDef o, Setter setter) {
"""
Creates an {@link OptionHandler} that handles the given {@link Option} annotation
and the {@link Setter} instance.
"""
checkNonNull(o, "CmdLineParser");
checkN... | java | @SuppressWarnings("unchecked")
protected OptionHandler createOptionHandler(CmdLineParser parser, OptionDef o, Setter setter) {
checkNonNull(o, "CmdLineParser");
checkNonNull(o, "OptionDef");
checkNonNull(setter, "Setter");
Class<? extends OptionHandler> h = o.handler();
if(h... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"OptionHandler",
"createOptionHandler",
"(",
"CmdLineParser",
"parser",
",",
"OptionDef",
"o",
",",
"Setter",
"setter",
")",
"{",
"checkNonNull",
"(",
"o",
",",
"\"CmdLineParser\"",
")",
";",
"checkN... | Creates an {@link OptionHandler} that handles the given {@link Option} annotation
and the {@link Setter} instance. | [
"Creates",
"an",
"{"
] | train | https://github.com/kohsuke/args4j/blob/dc2e7e265caf15a1a146e3389c1f16a8781f06cf/args4j/src/org/kohsuke/args4j/OptionHandlerRegistry.java#L166-L190 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Disk.java | Disk.createImage | public Operation createImage(String image, String description, OperationOption... options) {
"""
Creates an image for this disk given the image's name and description.
@return a global operation if the image creation was successfully requested
@throws ComputeException upon failure
"""
ImageInfo imageIn... | java | public Operation createImage(String image, String description, OperationOption... options) {
ImageInfo imageInfo =
ImageInfo.newBuilder(ImageId.of(image), DiskImageConfiguration.of(getDiskId()))
.setDescription(description)
.build();
return compute.create(imageInfo, options);
} | [
"public",
"Operation",
"createImage",
"(",
"String",
"image",
",",
"String",
"description",
",",
"OperationOption",
"...",
"options",
")",
"{",
"ImageInfo",
"imageInfo",
"=",
"ImageInfo",
".",
"newBuilder",
"(",
"ImageId",
".",
"of",
"(",
"image",
")",
",",
... | Creates an image for this disk given the image's name and description.
@return a global operation if the image creation was successfully requested
@throws ComputeException upon failure | [
"Creates",
"an",
"image",
"for",
"this",
"disk",
"given",
"the",
"image",
"s",
"name",
"and",
"description",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Disk.java#L204-L210 |
maven-nar/nar-maven-plugin | src/main/java/com/github/maven_nar/cpptasks/CUtil.java | CUtil.runCommand | public static int runCommand(final CCTask task, final File workingDir, final String[] cmdline,
final boolean newEnvironment, final Environment env) throws BuildException {
"""
This method is exposed so test classes can overload and test the
arguments without actually spawning the compiler
"""
try {
... | java | public static int runCommand(final CCTask task, final File workingDir, final String[] cmdline,
final boolean newEnvironment, final Environment env) throws BuildException {
try {
task.log(Commandline.toString(cmdline), task.getCommandLogLevel());
/* final Execute exe = new Execute(new LogStreamHand... | [
"public",
"static",
"int",
"runCommand",
"(",
"final",
"CCTask",
"task",
",",
"final",
"File",
"workingDir",
",",
"final",
"String",
"[",
"]",
"cmdline",
",",
"final",
"boolean",
"newEnvironment",
",",
"final",
"Environment",
"env",
")",
"throws",
"BuildExcept... | This method is exposed so test classes can overload and test the
arguments without actually spawning the compiler | [
"This",
"method",
"is",
"exposed",
"so",
"test",
"classes",
"can",
"overload",
"and",
"test",
"the",
"arguments",
"without",
"actually",
"spawning",
"the",
"compiler"
] | train | https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/CUtil.java#L399-L427 |
resilience4j/resilience4j | resilience4j-prometheus/src/main/java/io/github/resilience4j/prometheus/collectors/RateLimiterMetricsCollector.java | RateLimiterMetricsCollector.ofSupplier | public static RateLimiterMetricsCollector ofSupplier(MetricNames names, Supplier<? extends Iterable<? extends RateLimiter>> supplier) {
"""
Creates a new collector with custom metric names and
using given {@code supplier} as source of rate limiters.
@param names the custom metric names
@param supplier the ... | java | public static RateLimiterMetricsCollector ofSupplier(MetricNames names, Supplier<? extends Iterable<? extends RateLimiter>> supplier) {
return new RateLimiterMetricsCollector(names, supplier);
} | [
"public",
"static",
"RateLimiterMetricsCollector",
"ofSupplier",
"(",
"MetricNames",
"names",
",",
"Supplier",
"<",
"?",
"extends",
"Iterable",
"<",
"?",
"extends",
"RateLimiter",
">",
">",
"supplier",
")",
"{",
"return",
"new",
"RateLimiterMetricsCollector",
"(",
... | Creates a new collector with custom metric names and
using given {@code supplier} as source of rate limiters.
@param names the custom metric names
@param supplier the supplier of rate limiters, note that supplier will be called one every {@link #collect()} | [
"Creates",
"a",
"new",
"collector",
"with",
"custom",
"metric",
"names",
"and",
"using",
"given",
"{",
"@code",
"supplier",
"}",
"as",
"source",
"of",
"rate",
"limiters",
"."
] | train | https://github.com/resilience4j/resilience4j/blob/fa843d30f531c00f0c3dc218b65a7f2bb51af336/resilience4j-prometheus/src/main/java/io/github/resilience4j/prometheus/collectors/RateLimiterMetricsCollector.java#L41-L43 |
voldemort/voldemort | src/java/voldemort/store/routed/action/AsyncPutSynchronizer.java | AsyncPutSynchronizer.tryDelegateResponseHandling | public synchronized boolean tryDelegateResponseHandling(Response<ByteArray, Object> response) {
"""
try to delegate the master to handle the response
@param response
@return true if the master accepted the response; false if the master
didn't accept
"""
if(responseHandlingCutoff) {
ret... | java | public synchronized boolean tryDelegateResponseHandling(Response<ByteArray, Object> response) {
if(responseHandlingCutoff) {
return false;
} else {
responseQueue.offer(response);
this.notifyAll();
return true;
}
} | [
"public",
"synchronized",
"boolean",
"tryDelegateResponseHandling",
"(",
"Response",
"<",
"ByteArray",
",",
"Object",
">",
"response",
")",
"{",
"if",
"(",
"responseHandlingCutoff",
")",
"{",
"return",
"false",
";",
"}",
"else",
"{",
"responseQueue",
".",
"offer... | try to delegate the master to handle the response
@param response
@return true if the master accepted the response; false if the master
didn't accept | [
"try",
"to",
"delegate",
"the",
"master",
"to",
"handle",
"the",
"response"
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/routed/action/AsyncPutSynchronizer.java#L87-L95 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/DateFormat.java | DateFormat.getTimeInstance | public final static DateFormat getTimeInstance(int style) {
"""
Gets the time formatter with the given formatting style
for the default locale.
@param style the given formatting style. For example,
SHORT for "h:mm a" in the US locale.
@return a time formatter.
"""
return get(style, 0, 1, Locale.get... | java | public final static DateFormat getTimeInstance(int style)
{
return get(style, 0, 1, Locale.getDefault(Locale.Category.FORMAT));
} | [
"public",
"final",
"static",
"DateFormat",
"getTimeInstance",
"(",
"int",
"style",
")",
"{",
"return",
"get",
"(",
"style",
",",
"0",
",",
"1",
",",
"Locale",
".",
"getDefault",
"(",
"Locale",
".",
"Category",
".",
"FORMAT",
")",
")",
";",
"}"
] | Gets the time formatter with the given formatting style
for the default locale.
@param style the given formatting style. For example,
SHORT for "h:mm a" in the US locale.
@return a time formatter. | [
"Gets",
"the",
"time",
"formatter",
"with",
"the",
"given",
"formatting",
"style",
"for",
"the",
"default",
"locale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/DateFormat.java#L458-L461 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/process/WordShapeClassifier.java | WordShapeClassifier.wordShapeChris4 | private static String wordShapeChris4(String s, boolean omitIfInBoundary, Collection<String> knownLCWords) {
"""
This one picks up on Dan2 ideas, but seeks to make less distinctions
mid sequence by sorting for long words, but to maintain extra
distinctions for short words, by always recording the class of the
f... | java | private static String wordShapeChris4(String s, boolean omitIfInBoundary, Collection<String> knownLCWords) {
int len = s.length();
if (len <= BOUNDARY_SIZE * 2) {
return wordShapeChris4Short(s, len, knownLCWords);
} else {
return wordShapeChris4Long(s, omitIfInBoundary, len, knownLCWords);
... | [
"private",
"static",
"String",
"wordShapeChris4",
"(",
"String",
"s",
",",
"boolean",
"omitIfInBoundary",
",",
"Collection",
"<",
"String",
">",
"knownLCWords",
")",
"{",
"int",
"len",
"=",
"s",
".",
"length",
"(",
")",
";",
"if",
"(",
"len",
"<=",
"BOUN... | This one picks up on Dan2 ideas, but seeks to make less distinctions
mid sequence by sorting for long words, but to maintain extra
distinctions for short words, by always recording the class of the
first and last two characters of the word.
Compared to chris2 on which it is based,
it uses more Unicode classes, and so c... | [
"This",
"one",
"picks",
"up",
"on",
"Dan2",
"ideas",
"but",
"seeks",
"to",
"make",
"less",
"distinctions",
"mid",
"sequence",
"by",
"sorting",
"for",
"long",
"words",
"but",
"to",
"maintain",
"extra",
"distinctions",
"for",
"short",
"words",
"by",
"always",
... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/process/WordShapeClassifier.java#L555-L562 |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java | CompressorHttp2ConnectionEncoder.cleanup | void cleanup(Http2Stream stream, EmbeddedChannel compressor) {
"""
Release remaining content from {@link EmbeddedChannel} and remove the compressor from the {@link Http2Stream}.
@param stream The stream for which {@code compressor} is the compressor for
@param compressor The compressor for {@code stream}
"... | java | void cleanup(Http2Stream stream, EmbeddedChannel compressor) {
if (compressor.finish()) {
for (;;) {
final ByteBuf buf = compressor.readOutbound();
if (buf == null) {
break;
}
buf.release();
}
}
... | [
"void",
"cleanup",
"(",
"Http2Stream",
"stream",
",",
"EmbeddedChannel",
"compressor",
")",
"{",
"if",
"(",
"compressor",
".",
"finish",
"(",
")",
")",
"{",
"for",
"(",
";",
";",
")",
"{",
"final",
"ByteBuf",
"buf",
"=",
"compressor",
".",
"readOutbound"... | Release remaining content from {@link EmbeddedChannel} and remove the compressor from the {@link Http2Stream}.
@param stream The stream for which {@code compressor} is the compressor for
@param compressor The compressor for {@code stream} | [
"Release",
"remaining",
"content",
"from",
"{",
"@link",
"EmbeddedChannel",
"}",
"and",
"remove",
"the",
"compressor",
"from",
"the",
"{",
"@link",
"Http2Stream",
"}",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java#L286-L298 |
alkacon/opencms-core | src/org/opencms/main/CmsShellCommands.java | CmsShellCommands.createDefaultProject | public void createDefaultProject(String name, String description) throws Exception {
"""
Creates a default project.<p>
This created project has the following properties:<ul>
<li>The users group is the default user group
<li>The users group is also the default project manager group
<li>All resources are conta... | java | public void createDefaultProject(String name, String description) throws Exception {
String storedSiteRoot = m_cms.getRequestContext().getSiteRoot();
try {
m_cms.getRequestContext().setSiteRoot("/");
CmsProject project = m_cms.createProject(
name,
... | [
"public",
"void",
"createDefaultProject",
"(",
"String",
"name",
",",
"String",
"description",
")",
"throws",
"Exception",
"{",
"String",
"storedSiteRoot",
"=",
"m_cms",
".",
"getRequestContext",
"(",
")",
".",
"getSiteRoot",
"(",
")",
";",
"try",
"{",
"m_cms"... | Creates a default project.<p>
This created project has the following properties:<ul>
<li>The users group is the default user group
<li>The users group is also the default project manager group
<li>All resources are contained in the project
<li>The project will remain after publishing</ul>
@param name the name of the ... | [
"Creates",
"a",
"default",
"project",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsShellCommands.java#L302-L322 |
weld/core | impl/src/main/java/org/jboss/weld/resolution/ResolvableBuilder.java | ResolvableBuilder.createMetadataProvider | private Resolvable createMetadataProvider(Class<?> rawType) {
"""
just as facade but we keep the qualifiers so that we can recognize Bean from @Intercepted Bean.
"""
Set<Type> types = Collections.<Type>singleton(rawType);
return new ResolvableImpl(rawType, types, declaringBean, qualifierInstanc... | java | private Resolvable createMetadataProvider(Class<?> rawType) {
Set<Type> types = Collections.<Type>singleton(rawType);
return new ResolvableImpl(rawType, types, declaringBean, qualifierInstances, delegate);
} | [
"private",
"Resolvable",
"createMetadataProvider",
"(",
"Class",
"<",
"?",
">",
"rawType",
")",
"{",
"Set",
"<",
"Type",
">",
"types",
"=",
"Collections",
".",
"<",
"Type",
">",
"singleton",
"(",
"rawType",
")",
";",
"return",
"new",
"ResolvableImpl",
"(",... | just as facade but we keep the qualifiers so that we can recognize Bean from @Intercepted Bean. | [
"just",
"as",
"facade",
"but",
"we",
"keep",
"the",
"qualifiers",
"so",
"that",
"we",
"can",
"recognize",
"Bean",
"from"
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/resolution/ResolvableBuilder.java#L143-L146 |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/view/CShareableResource.java | CShareableResource.minVMAllocation | public int minVMAllocation(int vmIdx, int v) {
"""
Change the VM resource allocation.
@param vmIdx the VM identifier
@param v the amount to ask.
@return the retained value. May be bigger than {@code v} if a previous call asks for more
"""
int vv = Math.max(v, vmAllocation.get(vmIdx));
... | java | public int minVMAllocation(int vmIdx, int v) {
int vv = Math.max(v, vmAllocation.get(vmIdx));
vmAllocation.set(vmIdx, vv);
return vv;
} | [
"public",
"int",
"minVMAllocation",
"(",
"int",
"vmIdx",
",",
"int",
"v",
")",
"{",
"int",
"vv",
"=",
"Math",
".",
"max",
"(",
"v",
",",
"vmAllocation",
".",
"get",
"(",
"vmIdx",
")",
")",
";",
"vmAllocation",
".",
"set",
"(",
"vmIdx",
",",
"vv",
... | Change the VM resource allocation.
@param vmIdx the VM identifier
@param v the amount to ask.
@return the retained value. May be bigger than {@code v} if a previous call asks for more | [
"Change",
"the",
"VM",
"resource",
"allocation",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/view/CShareableResource.java#L221-L225 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/proxyqueue/impl/ConversationHelperImpl.java | ConversationHelperImpl.requestMoreMessages | public void requestMoreMessages(int receivedBytes, int requestedBytes)
throws SIConnectionDroppedException, SIConnectionLostException {
"""
Requests more messages (read ahead)
@param receivedBytes
@param requestedBytes
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.e... | java | public void requestMoreMessages(int receivedBytes, int requestedBytes)
throws SIConnectionDroppedException, SIConnectionLostException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "requestMoreMessages",
new Object[]{""+... | [
"public",
"void",
"requestMoreMessages",
"(",
"int",
"receivedBytes",
",",
"int",
"requestedBytes",
")",
"throws",
"SIConnectionDroppedException",
",",
"SIConnectionLostException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
"."... | Requests more messages (read ahead)
@param receivedBytes
@param requestedBytes | [
"Requests",
"more",
"messages",
"(",
"read",
"ahead",
")"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/proxyqueue/impl/ConversationHelperImpl.java#L549-L589 |
ManfredTremmel/gwt-commons-lang3 | src/main/resources/org/apache/commons/jre/java/util/BitSet.java | BitSet.flipMaskedWord | private static void flipMaskedWord(int[] array, int index, int from, int to) {
"""
Flips all bits in a word within the given range.
@param array The array.
@param index The word index.
@param from The lower bit index.
@param to The upper bit index.
"""
if (from == to) {
return;
}
to = ... | java | private static void flipMaskedWord(int[] array, int index, int from, int to) {
if (from == to) {
return;
}
to = 32 - to;
int word = wordAt(array, index);
word ^= ((0xffffffff >>> from) << (from + to)) >>> to;
array[index] = word & WORD_MASK;
} | [
"private",
"static",
"void",
"flipMaskedWord",
"(",
"int",
"[",
"]",
"array",
",",
"int",
"index",
",",
"int",
"from",
",",
"int",
"to",
")",
"{",
"if",
"(",
"from",
"==",
"to",
")",
"{",
"return",
";",
"}",
"to",
"=",
"32",
"-",
"to",
";",
"in... | Flips all bits in a word within the given range.
@param array The array.
@param index The word index.
@param from The lower bit index.
@param to The upper bit index. | [
"Flips",
"all",
"bits",
"in",
"a",
"word",
"within",
"the",
"given",
"range",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/resources/org/apache/commons/jre/java/util/BitSet.java#L155-L164 |
OpenBEL/openbel-framework | org.openbel.framework.core/src/main/java/org/openbel/framework/core/equivalence/DefaultParameterEquivalencer.java | DefaultParameterEquivalencer.doFindEquivalence | private String doFindEquivalence(final String sourceNamespace,
final String destinationNamespace, final String sourceValue) {
"""
Obtain the destinationNamespace equivalent value of sourceValue in sourceNamespace
@param sourceNamespace resourceLocation of source namespace
@param destinationNamespace ... | java | private String doFindEquivalence(final String sourceNamespace,
final String destinationNamespace, final String sourceValue) {
JDBMEquivalenceLookup sourceLookup =
openEquivalences.get(sourceNamespace);
if (sourceLookup == null) {
return null;
}
fin... | [
"private",
"String",
"doFindEquivalence",
"(",
"final",
"String",
"sourceNamespace",
",",
"final",
"String",
"destinationNamespace",
",",
"final",
"String",
"sourceValue",
")",
"{",
"JDBMEquivalenceLookup",
"sourceLookup",
"=",
"openEquivalences",
".",
"get",
"(",
"so... | Obtain the destinationNamespace equivalent value of sourceValue in sourceNamespace
@param sourceNamespace resourceLocation of source namespace
@param destinationNamespace resourceLocation of destination namespace
@param sourceValue
@return equivalent value, may be null. | [
"Obtain",
"the",
"destinationNamespace",
"equivalent",
"value",
"of",
"sourceValue",
"in",
"sourceNamespace"
] | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/equivalence/DefaultParameterEquivalencer.java#L267-L280 |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKRGraph.java | CDKRGraph.isContainedIn | private boolean isContainedIn(BitSet sourceBitSet, BitSet targetBitSet) {
"""
Test if set sourceBitSet is contained in set targetBitSet.
@param sourceBitSet a bitSet
@param targetBitSet a bitSet
@return true if sourceBitSet is contained in targetBitSet
"""
boolean result = false;
... | java | private boolean isContainedIn(BitSet sourceBitSet, BitSet targetBitSet) {
boolean result = false;
if (sourceBitSet.isEmpty()) {
return true;
}
BitSet setA = (BitSet) sourceBitSet.clone();
setA.and(targetBitSet);
if (setA.equals(sourceBitSet)) {
... | [
"private",
"boolean",
"isContainedIn",
"(",
"BitSet",
"sourceBitSet",
",",
"BitSet",
"targetBitSet",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"sourceBitSet",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"BitSet",
"set... | Test if set sourceBitSet is contained in set targetBitSet.
@param sourceBitSet a bitSet
@param targetBitSet a bitSet
@return true if sourceBitSet is contained in targetBitSet | [
"Test",
"if",
"set",
"sourceBitSet",
"is",
"contained",
"in",
"set",
"targetBitSet",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKRGraph.java#L568-L583 |
apache/flink | flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/client/state/serialization/KvStateSerializer.java | KvStateSerializer.deserializeMap | public static <UK, UV> Map<UK, UV> deserializeMap(byte[] serializedValue, TypeSerializer<UK> keySerializer, TypeSerializer<UV> valueSerializer) throws IOException {
"""
Deserializes all kv pairs with the given serializer.
@param serializedValue Serialized value of type Map<UK, UV>
@param keySerializer ... | java | public static <UK, UV> Map<UK, UV> deserializeMap(byte[] serializedValue, TypeSerializer<UK> keySerializer, TypeSerializer<UV> valueSerializer) throws IOException {
if (serializedValue != null) {
DataInputDeserializer in = new DataInputDeserializer(serializedValue, 0, serializedValue.length);
Map<UK, UV> resul... | [
"public",
"static",
"<",
"UK",
",",
"UV",
">",
"Map",
"<",
"UK",
",",
"UV",
">",
"deserializeMap",
"(",
"byte",
"[",
"]",
"serializedValue",
",",
"TypeSerializer",
"<",
"UK",
">",
"keySerializer",
",",
"TypeSerializer",
"<",
"UV",
">",
"valueSerializer",
... | Deserializes all kv pairs with the given serializer.
@param serializedValue Serialized value of type Map<UK, UV>
@param keySerializer Serializer for UK
@param valueSerializer Serializer for UV
@param <UK> Type of the key
@param <UV> Type of the value.
@return Deserialized map or <code>nul... | [
"Deserializes",
"all",
"kv",
"pairs",
"with",
"the",
"given",
"serializer",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/client/state/serialization/KvStateSerializer.java#L250-L268 |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/security/KeyProvider.java | KeyProvider.getKey | public Key getKey(String alias, String password) {
"""
Gets a key from the key store
@param alias key alias
@param password key password
@return the key
"""
try {
return keyStore.getKey(alias, password.toCharArray());
} catch (GeneralSecurityException e) {
throw new I... | java | public Key getKey(String alias, String password) {
try {
return keyStore.getKey(alias, password.toCharArray());
} catch (GeneralSecurityException e) {
throw new IllegalStateException(e);
}
} | [
"public",
"Key",
"getKey",
"(",
"String",
"alias",
",",
"String",
"password",
")",
"{",
"try",
"{",
"return",
"keyStore",
".",
"getKey",
"(",
"alias",
",",
"password",
".",
"toCharArray",
"(",
")",
")",
";",
"}",
"catch",
"(",
"GeneralSecurityException",
... | Gets a key from the key store
@param alias key alias
@param password key password
@return the key | [
"Gets",
"a",
"key",
"from",
"the",
"key",
"store"
] | train | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/security/KeyProvider.java#L41-L47 |
symphonyoss/messageml-utils | src/main/java/org/symphonyoss/symphony/messageml/MessageMLContext.java | MessageMLContext.parseMarkdown | public void parseMarkdown(String message, JsonNode entities, JsonNode media) throws InvalidInputException {
"""
Parse a Markdown message into its MessageMLV2 representation. Generates document tree structures for
serialization into output formats with the respective get() methods.
@param message string containin... | java | public void parseMarkdown(String message, JsonNode entities, JsonNode media) throws InvalidInputException {
this.messageML = markdownParser.parse(message, entities, media);
this.entityJson = messageML.asEntityJson(this.entityJson);
this.markdownRenderer = new MarkdownRenderer(messageML.asMarkdown());
} | [
"public",
"void",
"parseMarkdown",
"(",
"String",
"message",
",",
"JsonNode",
"entities",
",",
"JsonNode",
"media",
")",
"throws",
"InvalidInputException",
"{",
"this",
".",
"messageML",
"=",
"markdownParser",
".",
"parse",
"(",
"message",
",",
"entities",
",",
... | Parse a Markdown message into its MessageMLV2 representation. Generates document tree structures for
serialization into output formats with the respective get() methods.
@param message string containing a message in Markdown
@param entities additional entity data in JSON | [
"Parse",
"a",
"Markdown",
"message",
"into",
"its",
"MessageMLV2",
"representation",
".",
"Generates",
"document",
"tree",
"structures",
"for",
"serialization",
"into",
"output",
"formats",
"with",
"the",
"respective",
"get",
"()",
"methods",
"."
] | train | https://github.com/symphonyoss/messageml-utils/blob/68daed66267062d144a05b3ee9a9bf4b715e3f95/src/main/java/org/symphonyoss/symphony/messageml/MessageMLContext.java#L83-L87 |
NoraUi/NoraUi | src/main/java/com/github/noraui/browser/steps/BrowserSteps.java | BrowserSteps.closeWindowAndSwitchTo | public void closeWindowAndSwitchTo(String key, String backTo) throws TechnicalException, FailureException {
"""
Closes a specific window and go to the given url.
This method is called by reflexion from @see exceptions.ExceptionCallback#getCallBack(String).
@param key
window key to close
@param backTo
url to... | java | public void closeWindowAndSwitchTo(String key, String backTo) throws TechnicalException, FailureException {
closeWindowAndSwitchTo(key);
goToUrl(backTo);
} | [
"public",
"void",
"closeWindowAndSwitchTo",
"(",
"String",
"key",
",",
"String",
"backTo",
")",
"throws",
"TechnicalException",
",",
"FailureException",
"{",
"closeWindowAndSwitchTo",
"(",
"key",
")",
";",
"goToUrl",
"(",
"backTo",
")",
";",
"}"
] | Closes a specific window and go to the given url.
This method is called by reflexion from @see exceptions.ExceptionCallback#getCallBack(String).
@param key
window key to close
@param backTo
url to go back to
@throws TechnicalException
is thrown if you have a technical error (format, configuration, datas, ...) in NoraU... | [
"Closes",
"a",
"specific",
"window",
"and",
"go",
"to",
"the",
"given",
"url",
".",
"This",
"method",
"is",
"called",
"by",
"reflexion",
"from",
"@see",
"exceptions",
".",
"ExceptionCallback#getCallBack",
"(",
"String",
")",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/browser/steps/BrowserSteps.java#L188-L191 |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/action/ShowCumulatedProducersAction.java | ShowCumulatedProducersAction.setThresholdAttributes | private void setThresholdAttributes(List<String> thresholdIds, HttpServletRequest request) throws APIException {
"""
Sets threshold specific attributes, required to show thresholds on page.
@param thresholdIds Threshold IDs, tied to given producers
@param request {@link HttpServletRequest}
"""
if (th... | java | private void setThresholdAttributes(List<String> thresholdIds, HttpServletRequest request) throws APIException {
if (thresholdIds == null || thresholdIds.isEmpty()) {
return;
}
request.setAttribute("thresholdsPresent", Boolean.TRUE);
List<ThresholdStatusBean> thresholdStatus... | [
"private",
"void",
"setThresholdAttributes",
"(",
"List",
"<",
"String",
">",
"thresholdIds",
",",
"HttpServletRequest",
"request",
")",
"throws",
"APIException",
"{",
"if",
"(",
"thresholdIds",
"==",
"null",
"||",
"thresholdIds",
".",
"isEmpty",
"(",
")",
")",
... | Sets threshold specific attributes, required to show thresholds on page.
@param thresholdIds Threshold IDs, tied to given producers
@param request {@link HttpServletRequest} | [
"Sets",
"threshold",
"specific",
"attributes",
"required",
"to",
"show",
"thresholds",
"on",
"page",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/producers/action/ShowCumulatedProducersAction.java#L169-L177 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.getAt | @SuppressWarnings("unchecked")
public static List<Integer> getAt(int[] array, ObjectRange range) {
"""
Support the subscript operator with an ObjectRange for an int array
@param array an int array
@param range an ObjectRange indicating the indices for the items to retrieve
@return list of the retrieved in... | java | @SuppressWarnings("unchecked")
public static List<Integer> getAt(int[] array, ObjectRange range) {
return primitiveArrayGet(array, range);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"List",
"<",
"Integer",
">",
"getAt",
"(",
"int",
"[",
"]",
"array",
",",
"ObjectRange",
"range",
")",
"{",
"return",
"primitiveArrayGet",
"(",
"array",
",",
"range",
")",
";",
"}"
] | Support the subscript operator with an ObjectRange for an int array
@param array an int array
@param range an ObjectRange indicating the indices for the items to retrieve
@return list of the retrieved ints
@since 1.0 | [
"Support",
"the",
"subscript",
"operator",
"with",
"an",
"ObjectRange",
"for",
"an",
"int",
"array"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L13873-L13876 |
biojava/biojava | biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java | LocationHelper.completeCircularPasses | public static int completeCircularPasses(int index, int seqLength) {
"""
Works in a similar way to modulateCircularLocation but returns
the number of complete passes over a Sequence length a circular
location makes i.e. if we have a sequence of length 10 and the
location 3..52 we make 4 complete passes through ... | java | public static int completeCircularPasses(int index, int seqLength) {
int count = 0;
while (index > seqLength) {
count++;
index -= seqLength;
}
return count - 1;
} | [
"public",
"static",
"int",
"completeCircularPasses",
"(",
"int",
"index",
",",
"int",
"seqLength",
")",
"{",
"int",
"count",
"=",
"0",
";",
"while",
"(",
"index",
">",
"seqLength",
")",
"{",
"count",
"++",
";",
"index",
"-=",
"seqLength",
";",
"}",
"re... | Works in a similar way to modulateCircularLocation but returns
the number of complete passes over a Sequence length a circular
location makes i.e. if we have a sequence of length 10 and the
location 3..52 we make 4 complete passes through the genome to
go from position 3 to position 52. | [
"Works",
"in",
"a",
"similar",
"way",
"to",
"modulateCircularLocation",
"but",
"returns",
"the",
"number",
"of",
"complete",
"passes",
"over",
"a",
"Sequence",
"length",
"a",
"circular",
"location",
"makes",
"i",
".",
"e",
".",
"if",
"we",
"have",
"a",
"se... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java#L245-L252 |
jenkinsci/artifactory-plugin | src/main/java/org/jfrog/hudson/util/BuildUniqueIdentifierHelper.java | BuildUniqueIdentifierHelper.getUpstreamIdentifier | public static String getUpstreamIdentifier(AbstractBuild<?, ?> rootBuild) {
"""
Get the identifier from the <b>root</b> build. which is composed of {@link hudson.model.AbstractProject#getFullName()}
-{@link hudson.model.Run#getNumber()}
@param rootBuild The root build
@return The upstream identifier.
"""
... | java | public static String getUpstreamIdentifier(AbstractBuild<?, ?> rootBuild) {
if (rootBuild != null) {
AbstractProject<?, ?> rootProject = rootBuild.getProject();
return ExtractorUtils.sanitizeBuildName(rootProject.getFullName()) + "-" + rootBuild.getNumber();
}
return nul... | [
"public",
"static",
"String",
"getUpstreamIdentifier",
"(",
"AbstractBuild",
"<",
"?",
",",
"?",
">",
"rootBuild",
")",
"{",
"if",
"(",
"rootBuild",
"!=",
"null",
")",
"{",
"AbstractProject",
"<",
"?",
",",
"?",
">",
"rootProject",
"=",
"rootBuild",
".",
... | Get the identifier from the <b>root</b> build. which is composed of {@link hudson.model.AbstractProject#getFullName()}
-{@link hudson.model.Run#getNumber()}
@param rootBuild The root build
@return The upstream identifier. | [
"Get",
"the",
"identifier",
"from",
"the",
"<b",
">",
"root<",
"/",
"b",
">",
"build",
".",
"which",
"is",
"composed",
"of",
"{",
"@link",
"hudson",
".",
"model",
".",
"AbstractProject#getFullName",
"()",
"}",
"-",
"{",
"@link",
"hudson",
".",
"model",
... | train | https://github.com/jenkinsci/artifactory-plugin/blob/f5fcfff6a5a50be5374813e49d1fe3aaf6422333/src/main/java/org/jfrog/hudson/util/BuildUniqueIdentifierHelper.java#L108-L115 |
twilio/twilio-java | src/main/java/com/twilio/rest/studio/v1/flow/EngagementReader.java | EngagementReader.previousPage | @Override
public Page<Engagement> previousPage(final Page<Engagement> page,
final TwilioRestClient client) {
"""
Retrieve the previous page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Previous... | java | @Override
public Page<Engagement> previousPage(final Page<Engagement> page,
final TwilioRestClient client) {
Request request = new Request(
HttpMethod.GET,
page.getPreviousPageUrl(
Domains.STUDIO.toString(),
cl... | [
"@",
"Override",
"public",
"Page",
"<",
"Engagement",
">",
"previousPage",
"(",
"final",
"Page",
"<",
"Engagement",
">",
"page",
",",
"final",
"TwilioRestClient",
"client",
")",
"{",
"Request",
"request",
"=",
"new",
"Request",
"(",
"HttpMethod",
".",
"GET",... | Retrieve the previous page from the Twilio API.
@param page current page
@param client TwilioRestClient with which to make the request
@return Previous Page | [
"Retrieve",
"the",
"previous",
"page",
"from",
"the",
"Twilio",
"API",
"."
] | train | https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/studio/v1/flow/EngagementReader.java#L110-L121 |
softindex/datakernel | core-eventloop/src/main/java/io/datakernel/jmx/ValueStats.java | ValueStats.linearSearch | private static int linearSearch(int[] histogramLevels, int value) {
"""
return index of smallest element that is greater than "value"
"""
for (int i = 0; i < histogramLevels.length; i++) {
if (value < histogramLevels[i]) {
return i;
}
}
return histogramLevels.length; //
} | java | private static int linearSearch(int[] histogramLevels, int value) {
for (int i = 0; i < histogramLevels.length; i++) {
if (value < histogramLevels[i]) {
return i;
}
}
return histogramLevels.length; //
} | [
"private",
"static",
"int",
"linearSearch",
"(",
"int",
"[",
"]",
"histogramLevels",
",",
"int",
"value",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"histogramLevels",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"value",
"<"... | return index of smallest element that is greater than "value" | [
"return",
"index",
"of",
"smallest",
"element",
"that",
"is",
"greater",
"than",
"value"
] | train | https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-eventloop/src/main/java/io/datakernel/jmx/ValueStats.java#L334-L341 |
aws/aws-sdk-java | aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/AutomationExecution.java | AutomationExecution.withTargetMaps | public AutomationExecution withTargetMaps(java.util.Map<String, java.util.List<String>>... targetMaps) {
"""
<p>
The specified key-value mapping of document parameters to target resources.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setTargetMaps(java.util.C... | java | public AutomationExecution withTargetMaps(java.util.Map<String, java.util.List<String>>... targetMaps) {
if (this.targetMaps == null) {
setTargetMaps(new com.amazonaws.internal.SdkInternalList<java.util.Map<String, java.util.List<String>>>(targetMaps.length));
}
for (java.util.Map<St... | [
"public",
"AutomationExecution",
"withTargetMaps",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
">",
"...",
"targetMaps",
")",
"{",
"if",
"(",
"this",
".",
"targetMaps",
"==",
"null",
"... | <p>
The specified key-value mapping of document parameters to target resources.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setTargetMaps(java.util.Collection)} or {@link #withTargetMaps(java.util.Collection)} if you want to
override the existing values.
</p>
@param ... | [
"<p",
">",
"The",
"specified",
"key",
"-",
"value",
"mapping",
"of",
"document",
"parameters",
"to",
"target",
"resources",
".",
"<",
"/",
"p",
">",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"This",
"method",
"appends",
"the",
"values",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/AutomationExecution.java#L1155-L1163 |
DDTH/ddth-queue | ddth-queue-core/src/main/java/com/github/ddth/queue/utils/MongoUtils.java | MongoUtils.collectionExists | public static boolean collectionExists(MongoDatabase db, String collectionName) {
"""
Check if a collection exists.
@param db
@param collectionName
@return
"""
return db.listCollections().filter(Filters.eq("name", collectionName)).first() != null;
} | java | public static boolean collectionExists(MongoDatabase db, String collectionName) {
return db.listCollections().filter(Filters.eq("name", collectionName)).first() != null;
} | [
"public",
"static",
"boolean",
"collectionExists",
"(",
"MongoDatabase",
"db",
",",
"String",
"collectionName",
")",
"{",
"return",
"db",
".",
"listCollections",
"(",
")",
".",
"filter",
"(",
"Filters",
".",
"eq",
"(",
"\"name\"",
",",
"collectionName",
")",
... | Check if a collection exists.
@param db
@param collectionName
@return | [
"Check",
"if",
"a",
"collection",
"exists",
"."
] | train | https://github.com/DDTH/ddth-queue/blob/b20776850d23111d3d71fc8ed6023c590bc3621f/ddth-queue-core/src/main/java/com/github/ddth/queue/utils/MongoUtils.java#L35-L37 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/data/model/ModelUtil.java | ModelUtil.getPrototypeOrCentroid | public static NumberVector getPrototypeOrCentroid(Model model, Relation<? extends NumberVector> relation, DBIDs ids) {
"""
Get the representative vector for a cluster model, or compute the centroid.
@param model Model
@param relation Data relation (for representatives specified per DBID)
@param ids Cluster id... | java | public static NumberVector getPrototypeOrCentroid(Model model, Relation<? extends NumberVector> relation, DBIDs ids) {
assert (ids.size() > 0);
NumberVector v = getPrototype(model, relation);
return v != null ? v : Centroid.make(relation, ids);
} | [
"public",
"static",
"NumberVector",
"getPrototypeOrCentroid",
"(",
"Model",
"model",
",",
"Relation",
"<",
"?",
"extends",
"NumberVector",
">",
"relation",
",",
"DBIDs",
"ids",
")",
"{",
"assert",
"(",
"ids",
".",
"size",
"(",
")",
">",
"0",
")",
";",
"N... | Get the representative vector for a cluster model, or compute the centroid.
@param model Model
@param relation Data relation (for representatives specified per DBID)
@param ids Cluster ids (must not be empty.
@return Some {@link NumberVector}. | [
"Get",
"the",
"representative",
"vector",
"for",
"a",
"cluster",
"model",
"or",
"compute",
"the",
"centroid",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/data/model/ModelUtil.java#L141-L145 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/DumpedPrivateKey.java | DumpedPrivateKey.fromBase58 | public static DumpedPrivateKey fromBase58(@Nullable NetworkParameters params, String base58)
throws AddressFormatException, AddressFormatException.WrongNetwork {
"""
Construct a private key from its Base58 representation.
@param params
The expected NetworkParameters or null if you don't want validati... | java | public static DumpedPrivateKey fromBase58(@Nullable NetworkParameters params, String base58)
throws AddressFormatException, AddressFormatException.WrongNetwork {
byte[] versionAndDataBytes = Base58.decodeChecked(base58);
int version = versionAndDataBytes[0] & 0xFF;
byte[] bytes = Arr... | [
"public",
"static",
"DumpedPrivateKey",
"fromBase58",
"(",
"@",
"Nullable",
"NetworkParameters",
"params",
",",
"String",
"base58",
")",
"throws",
"AddressFormatException",
",",
"AddressFormatException",
".",
"WrongNetwork",
"{",
"byte",
"[",
"]",
"versionAndDataBytes",... | Construct a private key from its Base58 representation.
@param params
The expected NetworkParameters or null if you don't want validation.
@param base58
The textual form of the private key.
@throws AddressFormatException
if the given base58 doesn't parse or the checksum is invalid
@throws AddressFormatException.WrongNe... | [
"Construct",
"a",
"private",
"key",
"from",
"its",
"Base58",
"representation",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/DumpedPrivateKey.java#L46-L61 |
ops4j/org.ops4j.base | ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertyResolver.java | PropertyResolver.startProperty | private static void startProperty( String name, Properties props, Stack<String> stack ) {
"""
Starts a new property.
@param name The name of the property.
@param props The Properties we are exchanging with.
@param stack The parsing stack.
"""
String propValue = System.getProperty( name );
... | java | private static void startProperty( String name, Properties props, Stack<String> stack )
{
String propValue = System.getProperty( name );
if( propValue == null )
{
propValue = props.getProperty( name );
}
if( propValue == null )
{
push( stack, "... | [
"private",
"static",
"void",
"startProperty",
"(",
"String",
"name",
",",
"Properties",
"props",
",",
"Stack",
"<",
"String",
">",
"stack",
")",
"{",
"String",
"propValue",
"=",
"System",
".",
"getProperty",
"(",
"name",
")",
";",
"if",
"(",
"propValue",
... | Starts a new property.
@param name The name of the property.
@param props The Properties we are exchanging with.
@param stack The parsing stack. | [
"Starts",
"a",
"new",
"property",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-util-collections/src/main/java/org/ops4j/util/collections/PropertyResolver.java#L127-L142 |
bluelinelabs/Conductor | demo/src/main/java/com/bluelinelabs/conductor/demo/util/AnimUtils.java | AnimUtils.createFloatProperty | public static <T> Property<T, Float> createFloatProperty(final FloatProp<T> impl) {
"""
The animation framework has an optimization for <code>Properties</code> of type
<code>float</code> but it was only made public in API24, so wrap the impl in our own type
and conditionally create the appropriate type, delegati... | java | public static <T> Property<T, Float> createFloatProperty(final FloatProp<T> impl) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
return new FloatProperty<T>(impl.name) {
@Override
public Float get(T object) {
return impl.get(object);
... | [
"public",
"static",
"<",
"T",
">",
"Property",
"<",
"T",
",",
"Float",
">",
"createFloatProperty",
"(",
"final",
"FloatProp",
"<",
"T",
">",
"impl",
")",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"Build",
".",
"VERSION_CODES",
".",... | The animation framework has an optimization for <code>Properties</code> of type
<code>float</code> but it was only made public in API24, so wrap the impl in our own type
and conditionally create the appropriate type, delegating the implementation. | [
"The",
"animation",
"framework",
"has",
"an",
"optimization",
"for",
"<code",
">",
"Properties<",
"/",
"code",
">",
"of",
"type",
"<code",
">",
"float<",
"/",
"code",
">",
"but",
"it",
"was",
"only",
"made",
"public",
"in",
"API24",
"so",
"wrap",
"the",
... | train | https://github.com/bluelinelabs/Conductor/blob/94c9121bb16f93b481954513a8e3905846829fb2/demo/src/main/java/com/bluelinelabs/conductor/demo/util/AnimUtils.java#L157-L183 |
code4everything/util | src/main/java/com/zhazhapan/config/JsonParser.java | JsonParser.containsValue | public boolean containsValue(String path, Object value) {
"""
是否包含某个值
@param path <a href= "https://github.com/alibaba/fastjson/wiki/JSONPath">路径语法</a>
@param value 值
@return {@link Boolean}
"""
return JSONPath.containsValue(jsonObject, checkPath(path), value);
} | java | public boolean containsValue(String path, Object value) {
return JSONPath.containsValue(jsonObject, checkPath(path), value);
} | [
"public",
"boolean",
"containsValue",
"(",
"String",
"path",
",",
"Object",
"value",
")",
"{",
"return",
"JSONPath",
".",
"containsValue",
"(",
"jsonObject",
",",
"checkPath",
"(",
"path",
")",
",",
"value",
")",
";",
"}"
] | 是否包含某个值
@param path <a href= "https://github.com/alibaba/fastjson/wiki/JSONPath">路径语法</a>
@param value 值
@return {@link Boolean} | [
"是否包含某个值"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/config/JsonParser.java#L170-L172 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.javaeesec/src/com/ibm/ws/security/javaeesec/identitystore/ELHelper.java | ELHelper.processInt | protected Integer processInt(String name, String expression, int value, boolean immediateOnly) {
"""
This method will process a configuration value for an Integer setting in
{@link LdapIdentityStoreDefinition} or {@link DatabaseIdentityStoreDefinition}.
It will first check to see if there is an EL expression. It... | java | protected Integer processInt(String name, String expression, int value, boolean immediateOnly) {
Integer result = null;
boolean immediate = false;
/*
* The expression language value takes precedence over the direct setting.
*/
if (expression.isEmpty()) {
/*... | [
"protected",
"Integer",
"processInt",
"(",
"String",
"name",
",",
"String",
"expression",
",",
"int",
"value",
",",
"boolean",
"immediateOnly",
")",
"{",
"Integer",
"result",
"=",
"null",
";",
"boolean",
"immediate",
"=",
"false",
";",
"/*\n * The expres... | This method will process a configuration value for an Integer setting in
{@link LdapIdentityStoreDefinition} or {@link DatabaseIdentityStoreDefinition}.
It will first check to see if there is an EL expression. It there is, it will return
the evaluated expression; otherwise, it
will return the non-EL value.
@param name... | [
"This",
"method",
"will",
"process",
"a",
"configuration",
"value",
"for",
"an",
"Integer",
"setting",
"in",
"{",
"@link",
"LdapIdentityStoreDefinition",
"}",
"or",
"{",
"@link",
"DatabaseIdentityStoreDefinition",
"}",
".",
"It",
"will",
"first",
"check",
"to",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.javaeesec/src/com/ibm/ws/security/javaeesec/identitystore/ELHelper.java#L146-L174 |
iipc/webarchive-commons | src/main/java/org/archive/io/GenerationFileHandler.java | GenerationFileHandler.makeNew | public static GenerationFileHandler makeNew(String filename, boolean append, boolean shouldManifest) throws SecurityException, IOException {
"""
Constructor-helper that rather than clobbering any existing
file, moves it aside with a timestamp suffix.
@param filename
@param append
@param shouldManifest
@retu... | java | public static GenerationFileHandler makeNew(String filename, boolean append, boolean shouldManifest) throws SecurityException, IOException {
FileUtils.moveAsideIfExists(new File(filename));
return new GenerationFileHandler(filename, append, shouldManifest);
} | [
"public",
"static",
"GenerationFileHandler",
"makeNew",
"(",
"String",
"filename",
",",
"boolean",
"append",
",",
"boolean",
"shouldManifest",
")",
"throws",
"SecurityException",
",",
"IOException",
"{",
"FileUtils",
".",
"moveAsideIfExists",
"(",
"new",
"File",
"("... | Constructor-helper that rather than clobbering any existing
file, moves it aside with a timestamp suffix.
@param filename
@param append
@param shouldManifest
@return
@throws SecurityException
@throws IOException | [
"Constructor",
"-",
"helper",
"that",
"rather",
"than",
"clobbering",
"any",
"existing",
"file",
"moves",
"it",
"aside",
"with",
"a",
"timestamp",
"suffix",
"."
] | train | https://github.com/iipc/webarchive-commons/blob/988bec707c27a01333becfc3bd502af4441ea1e1/src/main/java/org/archive/io/GenerationFileHandler.java#L156-L159 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/http/AbstractMappingHTTPResponseHandler.java | AbstractMappingHTTPResponseHandler.populateStatusString2FaxStatusMappings | protected void populateStatusString2FaxStatusMappings(FaxJobStatus[] faxJobStatuses,Enum<?>[] configurationKeys) {
"""
This function populates the status strings to fax status enum values
based on the configuration of the handler.
@param faxJobStatuses
The fax job statues used for the mapping
@param conf... | java | protected void populateStatusString2FaxStatusMappings(FaxJobStatus[] faxJobStatuses,Enum<?>[] configurationKeys)
{
//populate map
FaxJobStatus faxJobStatus=null;
String valuesStr=null;
String[] values=null;
String value=null;
for(int index=0;index<configurationKeys.le... | [
"protected",
"void",
"populateStatusString2FaxStatusMappings",
"(",
"FaxJobStatus",
"[",
"]",
"faxJobStatuses",
",",
"Enum",
"<",
"?",
">",
"[",
"]",
"configurationKeys",
")",
"{",
"//populate map",
"FaxJobStatus",
"faxJobStatus",
"=",
"null",
";",
"String",
"values... | This function populates the status strings to fax status enum values
based on the configuration of the handler.
@param faxJobStatuses
The fax job statues used for the mapping
@param configurationKeys
The configuration keys used for the mapping | [
"This",
"function",
"populates",
"the",
"status",
"strings",
"to",
"fax",
"status",
"enum",
"values",
"based",
"on",
"the",
"configuration",
"of",
"the",
"handler",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/http/AbstractMappingHTTPResponseHandler.java#L104-L135 |
ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java | AuthorizationRequestManager.processResponseWrapper | private void processResponseWrapper(Response response, boolean isFailure) {
"""
Called from onSuccess and onFailure. Handles all possible exceptions and notifies the listener
if an exception occurs.
@param response server response
@param isFailure specifies whether this method is called from onSuccess (false... | java | private void processResponseWrapper(Response response, boolean isFailure) {
try {
ResponseImpl responseImpl = (ResponseImpl)response;
if (isFailure || !responseImpl.isRedirect()) {
processResponse(response);
} else {
processRedirectResponse(res... | [
"private",
"void",
"processResponseWrapper",
"(",
"Response",
"response",
",",
"boolean",
"isFailure",
")",
"{",
"try",
"{",
"ResponseImpl",
"responseImpl",
"=",
"(",
"ResponseImpl",
")",
"response",
";",
"if",
"(",
"isFailure",
"||",
"!",
"responseImpl",
".",
... | Called from onSuccess and onFailure. Handles all possible exceptions and notifies the listener
if an exception occurs.
@param response server response
@param isFailure specifies whether this method is called from onSuccess (false) or onFailure (true). | [
"Called",
"from",
"onSuccess",
"and",
"onFailure",
".",
"Handles",
"all",
"possible",
"exceptions",
"and",
"notifies",
"the",
"listener",
"if",
"an",
"exception",
"occurs",
"."
] | train | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationRequestManager.java#L557-L569 |
feroult/yawp | yawp-core/src/main/java/io/yawp/commons/utils/ResourceFinder.java | ResourceFinder.mapAllClasses | public Map<String, Class> mapAllClasses(String uri) throws IOException, ClassNotFoundException {
"""
Executes mapAllStrings assuming the value of each entry in the
map is the name of a class that should be loaded.
<p/>
Any class that cannot be loaded will be cause an exception to be thrown.
<p/>
Example class... | java | public Map<String, Class> mapAllClasses(String uri) throws IOException, ClassNotFoundException {
Map<String, Class> classes = new HashMap<>();
Map<String, String> map = mapAllStrings(uri);
for (Iterator iterator = map.entrySet().iterator(); iterator.hasNext();) {
Map.Entry entry = (M... | [
"public",
"Map",
"<",
"String",
",",
"Class",
">",
"mapAllClasses",
"(",
"String",
"uri",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"Map",
"<",
"String",
",",
"Class",
">",
"classes",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"M... | Executes mapAllStrings assuming the value of each entry in the
map is the name of a class that should be loaded.
<p/>
Any class that cannot be loaded will be cause an exception to be thrown.
<p/>
Example classpath:
<p/>
META-INF/xmlparsers/xerces
META-INF/xmlparsers/crimson
<p/>
ResourceFinder finder = new ResourceFind... | [
"Executes",
"mapAllStrings",
"assuming",
"the",
"value",
"of",
"each",
"entry",
"in",
"the",
"map",
"is",
"the",
"name",
"of",
"a",
"class",
"that",
"should",
"be",
"loaded",
".",
"<p",
"/",
">",
"Any",
"class",
"that",
"cannot",
"be",
"loaded",
"will",
... | train | https://github.com/feroult/yawp/blob/b90deb905edd3fdb3009a5525e310cd17ead7f3d/yawp-core/src/main/java/io/yawp/commons/utils/ResourceFinder.java#L381-L392 |
Netflix/Hystrix | hystrix-core/src/main/java/com/netflix/hystrix/HystrixThreadPoolMetrics.java | HystrixThreadPoolMetrics.getInstance | public static HystrixThreadPoolMetrics getInstance(HystrixThreadPoolKey key, ThreadPoolExecutor threadPool, HystrixThreadPoolProperties properties) {
"""
Get or create the {@link HystrixThreadPoolMetrics} instance for a given {@link HystrixThreadPoolKey}.
<p>
This is thread-safe and ensures only 1 {@link Hystrix... | java | public static HystrixThreadPoolMetrics getInstance(HystrixThreadPoolKey key, ThreadPoolExecutor threadPool, HystrixThreadPoolProperties properties) {
// attempt to retrieve from cache first
HystrixThreadPoolMetrics threadPoolMetrics = metrics.get(key.name());
if (threadPoolMetrics != null) {
... | [
"public",
"static",
"HystrixThreadPoolMetrics",
"getInstance",
"(",
"HystrixThreadPoolKey",
"key",
",",
"ThreadPoolExecutor",
"threadPool",
",",
"HystrixThreadPoolProperties",
"properties",
")",
"{",
"// attempt to retrieve from cache first",
"HystrixThreadPoolMetrics",
"threadPool... | Get or create the {@link HystrixThreadPoolMetrics} instance for a given {@link HystrixThreadPoolKey}.
<p>
This is thread-safe and ensures only 1 {@link HystrixThreadPoolMetrics} per {@link HystrixThreadPoolKey}.
@param key
{@link HystrixThreadPoolKey} of {@link HystrixThreadPool} instance requesting the {@link Hystrix... | [
"Get",
"or",
"create",
"the",
"{",
"@link",
"HystrixThreadPoolMetrics",
"}",
"instance",
"for",
"a",
"given",
"{",
"@link",
"HystrixThreadPoolKey",
"}",
".",
"<p",
">",
"This",
"is",
"thread",
"-",
"safe",
"and",
"ensures",
"only",
"1",
"{",
"@link",
"Hyst... | train | https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/HystrixThreadPoolMetrics.java#L62-L79 |
landawn/AbacusUtil | src/com/landawn/abacus/util/BooleanList.java | BooleanList.reduce | public <E extends Exception> boolean reduce(final boolean identity, final Try.BooleanBinaryOperator<E> accumulator) throws E {
"""
This is equivalent to:
<pre>
<code>
if (isEmpty()) {
return identity;
}
boolean result = identity;
for (int i = 0; i < size; i++) {
result = accumulator.applyAsBoolean(resu... | java | public <E extends Exception> boolean reduce(final boolean identity, final Try.BooleanBinaryOperator<E> accumulator) throws E {
if (isEmpty()) {
return identity;
}
boolean result = identity;
for (int i = 0; i < size; i++) {
result = accumulator.applyAsBoo... | [
"public",
"<",
"E",
"extends",
"Exception",
">",
"boolean",
"reduce",
"(",
"final",
"boolean",
"identity",
",",
"final",
"Try",
".",
"BooleanBinaryOperator",
"<",
"E",
">",
"accumulator",
")",
"throws",
"E",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",... | This is equivalent to:
<pre>
<code>
if (isEmpty()) {
return identity;
}
boolean result = identity;
for (int i = 0; i < size; i++) {
result = accumulator.applyAsBoolean(result, elementData[i]);
}
return result;
</code>
</pre>
@param identity
@param accumulator
@return | [
"This",
"is",
"equivalent",
"to",
":",
"<pre",
">",
"<code",
">",
"if",
"(",
"isEmpty",
"()",
")",
"{",
"return",
"identity",
";",
"}"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/BooleanList.java#L1041-L1053 |
kiswanij/jk-util | src/main/java/com/jk/util/xml/JKXmlHandler.java | JKXmlHandler.toXml | public String toXml(Object obj, Class<?>... clas) {
"""
To xml.
@param obj the obj
@param clas the clas
@return the string
"""
ByteArrayOutputStream out = new ByteArrayOutputStream();
toXml(obj, out, clas);
return out.toString();
} | java | public String toXml(Object obj, Class<?>... clas) {
ByteArrayOutputStream out = new ByteArrayOutputStream();
toXml(obj, out, clas);
return out.toString();
} | [
"public",
"String",
"toXml",
"(",
"Object",
"obj",
",",
"Class",
"<",
"?",
">",
"...",
"clas",
")",
"{",
"ByteArrayOutputStream",
"out",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"toXml",
"(",
"obj",
",",
"out",
",",
"clas",
")",
";",
"return... | To xml.
@param obj the obj
@param clas the clas
@return the string | [
"To",
"xml",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/xml/JKXmlHandler.java#L108-L112 |
Waikato/moa | moa/src/main/java/moa/classifiers/core/attributeclassobservers/FIMTDDNumericAttributeClassObserver.java | FIMTDDNumericAttributeClassObserver.removeBadSplits | public void removeBadSplits(SplitCriterion criterion, double lastCheckRatio, double lastCheckSDR, double lastCheckE) {
"""
A method to remove all nodes in the E-BST in which it and all it's
children represent 'bad' split points
"""
removeBadSplitNodes(criterion, this.root, lastCheckRatio, lastCheckSDR... | java | public void removeBadSplits(SplitCriterion criterion, double lastCheckRatio, double lastCheckSDR, double lastCheckE) {
removeBadSplitNodes(criterion, this.root, lastCheckRatio, lastCheckSDR, lastCheckE);
} | [
"public",
"void",
"removeBadSplits",
"(",
"SplitCriterion",
"criterion",
",",
"double",
"lastCheckRatio",
",",
"double",
"lastCheckSDR",
",",
"double",
"lastCheckE",
")",
"{",
"removeBadSplitNodes",
"(",
"criterion",
",",
"this",
".",
"root",
",",
"lastCheckRatio",
... | A method to remove all nodes in the E-BST in which it and all it's
children represent 'bad' split points | [
"A",
"method",
"to",
"remove",
"all",
"nodes",
"in",
"the",
"E",
"-",
"BST",
"in",
"which",
"it",
"and",
"all",
"it",
"s",
"children",
"represent",
"bad",
"split",
"points"
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/core/attributeclassobservers/FIMTDDNumericAttributeClassObserver.java#L193-L195 |
google/closure-compiler | src/com/google/javascript/jscomp/graph/LinkedDirectedGraph.java | LinkedDirectedGraph.isConnectedInDirection | @Override
public boolean isConnectedInDirection(N n1, N n2) {
"""
DiGraphNode look ups can be expensive for a large graph operation, prefer the
version below that takes DiGraphNodes, if you have them available.
"""
return isConnectedInDirection(n1, Predicates.<E>alwaysTrue(), n2);
} | java | @Override
public boolean isConnectedInDirection(N n1, N n2) {
return isConnectedInDirection(n1, Predicates.<E>alwaysTrue(), n2);
} | [
"@",
"Override",
"public",
"boolean",
"isConnectedInDirection",
"(",
"N",
"n1",
",",
"N",
"n2",
")",
"{",
"return",
"isConnectedInDirection",
"(",
"n1",
",",
"Predicates",
".",
"<",
"E",
">",
"alwaysTrue",
"(",
")",
",",
"n2",
")",
";",
"}"
] | DiGraphNode look ups can be expensive for a large graph operation, prefer the
version below that takes DiGraphNodes, if you have them available. | [
"DiGraphNode",
"look",
"ups",
"can",
"be",
"expensive",
"for",
"a",
"large",
"graph",
"operation",
"prefer",
"the",
"version",
"below",
"that",
"takes",
"DiGraphNodes",
"if",
"you",
"have",
"them",
"available",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/graph/LinkedDirectedGraph.java#L226-L229 |
demidenko05/beigesoft-accounting | src/main/java/org/beigesoft/accounting/service/SrvBalanceStd.java | SrvBalanceStd.evalDateBalanceStoreStart | public final synchronized Date evalDateBalanceStoreStart(
final Map<String, Object> pAddParam) throws Exception {
"""
<p>Evaluate date start of stored balances according settings,
this is the first month of the first accounting entry or start of current
year if there are no any acc-entry.</p>
@param pAddPar... | java | public final synchronized Date evalDateBalanceStoreStart(
final Map<String, Object> pAddParam) throws Exception {
Date dateBalanceStoreStart = lazyGetBalanceAtAllDirtyCheck(pAddParam)
.getDateBalanceStoreStart();
Date leastAccountingEntryDate = this.balanceAtAllDirtyCheck
.getLeastAccountingEntr... | [
"public",
"final",
"synchronized",
"Date",
"evalDateBalanceStoreStart",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"pAddParam",
")",
"throws",
"Exception",
"{",
"Date",
"dateBalanceStoreStart",
"=",
"lazyGetBalanceAtAllDirtyCheck",
"(",
"pAddParam",
")",
... | <p>Evaluate date start of stored balances according settings,
this is the first month of the first accounting entry or start of current
year if there are no any acc-entry.</p>
@param pAddParam additional param
@return Date
@throws Exception - an exception | [
"<p",
">",
"Evaluate",
"date",
"start",
"of",
"stored",
"balances",
"according",
"settings",
"this",
"is",
"the",
"first",
"month",
"of",
"the",
"first",
"accounting",
"entry",
"or",
"start",
"of",
"current",
"year",
"if",
"there",
"are",
"no",
"any",
"acc... | train | https://github.com/demidenko05/beigesoft-accounting/blob/e6f423949008218ddd05953b078f1ea8805095c1/src/main/java/org/beigesoft/accounting/service/SrvBalanceStd.java#L525-L577 |
alkacon/opencms-core | src/org/opencms/ui/apps/cacheadmin/CmsImageCacheHolder.java | CmsImageCacheHolder.visitImages | private void visitImages(CmsObject cms, File directory) {
"""
Visits all cached images in the given directory.<p>
@param cms the cms context
@param directory the directory to visit
"""
if (!directory.canRead() || !directory.isDirectory()) {
return;
}
File[] files = dire... | java | private void visitImages(CmsObject cms, File directory) {
if (!directory.canRead() || !directory.isDirectory()) {
return;
}
File[] files = directory.listFiles(m_filter);
for (int i = 0; i < files.length; i++) {
File f = files[i];
if (f.isDirectory()) ... | [
"private",
"void",
"visitImages",
"(",
"CmsObject",
"cms",
",",
"File",
"directory",
")",
"{",
"if",
"(",
"!",
"directory",
".",
"canRead",
"(",
")",
"||",
"!",
"directory",
".",
"isDirectory",
"(",
")",
")",
"{",
"return",
";",
"}",
"File",
"[",
"]"... | Visits all cached images in the given directory.<p>
@param cms the cms context
@param directory the directory to visit | [
"Visits",
"all",
"cached",
"images",
"in",
"the",
"given",
"directory",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/cacheadmin/CmsImageCacheHolder.java#L282-L296 |
erlang/otp | lib/jinterface/java_src/com/ericsson/otp/erlang/OtpLocalNode.java | OtpLocalNode.createPort | public synchronized OtpErlangPort createPort() {
"""
Create an Erlang {@link OtpErlangPort port}. Erlang ports are based upon
some node specific information; this method creates a port using the
information in this node. Each call to this method produces a unique
port. It may not be meaningful to create a port ... | java | public synchronized OtpErlangPort createPort() {
final OtpErlangPort p = new OtpErlangPort(node, portCount, creation);
portCount++;
if (portCount > 0xfffffff) { /* 28 bits */
portCount = 0;
}
return p;
} | [
"public",
"synchronized",
"OtpErlangPort",
"createPort",
"(",
")",
"{",
"final",
"OtpErlangPort",
"p",
"=",
"new",
"OtpErlangPort",
"(",
"node",
",",
"portCount",
",",
"creation",
")",
";",
"portCount",
"++",
";",
"if",
"(",
"portCount",
">",
"0xfffffff",
")... | Create an Erlang {@link OtpErlangPort port}. Erlang ports are based upon
some node specific information; this method creates a port using the
information in this node. Each call to this method produces a unique
port. It may not be meaningful to create a port in a non-Erlang
environment, but this method is provided for ... | [
"Create",
"an",
"Erlang",
"{",
"@link",
"OtpErlangPort",
"port",
"}",
".",
"Erlang",
"ports",
"are",
"based",
"upon",
"some",
"node",
"specific",
"information",
";",
"this",
"method",
"creates",
"a",
"port",
"using",
"the",
"information",
"in",
"this",
"node... | train | https://github.com/erlang/otp/blob/ac6084fd83240355f72e94adbf303e57832d1fab/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpLocalNode.java#L141-L150 |
cdapio/tigon | tigon-api/src/main/java/co/cask/tigon/internal/io/SchemaTypeAdapter.java | SchemaTypeAdapter.readRecord | private Schema readRecord(JsonReader reader, Set<String> knownRecords) throws IOException {
"""
Constructs {@link Schema.Type#RECORD RECORD} type schema from the json input.
@param reader The {@link JsonReader} for streaming json input tokens.
@param knownRecords Set of record name already encountered during t... | java | private Schema readRecord(JsonReader reader, Set<String> knownRecords) throws IOException {
if (!"name".equals(reader.nextName())) {
throw new IOException("Property \"name\" missing for record.");
}
String recordName = reader.nextString();
// Read in fields schemas
if (!"fields".equals(reade... | [
"private",
"Schema",
"readRecord",
"(",
"JsonReader",
"reader",
",",
"Set",
"<",
"String",
">",
"knownRecords",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"\"name\"",
".",
"equals",
"(",
"reader",
".",
"nextName",
"(",
")",
")",
")",
"{",
"throw"... | Constructs {@link Schema.Type#RECORD RECORD} type schema from the json input.
@param reader The {@link JsonReader} for streaming json input tokens.
@param knownRecords Set of record name already encountered during the reading.
@return A {@link Schema} of type {@link Schema.Type#RECORD RECORD}.
@throws java.io.IOExcept... | [
"Constructs",
"{",
"@link",
"Schema",
".",
"Type#RECORD",
"RECORD",
"}",
"type",
"schema",
"from",
"the",
"json",
"input",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-api/src/main/java/co/cask/tigon/internal/io/SchemaTypeAdapter.java#L190-L217 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/meta/Column.java | Column.init | public void init(String tableName, ResultSet columnMetaRs) throws SQLException {
"""
初始化
@param tableName 表名
@param columnMetaRs 列的meta ResultSet
@throws SQLException SQL执行异常
"""
this.tableName = tableName;
this.name = columnMetaRs.getString("COLUMN_NAME");
this.type = columnMetaRs.getInt("DATA_TYP... | java | public void init(String tableName, ResultSet columnMetaRs) throws SQLException {
this.tableName = tableName;
this.name = columnMetaRs.getString("COLUMN_NAME");
this.type = columnMetaRs.getInt("DATA_TYPE");
this.size = columnMetaRs.getInt("COLUMN_SIZE");
this.isNullable = columnMetaRs.getBoolean("NULLABLE");
... | [
"public",
"void",
"init",
"(",
"String",
"tableName",
",",
"ResultSet",
"columnMetaRs",
")",
"throws",
"SQLException",
"{",
"this",
".",
"tableName",
"=",
"tableName",
";",
"this",
".",
"name",
"=",
"columnMetaRs",
".",
"getString",
"(",
"\"COLUMN_NAME\"",
")"... | 初始化
@param tableName 表名
@param columnMetaRs 列的meta ResultSet
@throws SQLException SQL执行异常 | [
"初始化"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/meta/Column.java#L73-L81 |
mozilla/rhino | src/org/mozilla/javascript/Parser.java | Parser.createNameNode | private Name createNameNode(boolean checkActivation, int token) {
"""
Create a {@code Name} node using the token info from the
last scanned name. In some cases we need to either synthesize
a name node, or we lost the name token information by peeking.
If the {@code token} parameter is not {@link Token#NAME}, t... | java | private Name createNameNode(boolean checkActivation, int token) {
int beg = ts.tokenBeg;
String s = ts.getString();
int lineno = ts.lineno;
if (!"".equals(prevNameTokenString)) {
beg = prevNameTokenStart;
s = prevNameTokenString;
lineno = prevNameToken... | [
"private",
"Name",
"createNameNode",
"(",
"boolean",
"checkActivation",
",",
"int",
"token",
")",
"{",
"int",
"beg",
"=",
"ts",
".",
"tokenBeg",
";",
"String",
"s",
"=",
"ts",
".",
"getString",
"(",
")",
";",
"int",
"lineno",
"=",
"ts",
".",
"lineno",
... | Create a {@code Name} node using the token info from the
last scanned name. In some cases we need to either synthesize
a name node, or we lost the name token information by peeking.
If the {@code token} parameter is not {@link Token#NAME}, then
we use token info saved in instance vars. | [
"Create",
"a",
"{"
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Parser.java#L3748-L3773 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java | SearchIndex.updateNodes | @Override
public void updateNodes(final Iterator<String> remove, final Iterator<NodeData> add) throws RepositoryException,
IOException {
"""
This implementation forwards the call to
{@link MultiIndex#update(Collection, Collection)} and transforms the two
iterators to the required types.
@param remove... | java | @Override
public void updateNodes(final Iterator<String> remove, final Iterator<NodeData> add) throws RepositoryException,
IOException
{
checkOpen();
apply(getChanges(remove, add));
} | [
"@",
"Override",
"public",
"void",
"updateNodes",
"(",
"final",
"Iterator",
"<",
"String",
">",
"remove",
",",
"final",
"Iterator",
"<",
"NodeData",
">",
"add",
")",
"throws",
"RepositoryException",
",",
"IOException",
"{",
"checkOpen",
"(",
")",
";",
"apply... | This implementation forwards the call to
{@link MultiIndex#update(Collection, Collection)} and transforms the two
iterators to the required types.
@param remove
uuids of nodes to remove.
@param add
NodeStates to add. Calls to <code>next()</code> on this
iterator may return <code>null</code>, to indicate that a node
co... | [
"This",
"implementation",
"forwards",
"the",
"call",
"to",
"{",
"@link",
"MultiIndex#update",
"(",
"Collection",
"Collection",
")",
"}",
"and",
"transforms",
"the",
"two",
"iterators",
"to",
"the",
"required",
"types",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java#L1270-L1276 |
HolmesNL/kafka-spout | src/main/java/nl/minvenj/nfi/storm/kafka/util/ConfigUtils.java | ConfigUtils.getStormZookeepers | public static String getStormZookeepers(final Map<String, Object> stormConfig) {
"""
Creates a zookeeper connect string usable for the kafka configuration property {@code "zookeeper.connect"} from
storm's configuration map by looking up the {@link org.apache.storm.Config#STORM_ZOOKEEPER_SERVERS} and
{@link org.a... | java | public static String getStormZookeepers(final Map<String, Object> stormConfig) {
final Object stormZookeepers = stormConfig.get(Config.STORM_ZOOKEEPER_SERVERS);
final Object stormZookeepersPort = stormConfig.get(Config.STORM_ZOOKEEPER_PORT);
if (stormZookeepers instanceof List && stormZookeepers... | [
"public",
"static",
"String",
"getStormZookeepers",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"stormConfig",
")",
"{",
"final",
"Object",
"stormZookeepers",
"=",
"stormConfig",
".",
"get",
"(",
"Config",
".",
"STORM_ZOOKEEPER_SERVERS",
")",
";",
... | Creates a zookeeper connect string usable for the kafka configuration property {@code "zookeeper.connect"} from
storm's configuration map by looking up the {@link org.apache.storm.Config#STORM_ZOOKEEPER_SERVERS} and
{@link org.apache.storm.Config#STORM_ZOOKEEPER_PORT} values. Returns null when this procedure fails.
@p... | [
"Creates",
"a",
"zookeeper",
"connect",
"string",
"usable",
"for",
"the",
"kafka",
"configuration",
"property",
"{",
"@code",
"zookeeper",
".",
"connect",
"}",
"from",
"storm",
"s",
"configuration",
"map",
"by",
"looking",
"up",
"the",
"{",
"@link",
"org",
"... | train | https://github.com/HolmesNL/kafka-spout/blob/bef626b9fab6946a7e0d3c85979ec36ae0870233/src/main/java/nl/minvenj/nfi/storm/kafka/util/ConfigUtils.java#L195-L216 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/auth/ChooseAuthenticationFragment.java | ChooseAuthenticationFragment.createChooseAuthenticationFragment | public static ChooseAuthenticationFragment createChooseAuthenticationFragment(final Context context, final ArrayList<BoxAuthentication.BoxAuthenticationInfo> listOfAuthInfo) {
"""
Create an instance of this fragment to display the given list of BoxAuthenticationInfos.
@param context current context
@param listOf... | java | public static ChooseAuthenticationFragment createChooseAuthenticationFragment(final Context context, final ArrayList<BoxAuthentication.BoxAuthenticationInfo> listOfAuthInfo){
ChooseAuthenticationFragment fragment = createAuthenticationActivity(context);
Bundle b = fragment.getArguments();
if (b ... | [
"public",
"static",
"ChooseAuthenticationFragment",
"createChooseAuthenticationFragment",
"(",
"final",
"Context",
"context",
",",
"final",
"ArrayList",
"<",
"BoxAuthentication",
".",
"BoxAuthenticationInfo",
">",
"listOfAuthInfo",
")",
"{",
"ChooseAuthenticationFragment",
"f... | Create an instance of this fragment to display the given list of BoxAuthenticationInfos.
@param context current context
@param listOfAuthInfo a list of auth infos in the order to display to the user.
@return a fragment displaying list of authinfos provided above. | [
"Create",
"an",
"instance",
"of",
"this",
"fragment",
"to",
"display",
"the",
"given",
"list",
"of",
"BoxAuthenticationInfos",
"."
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/auth/ChooseAuthenticationFragment.java#L103-L119 |
apache/incubator-shardingsphere | sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/ShardingRule.java | ShardingRule.isShardingColumn | public boolean isShardingColumn(final String columnName, final String tableName) {
"""
Judge is sharding column or not.
@param columnName column name
@param tableName table name
@return is sharding column or not
"""
for (TableRule each : tableRules) {
if (each.getLogicTable().equalsIgn... | java | public boolean isShardingColumn(final String columnName, final String tableName) {
for (TableRule each : tableRules) {
if (each.getLogicTable().equalsIgnoreCase(tableName) && isShardingColumn(each, columnName)) {
return true;
}
}
return false;
} | [
"public",
"boolean",
"isShardingColumn",
"(",
"final",
"String",
"columnName",
",",
"final",
"String",
"tableName",
")",
"{",
"for",
"(",
"TableRule",
"each",
":",
"tableRules",
")",
"{",
"if",
"(",
"each",
".",
"getLogicTable",
"(",
")",
".",
"equalsIgnoreC... | Judge is sharding column or not.
@param columnName column name
@param tableName table name
@return is sharding column or not | [
"Judge",
"is",
"sharding",
"column",
"or",
"not",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/ShardingRule.java#L323-L330 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/http/HttpHeaderMap.java | HttpHeaderMap.setDateHeader | public void setDateHeader (@Nonnull @Nonempty final String sName, @Nonnull final LocalDate aLD) {
"""
Set the passed header as a date header.
@param sName
Header name. May neither be <code>null</code> nor empty.
@param aLD
The LocalDate to set as a date. The time is set to start of day. May
not be <code>nul... | java | public void setDateHeader (@Nonnull @Nonempty final String sName, @Nonnull final LocalDate aLD)
{
setDateHeader (sName, PDTFactory.createZonedDateTime (aLD));
} | [
"public",
"void",
"setDateHeader",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sName",
",",
"@",
"Nonnull",
"final",
"LocalDate",
"aLD",
")",
"{",
"setDateHeader",
"(",
"sName",
",",
"PDTFactory",
".",
"createZonedDateTime",
"(",
"aLD",
")",
")... | Set the passed header as a date header.
@param sName
Header name. May neither be <code>null</code> nor empty.
@param aLD
The LocalDate to set as a date. The time is set to start of day. May
not be <code>null</code>. | [
"Set",
"the",
"passed",
"header",
"as",
"a",
"date",
"header",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/http/HttpHeaderMap.java#L251-L254 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java | DateFormat.getDateTimeInstance | public final static DateFormat getDateTimeInstance(
int dateStyle, int timeStyle, Locale aLocale) {
"""
Returns the date/time formatter with the given formatting styles
for the given locale.
@param dateStyle the given date formatting style. As currently implemented, relative date
formatting only affects... | java | public final static DateFormat getDateTimeInstance(
int dateStyle, int timeStyle, Locale aLocale)
{
return get(dateStyle, timeStyle, ULocale.forLocale(aLocale), null);
} | [
"public",
"final",
"static",
"DateFormat",
"getDateTimeInstance",
"(",
"int",
"dateStyle",
",",
"int",
"timeStyle",
",",
"Locale",
"aLocale",
")",
"{",
"return",
"get",
"(",
"dateStyle",
",",
"timeStyle",
",",
"ULocale",
".",
"forLocale",
"(",
"aLocale",
")",
... | Returns the date/time formatter with the given formatting styles
for the given locale.
@param dateStyle the given date formatting style. As currently implemented, relative date
formatting only affects a limited range of calendar days before or after the
current date, based on the CLDR <field type="day">/<relat... | [
"Returns",
"the",
"date",
"/",
"time",
"formatter",
"with",
"the",
"given",
"formatting",
"styles",
"for",
"the",
"given",
"locale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java#L1385-L1389 |
citrusframework/citrus | modules/citrus-ws/src/main/java/com/consol/citrus/ws/interceptor/LoggingInterceptorSupport.java | LoggingInterceptorSupport.logMessage | protected void logMessage(String logMessage, String message, boolean incoming) {
"""
Performs the final logger call with dynamic message.
@param logMessage a custom log message entry.
@param message the message content.
@param incoming
"""
if (messageListener != null) {
log.debug(logMe... | java | protected void logMessage(String logMessage, String message, boolean incoming) {
if (messageListener != null) {
log.debug(logMessage);
if (incoming) {
messageListener.onInboundMessage(new RawMessage(message), null);
} else {
messageListener.on... | [
"protected",
"void",
"logMessage",
"(",
"String",
"logMessage",
",",
"String",
"message",
",",
"boolean",
"incoming",
")",
"{",
"if",
"(",
"messageListener",
"!=",
"null",
")",
"{",
"log",
".",
"debug",
"(",
"logMessage",
")",
";",
"if",
"(",
"incoming",
... | Performs the final logger call with dynamic message.
@param logMessage a custom log message entry.
@param message the message content.
@param incoming | [
"Performs",
"the",
"final",
"logger",
"call",
"with",
"dynamic",
"message",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-ws/src/main/java/com/consol/citrus/ws/interceptor/LoggingInterceptorSupport.java#L131-L145 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/ConversationState.java | ConversationState.putChunkedMessageWrapper | public void putChunkedMessageWrapper(long wrapperId, ChunkedMessageWrapper wrapper) {
"""
Puts a chunked message wrapper into our map.
@param wrapperId
@param wrapper
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "putChunkedMessageWrapper", n... | java | public void putChunkedMessageWrapper(long wrapperId, ChunkedMessageWrapper wrapper)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "putChunkedMessageWrapper", new Object[] { Long.valueOf(wrapperId), wrapper });
inProgressMessages.put(Long.valueOf... | [
"public",
"void",
"putChunkedMessageWrapper",
"(",
"long",
"wrapperId",
",",
"ChunkedMessageWrapper",
"wrapper",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",... | Puts a chunked message wrapper into our map.
@param wrapperId
@param wrapper | [
"Puts",
"a",
"chunked",
"message",
"wrapper",
"into",
"our",
"map",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/ConversationState.java#L672-L679 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/imageprocess/AipImageProcess.java | AipImageProcess.dehaze | public JSONObject dehaze(byte[] image, HashMap<String, String> options) {
"""
图像去雾接口
对浓雾天气下拍摄,导致细节无法辨认的图像进行去雾处理,还原更清晰真实的图像。
@param image - 二进制图像数据
@param options - 可选参数对象,key: value都为string类型
options - options列表:
@return JSONObject
"""
AipRequest request = new AipRequest();
preOperation(... | java | public JSONObject dehaze(byte[] image, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
String base64Content = Base64Util.encode(image);
request.addBody("image", base64Content);
if (options != null) {
request.ad... | [
"public",
"JSONObject",
"dehaze",
"(",
"byte",
"[",
"]",
"image",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"String"... | 图像去雾接口
对浓雾天气下拍摄,导致细节无法辨认的图像进行去雾处理,还原更清晰真实的图像。
@param image - 二进制图像数据
@param options - 可选参数对象,key: value都为string类型
options - options列表:
@return JSONObject | [
"图像去雾接口",
"对浓雾天气下拍摄,导致细节无法辨认的图像进行去雾处理,还原更清晰真实的图像。"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/imageprocess/AipImageProcess.java#L83-L95 |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/db/graph/OGraphDatabase.java | OGraphDatabase.getEdgesBetweenVertexes | public Set<ODocument> getEdgesBetweenVertexes(final ODocument iVertex1, final ODocument iVertex2) {
"""
Returns all the edges between the vertexes iVertex1 and iVertex2.
@param iVertex1
First Vertex
@param iVertex2
Second Vertex
@return The Set with the common Edges between the two vertexes. If edges aren't... | java | public Set<ODocument> getEdgesBetweenVertexes(final ODocument iVertex1, final ODocument iVertex2) {
return getEdgesBetweenVertexes(iVertex1, iVertex2, null, null);
} | [
"public",
"Set",
"<",
"ODocument",
">",
"getEdgesBetweenVertexes",
"(",
"final",
"ODocument",
"iVertex1",
",",
"final",
"ODocument",
"iVertex2",
")",
"{",
"return",
"getEdgesBetweenVertexes",
"(",
"iVertex1",
",",
"iVertex2",
",",
"null",
",",
"null",
")",
";",
... | Returns all the edges between the vertexes iVertex1 and iVertex2.
@param iVertex1
First Vertex
@param iVertex2
Second Vertex
@return The Set with the common Edges between the two vertexes. If edges aren't found the set is empty | [
"Returns",
"all",
"the",
"edges",
"between",
"the",
"vertexes",
"iVertex1",
"and",
"iVertex2",
"."
] | train | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/db/graph/OGraphDatabase.java#L338-L340 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSet.java | NodeSet.addNodesInDocOrder | public void addNodesInDocOrder(NodeIterator iterator, XPathContext support) {
"""
Copy NodeList members into this nodelist, adding in
document order. If a node is null, don't add it.
@param iterator NodeIterator which yields the nodes to be added.
@param support The XPath runtime context.
@throws RuntimeExc... | java | public void addNodesInDocOrder(NodeIterator iterator, XPathContext support)
{
if (!m_mutable)
throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
Node node;
while (null != (node = iterator.nextNode()))
... | [
"public",
"void",
"addNodesInDocOrder",
"(",
"NodeIterator",
"iterator",
",",
"XPathContext",
"support",
")",
"{",
"if",
"(",
"!",
"m_mutable",
")",
"throw",
"new",
"RuntimeException",
"(",
"XSLMessages",
".",
"createXPATHMessage",
"(",
"XPATHErrorResources",
".",
... | Copy NodeList members into this nodelist, adding in
document order. If a node is null, don't add it.
@param iterator NodeIterator which yields the nodes to be added.
@param support The XPath runtime context.
@throws RuntimeException thrown if this NodeSet is not of
a mutable type. | [
"Copy",
"NodeList",
"members",
"into",
"this",
"nodelist",
"adding",
"in",
"document",
"order",
".",
"If",
"a",
"node",
"is",
"null",
"don",
"t",
"add",
"it",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSet.java#L544-L556 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbMovies.java | TmdbMovies.getMovieAlternativeTitles | public ResultList<AlternativeTitle> getMovieAlternativeTitles(int movieId, String country) throws MovieDbException {
"""
This method is used to retrieve all of the alternative titles we have for a particular movie.
@param movieId
@param country
@return
@throws MovieDbException
"""
TmdbParameters ... | java | public ResultList<AlternativeTitle> getMovieAlternativeTitles(int movieId, String country) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, movieId);
parameters.add(Param.COUNTRY, country);
URL url = new ApiUrl(apiKey, MethodBase.MOVIE... | [
"public",
"ResultList",
"<",
"AlternativeTitle",
">",
"getMovieAlternativeTitles",
"(",
"int",
"movieId",
",",
"String",
"country",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"parameters",
"."... | This method is used to retrieve all of the alternative titles we have for a particular movie.
@param movieId
@param country
@return
@throws MovieDbException | [
"This",
"method",
"is",
"used",
"to",
"retrieve",
"all",
"of",
"the",
"alternative",
"titles",
"we",
"have",
"for",
"a",
"particular",
"movie",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbMovies.java#L176-L191 |
MorphiaOrg/morphia | morphia/src/main/java/dev/morphia/mapping/Mapper.java | Mapper.getMappedClass | public MappedClass getMappedClass(final Object obj) {
"""
Gets the {@link MappedClass} for the object (type). If it isn't mapped, create a new class and cache it (without validating).
@param obj the object to process
@return the MappedClass for the object given
"""
if (obj == null) {
re... | java | public MappedClass getMappedClass(final Object obj) {
if (obj == null) {
return null;
}
Class type = (obj instanceof Class) ? (Class) obj : obj.getClass();
if (ProxyHelper.isProxy(obj)) {
type = ProxyHelper.getReferentClass(obj);
}
MappedClass mc... | [
"public",
"MappedClass",
"getMappedClass",
"(",
"final",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Class",
"type",
"=",
"(",
"obj",
"instanceof",
"Class",
")",
"?",
"(",
"Class",
")",
"obj",
":"... | Gets the {@link MappedClass} for the object (type). If it isn't mapped, create a new class and cache it (without validating).
@param obj the object to process
@return the MappedClass for the object given | [
"Gets",
"the",
"{",
"@link",
"MappedClass",
"}",
"for",
"the",
"object",
"(",
"type",
")",
".",
"If",
"it",
"isn",
"t",
"mapped",
"create",
"a",
"new",
"class",
"and",
"cache",
"it",
"(",
"without",
"validating",
")",
"."
] | train | https://github.com/MorphiaOrg/morphia/blob/667c30bdc7c6f1d9f2e2eb8774835d6137b52d12/morphia/src/main/java/dev/morphia/mapping/Mapper.java#L504-L521 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/SnippetsApi.java | SnippetsApi.getSnippet | public Snippet getSnippet(Integer snippetId, boolean downloadContent) throws GitLabApiException {
"""
Get a specific Snippet.
@param snippetId the snippet ID to get
@param downloadContent indicating whether to download the snippet content
@return the snippet with the given id
@throws GitLabApiException if an... | java | public Snippet getSnippet(Integer snippetId, boolean downloadContent) throws GitLabApiException {
if (snippetId == null) {
throw new RuntimeException("snippetId can't be null");
}
Response response = get(Response.Status.OK, null, "snippets", snippetId);
Snippet snippet = re... | [
"public",
"Snippet",
"getSnippet",
"(",
"Integer",
"snippetId",
",",
"boolean",
"downloadContent",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"snippetId",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"snippetId can't be null\"",
")",
... | Get a specific Snippet.
@param snippetId the snippet ID to get
@param downloadContent indicating whether to download the snippet content
@return the snippet with the given id
@throws GitLabApiException if any exception occurs | [
"Get",
"a",
"specific",
"Snippet",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/SnippetsApi.java#L104-L118 |
UrielCh/ovh-java-sdk | ovh-java-sdk-store/src/main/java/net/minidev/ovh/api/ApiOvhStore.java | ApiOvhStore.document_documentId_GET | public OvhDocument document_documentId_GET(String documentId) throws IOException {
"""
Get document info
REST: GET /store/document/{documentId}
@param documentId [required] Id of the document to fetch
API beta
"""
String qPath = "/store/document/{documentId}";
StringBuilder sb = path(qPath, document... | java | public OvhDocument document_documentId_GET(String documentId) throws IOException {
String qPath = "/store/document/{documentId}";
StringBuilder sb = path(qPath, documentId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhDocument.class);
} | [
"public",
"OvhDocument",
"document_documentId_GET",
"(",
"String",
"documentId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/store/document/{documentId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"documentId",
")",
";",
"Strin... | Get document info
REST: GET /store/document/{documentId}
@param documentId [required] Id of the document to fetch
API beta | [
"Get",
"document",
"info"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-store/src/main/java/net/minidev/ovh/api/ApiOvhStore.java#L49-L54 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/MutableDictionary.java | MutableDictionary.setFloat | @NonNull
@Override
public MutableDictionary setFloat(@NonNull String key, float value) {
"""
Set a float value for the given key.
@param key The key
@param value The float value.
@return The self object.
"""
return setValue(key, value);
} | java | @NonNull
@Override
public MutableDictionary setFloat(@NonNull String key, float value) {
return setValue(key, value);
} | [
"@",
"NonNull",
"@",
"Override",
"public",
"MutableDictionary",
"setFloat",
"(",
"@",
"NonNull",
"String",
"key",
",",
"float",
"value",
")",
"{",
"return",
"setValue",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Set a float value for the given key.
@param key The key
@param value The float value.
@return The self object. | [
"Set",
"a",
"float",
"value",
"for",
"the",
"given",
"key",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableDictionary.java#L169-L173 |
HubSpot/jinjava | src/main/java/com/hubspot/jinjava/interpret/JinjavaInterpreter.java | JinjavaInterpreter.resolveString | public String resolveString(String variable, int lineNumber, int startPosition) {
"""
Resolve a variable into a string value. If given a string literal (e.g. 'foo' or "foo"), this method returns the literal unquoted. If the variable is undefined in the context, this method returns the given variable string.
@pa... | java | public String resolveString(String variable, int lineNumber, int startPosition) {
return Objects.toString(resolveObject(variable, lineNumber, startPosition), "");
} | [
"public",
"String",
"resolveString",
"(",
"String",
"variable",
",",
"int",
"lineNumber",
",",
"int",
"startPosition",
")",
"{",
"return",
"Objects",
".",
"toString",
"(",
"resolveObject",
"(",
"variable",
",",
"lineNumber",
",",
"startPosition",
")",
",",
"\"... | Resolve a variable into a string value. If given a string literal (e.g. 'foo' or "foo"), this method returns the literal unquoted. If the variable is undefined in the context, this method returns the given variable string.
@param variable
name of variable in context
@param lineNumber
current line number, for error rep... | [
"Resolve",
"a",
"variable",
"into",
"a",
"string",
"value",
".",
"If",
"given",
"a",
"string",
"literal",
"(",
"e",
".",
"g",
".",
"foo",
"or",
"foo",
")",
"this",
"method",
"returns",
"the",
"literal",
"unquoted",
".",
"If",
"the",
"variable",
"is",
... | train | https://github.com/HubSpot/jinjava/blob/ce570935630f49c666170d2330b0b9ba4eddb955/src/main/java/com/hubspot/jinjava/interpret/JinjavaInterpreter.java#L389-L391 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.groupAnswer | protected static <K, T> void groupAnswer(final Map<K, List<T>> answer, T element, K value) {
"""
Groups the current element according to the value
@param answer the map containing the results
@param element the element to be placed
@param value the value according to which the element will be placed
@sinc... | java | protected static <K, T> void groupAnswer(final Map<K, List<T>> answer, T element, K value) {
if (answer.containsKey(value)) {
answer.get(value).add(element);
} else {
List<T> groupedElements = new ArrayList<T>();
groupedElements.add(element);
answer.put(va... | [
"protected",
"static",
"<",
"K",
",",
"T",
">",
"void",
"groupAnswer",
"(",
"final",
"Map",
"<",
"K",
",",
"List",
"<",
"T",
">",
">",
"answer",
",",
"T",
"element",
",",
"K",
"value",
")",
"{",
"if",
"(",
"answer",
".",
"containsKey",
"(",
"valu... | Groups the current element according to the value
@param answer the map containing the results
@param element the element to be placed
@param value the value according to which the element will be placed
@since 1.5.0 | [
"Groups",
"the",
"current",
"element",
"according",
"to",
"the",
"value"
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L5205-L5213 |
wnameless/rubycollect4j | src/main/java/net/sf/rubycollect4j/RubyObject.java | RubyObject.send | public static <E> E send(Object o, String methodName, Character arg) {
"""
Executes a method of any Object by Java reflection.
@param o
an Object
@param methodName
name of the method
@param arg
a Character
@return the result of the method called
"""
return send(o, methodName, (Object) arg);
} | java | public static <E> E send(Object o, String methodName, Character arg) {
return send(o, methodName, (Object) arg);
} | [
"public",
"static",
"<",
"E",
">",
"E",
"send",
"(",
"Object",
"o",
",",
"String",
"methodName",
",",
"Character",
"arg",
")",
"{",
"return",
"send",
"(",
"o",
",",
"methodName",
",",
"(",
"Object",
")",
"arg",
")",
";",
"}"
] | Executes a method of any Object by Java reflection.
@param o
an Object
@param methodName
name of the method
@param arg
a Character
@return the result of the method called | [
"Executes",
"a",
"method",
"of",
"any",
"Object",
"by",
"Java",
"reflection",
"."
] | train | https://github.com/wnameless/rubycollect4j/blob/b8b8d8eccaca2254a3d09b91745882fb7a0d5add/src/main/java/net/sf/rubycollect4j/RubyObject.java#L363-L365 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/ChatApi.java | ChatApi.cancelConsultationChat | public ApiSuccessResponse cancelConsultationChat(String id, CancelConsultData cancelConsultData) throws ApiException {
"""
Cancel a chat consultation request
Cancel a chat consultation request that was initialized by calling [/media/chat/interactions/{id}/consult-by-queue](/reference/workspace/Media/index.html#co... | java | public ApiSuccessResponse cancelConsultationChat(String id, CancelConsultData cancelConsultData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = cancelConsultationChatWithHttpInfo(id, cancelConsultData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"cancelConsultationChat",
"(",
"String",
"id",
",",
"CancelConsultData",
"cancelConsultData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"cancelConsultationChatWithHttpInfo",
"(",
"id",
"... | Cancel a chat consultation request
Cancel a chat consultation request that was initialized by calling [/media/chat/interactions/{id}/consult-by-queue](/reference/workspace/Media/index.html#consultByQueue). If the agent has already accepted the invitation, the Workspace API can't cancel the consultation.
@param id T... | [
"Cancel",
"a",
"chat",
"consultation",
"request",
"Cancel",
"a",
"chat",
"consultation",
"request",
"that",
"was",
"initialized",
"by",
"calling",
"[",
"/",
"media",
"/",
"chat",
"/",
"interactions",
"/",
"{",
"id",
"}",
"/",
"consult",
"-",
"by",
"-",
"... | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/ChatApi.java#L408-L411 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java | ParagraphVectors.inferVector | public INDArray inferVector(@NonNull List<VocabWord> document, double learningRate, double minLearningRate,
int iterations) {
"""
This method calculates inferred vector for given document
@param document
@return
"""
if (this.vocab == null || this.vocab.numWords() == 0)
... | java | public INDArray inferVector(@NonNull List<VocabWord> document, double learningRate, double minLearningRate,
int iterations) {
if (this.vocab == null || this.vocab.numWords() == 0)
reassignExistingModel();
SequenceLearningAlgorithm<VocabWord> learner = sequenceLearningAl... | [
"public",
"INDArray",
"inferVector",
"(",
"@",
"NonNull",
"List",
"<",
"VocabWord",
">",
"document",
",",
"double",
"learningRate",
",",
"double",
"minLearningRate",
",",
"int",
"iterations",
")",
"{",
"if",
"(",
"this",
".",
"vocab",
"==",
"null",
"||",
"... | This method calculates inferred vector for given document
@param document
@return | [
"This",
"method",
"calculates",
"inferred",
"vector",
"for",
"given",
"document"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java#L246-L284 |
kiegroup/drools | drools-compiler/src/main/java/org/drools/compiler/compiler/DRLFactory.java | DRLFactory.getBetterToken | public static String getBetterToken( int tokenType, String defaultValue, LanguageLevelOption languageLevel ) {
"""
Helper method that creates a user friendly token definition
@param tokenType
token type
@param defaultValue
default value for identifier token, may be null
@return user friendly token definitio... | java | public static String getBetterToken( int tokenType, String defaultValue, LanguageLevelOption languageLevel ) {
switch (languageLevel) {
case DRL5:
return getBetterTokenForDRL5(tokenType, defaultValue);
case DRL6:
case DRL6_STRICT:
return getBet... | [
"public",
"static",
"String",
"getBetterToken",
"(",
"int",
"tokenType",
",",
"String",
"defaultValue",
",",
"LanguageLevelOption",
"languageLevel",
")",
"{",
"switch",
"(",
"languageLevel",
")",
"{",
"case",
"DRL5",
":",
"return",
"getBetterTokenForDRL5",
"(",
"t... | Helper method that creates a user friendly token definition
@param tokenType
token type
@param defaultValue
default value for identifier token, may be null
@return user friendly token definition | [
"Helper",
"method",
"that",
"creates",
"a",
"user",
"friendly",
"token",
"definition"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/compiler/DRLFactory.java#L148-L157 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java | WordVectorSerializer.readVocabCache | public static VocabCache<VocabWord> readVocabCache(@NonNull InputStream stream) throws IOException {
"""
This method reads vocab cache from provided InputStream.
Please note: it reads only vocab content, so it's suitable mostly for BagOfWords/TF-IDF vectorizers
@param stream
@return
@throws IOException
"... | java | public static VocabCache<VocabWord> readVocabCache(@NonNull InputStream stream) throws IOException {
val vocabCache = new AbstractCache.Builder<VocabWord>().build();
val factory = new VocabWordFactory();
boolean firstLine = true;
long totalWordOcc = -1L;
try (BufferedReader reade... | [
"public",
"static",
"VocabCache",
"<",
"VocabWord",
">",
"readVocabCache",
"(",
"@",
"NonNull",
"InputStream",
"stream",
")",
"throws",
"IOException",
"{",
"val",
"vocabCache",
"=",
"new",
"AbstractCache",
".",
"Builder",
"<",
"VocabWord",
">",
"(",
")",
".",
... | This method reads vocab cache from provided InputStream.
Please note: it reads only vocab content, so it's suitable mostly for BagOfWords/TF-IDF vectorizers
@param stream
@return
@throws IOException | [
"This",
"method",
"reads",
"vocab",
"cache",
"from",
"provided",
"InputStream",
".",
"Please",
"note",
":",
"it",
"reads",
"only",
"vocab",
"content",
"so",
"it",
"s",
"suitable",
"mostly",
"for",
"BagOfWords",
"/",
"TF",
"-",
"IDF",
"vectorizers"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java#L2236-L2272 |
telly/groundy | library/src/main/java/com/telly/groundy/TaskResult.java | TaskResult.addIntegerArrayList | public TaskResult addIntegerArrayList(String key, ArrayList<Integer> value) {
"""
Inserts an ArrayList<Integer> value into the mapping of this Bundle, replacing any existing
value for the given key. Either key or value may be null.
@param key a String, or null
@param value an ArrayList<Integer> object, or nu... | java | public TaskResult addIntegerArrayList(String key, ArrayList<Integer> value) {
mBundle.putIntegerArrayList(key, value);
return this;
} | [
"public",
"TaskResult",
"addIntegerArrayList",
"(",
"String",
"key",
",",
"ArrayList",
"<",
"Integer",
">",
"value",
")",
"{",
"mBundle",
".",
"putIntegerArrayList",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts an ArrayList<Integer> value into the mapping of this Bundle, replacing any existing
value for the given key. Either key or value may be null.
@param key a String, or null
@param value an ArrayList<Integer> object, or null | [
"Inserts",
"an",
"ArrayList<Integer",
">",
"value",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/TaskResult.java#L227-L230 |
cketti/ckChangeLog | ckChangeLog/src/main/java/de/cketti/library/changelog/ChangeLog.java | ChangeLog.getDialog | protected AlertDialog getDialog(boolean full) {
"""
Create a dialog containing (parts of the) change log.
@param full
If this is {@code true} the full change log is displayed. Otherwise only changes for
versions newer than the last version are displayed.
@return A dialog containing the (partial) change log... | java | protected AlertDialog getDialog(boolean full) {
WebView wv = new WebView(mContext);
//wv.setBackgroundColor(0); // transparent
wv.loadDataWithBaseURL(null, getLog(full), "text/html", "UTF-8", null);
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
builder.setTitl... | [
"protected",
"AlertDialog",
"getDialog",
"(",
"boolean",
"full",
")",
"{",
"WebView",
"wv",
"=",
"new",
"WebView",
"(",
"mContext",
")",
";",
"//wv.setBackgroundColor(0); // transparent",
"wv",
".",
"loadDataWithBaseURL",
"(",
"null",
",",
"getLog",
"(",
"full",
... | Create a dialog containing (parts of the) change log.
@param full
If this is {@code true} the full change log is displayed. Otherwise only changes for
versions newer than the last version are displayed.
@return A dialog containing the (partial) change log. | [
"Create",
"a",
"dialog",
"containing",
"(",
"parts",
"of",
"the",
")",
"change",
"log",
"."
] | train | https://github.com/cketti/ckChangeLog/blob/e9a81ad3e043357e80922aa7c149241af73223d3/ckChangeLog/src/main/java/de/cketti/library/changelog/ChangeLog.java#L286-L321 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/crypto/HashUtils.java | HashUtils.digest | @Sensitive
protected static String digest(@Sensitive String input, String algorithm) {
"""
generate hash code by using specified algorithm If there is some error,
log the error.
"""
return digest(input, algorithm, DEFAULT_CHARSET);
} | java | @Sensitive
protected static String digest(@Sensitive String input, String algorithm) {
return digest(input, algorithm, DEFAULT_CHARSET);
} | [
"@",
"Sensitive",
"protected",
"static",
"String",
"digest",
"(",
"@",
"Sensitive",
"String",
"input",
",",
"String",
"algorithm",
")",
"{",
"return",
"digest",
"(",
"input",
",",
"algorithm",
",",
"DEFAULT_CHARSET",
")",
";",
"}"
] | generate hash code by using specified algorithm If there is some error,
log the error. | [
"generate",
"hash",
"code",
"by",
"using",
"specified",
"algorithm",
"If",
"there",
"is",
"some",
"error",
"log",
"the",
"error",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/crypto/HashUtils.java#L42-L45 |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/db/user/UserManager.java | UserManager.executeWithUser | public <T> T executeWithUser(final String user, final String password,
final SpecificUserAction<T> userAction) {
"""
Changes connection credentials user outside of transaction. Used to affect multiple transactions.
<p>
Recursive user changes are not allowed, but user change insid... | java | public <T> T executeWithUser(final String user, final String password,
final SpecificUserAction<T> userAction) {
Preconditions.checkState(!transactionManager.isTransactionActive(),
"User can't be changed during transaction");
Preconditions.checkState(spec... | [
"public",
"<",
"T",
">",
"T",
"executeWithUser",
"(",
"final",
"String",
"user",
",",
"final",
"String",
"password",
",",
"final",
"SpecificUserAction",
"<",
"T",
">",
"userAction",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"!",
"transactionManager",
... | Changes connection credentials user outside of transaction. Used to affect multiple transactions.
<p>
Recursive user changes are not allowed, but user change inside transaction is allowed with
{@link #executeWithTxUser(String, SpecificUserAction)}.
<p>
Action approach is important to explicitly define scope of specific... | [
"Changes",
"connection",
"credentials",
"user",
"outside",
"of",
"transaction",
".",
"Used",
"to",
"affect",
"multiple",
"transactions",
".",
"<p",
">",
"Recursive",
"user",
"changes",
"are",
"not",
"allowed",
"but",
"user",
"change",
"inside",
"transaction",
"i... | train | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/db/user/UserManager.java#L98-L117 |
radkovo/CSSBox | src/main/java/org/fit/cssbox/layout/TableBodyBox.java | TableBodyBox.organizeContent | private void organizeContent() {
"""
Goes through the list of child boxes and creates the anonymous rows if necessary.
"""
TableRowBox anonrow = null;
for (Iterator<Box> it = nested.iterator(); it.hasNext(); )
{
Box box = it.next();
if (box instanceof El... | java | private void organizeContent()
{
TableRowBox anonrow = null;
for (Iterator<Box> it = nested.iterator(); it.hasNext(); )
{
Box box = it.next();
if (box instanceof ElementBox && ((ElementBox) box).getDisplay() == ElementBox.DISPLAY_TABLE_ROW)
{
... | [
"private",
"void",
"organizeContent",
"(",
")",
"{",
"TableRowBox",
"anonrow",
"=",
"null",
";",
"for",
"(",
"Iterator",
"<",
"Box",
">",
"it",
"=",
"nested",
".",
"iterator",
"(",
")",
";",
"it",
".",
"hasNext",
"(",
")",
";",
")",
"{",
"Box",
"bo... | Goes through the list of child boxes and creates the anonymous rows if necessary. | [
"Goes",
"through",
"the",
"list",
"of",
"child",
"boxes",
"and",
"creates",
"the",
"anonymous",
"rows",
"if",
"necessary",
"."
] | train | https://github.com/radkovo/CSSBox/blob/38aaf8f22d233d7b4dbc12a56cdbc72b447bc559/src/main/java/org/fit/cssbox/layout/TableBodyBox.java#L413-L454 |
voldemort/voldemort | contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/HadoopStoreBuilder.java | HadoopStoreBuilder.writeMetadataFile | private void writeMetadataFile(Path directoryPath,
FileSystem outputFs,
String metadataFileName,
ReadOnlyStorageMetadata metadata) throws IOException {
"""
Persists a *.metadata file to a specific directory in ... | java | private void writeMetadataFile(Path directoryPath,
FileSystem outputFs,
String metadataFileName,
ReadOnlyStorageMetadata metadata) throws IOException {
Path metadataPath = new Path(directoryPath, metadataFil... | [
"private",
"void",
"writeMetadataFile",
"(",
"Path",
"directoryPath",
",",
"FileSystem",
"outputFs",
",",
"String",
"metadataFileName",
",",
"ReadOnlyStorageMetadata",
"metadata",
")",
"throws",
"IOException",
"{",
"Path",
"metadataPath",
"=",
"new",
"Path",
"(",
"d... | Persists a *.metadata file to a specific directory in HDFS.
@param directoryPath where to write the metadata file.
@param outputFs {@link org.apache.hadoop.fs.FileSystem} where to write the file
@param metadataFileName name of the file (including extension)
@param metadata {@link voldemort.store.readonly.ReadOnlyStora... | [
"Persists",
"a",
"*",
".",
"metadata",
"file",
"to",
"a",
"specific",
"directory",
"in",
"HDFS",
"."
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/contrib/hadoop-store-builder/src/java/voldemort/store/readonly/mr/HadoopStoreBuilder.java#L435-L445 |
google/closure-compiler | src/com/google/javascript/jscomp/FileInstrumentationData.java | FileInstrumentationData.getBranchNode | Node getBranchNode(int lineNumber, int branchNumber) {
"""
Get the block node to be instrumented for branch coverage.
@param lineNumber 1-based line number
@param branchNumber 1-based branch number
@return the node of the conditional block.
"""
Preconditions.checkArgument(
lineNumber > 0, "Expec... | java | Node getBranchNode(int lineNumber, int branchNumber) {
Preconditions.checkArgument(
lineNumber > 0, "Expected non-zero positive integer as line number: %s", lineNumber);
Preconditions.checkArgument(
branchNumber > 0, "Expected non-zero positive integer as branch number: %s", branchNumber);
... | [
"Node",
"getBranchNode",
"(",
"int",
"lineNumber",
",",
"int",
"branchNumber",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"lineNumber",
">",
"0",
",",
"\"Expected non-zero positive integer as line number: %s\"",
",",
"lineNumber",
")",
";",
"Preconditions",
... | Get the block node to be instrumented for branch coverage.
@param lineNumber 1-based line number
@param branchNumber 1-based branch number
@return the node of the conditional block. | [
"Get",
"the",
"block",
"node",
"to",
"be",
"instrumented",
"for",
"branch",
"coverage",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/FileInstrumentationData.java#L139-L146 |
Red5/red5-server-common | src/main/java/org/red5/server/messaging/AbstractPipe.java | AbstractPipe.fireProviderConnectionEvent | protected void fireProviderConnectionEvent(IProvider provider, PipeConnectionEvent.EventType type, Map<String, Object> paramMap) {
"""
Broadcast provider connection event
@param provider
Provider that has connected
@param type
Event type
@param paramMap
Parameters passed with connection
"""
fir... | java | protected void fireProviderConnectionEvent(IProvider provider, PipeConnectionEvent.EventType type, Map<String, Object> paramMap) {
firePipeConnectionEvent(PipeConnectionEvent.build(this, type, provider, paramMap));
} | [
"protected",
"void",
"fireProviderConnectionEvent",
"(",
"IProvider",
"provider",
",",
"PipeConnectionEvent",
".",
"EventType",
"type",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"paramMap",
")",
"{",
"firePipeConnectionEvent",
"(",
"PipeConnectionEvent",
".",
"... | Broadcast provider connection event
@param provider
Provider that has connected
@param type
Event type
@param paramMap
Parameters passed with connection | [
"Broadcast",
"provider",
"connection",
"event"
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/messaging/AbstractPipe.java#L253-L255 |
iig-uni-freiburg/SEWOL | ext/org/deckfour/xes/extension/XExtension.java | XExtension.accept | public void accept(XVisitor visitor, XLog log) {
"""
/*
Runs the given visitor for the given log on this extension.
"""
/*
* First call.
*/
visitor.visitExtensionPre(this, log);
/*
* Last call.
*/
visitor.visitExtensionPost(this, log);
} | java | public void accept(XVisitor visitor, XLog log) {
/*
* First call.
*/
visitor.visitExtensionPre(this, log);
/*
* Last call.
*/
visitor.visitExtensionPost(this, log);
} | [
"public",
"void",
"accept",
"(",
"XVisitor",
"visitor",
",",
"XLog",
"log",
")",
"{",
"/*\n\t\t * First call.\n\t\t */",
"visitor",
".",
"visitExtensionPre",
"(",
"this",
",",
"log",
")",
";",
"/*\n\t\t * Last call.\n\t\t */",
"visitor",
".",
"visitExtensionPost",
"... | /*
Runs the given visitor for the given log on this extension. | [
"/",
"*",
"Runs",
"the",
"given",
"visitor",
"for",
"the",
"given",
"log",
"on",
"this",
"extension",
"."
] | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/XExtension.java#L254-L263 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java | Apptentive.register | public static void register(Application application, String apptentiveKey, String apptentiveSignature) {
"""
Must be called from the {@link Application#onCreate()} method in the {@link Application} object defined in your app's manifest.
@param application Application object.
@param apptentiveKey Apptentive Key.
... | java | public static void register(Application application, String apptentiveKey, String apptentiveSignature) {
register(application, new ApptentiveConfiguration(apptentiveKey, apptentiveSignature));
} | [
"public",
"static",
"void",
"register",
"(",
"Application",
"application",
",",
"String",
"apptentiveKey",
",",
"String",
"apptentiveSignature",
")",
"{",
"register",
"(",
"application",
",",
"new",
"ApptentiveConfiguration",
"(",
"apptentiveKey",
",",
"apptentiveSign... | Must be called from the {@link Application#onCreate()} method in the {@link Application} object defined in your app's manifest.
@param application Application object.
@param apptentiveKey Apptentive Key.
@param apptentiveSignature Apptentive Signature. | [
"Must",
"be",
"called",
"from",
"the",
"{"
] | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java#L110-L112 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/agent/PluginUtils.java | PluginUtils.addInstanceTracking | public static byte[] addInstanceTracking(byte[] bytes, String classToCall) {
"""
If adding instance tracking, the classToCall must implement:
<tt>public static void recordInstance(Object obj)</tt>.
@param bytes the bytes for the class to which instance tracking is being added
@param classToCall the class to c... | java | public static byte[] addInstanceTracking(byte[] bytes, String classToCall) {
ClassReader cr = new ClassReader(bytes);
ClassVisitingConstructorAppender ca = new ClassVisitingConstructorAppender(classToCall, "recordInstance");
cr.accept(ca, 0);
byte[] newbytes = ca.getBytes();
return newbytes;
} | [
"public",
"static",
"byte",
"[",
"]",
"addInstanceTracking",
"(",
"byte",
"[",
"]",
"bytes",
",",
"String",
"classToCall",
")",
"{",
"ClassReader",
"cr",
"=",
"new",
"ClassReader",
"(",
"bytes",
")",
";",
"ClassVisitingConstructorAppender",
"ca",
"=",
"new",
... | If adding instance tracking, the classToCall must implement:
<tt>public static void recordInstance(Object obj)</tt>.
@param bytes the bytes for the class to which instance tracking is being added
@param classToCall the class to call when a new instance is created
@return the modified bytes for the class | [
"If",
"adding",
"instance",
"tracking",
"the",
"classToCall",
"must",
"implement",
":",
"<tt",
">",
"public",
"static",
"void",
"recordInstance",
"(",
"Object",
"obj",
")",
"<",
"/",
"tt",
">",
"."
] | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/agent/PluginUtils.java#L31-L37 |
alkacon/opencms-core | src/org/opencms/staticexport/CmsLinkManager.java | CmsLinkManager.setLinkSubstitutionHandler | public void setLinkSubstitutionHandler(CmsObject cms, I_CmsLinkSubstitutionHandler linkSubstitutionHandler)
throws CmsRoleViolationException {
"""
Sets the internal link substitution handler.<p>
@param cms an OpenCms user context that must have the permissions for role {@link CmsRole#ROOT_ADMIN}.<p>
@param... | java | public void setLinkSubstitutionHandler(CmsObject cms, I_CmsLinkSubstitutionHandler linkSubstitutionHandler)
throws CmsRoleViolationException {
OpenCms.getRoleManager().checkRole(cms, CmsRole.ROOT_ADMIN);
m_linkSubstitutionHandler = linkSubstitutionHandler;
} | [
"public",
"void",
"setLinkSubstitutionHandler",
"(",
"CmsObject",
"cms",
",",
"I_CmsLinkSubstitutionHandler",
"linkSubstitutionHandler",
")",
"throws",
"CmsRoleViolationException",
"{",
"OpenCms",
".",
"getRoleManager",
"(",
")",
".",
"checkRole",
"(",
"cms",
",",
"CmsR... | Sets the internal link substitution handler.<p>
@param cms an OpenCms user context that must have the permissions for role {@link CmsRole#ROOT_ADMIN}.<p>
@param linkSubstitutionHandler the handler to set
@throws CmsRoleViolationException in case the provided OpenCms user context does not have the required permissions | [
"Sets",
"the",
"internal",
"link",
"substitution",
"handler",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsLinkManager.java#L614-L619 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java | SameDiff.setOriginalPlaceHolderShape | public void setOriginalPlaceHolderShape(String variableName, long[] shape) {
"""
Set the original shape for a given place holder.<br>
This is used to track original shapes of place holder variables.<br>
The reason we track original shapes is to validate possible candidate arrays coming in (especially with -1
as... | java | public void setOriginalPlaceHolderShape(String variableName, long[] shape) {
if (!isPlaceHolder(variableName)) {
throw new ND4JIllegalStateException("Vertex id " + variableName + " does not appear to be a place holder. Did you forget to call addPlaceHolder?");
}
if (shape == null) {... | [
"public",
"void",
"setOriginalPlaceHolderShape",
"(",
"String",
"variableName",
",",
"long",
"[",
"]",
"shape",
")",
"{",
"if",
"(",
"!",
"isPlaceHolder",
"(",
"variableName",
")",
")",
"{",
"throw",
"new",
"ND4JIllegalStateException",
"(",
"\"Vertex id \"",
"+"... | Set the original shape for a given place holder.<br>
This is used to track original shapes of place holder variables.<br>
The reason we track original shapes is to validate possible candidate arrays coming in (especially with -1
as the expected shapes).
<p>
Note that if {@link #isPlaceHolder(String)}
returns false for ... | [
"Set",
"the",
"original",
"shape",
"for",
"a",
"given",
"place",
"holder",
".",
"<br",
">",
"This",
"is",
"used",
"to",
"track",
"original",
"shapes",
"of",
"place",
"holder",
"variables",
".",
"<br",
">",
"The",
"reason",
"we",
"track",
"original",
"sha... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java#L3703-L3720 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/SheetsExtractor.java | SheetsExtractor.getSheetSize | private static Surface getSheetSize(Collection<ImageBuffer> tiles, int horizontalTiles) {
"""
Get the sheet size depending of the number of horizontal tiles and total number of tiles.
@param tiles The tiles list.
@param horizontalTiles The horizontal tiles.
@return The horizontal and vertical tiles.
"""
... | java | private static Surface getSheetSize(Collection<ImageBuffer> tiles, int horizontalTiles)
{
final int tilesNumber = tiles.size();
final int horizontals;
final int verticals;
if (horizontalTiles > 0)
{
horizontals = horizontalTiles;
verticals = (i... | [
"private",
"static",
"Surface",
"getSheetSize",
"(",
"Collection",
"<",
"ImageBuffer",
">",
"tiles",
",",
"int",
"horizontalTiles",
")",
"{",
"final",
"int",
"tilesNumber",
"=",
"tiles",
".",
"size",
"(",
")",
";",
"final",
"int",
"horizontals",
";",
"final"... | Get the sheet size depending of the number of horizontal tiles and total number of tiles.
@param tiles The tiles list.
@param horizontalTiles The horizontal tiles.
@return The horizontal and vertical tiles. | [
"Get",
"the",
"sheet",
"size",
"depending",
"of",
"the",
"number",
"of",
"horizontal",
"tiles",
"and",
"total",
"number",
"of",
"tiles",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/SheetsExtractor.java#L94-L123 |
alkacon/opencms-core | src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java | CmsContainerpageController.isInlineEditable | public boolean isInlineEditable(CmsContainerPageElementPanel element, I_CmsDropContainer dragParent) {
"""
Checks whether the given element should be inline editable.<p>
@param element the element
@param dragParent the element parent
@return <code>true</code> if the element should be inline editable
"""... | java | public boolean isInlineEditable(CmsContainerPageElementPanel element, I_CmsDropContainer dragParent) {
CmsUUID elemView = element.getElementView();
return !getData().isUseClassicEditor()
&& CmsStringUtil.isEmptyOrWhitespaceOnly(element.getNoEditReason())
&& hasActiveSelection()
... | [
"public",
"boolean",
"isInlineEditable",
"(",
"CmsContainerPageElementPanel",
"element",
",",
"I_CmsDropContainer",
"dragParent",
")",
"{",
"CmsUUID",
"elemView",
"=",
"element",
".",
"getElementView",
"(",
")",
";",
"return",
"!",
"getData",
"(",
")",
".",
"isUse... | Checks whether the given element should be inline editable.<p>
@param element the element
@param dragParent the element parent
@return <code>true</code> if the element should be inline editable | [
"Checks",
"whether",
"the",
"given",
"element",
"should",
"be",
"inline",
"editable",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/CmsContainerpageController.java#L2206-L2217 |
JodaOrg/joda-time | src/main/java/org/joda/time/base/BasePeriod.java | BasePeriod.setFieldInto | protected void setFieldInto(int[] values, DurationFieldType field, int value) {
"""
Sets the value of a field in this period.
@param values the array of values to update
@param field the field to set
@param value the value to set
@throws IllegalArgumentException if field is null or not supported.
"""
... | java | protected void setFieldInto(int[] values, DurationFieldType field, int value) {
int index = indexOf(field);
if (index == -1) {
if (value != 0 || field == null) {
throw new IllegalArgumentException(
"Period does not support field '" + field + "'");
... | [
"protected",
"void",
"setFieldInto",
"(",
"int",
"[",
"]",
"values",
",",
"DurationFieldType",
"field",
",",
"int",
"value",
")",
"{",
"int",
"index",
"=",
"indexOf",
"(",
"field",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"if",
"(",
... | Sets the value of a field in this period.
@param values the array of values to update
@param field the field to set
@param value the value to set
@throws IllegalArgumentException if field is null or not supported. | [
"Sets",
"the",
"value",
"of",
"a",
"field",
"in",
"this",
"period",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/BasePeriod.java#L485-L495 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/channels/Channels.java | Channels.newReader | public static Reader newReader(ReadableByteChannel ch,
String csName) {
"""
Constructs a reader that decodes bytes from the given channel according
to the named charset.
<p> An invocation of this method of the form
<blockquote><pre>
Channels.newReader(ch, csname)</pre></b... | java | public static Reader newReader(ReadableByteChannel ch,
String csName)
{
checkNotNull(csName, "csName");
return newReader(ch, Charset.forName(csName).newDecoder(), -1);
} | [
"public",
"static",
"Reader",
"newReader",
"(",
"ReadableByteChannel",
"ch",
",",
"String",
"csName",
")",
"{",
"checkNotNull",
"(",
"csName",
",",
"\"csName\"",
")",
";",
"return",
"newReader",
"(",
"ch",
",",
"Charset",
".",
"forName",
"(",
"csName",
")",
... | Constructs a reader that decodes bytes from the given channel according
to the named charset.
<p> An invocation of this method of the form
<blockquote><pre>
Channels.newReader(ch, csname)</pre></blockquote>
behaves in exactly the same way as the expression
<blockquote><pre>
Channels.newReader(ch,
Charset.forName(cs... | [
"Constructs",
"a",
"reader",
"that",
"decodes",
"bytes",
"from",
"the",
"given",
"channel",
"according",
"to",
"the",
"named",
"charset",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/channels/Channels.java#L386-L391 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/protocols/payments/PaymentSession.java | PaymentSession.getSendRequest | public SendRequest getSendRequest() {
"""
Returns a {@link SendRequest} suitable for broadcasting to the network.
"""
Transaction tx = new Transaction(params);
for (Protos.Output output : paymentDetails.getOutputsList())
tx.addOutput(new TransactionOutput(params, tx, Coin.valueOf(ou... | java | public SendRequest getSendRequest() {
Transaction tx = new Transaction(params);
for (Protos.Output output : paymentDetails.getOutputsList())
tx.addOutput(new TransactionOutput(params, tx, Coin.valueOf(output.getAmount()), output.getScript().toByteArray()));
return SendRequest.forTx(t... | [
"public",
"SendRequest",
"getSendRequest",
"(",
")",
"{",
"Transaction",
"tx",
"=",
"new",
"Transaction",
"(",
"params",
")",
";",
"for",
"(",
"Protos",
".",
"Output",
"output",
":",
"paymentDetails",
".",
"getOutputsList",
"(",
")",
")",
"tx",
".",
"addOu... | Returns a {@link SendRequest} suitable for broadcasting to the network. | [
"Returns",
"a",
"{"
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/protocols/payments/PaymentSession.java#L300-L305 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java | FindbugsPlugin.getCorePreferences | public static UserPreferences getCorePreferences(@CheckForNull IProject project, boolean forceRead) {
"""
Get the FindBugs core preferences for given project. This method can
return workspace preferences if project preferences are not created yet
or they are disabled.
@param project
the project (if null, wor... | java | public static UserPreferences getCorePreferences(@CheckForNull IProject project, boolean forceRead) {
if (project == null || !isProjectSettingsEnabled(project)) {
// read workspace (user) settings from instance area
return getWorkspacePreferences();
}
// use project sett... | [
"public",
"static",
"UserPreferences",
"getCorePreferences",
"(",
"@",
"CheckForNull",
"IProject",
"project",
",",
"boolean",
"forceRead",
")",
"{",
"if",
"(",
"project",
"==",
"null",
"||",
"!",
"isProjectSettingsEnabled",
"(",
"project",
")",
")",
"{",
"// rea... | Get the FindBugs core preferences for given project. This method can
return workspace preferences if project preferences are not created yet
or they are disabled.
@param project
the project (if null, workspace settings are used)
@param forceRead
true to enforce reading properties from disk
@return the preferences for... | [
"Get",
"the",
"FindBugs",
"core",
"preferences",
"for",
"given",
"project",
".",
"This",
"method",
"can",
"return",
"workspace",
"preferences",
"if",
"project",
"preferences",
"are",
"not",
"created",
"yet",
"or",
"they",
"are",
"disabled",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java#L868-L876 |
ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationProcessManager.java | AuthorizationProcessManager.logout | public void logout(Context context, ResponseListener listener) {
"""
logs out user
@param context Android Activity that will handle the authorization (like facebook or google)
@param listener Response listener
"""
AuthorizationRequestManager.RequestOptions options = new AuthorizationRequestManager.Re... | java | public void logout(Context context, ResponseListener listener) {
AuthorizationRequestManager.RequestOptions options = new AuthorizationRequestManager.RequestOptions();
options.parameters = new HashMap<String,String>(1);
options.parameters.put("client_id", preferences.clientId.get());
opt... | [
"public",
"void",
"logout",
"(",
"Context",
"context",
",",
"ResponseListener",
"listener",
")",
"{",
"AuthorizationRequestManager",
".",
"RequestOptions",
"options",
"=",
"new",
"AuthorizationRequestManager",
".",
"RequestOptions",
"(",
")",
";",
"options",
".",
"p... | logs out user
@param context Android Activity that will handle the authorization (like facebook or google)
@param listener Response listener | [
"logs",
"out",
"user"
] | train | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationProcessManager.java#L123-L135 |
networknt/light-4j | email-sender/src/main/java/com/networknt/email/EmailSender.java | EmailSender.sendMailWithAttachment | public void sendMailWithAttachment (String to, String subject, String content, String filename) throws MessagingException {
"""
Send email with a string content and attachment
@param to destination eamil address
@param subject email subject
@param content email content
@param filename attachment filename
@t... | java | public void sendMailWithAttachment (String to, String subject, String content, String filename) throws MessagingException{
Properties props = new Properties();
props.put("mail.smtp.user", emailConfg.getUser());
props.put("mail.smtp.host", emailConfg.getHost());
props.put("mail.smtp.port"... | [
"public",
"void",
"sendMailWithAttachment",
"(",
"String",
"to",
",",
"String",
"subject",
",",
"String",
"content",
",",
"String",
"filename",
")",
"throws",
"MessagingException",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"props",
"... | Send email with a string content and attachment
@param to destination eamil address
@param subject email subject
@param content email content
@param filename attachment filename
@throws MessagingException messaging exception | [
"Send",
"email",
"with",
"a",
"string",
"content",
"and",
"attachment"
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/email-sender/src/main/java/com/networknt/email/EmailSender.java#L97-L141 |
Red5/red5-client | src/main/java/org/red5/client/net/remoting/DSRemotingClient.java | DSRemotingClient.encodeInvoke | private IoBuffer encodeInvoke(String method, Object[] params) {
"""
Encode the method call.
@param method
Remote method being called
@param params
Method parameters
@return Byte buffer with data to perform remoting call
"""
log.debug("RemotingClient encodeInvoke - method: {} params: {}", method... | java | private IoBuffer encodeInvoke(String method, Object[] params) {
log.debug("RemotingClient encodeInvoke - method: {} params: {}", method, params);
IoBuffer result = IoBuffer.allocate(1024);
result.setAutoExpand(true);
//force version 3
result.putShort((short) 3);
// ... | [
"private",
"IoBuffer",
"encodeInvoke",
"(",
"String",
"method",
",",
"Object",
"[",
"]",
"params",
")",
"{",
"log",
".",
"debug",
"(",
"\"RemotingClient encodeInvoke - method: {} params: {}\"",
",",
"method",
",",
"params",
")",
";",
"IoBuffer",
"result",
"=",
"... | Encode the method call.
@param method
Remote method being called
@param params
Method parameters
@return Byte buffer with data to perform remoting call | [
"Encode",
"the",
"method",
"call",
"."
] | train | https://github.com/Red5/red5-client/blob/f894495b60e59d7cfba647abd9b934237cac9d45/src/main/java/org/red5/client/net/remoting/DSRemotingClient.java#L99-L152 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/InstructionsOutgoingEdges.java | InstructionsOutgoingEdges.getOtherContinue | public EdgeIteratorState getOtherContinue(double prevLat, double prevLon, double prevOrientation) {
"""
Returns an edge that has more or less in the same orientation as the prevEdge, but is not the currentEdge.
If there is one, this indicates that we might need an instruction to help finding the correct edge out ... | java | public EdgeIteratorState getOtherContinue(double prevLat, double prevLon, double prevOrientation) {
int tmpSign;
for (EdgeIteratorState edge : allowedOutgoingEdges) {
GHPoint point = InstructionsHelper.getPointForOrientationCalculation(edge, nodeAccess);
tmpSign = InstructionsHel... | [
"public",
"EdgeIteratorState",
"getOtherContinue",
"(",
"double",
"prevLat",
",",
"double",
"prevLon",
",",
"double",
"prevOrientation",
")",
"{",
"int",
"tmpSign",
";",
"for",
"(",
"EdgeIteratorState",
"edge",
":",
"allowedOutgoingEdges",
")",
"{",
"GHPoint",
"po... | Returns an edge that has more or less in the same orientation as the prevEdge, but is not the currentEdge.
If there is one, this indicates that we might need an instruction to help finding the correct edge out of the different choices.
If there is none, return null. | [
"Returns",
"an",
"edge",
"that",
"has",
"more",
"or",
"less",
"in",
"the",
"same",
"orientation",
"as",
"the",
"prevEdge",
"but",
"is",
"not",
"the",
"currentEdge",
".",
"If",
"there",
"is",
"one",
"this",
"indicates",
"that",
"we",
"might",
"need",
"an"... | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/InstructionsOutgoingEdges.java#L164-L174 |
auth0/auth0-java | src/main/java/com/auth0/client/mgmt/filter/ClientFilter.java | ClientFilter.withPage | public ClientFilter withPage(int pageNumber, int amountPerPage) {
"""
Filter by page
@param pageNumber the page number to retrieve.
@param amountPerPage the amount of items per page to retrieve.
@return this filter instance
"""
parameters.put("page", pageNumber);
parameters.put("per_pag... | java | public ClientFilter withPage(int pageNumber, int amountPerPage) {
parameters.put("page", pageNumber);
parameters.put("per_page", amountPerPage);
return this;
} | [
"public",
"ClientFilter",
"withPage",
"(",
"int",
"pageNumber",
",",
"int",
"amountPerPage",
")",
"{",
"parameters",
".",
"put",
"(",
"\"page\"",
",",
"pageNumber",
")",
";",
"parameters",
".",
"put",
"(",
"\"per_page\"",
",",
"amountPerPage",
")",
";",
"ret... | Filter by page
@param pageNumber the page number to retrieve.
@param amountPerPage the amount of items per page to retrieve.
@return this filter instance | [
"Filter",
"by",
"page"
] | train | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/client/mgmt/filter/ClientFilter.java#L26-L30 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.