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 |
|---|---|---|---|---|---|---|---|---|---|---|
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/XFactory.java | XFactory.createXMethod | private static XMethod createXMethod(@DottedClassName String className, String methodName, String methodSig, int accessFlags) {
"""
/*
Create a new, never-before-seen, XMethod object and intern it.
"""
return createXMethod(className, methodName, methodSig, (accessFlags & Const.ACC_STATIC) != 0);
} | java | private static XMethod createXMethod(@DottedClassName String className, String methodName, String methodSig, int accessFlags) {
return createXMethod(className, methodName, methodSig, (accessFlags & Const.ACC_STATIC) != 0);
} | [
"private",
"static",
"XMethod",
"createXMethod",
"(",
"@",
"DottedClassName",
"String",
"className",
",",
"String",
"methodName",
",",
"String",
"methodSig",
",",
"int",
"accessFlags",
")",
"{",
"return",
"createXMethod",
"(",
"className",
",",
"methodName",
",",
... | /*
Create a new, never-before-seen, XMethod object and intern it. | [
"/",
"*",
"Create",
"a",
"new",
"never",
"-",
"before",
"-",
"seen",
"XMethod",
"object",
"and",
"intern",
"it",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/XFactory.java#L266-L268 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/Utils.java | Utils.findMethod | public MethodDoc findMethod(ClassDoc cd, MethodDoc method) {
"""
Search for the given method in the given class.
@param cd Class to search into.
@param method Method to be searched.
@return MethodDoc Method found, null otherwise.
"""
MethodDoc[] methods = cd.methods();
for (Met... | java | public MethodDoc findMethod(ClassDoc cd, MethodDoc method) {
MethodDoc[] methods = cd.methods();
for (MethodDoc m : methods) {
if (executableMembersEqual(method, m)) {
return m;
}
}
return null;
} | [
"public",
"MethodDoc",
"findMethod",
"(",
"ClassDoc",
"cd",
",",
"MethodDoc",
"method",
")",
"{",
"MethodDoc",
"[",
"]",
"methods",
"=",
"cd",
".",
"methods",
"(",
")",
";",
"for",
"(",
"MethodDoc",
"m",
":",
"methods",
")",
"{",
"if",
"(",
"executable... | Search for the given method in the given class.
@param cd Class to search into.
@param method Method to be searched.
@return MethodDoc Method found, null otherwise. | [
"Search",
"for",
"the",
"given",
"method",
"in",
"the",
"given",
"class",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/Utils.java#L123-L132 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/transport/http/HTTPConduit.java | HTTPConduit.extractLocation | protected String extractLocation(Map<String, List<String>> headers) throws MalformedURLException {
"""
This method extracts the value of the "Location" Http
Response header.
@param headers The Http response headers.
@return The value of the "Location" header, null if non-existent.
@throws MalformedURLExcepti... | java | protected String extractLocation(Map<String, List<String>> headers) throws MalformedURLException {
for (Map.Entry<String, List<String>> head : headers.entrySet()) {
if ("Location".equalsIgnoreCase(head.getKey())) {
List<String> locs = head.getValue();
if (locs != null... | [
"protected",
"String",
"extractLocation",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headers",
")",
"throws",
"MalformedURLException",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"head... | This method extracts the value of the "Location" Http
Response header.
@param headers The Http response headers.
@return The value of the "Location" header, null if non-existent.
@throws MalformedURLException | [
"This",
"method",
"extracts",
"the",
"value",
"of",
"the",
"Location",
"Http",
"Response",
"header",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/transport/http/HTTPConduit.java#L1045-L1060 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/connector/filesystem/FileSystemConnector.java | FileSystemConnector.checkFileNotExcluded | protected void checkFileNotExcluded( String id,
File file ) {
"""
Utility method to ensure that the file is writable by this connector.
@param id the identifier of the node
@param file the file
@throws DocumentStoreException if the file is expected to be writable but i... | java | protected void checkFileNotExcluded( String id,
File file ) {
if (isExcluded(file)) {
String msg = JcrI18n.fileConnectorCannotStoreFileThatIsExcluded.text(getSourceName(), id, file.getAbsolutePath());
throw new DocumentStoreException(id, msg);
... | [
"protected",
"void",
"checkFileNotExcluded",
"(",
"String",
"id",
",",
"File",
"file",
")",
"{",
"if",
"(",
"isExcluded",
"(",
"file",
")",
")",
"{",
"String",
"msg",
"=",
"JcrI18n",
".",
"fileConnectorCannotStoreFileThatIsExcluded",
".",
"text",
"(",
"getSour... | Utility method to ensure that the file is writable by this connector.
@param id the identifier of the node
@param file the file
@throws DocumentStoreException if the file is expected to be writable but is not or is excluded, or if the connector is
readonly | [
"Utility",
"method",
"to",
"ensure",
"that",
"the",
"file",
"is",
"writable",
"by",
"this",
"connector",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/connector/filesystem/FileSystemConnector.java#L471-L477 |
nextreports/nextreports-engine | src/ro/nextreports/engine/exporter/ResultExporter.java | ResultExporter.getFunctionTemplate | private String getFunctionTemplate(GroupCache gc, FunctionBandElement fbe, boolean previous) throws QueryException {
"""
string template used by functions in header and group header bands
"""
StringBuilder templateKey = new StringBuilder();
if (gc == null) {
// function in Header
templateKey.appen... | java | private String getFunctionTemplate(GroupCache gc, FunctionBandElement fbe, boolean previous) throws QueryException {
StringBuilder templateKey = new StringBuilder();
if (gc == null) {
// function in Header
templateKey.append("F_").
append(fbe.getFunction()).append("_").
append(fbe.getColumn());... | [
"private",
"String",
"getFunctionTemplate",
"(",
"GroupCache",
"gc",
",",
"FunctionBandElement",
"fbe",
",",
"boolean",
"previous",
")",
"throws",
"QueryException",
"{",
"StringBuilder",
"templateKey",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"gc",
... | string template used by functions in header and group header bands | [
"string",
"template",
"used",
"by",
"functions",
"in",
"header",
"and",
"group",
"header",
"bands"
] | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/exporter/ResultExporter.java#L2105-L2144 |
actorapp/actor-platform | actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java | Messenger.bindRawFile | @ObjectiveCName("bindRawFileWithReference:autoStart:withCallback:")
public void bindRawFile(FileReference fileReference, boolean isAutoStart, FileCallback callback) {
"""
Raw Bind File
@param fileReference reference to file
@param isAutoStart automatically start download
@param callback file state ... | java | @ObjectiveCName("bindRawFileWithReference:autoStart:withCallback:")
public void bindRawFile(FileReference fileReference, boolean isAutoStart, FileCallback callback) {
modules.getFilesModule().bindFile(fileReference, isAutoStart, callback);
} | [
"@",
"ObjectiveCName",
"(",
"\"bindRawFileWithReference:autoStart:withCallback:\"",
")",
"public",
"void",
"bindRawFile",
"(",
"FileReference",
"fileReference",
",",
"boolean",
"isAutoStart",
",",
"FileCallback",
"callback",
")",
"{",
"modules",
".",
"getFilesModule",
"("... | Raw Bind File
@param fileReference reference to file
@param isAutoStart automatically start download
@param callback file state callback | [
"Raw",
"Bind",
"File"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java#L1930-L1933 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/TimeZone.java | TimeZone.getDisplayName | public final String getDisplayName(Locale locale) {
"""
Returns a name of this time zone suitable for presentation to the user
in the specified locale.
This method returns the long generic name.
If the display name is not available for the locale,
a fallback based on the country, city, or time zone id will be ... | java | public final String getDisplayName(Locale locale) {
return _getDisplayName(LONG_GENERIC, false, ULocale.forLocale(locale));
} | [
"public",
"final",
"String",
"getDisplayName",
"(",
"Locale",
"locale",
")",
"{",
"return",
"_getDisplayName",
"(",
"LONG_GENERIC",
",",
"false",
",",
"ULocale",
".",
"forLocale",
"(",
"locale",
")",
")",
";",
"}"
] | Returns a name of this time zone suitable for presentation to the user
in the specified locale.
This method returns the long generic name.
If the display name is not available for the locale,
a fallback based on the country, city, or time zone id will be used.
@param locale the locale in which to supply the display nam... | [
"Returns",
"a",
"name",
"of",
"this",
"time",
"zone",
"suitable",
"for",
"presentation",
"to",
"the",
"user",
"in",
"the",
"specified",
"locale",
".",
"This",
"method",
"returns",
"the",
"long",
"generic",
"name",
".",
"If",
"the",
"display",
"name",
"is",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/TimeZone.java#L388-L390 |
killbill/killbill | util/src/main/java/org/killbill/billing/util/security/AnnotationHierarchicalResolver.java | AnnotationHierarchicalResolver.getAnnotation | public static <A extends Annotation> A getAnnotation(final Method method, final Class<A> annotationType) {
"""
Get a single {@link Annotation} of <code>annotationType</code> from the supplied {@link Method}.
@param method the method to look for annotations on
@param annotationType the annotation class ... | java | public static <A extends Annotation> A getAnnotation(final Method method, final Class<A> annotationType) {
A ann = method.getAnnotation(annotationType);
if (ann == null) {
for (final Annotation metaAnn : method.getAnnotations()) {
ann = metaAnn.annotationType().getAnnotation(... | [
"public",
"static",
"<",
"A",
"extends",
"Annotation",
">",
"A",
"getAnnotation",
"(",
"final",
"Method",
"method",
",",
"final",
"Class",
"<",
"A",
">",
"annotationType",
")",
"{",
"A",
"ann",
"=",
"method",
".",
"getAnnotation",
"(",
"annotationType",
")... | Get a single {@link Annotation} of <code>annotationType</code> from the supplied {@link Method}.
@param method the method to look for annotations on
@param annotationType the annotation class to look for
@return the annotations found | [
"Get",
"a",
"single",
"{",
"@link",
"Annotation",
"}",
"of",
"<code",
">",
"annotationType<",
"/",
"code",
">",
"from",
"the",
"supplied",
"{",
"@link",
"Method",
"}",
"."
] | train | https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/util/src/main/java/org/killbill/billing/util/security/AnnotationHierarchicalResolver.java#L94-L105 |
real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaUtil.java | JavaUtil.generateOptionEncodeJavadoc | public static String generateOptionEncodeJavadoc(final String indent, final Token optionToken) {
"""
Generate the Javadoc comment header for a bitset choice option encode method.
@param indent level for the comment.
@param optionToken for the type.
@return a string representation of the Javadoc comment.
... | java | public static String generateOptionEncodeJavadoc(final String indent, final Token optionToken)
{
final String description = optionToken.description();
if (null == description || description.isEmpty())
{
return "";
}
return
indent + "/**\n" +
... | [
"public",
"static",
"String",
"generateOptionEncodeJavadoc",
"(",
"final",
"String",
"indent",
",",
"final",
"Token",
"optionToken",
")",
"{",
"final",
"String",
"description",
"=",
"optionToken",
".",
"description",
"(",
")",
";",
"if",
"(",
"null",
"==",
"de... | Generate the Javadoc comment header for a bitset choice option encode method.
@param indent level for the comment.
@param optionToken for the type.
@return a string representation of the Javadoc comment. | [
"Generate",
"the",
"Javadoc",
"comment",
"header",
"for",
"a",
"bitset",
"choice",
"option",
"encode",
"method",
"."
] | train | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaUtil.java#L303-L317 |
Microsoft/malmo | Minecraft/src/main/java/com/microsoft/Malmo/Utils/TCPUtils.java | TCPUtils.getSocketInRange | public static ServerSocket getSocketInRange(int minPort, int maxPort, boolean random) {
"""
Choose a port from the specified range - either sequentially, or at random.
@param minPort minimum (inclusive) value for port.
@param maxPort max (inclusive) possible port value.
@param random true to allo... | java | public static ServerSocket getSocketInRange(int minPort, int maxPort, boolean random)
{
TCPUtils.Log(Level.INFO, "Attempting to create a ServerSocket in range (" + minPort + "-" + maxPort + (random ? ") at random..." : ") sequentially..."));
ServerSocket s = null;
int port = minPort - 1;
... | [
"public",
"static",
"ServerSocket",
"getSocketInRange",
"(",
"int",
"minPort",
",",
"int",
"maxPort",
",",
"boolean",
"random",
")",
"{",
"TCPUtils",
".",
"Log",
"(",
"Level",
".",
"INFO",
",",
"\"Attempting to create a ServerSocket in range (\"",
"+",
"minPort",
... | Choose a port from the specified range - either sequentially, or at random.
@param minPort minimum (inclusive) value for port.
@param maxPort max (inclusive) possible port value.
@param random true to allocate based on a random sample; false to allocate sequentially, starting from minPort.
@return a Serve... | [
"Choose",
"a",
"port",
"from",
"the",
"specified",
"range",
"-",
"either",
"sequentially",
"or",
"at",
"random",
"."
] | train | https://github.com/Microsoft/malmo/blob/4139cd6f3e52f6e893a931a1d4b70d35f8e70e5a/Minecraft/src/main/java/com/microsoft/Malmo/Utils/TCPUtils.java#L175-L202 |
VoltDB/voltdb | src/frontend/org/voltcore/messaging/HostMessenger.java | HostMessenger.createMailbox | public void createMailbox(Long proposedHSId, Mailbox mailbox) {
"""
/*
Register a custom mailbox, optionally specifying what the hsid should be.
"""
long hsId = 0;
if (proposedHSId != null) {
if (m_siteMailboxes.containsKey(proposedHSId)) {
org.voltdb.VoltDB.crashLo... | java | public void createMailbox(Long proposedHSId, Mailbox mailbox) {
long hsId = 0;
if (proposedHSId != null) {
if (m_siteMailboxes.containsKey(proposedHSId)) {
org.voltdb.VoltDB.crashLocalVoltDB(
"Attempted to create a mailbox for site " +
... | [
"public",
"void",
"createMailbox",
"(",
"Long",
"proposedHSId",
",",
"Mailbox",
"mailbox",
")",
"{",
"long",
"hsId",
"=",
"0",
";",
"if",
"(",
"proposedHSId",
"!=",
"null",
")",
"{",
"if",
"(",
"m_siteMailboxes",
".",
"containsKey",
"(",
"proposedHSId",
")... | /*
Register a custom mailbox, optionally specifying what the hsid should be. | [
"/",
"*",
"Register",
"a",
"custom",
"mailbox",
"optionally",
"specifying",
"what",
"the",
"hsid",
"should",
"be",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/messaging/HostMessenger.java#L1716-L1731 |
xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/util/GenericsResolutionUtils.java | GenericsResolutionUtils.resolveRawGenerics | public static LinkedHashMap<String, Type> resolveRawGenerics(final Class<?> type) {
"""
Resolve type generics by declaration (as upper bound). Used for cases when actual generic definition is not
available (so actual generics are unknown). In most cases such generics resolved as Object
(for example, {@code Some<... | java | public static LinkedHashMap<String, Type> resolveRawGenerics(final Class<?> type) {
// inner class can use outer class generics
return fillOuterGenerics(type, resolveDirectRawGenerics(type), null);
} | [
"public",
"static",
"LinkedHashMap",
"<",
"String",
",",
"Type",
">",
"resolveRawGenerics",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"// inner class can use outer class generics",
"return",
"fillOuterGenerics",
"(",
"type",
",",
"resolveDirectRawGeneric... | Resolve type generics by declaration (as upper bound). Used for cases when actual generic definition is not
available (so actual generics are unknown). In most cases such generics resolved as Object
(for example, {@code Some<T>}).
<p>
If class is inner class, resolve outer class generics (which may be used in class)
@... | [
"Resolve",
"type",
"generics",
"by",
"declaration",
"(",
"as",
"upper",
"bound",
")",
".",
"Used",
"for",
"cases",
"when",
"actual",
"generic",
"definition",
"is",
"not",
"available",
"(",
"so",
"actual",
"generics",
"are",
"unknown",
")",
".",
"In",
"most... | train | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/GenericsResolutionUtils.java#L179-L182 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/task/HiveConverterUtils.java | HiveConverterUtils.getDestinationTableMeta | public static Pair<Optional<Table>, Optional<List<Partition>>> getDestinationTableMeta(String dbName,
String tableName, Properties props) {
"""
Returns a pair of Hive table and its partitions
@param dbName db name
@param tableName table name
@param props properties
@return a pair of Hive table and its pa... | java | public static Pair<Optional<Table>, Optional<List<Partition>>> getDestinationTableMeta(String dbName,
String tableName, Properties props) {
Optional<Table> table = Optional.<Table>absent();
Optional<List<Partition>> partitions = Optional.<List<Partition>>absent();
try {
HiveMetastoreClientPool... | [
"public",
"static",
"Pair",
"<",
"Optional",
"<",
"Table",
">",
",",
"Optional",
"<",
"List",
"<",
"Partition",
">",
">",
">",
"getDestinationTableMeta",
"(",
"String",
"dbName",
",",
"String",
"tableName",
",",
"Properties",
"props",
")",
"{",
"Optional",
... | Returns a pair of Hive table and its partitions
@param dbName db name
@param tableName table name
@param props properties
@return a pair of Hive table and its partitions
@throws DataConversionException | [
"Returns",
"a",
"pair",
"of",
"Hive",
"table",
"and",
"its",
"partitions"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/task/HiveConverterUtils.java#L425-L450 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/gen/CodeBuilderUtil.java | CodeBuilderUtil.definePrepareBridge | private static void definePrepareBridge(ClassFile cf, Class leaf, Class returnClass) {
"""
Add a prepare bridge method to the classfile for the given type.
@param cf file to which to add the prepare bridge
@param leaf leaf class
@param returnClass type returned from generated bridge method
@since 1.2
"""... | java | private static void definePrepareBridge(ClassFile cf, Class leaf, Class returnClass) {
TypeDesc returnType = TypeDesc.forClass(returnClass);
if (isPublicMethodFinal(leaf, PREPARE_METHOD_NAME, returnType, null)) {
// Cannot override.
return;
}
MethodInfo ... | [
"private",
"static",
"void",
"definePrepareBridge",
"(",
"ClassFile",
"cf",
",",
"Class",
"leaf",
",",
"Class",
"returnClass",
")",
"{",
"TypeDesc",
"returnType",
"=",
"TypeDesc",
".",
"forClass",
"(",
"returnClass",
")",
";",
"if",
"(",
"isPublicMethodFinal",
... | Add a prepare bridge method to the classfile for the given type.
@param cf file to which to add the prepare bridge
@param leaf leaf class
@param returnClass type returned from generated bridge method
@since 1.2 | [
"Add",
"a",
"prepare",
"bridge",
"method",
"to",
"the",
"classfile",
"for",
"the",
"given",
"type",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/gen/CodeBuilderUtil.java#L278-L292 |
vdurmont/emoji-java | src/main/java/com/vdurmont/emoji/EmojiParser.java | EmojiParser.parseToHtmlHexadecimal | public static String parseToHtmlHexadecimal(
String input,
final FitzpatrickAction fitzpatrickAction
) {
"""
Replaces the emoji's unicode occurrences by their html hex
representation.<br>
Example: <code>👦</code> will be replaced by <code>&#x1f466;</code><br>
<br>
When a fitzpatrick modifier is p... | java | public static String parseToHtmlHexadecimal(
String input,
final FitzpatrickAction fitzpatrickAction
) {
EmojiTransformer emojiTransformer = new EmojiTransformer() {
public String transform(UnicodeCandidate unicodeCandidate) {
switch (fitzpatrickAction) {
default:
case PA... | [
"public",
"static",
"String",
"parseToHtmlHexadecimal",
"(",
"String",
"input",
",",
"final",
"FitzpatrickAction",
"fitzpatrickAction",
")",
"{",
"EmojiTransformer",
"emojiTransformer",
"=",
"new",
"EmojiTransformer",
"(",
")",
"{",
"public",
"String",
"transform",
"(... | Replaces the emoji's unicode occurrences by their html hex
representation.<br>
Example: <code>👦</code> will be replaced by <code>&#x1f466;</code><br>
<br>
When a fitzpatrick modifier is present with a PARSE or REMOVE action, the
modifier will be deleted.<br>
Example: <code>👦🏿</code> will be replaced by
<code>&am... | [
"Replaces",
"the",
"emoji",
"s",
"unicode",
"occurrences",
"by",
"their",
"html",
"hex",
"representation",
".",
"<br",
">",
"Example",
":",
"<code",
">",
"👦<",
"/",
"code",
">",
"will",
"be",
"replaced",
"by",
"<code",
">",
"&",
";",
"#x1f466",
";",
... | train | https://github.com/vdurmont/emoji-java/blob/8cf5fbe0d7c1020b926791f2b342a263ed07bb0f/src/main/java/com/vdurmont/emoji/EmojiParser.java#L261-L280 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FileSystem.java | FileSystem.moveToLocalFile | public void moveToLocalFile(Path src, Path dst) throws IOException {
"""
The src file is under FS, and the dst is on the local disk.
Copy it from FS control to the local dst name.
Remove the source afterwards
"""
copyToLocalFile(true, false, src, dst);
} | java | public void moveToLocalFile(Path src, Path dst) throws IOException {
copyToLocalFile(true, false, src, dst);
} | [
"public",
"void",
"moveToLocalFile",
"(",
"Path",
"src",
",",
"Path",
"dst",
")",
"throws",
"IOException",
"{",
"copyToLocalFile",
"(",
"true",
",",
"false",
",",
"src",
",",
"dst",
")",
";",
"}"
] | The src file is under FS, and the dst is on the local disk.
Copy it from FS control to the local dst name.
Remove the source afterwards | [
"The",
"src",
"file",
"is",
"under",
"FS",
"and",
"the",
"dst",
"is",
"on",
"the",
"local",
"disk",
".",
"Copy",
"it",
"from",
"FS",
"control",
"to",
"the",
"local",
"dst",
"name",
".",
"Remove",
"the",
"source",
"afterwards"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileSystem.java#L1730-L1732 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/thrift/CassandraSchemaMgr.java | CassandraSchemaMgr.dropKeyspace | public void dropKeyspace(DBConn dbConn, String keyspace) {
"""
Delete the keyspace with the given name. This method can use any DB connection.
@param dbConn Database connection to use.
@param keyspace Name of keyspace to drop.
"""
m_logger.info("Deleting Keyspace '{}'", keyspace);
try... | java | public void dropKeyspace(DBConn dbConn, String keyspace) {
m_logger.info("Deleting Keyspace '{}'", keyspace);
try {
dbConn.getClientSession().system_drop_keyspace(keyspace);
waitForSchemaPropagation(dbConn);
} catch (Exception ex) {
String errMsg = "Fail... | [
"public",
"void",
"dropKeyspace",
"(",
"DBConn",
"dbConn",
",",
"String",
"keyspace",
")",
"{",
"m_logger",
".",
"info",
"(",
"\"Deleting Keyspace '{}'\"",
",",
"keyspace",
")",
";",
"try",
"{",
"dbConn",
".",
"getClientSession",
"(",
")",
".",
"system_drop_ke... | Delete the keyspace with the given name. This method can use any DB connection.
@param dbConn Database connection to use.
@param keyspace Name of keyspace to drop. | [
"Delete",
"the",
"keyspace",
"with",
"the",
"given",
"name",
".",
"This",
"method",
"can",
"use",
"any",
"DB",
"connection",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/thrift/CassandraSchemaMgr.java#L118-L128 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/PostParameterHelper.java | PostParameterHelper.deserializePostParam | private HashMap deserializePostParam(IExtendedRequest req, byte[] cookieValueBytes, String reqURL) throws IOException, UnsupportedEncodingException, IllegalStateException {
"""
deserialize Post parameters.
The code doesn't expect that the req, cookieValueBytes, or reqURL is null.
"""
HashMap output = null;
... | java | private HashMap deserializePostParam(IExtendedRequest req, byte[] cookieValueBytes, String reqURL) throws IOException, UnsupportedEncodingException, IllegalStateException {
HashMap output = null;
List<byte[]> data = splitBytes(cookieValueBytes, (byte) '.');
int total = data.size();
if (total > OFFSET_DATA) {
... | [
"private",
"HashMap",
"deserializePostParam",
"(",
"IExtendedRequest",
"req",
",",
"byte",
"[",
"]",
"cookieValueBytes",
",",
"String",
"reqURL",
")",
"throws",
"IOException",
",",
"UnsupportedEncodingException",
",",
"IllegalStateException",
"{",
"HashMap",
"output",
... | deserialize Post parameters.
The code doesn't expect that the req, cookieValueBytes, or reqURL is null. | [
"deserialize",
"Post",
"parameters",
".",
"The",
"code",
"doesn",
"t",
"expect",
"that",
"the",
"req",
"cookieValueBytes",
"or",
"reqURL",
"is",
"null",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/PostParameterHelper.java#L349-L370 |
threerings/narya | core/src/main/java/com/threerings/presents/dobj/DynamicListener.java | DynamicListener.dispatchMethod | public void dispatchMethod (String name, Object[] arguments) {
"""
Dynamically looks up the method in question on our target and dispatches
an event if it does.
"""
// first check the cache
Method method = _mcache.get(name);
if (method == null) {
// if we haven't already de... | java | public void dispatchMethod (String name, Object[] arguments)
{
// first check the cache
Method method = _mcache.get(name);
if (method == null) {
// if we haven't already determined this method doesn't exist, try
// to resolve it
if (!_mcache.containsKey(na... | [
"public",
"void",
"dispatchMethod",
"(",
"String",
"name",
",",
"Object",
"[",
"]",
"arguments",
")",
"{",
"// first check the cache",
"Method",
"method",
"=",
"_mcache",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"method",
"==",
"null",
")",
"{",
"//... | Dynamically looks up the method in question on our target and dispatches
an event if it does. | [
"Dynamically",
"looks",
"up",
"the",
"method",
"in",
"question",
"on",
"our",
"target",
"and",
"dispatches",
"an",
"event",
"if",
"it",
"does",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DynamicListener.java#L99-L118 |
apache/incubator-druid | server/src/main/java/org/apache/druid/initialization/Initialization.java | Initialization.getClassLoaderForExtension | public static URLClassLoader getClassLoaderForExtension(File extension, boolean useExtensionClassloaderFirst) {
"""
@param extension The File instance of the extension we want to load
@return a URLClassLoader that loads all the jars on which the extension is dependent
"""
return loadersMap.computeIfAbse... | java | public static URLClassLoader getClassLoaderForExtension(File extension, boolean useExtensionClassloaderFirst)
{
return loadersMap.computeIfAbsent(
extension,
theExtension -> makeClassLoaderForExtension(theExtension, useExtensionClassloaderFirst)
);
} | [
"public",
"static",
"URLClassLoader",
"getClassLoaderForExtension",
"(",
"File",
"extension",
",",
"boolean",
"useExtensionClassloaderFirst",
")",
"{",
"return",
"loadersMap",
".",
"computeIfAbsent",
"(",
"extension",
",",
"theExtension",
"->",
"makeClassLoaderForExtension"... | @param extension The File instance of the extension we want to load
@return a URLClassLoader that loads all the jars on which the extension is dependent | [
"@param",
"extension",
"The",
"File",
"instance",
"of",
"the",
"extension",
"we",
"want",
"to",
"load"
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/server/src/main/java/org/apache/druid/initialization/Initialization.java#L293-L299 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java | StreamExecutionEnvironment.fromCollection | public <OUT> DataStreamSource<OUT> fromCollection(Iterator<OUT> data, TypeInformation<OUT> typeInfo) {
"""
Creates a data stream from the given iterator.
<p>Because the iterator will remain unmodified until the actual execution happens,
the type of data returned by the iterator must be given explicitly in the ... | java | public <OUT> DataStreamSource<OUT> fromCollection(Iterator<OUT> data, TypeInformation<OUT> typeInfo) {
Preconditions.checkNotNull(data, "The iterator must not be null");
SourceFunction<OUT> function = new FromIteratorFunction<>(data);
return addSource(function, "Collection Source", typeInfo);
} | [
"public",
"<",
"OUT",
">",
"DataStreamSource",
"<",
"OUT",
">",
"fromCollection",
"(",
"Iterator",
"<",
"OUT",
">",
"data",
",",
"TypeInformation",
"<",
"OUT",
">",
"typeInfo",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"data",
",",
"\"The iterator... | Creates a data stream from the given iterator.
<p>Because the iterator will remain unmodified until the actual execution happens,
the type of data returned by the iterator must be given explicitly in the form of the type
information. This method is useful for cases where the type is generic.
In that case, the type cla... | [
"Creates",
"a",
"data",
"stream",
"from",
"the",
"given",
"iterator",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L864-L869 |
leadware/jpersistence-tools | jpersistence-tools-core/src/main/java/net/leadware/persistence/tools/core/dao/impl/JPAGenericDAORulesBasedImpl.java | JPAGenericDAORulesBasedImpl.validateEntityReferentialConstraint | protected void validateEntityReferentialConstraint(Object entity, DAOMode mode, DAOValidatorEvaluationTime validationTime) {
"""
Méthode de validation des contraintes referentielles
@param entity Entité à valider
@param mode Mode DAO
@param validationTime Moment d'évaluation
"""
// Obtention de la list... | java | protected void validateEntityReferentialConstraint(Object entity, DAOMode mode, DAOValidatorEvaluationTime validationTime) {
// Obtention de la liste des annotations DAO qui sont sur la classe
List<Annotation> daoAnnotations = DAOValidatorHelper.loadDAOValidatorAnnotations(entity);
// Si la liste est vid... | [
"protected",
"void",
"validateEntityReferentialConstraint",
"(",
"Object",
"entity",
",",
"DAOMode",
"mode",
",",
"DAOValidatorEvaluationTime",
"validationTime",
")",
"{",
"// Obtention de la liste des annotations DAO qui sont sur la classe\r",
"List",
"<",
"Annotation",
">",
"... | Méthode de validation des contraintes referentielles
@param entity Entité à valider
@param mode Mode DAO
@param validationTime Moment d'évaluation | [
"Méthode",
"de",
"validation",
"des",
"contraintes",
"referentielles"
] | train | https://github.com/leadware/jpersistence-tools/blob/4c15372993584579d7dbb9b23dd4c0c0fdc9e789/jpersistence-tools-core/src/main/java/net/leadware/persistence/tools/core/dao/impl/JPAGenericDAORulesBasedImpl.java#L803-L837 |
GerdHolz/TOVAL | src/de/invation/code/toval/time/TimeUtils.java | TimeUtils.pastFromDate | public static Date pastFromDate(Date date, TimeValue value, boolean clearTimeOfDay) {
"""
Caution: Difference calculation is based on adding/subtracting milliseconds and omits time zones.<br>
In some cases the method might return possibly unexpected results due to time zones.<br>
When for example to the last day... | java | public static Date pastFromDate(Date date, TimeValue value, boolean clearTimeOfDay){
return diffFromDate(date, -value.getValueInMilliseconds(), clearTimeOfDay);
} | [
"public",
"static",
"Date",
"pastFromDate",
"(",
"Date",
"date",
",",
"TimeValue",
"value",
",",
"boolean",
"clearTimeOfDay",
")",
"{",
"return",
"diffFromDate",
"(",
"date",
",",
"-",
"value",
".",
"getValueInMilliseconds",
"(",
")",
",",
"clearTimeOfDay",
")... | Caution: Difference calculation is based on adding/subtracting milliseconds and omits time zones.<br>
In some cases the method might return possibly unexpected results due to time zones.<br>
When for example to the last day of CEST without time of day information (in 2016: 30.10.2016 00:00:00 000) milliseconds for one ... | [
"Caution",
":",
"Difference",
"calculation",
"is",
"based",
"on",
"adding",
"/",
"subtracting",
"milliseconds",
"and",
"omits",
"time",
"zones",
".",
"<br",
">",
"In",
"some",
"cases",
"the",
"method",
"might",
"return",
"possibly",
"unexpected",
"results",
"d... | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/time/TimeUtils.java#L78-L80 |
b3log/latke | latke-core/src/main/java/org/b3log/latke/servlet/RequestContext.java | RequestContext.parseRequestJSONObject | private static JSONObject parseRequestJSONObject(final HttpServletRequest request, final HttpServletResponse response) {
"""
Gets the request json object with the specified request.
@param request the specified request
@param response the specified response, sets its content type with "application/json"
@ret... | java | private static JSONObject parseRequestJSONObject(final HttpServletRequest request, final HttpServletResponse response) {
response.setContentType("application/json");
try {
BufferedReader reader;
try {
reader = request.getReader();
} catch (final Illeg... | [
"private",
"static",
"JSONObject",
"parseRequestJSONObject",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"HttpServletResponse",
"response",
")",
"{",
"response",
".",
"setContentType",
"(",
"\"application/json\"",
")",
";",
"try",
"{",
"BufferedReader",... | Gets the request json object with the specified request.
@param request the specified request
@param response the specified response, sets its content type with "application/json"
@return a json object | [
"Gets",
"the",
"request",
"json",
"object",
"with",
"the",
"specified",
"request",
"."
] | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/servlet/RequestContext.java#L578-L604 |
digitalheir/java-xml-to-json | src/main/java/org/leibnizcenter/xml/TerseJson.java | TerseJson.toXml | public Document toXml(InputStream json) throws IOException, NotImplemented {
"""
First element must be a document
@param json JSON stream
@return XML document
"""
JsonReader reader = null;
try {
reader = new JsonReader(new InputStreamReader(json, "utf-8"));
return pa... | java | public Document toXml(InputStream json) throws IOException, NotImplemented {
JsonReader reader = null;
try {
reader = new JsonReader(new InputStreamReader(json, "utf-8"));
return parse(reader);
} catch (UnsupportedEncodingException e) {
throw new IllegalStateE... | [
"public",
"Document",
"toXml",
"(",
"InputStream",
"json",
")",
"throws",
"IOException",
",",
"NotImplemented",
"{",
"JsonReader",
"reader",
"=",
"null",
";",
"try",
"{",
"reader",
"=",
"new",
"JsonReader",
"(",
"new",
"InputStreamReader",
"(",
"json",
",",
... | First element must be a document
@param json JSON stream
@return XML document | [
"First",
"element",
"must",
"be",
"a",
"document"
] | train | https://github.com/digitalheir/java-xml-to-json/blob/94b4cef671bea9b79fb6daa685cd5bf78c222179/src/main/java/org/leibnizcenter/xml/TerseJson.java#L214-L225 |
softindex/datakernel | core-serializer/src/main/java/io/datakernel/serializer/SerializerBuilder.java | SerializerBuilder.build | public <T> BinarySerializer<T> build(Class<T> type) {
"""
Creates a {@code BinarySerializer} for the given type token.
@return {@code BinarySerializer} for the given type token
"""
SerializerForType[] serializerForTypes = new SerializerForType[0];
return build(type, serializerForTypes);
} | java | public <T> BinarySerializer<T> build(Class<T> type) {
SerializerForType[] serializerForTypes = new SerializerForType[0];
return build(type, serializerForTypes);
} | [
"public",
"<",
"T",
">",
"BinarySerializer",
"<",
"T",
">",
"build",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"SerializerForType",
"[",
"]",
"serializerForTypes",
"=",
"new",
"SerializerForType",
"[",
"0",
"]",
";",
"return",
"build",
"(",
"type",
... | Creates a {@code BinarySerializer} for the given type token.
@return {@code BinarySerializer} for the given type token | [
"Creates",
"a",
"{",
"@code",
"BinarySerializer",
"}",
"for",
"the",
"given",
"type",
"token",
"."
] | train | https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/core-serializer/src/main/java/io/datakernel/serializer/SerializerBuilder.java#L267-L270 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuGraphicsSubResourceGetMappedArray | public static int cuGraphicsSubResourceGetMappedArray(CUarray pArray, CUgraphicsResource resource, int arrayIndex, int mipLevel) {
"""
Get an array through which to access a subresource of a mapped graphics resource.
<pre>
CUresult cuGraphicsSubResourceGetMappedArray (
CUarray* pArray,
CUgraphicsResource res... | java | public static int cuGraphicsSubResourceGetMappedArray(CUarray pArray, CUgraphicsResource resource, int arrayIndex, int mipLevel)
{
return checkResult(cuGraphicsSubResourceGetMappedArrayNative(pArray, resource, arrayIndex, mipLevel));
} | [
"public",
"static",
"int",
"cuGraphicsSubResourceGetMappedArray",
"(",
"CUarray",
"pArray",
",",
"CUgraphicsResource",
"resource",
",",
"int",
"arrayIndex",
",",
"int",
"mipLevel",
")",
"{",
"return",
"checkResult",
"(",
"cuGraphicsSubResourceGetMappedArrayNative",
"(",
... | Get an array through which to access a subresource of a mapped graphics resource.
<pre>
CUresult cuGraphicsSubResourceGetMappedArray (
CUarray* pArray,
CUgraphicsResource resource,
unsigned int arrayIndex,
unsigned int mipLevel )
</pre>
<div>
<p>Get an array through which to access a
subresource of a mapped graphics... | [
"Get",
"an",
"array",
"through",
"which",
"to",
"access",
"a",
"subresource",
"of",
"a",
"mapped",
"graphics",
"resource",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L15864-L15867 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.updateSecret | public SecretBundle updateSecret(String vaultBaseUrl, String secretName, String secretVersion, String contentType, SecretAttributes secretAttributes, Map<String, String> tags) {
"""
Updates the attributes associated with a specified secret in a given key vault.
The UPDATE operation changes specified attributes of... | java | public SecretBundle updateSecret(String vaultBaseUrl, String secretName, String secretVersion, String contentType, SecretAttributes secretAttributes, Map<String, String> tags) {
return updateSecretWithServiceResponseAsync(vaultBaseUrl, secretName, secretVersion, contentType, secretAttributes, tags).toBlocking()... | [
"public",
"SecretBundle",
"updateSecret",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"secretName",
",",
"String",
"secretVersion",
",",
"String",
"contentType",
",",
"SecretAttributes",
"secretAttributes",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
... | Updates the attributes associated with a specified secret in a given key vault.
The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set per... | [
"Updates",
"the",
"attributes",
"associated",
"with",
"a",
"specified",
"secret",
"in",
"a",
"given",
"key",
"vault",
".",
"The",
"UPDATE",
"operation",
"changes",
"specified",
"attributes",
"of",
"an",
"existing",
"stored",
"secret",
".",
"Attributes",
"that",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L3718-L3720 |
Netflix/Hystrix | hystrix-core/src/main/java/com/netflix/hystrix/strategy/metrics/HystrixMetricsPublisher.java | HystrixMetricsPublisher.getMetricsPublisherForThreadPool | public HystrixMetricsPublisherThreadPool getMetricsPublisherForThreadPool(HystrixThreadPoolKey threadPoolKey, HystrixThreadPoolMetrics metrics, HystrixThreadPoolProperties properties) {
"""
Construct an implementation of {@link HystrixMetricsPublisherThreadPool} for {@link HystrixThreadPool} instances having key {... | java | public HystrixMetricsPublisherThreadPool getMetricsPublisherForThreadPool(HystrixThreadPoolKey threadPoolKey, HystrixThreadPoolMetrics metrics, HystrixThreadPoolProperties properties) {
return new HystrixMetricsPublisherThreadPoolDefault(threadPoolKey, metrics, properties);
} | [
"public",
"HystrixMetricsPublisherThreadPool",
"getMetricsPublisherForThreadPool",
"(",
"HystrixThreadPoolKey",
"threadPoolKey",
",",
"HystrixThreadPoolMetrics",
"metrics",
",",
"HystrixThreadPoolProperties",
"properties",
")",
"{",
"return",
"new",
"HystrixMetricsPublisherThreadPool... | Construct an implementation of {@link HystrixMetricsPublisherThreadPool} for {@link HystrixThreadPool} instances having key {@link HystrixThreadPoolKey}.
<p>
This will be invoked once per {@link HystrixThreadPoolKey} instance.
<p>
<b>Default Implementation</b>
<p>
Return instance of {@link HystrixMetricsPublisherThread... | [
"Construct",
"an",
"implementation",
"of",
"{",
"@link",
"HystrixMetricsPublisherThreadPool",
"}",
"for",
"{",
"@link",
"HystrixThreadPool",
"}",
"instances",
"having",
"key",
"{",
"@link",
"HystrixThreadPoolKey",
"}",
".",
"<p",
">",
"This",
"will",
"be",
"invoke... | train | https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/strategy/metrics/HystrixMetricsPublisher.java#L90-L92 |
google/closure-compiler | src/com/google/javascript/rhino/Node.java | Node.mergeLineCharNo | protected static int mergeLineCharNo(int lineno, int charno) {
"""
Merges the line number and character number in one integer. The Character
number takes the first 12 bits and the line number takes the rest. If
the character number is greater than <code>2<sup>12</sup>-1</code> it is
adjusted to <code>2<sup>12</... | java | protected static int mergeLineCharNo(int lineno, int charno) {
if (lineno < 0 || charno < 0) {
return -1;
} else if ((charno & ~COLUMN_MASK) != 0) {
return lineno << COLUMN_BITS | COLUMN_MASK;
} else {
return lineno << COLUMN_BITS | (charno & COLUMN_MASK);
}
} | [
"protected",
"static",
"int",
"mergeLineCharNo",
"(",
"int",
"lineno",
",",
"int",
"charno",
")",
"{",
"if",
"(",
"lineno",
"<",
"0",
"||",
"charno",
"<",
"0",
")",
"{",
"return",
"-",
"1",
";",
"}",
"else",
"if",
"(",
"(",
"charno",
"&",
"~",
"C... | Merges the line number and character number in one integer. The Character
number takes the first 12 bits and the line number takes the rest. If
the character number is greater than <code>2<sup>12</sup>-1</code> it is
adjusted to <code>2<sup>12</sup>-1</code>. | [
"Merges",
"the",
"line",
"number",
"and",
"character",
"number",
"in",
"one",
"integer",
".",
"The",
"Character",
"number",
"takes",
"the",
"first",
"12",
"bits",
"and",
"the",
"line",
"number",
"takes",
"the",
"rest",
".",
"If",
"the",
"character",
"numbe... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/Node.java#L1591-L1599 |
samskivert/pythagoras | src/main/java/pythagoras/d/Matrix4.java | Matrix4.setToTransform | public Matrix4 setToTransform (IVector3 translation, IQuaternion rotation, IVector3 scale) {
"""
Sets this to a matrix that first scales, then rotates, then translates.
@return a reference to this matrix, for chaining.
"""
double sx = scale.x(), sy = scale.y(), sz = scale.z();
return setToRo... | java | public Matrix4 setToTransform (IVector3 translation, IQuaternion rotation, IVector3 scale) {
double sx = scale.x(), sy = scale.y(), sz = scale.z();
return setToRotation(rotation).set(
m00 * sx, m10 * sy, m20 * sz, translation.x(),
m01 * sx, m11 * sy, m21 * sz, translation.y(),
... | [
"public",
"Matrix4",
"setToTransform",
"(",
"IVector3",
"translation",
",",
"IQuaternion",
"rotation",
",",
"IVector3",
"scale",
")",
"{",
"double",
"sx",
"=",
"scale",
".",
"x",
"(",
")",
",",
"sy",
"=",
"scale",
".",
"y",
"(",
")",
",",
"sz",
"=",
... | Sets this to a matrix that first scales, then rotates, then translates.
@return a reference to this matrix, for chaining. | [
"Sets",
"this",
"to",
"a",
"matrix",
"that",
"first",
"scales",
"then",
"rotates",
"then",
"translates",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Matrix4.java#L125-L132 |
facebookarchive/hive-dwrf | hive-dwrf/src/main/java/com/facebook/hive/orc/OrcFile.java | OrcFile.createReader | public static Reader createReader(FileSystem fs, Path path, Configuration conf )
throws IOException {
"""
Create an ORC file reader.
@param fs file system
@param path file name to read from
@return a new ORC file reader.
@throws IOException
"""
return new ReaderImpl(fs, path, conf);
} | java | public static Reader createReader(FileSystem fs, Path path, Configuration conf )
throws IOException {
return new ReaderImpl(fs, path, conf);
} | [
"public",
"static",
"Reader",
"createReader",
"(",
"FileSystem",
"fs",
",",
"Path",
"path",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"return",
"new",
"ReaderImpl",
"(",
"fs",
",",
"path",
",",
"conf",
")",
";",
"}"
] | Create an ORC file reader.
@param fs file system
@param path file name to read from
@return a new ORC file reader.
@throws IOException | [
"Create",
"an",
"ORC",
"file",
"reader",
"."
] | train | https://github.com/facebookarchive/hive-dwrf/blob/a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45/hive-dwrf/src/main/java/com/facebook/hive/orc/OrcFile.java#L104-L107 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/UtilLepetitEPnP.java | UtilLepetitEPnP.constraintMatrix6x4 | public static void constraintMatrix6x4( DMatrixRMaj L_6x10 , DMatrixRMaj L_6x4 ) {
"""
Extracts the linear constraint matrix for case 1 from the full 6x10 constraint matrix.
"""
int index = 0;
for( int i = 0; i < 6; i++ ) {
L_6x4.data[index++] = L_6x10.get(i,0);
L_6x4.data[index++] = L_6x10.get(i,1)... | java | public static void constraintMatrix6x4( DMatrixRMaj L_6x10 , DMatrixRMaj L_6x4 ) {
int index = 0;
for( int i = 0; i < 6; i++ ) {
L_6x4.data[index++] = L_6x10.get(i,0);
L_6x4.data[index++] = L_6x10.get(i,1);
L_6x4.data[index++] = L_6x10.get(i,3);
L_6x4.data[index++] = L_6x10.get(i,6);
}
} | [
"public",
"static",
"void",
"constraintMatrix6x4",
"(",
"DMatrixRMaj",
"L_6x10",
",",
"DMatrixRMaj",
"L_6x4",
")",
"{",
"int",
"index",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"6",
";",
"i",
"++",
")",
"{",
"L_6x4",
".",
"da... | Extracts the linear constraint matrix for case 1 from the full 6x10 constraint matrix. | [
"Extracts",
"the",
"linear",
"constraint",
"matrix",
"for",
"case",
"1",
"from",
"the",
"full",
"6x10",
"constraint",
"matrix",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/pose/UtilLepetitEPnP.java#L68-L77 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/KeyVaultCredentials.java | KeyVaultCredentials.getAuthenticationCredentials | private AuthenticationResult getAuthenticationCredentials(Boolean supportsPop, Map<String, String> challengeMap) {
"""
Extracts the authentication challenges from the challenge map and calls the
authentication callback to get the bearer token and return it.
@param supportsPop
is resource supports pop authenti... | java | private AuthenticationResult getAuthenticationCredentials(Boolean supportsPop, Map<String, String> challengeMap) {
String authorization = challengeMap.get("authorization");
if (authorization == null) {
authorization = challengeMap.get("authorization_uri");
}
String resource... | [
"private",
"AuthenticationResult",
"getAuthenticationCredentials",
"(",
"Boolean",
"supportsPop",
",",
"Map",
"<",
"String",
",",
"String",
">",
"challengeMap",
")",
"{",
"String",
"authorization",
"=",
"challengeMap",
".",
"get",
"(",
"\"authorization\"",
")",
";",... | Extracts the authentication challenges from the challenge map and calls the
authentication callback to get the bearer token and return it.
@param supportsPop
is resource supports pop authentication.
@param challengeMap
the challenge map.
@return AuthenticationResult with bearer token and PoP key. | [
"Extracts",
"the",
"authentication",
"challenges",
"from",
"the",
"challenge",
"map",
"and",
"calls",
"the",
"authentication",
"callback",
"to",
"get",
"the",
"bearer",
"token",
"and",
"return",
"it",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/authentication/KeyVaultCredentials.java#L211-L222 |
spotify/styx | styx-scheduler-service/src/main/java/com/spotify/styx/ScheduledExecutionUtil.java | ScheduledExecutionUtil.scheduleWithJitter | public static void scheduleWithJitter(Runnable runnable, ScheduledExecutorService exec, Duration interval) {
"""
Schedule a runnable to execute at randomized intervals with a mean value of {@param interval}.
The random intervals are values from the uniform distribution interval * [1.0 - JITTER, 1.0 + JITTER].
... | java | public static void scheduleWithJitter(Runnable runnable, ScheduledExecutorService exec, Duration interval) {
final double jitter = ThreadLocalRandom.current().nextDouble(1.0 - JITTER, 1.0 + JITTER);
final long delayMillis = (long) (jitter * interval.toMillis());
exec.schedule(() -> {
runGuarded(runnab... | [
"public",
"static",
"void",
"scheduleWithJitter",
"(",
"Runnable",
"runnable",
",",
"ScheduledExecutorService",
"exec",
",",
"Duration",
"interval",
")",
"{",
"final",
"double",
"jitter",
"=",
"ThreadLocalRandom",
".",
"current",
"(",
")",
".",
"nextDouble",
"(",
... | Schedule a runnable to execute at randomized intervals with a mean value of {@param interval}.
The random intervals are values from the uniform distribution interval * [1.0 - JITTER, 1.0 + JITTER].
@param runnable The {@link Runnable} to schedule.
@param exec The {@link ScheduledExecutorService} to schedule the ru... | [
"Schedule",
"a",
"runnable",
"to",
"execute",
"at",
"randomized",
"intervals",
"with",
"a",
"mean",
"value",
"of",
"{",
"@param",
"interval",
"}",
".",
"The",
"random",
"intervals",
"are",
"values",
"from",
"the",
"uniform",
"distribution",
"interval",
"*",
... | train | https://github.com/spotify/styx/blob/0d63999beeb93a17447e3bbccaa62175b74cf6e4/styx-scheduler-service/src/main/java/com/spotify/styx/ScheduledExecutionUtil.java#L46-L53 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/Check.java | Check.equality | public static void equality(int a, int b) {
"""
Check if <code>a</code> is equal to <code>b</code>.
@param a The parameter to test.
@param b The parameter to compare to.
@throws LionEngineException If check failed.
"""
if (a != b)
{
throw new LionEngineException(ERROR_ARGUME... | java | public static void equality(int a, int b)
{
if (a != b)
{
throw new LionEngineException(ERROR_ARGUMENT + String.valueOf(a) + ERROR_EQUALS + String.valueOf(b));
}
} | [
"public",
"static",
"void",
"equality",
"(",
"int",
"a",
",",
"int",
"b",
")",
"{",
"if",
"(",
"a",
"!=",
"b",
")",
"{",
"throw",
"new",
"LionEngineException",
"(",
"ERROR_ARGUMENT",
"+",
"String",
".",
"valueOf",
"(",
"a",
")",
"+",
"ERROR_EQUALS",
... | Check if <code>a</code> is equal to <code>b</code>.
@param a The parameter to test.
@param b The parameter to compare to.
@throws LionEngineException If check failed. | [
"Check",
"if",
"<code",
">",
"a<",
"/",
"code",
">",
"is",
"equal",
"to",
"<code",
">",
"b<",
"/",
"code",
">",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/Check.java#L214-L220 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java | Expressions.booleanTemplate | public static BooleanTemplate booleanTemplate(String template, List<?> args) {
"""
Create a new Template expression
@param template template
@param args template parameters
@return template expression
"""
return booleanTemplate(createTemplate(template), args);
} | java | public static BooleanTemplate booleanTemplate(String template, List<?> args) {
return booleanTemplate(createTemplate(template), args);
} | [
"public",
"static",
"BooleanTemplate",
"booleanTemplate",
"(",
"String",
"template",
",",
"List",
"<",
"?",
">",
"args",
")",
"{",
"return",
"booleanTemplate",
"(",
"createTemplate",
"(",
"template",
")",
",",
"args",
")",
";",
"}"
] | Create a new Template expression
@param template template
@param args template parameters
@return template expression | [
"Create",
"a",
"new",
"Template",
"expression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java#L985-L987 |
phax/ph-css | ph-css/src/main/java/com/helger/css/utils/CSSDataURL.java | CSSDataURL.getContentAsString | @Nonnull
public String getContentAsString () {
"""
Get the data content of this Data URL as String. If no String
representation was provided in the constructor, than it is lazily created
inside this method in which case instances of this class are not
thread-safe. If a non-<code>null</code> String was provide... | java | @Nonnull
public String getContentAsString ()
{
if (m_sContent == null)
m_sContent = new String (m_aContent, m_aCharset);
return m_sContent;
} | [
"@",
"Nonnull",
"public",
"String",
"getContentAsString",
"(",
")",
"{",
"if",
"(",
"m_sContent",
"==",
"null",
")",
"m_sContent",
"=",
"new",
"String",
"(",
"m_aContent",
",",
"m_aCharset",
")",
";",
"return",
"m_sContent",
";",
"}"
] | Get the data content of this Data URL as String. If no String
representation was provided in the constructor, than it is lazily created
inside this method in which case instances of this class are not
thread-safe. If a non-<code>null</code> String was provided in the
constructor, this object is immutable. No Base64 enc... | [
"Get",
"the",
"data",
"content",
"of",
"this",
"Data",
"URL",
"as",
"String",
".",
"If",
"no",
"String",
"representation",
"was",
"provided",
"in",
"the",
"constructor",
"than",
"it",
"is",
"lazily",
"created",
"inside",
"this",
"method",
"in",
"which",
"c... | train | https://github.com/phax/ph-css/blob/c9da5bb4decc681de6e27ce31712aad4c00adafa/ph-css/src/main/java/com/helger/css/utils/CSSDataURL.java#L271-L277 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.readManagerGroup | public CmsGroup readManagerGroup(CmsDbContext dbc, CmsProject project) {
"""
Reads the manager group of a project.<p>
@param dbc the current database context
@param project the project to read from
@return the group of a resource
"""
try {
return readGroup(dbc, project.getManagerGro... | java | public CmsGroup readManagerGroup(CmsDbContext dbc, CmsProject project) {
try {
return readGroup(dbc, project.getManagerGroupId());
} catch (CmsException exc) {
// the group does not exist any more - return a dummy-group
return new CmsGroup(
CmsUUID.ge... | [
"public",
"CmsGroup",
"readManagerGroup",
"(",
"CmsDbContext",
"dbc",
",",
"CmsProject",
"project",
")",
"{",
"try",
"{",
"return",
"readGroup",
"(",
"dbc",
",",
"project",
".",
"getManagerGroupId",
"(",
")",
")",
";",
"}",
"catch",
"(",
"CmsException",
"exc... | Reads the manager group of a project.<p>
@param dbc the current database context
@param project the project to read from
@return the group of a resource | [
"Reads",
"the",
"manager",
"group",
"of",
"a",
"project",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L7046-L7059 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/utils/HealthPinger.java | HealthPinger.pingBinary | private static Observable<PingServiceHealth> pingBinary(
final NetworkAddress hostname, final String bucket,
final ClusterFacade core, final long timeout, final TimeUnit timeUnit) {
"""
Pings the service and completes if successful - and fails if it didn't work
for some reason (reason is in the ex... | java | private static Observable<PingServiceHealth> pingBinary(
final NetworkAddress hostname, final String bucket,
final ClusterFacade core, final long timeout, final TimeUnit timeUnit) {
final AtomicReference<CouchbaseRequest> request = new AtomicReference<CouchbaseRequest>();
Observable<Noop... | [
"private",
"static",
"Observable",
"<",
"PingServiceHealth",
">",
"pingBinary",
"(",
"final",
"NetworkAddress",
"hostname",
",",
"final",
"String",
"bucket",
",",
"final",
"ClusterFacade",
"core",
",",
"final",
"long",
"timeout",
",",
"final",
"TimeUnit",
"timeUni... | Pings the service and completes if successful - and fails if it didn't work
for some reason (reason is in the exception). | [
"Pings",
"the",
"service",
"and",
"completes",
"if",
"successful",
"-",
"and",
"fails",
"if",
"it",
"didn",
"t",
"work",
"for",
"some",
"reason",
"(",
"reason",
"is",
"in",
"the",
"exception",
")",
"."
] | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/utils/HealthPinger.java#L169-L182 |
graphql-java/graphql-java | src/main/java/graphql/schema/idl/SchemaTypeExtensionsChecker.java | SchemaTypeExtensionsChecker.checkInputObjectTypeExtensions | private void checkInputObjectTypeExtensions(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry) {
"""
/*
Input object type extensions have the potential to be invalid if incorrectly defined.
The named type must already be defined and must be a Input Object type.
All fields of an Input Object type ... | java | private void checkInputObjectTypeExtensions(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry) {
typeRegistry.inputObjectTypeExtensions()
.forEach((name, extensions) -> {
checkTypeExtensionHasCorrespondingType(errors, typeRegistry, name, extensions, InputObjectTy... | [
"private",
"void",
"checkInputObjectTypeExtensions",
"(",
"List",
"<",
"GraphQLError",
">",
"errors",
",",
"TypeDefinitionRegistry",
"typeRegistry",
")",
"{",
"typeRegistry",
".",
"inputObjectTypeExtensions",
"(",
")",
".",
"forEach",
"(",
"(",
"name",
",",
"extensi... | /*
Input object type extensions have the potential to be invalid if incorrectly defined.
The named type must already be defined and must be a Input Object type.
All fields of an Input Object type extension must have unique names.
All fields of an Input Object type extension must not already be a field of the original ... | [
"/",
"*",
"Input",
"object",
"type",
"extensions",
"have",
"the",
"potential",
"to",
"be",
"invalid",
"if",
"incorrectly",
"defined",
"."
] | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/schema/idl/SchemaTypeExtensionsChecker.java#L259-L295 |
leancloud/java-sdk-all | android-sdk/realtime-android/src/main/java/cn/leancloud/push/PushService.java | PushService.setDefaultChannelId | @TargetApi(Build.VERSION_CODES.O)
public static void setDefaultChannelId(Context context, String channelId) {
"""
Set default channel for Android Oreo or newer version
Notice: it isn"t necessary to invoke this method for any Android version before Oreo.
@param context context
@param channelId default chan... | java | @TargetApi(Build.VERSION_CODES.O)
public static void setDefaultChannelId(Context context, String channelId) {
DefaultChannelId = channelId;
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.N_MR1) {
// do nothing for Android versions before Ore
return;
}
try {
NotificationManager not... | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"O",
")",
"public",
"static",
"void",
"setDefaultChannelId",
"(",
"Context",
"context",
",",
"String",
"channelId",
")",
"{",
"DefaultChannelId",
"=",
"channelId",
";",
"if",
"(",
"Build",
".",
"VERS... | Set default channel for Android Oreo or newer version
Notice: it isn"t necessary to invoke this method for any Android version before Oreo.
@param context context
@param channelId default channel id. | [
"Set",
"default",
"channel",
"for",
"Android",
"Oreo",
"or",
"newer",
"version",
"Notice",
":",
"it",
"isn",
"t",
"necessary",
"to",
"invoke",
"this",
"method",
"for",
"any",
"Android",
"version",
"before",
"Oreo",
"."
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/android-sdk/realtime-android/src/main/java/cn/leancloud/push/PushService.java#L334-L353 |
grails/grails-core | grails-core/src/main/groovy/org/grails/core/util/StopWatch.java | StopWatch.prettyPrint | public String prettyPrint() {
"""
Return a string with a table describing all tasks performed.
For custom reporting, call getTaskInfo() and use the task info directly.
"""
StringBuilder sb = new StringBuilder(shortSummary());
sb.append('\n');
sb.append("--------------------------------... | java | public String prettyPrint() {
StringBuilder sb = new StringBuilder(shortSummary());
sb.append('\n');
sb.append("-----------------------------------------\n");
sb.append("ms % Task name\n");
sb.append("-----------------------------------------\n");
NumberFormat nf ... | [
"public",
"String",
"prettyPrint",
"(",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"shortSummary",
"(",
")",
")",
";",
"sb",
".",
"append",
"(",
"'",
"'",
")",
";",
"sb",
".",
"append",
"(",
"\"----------------------------------------... | Return a string with a table describing all tasks performed.
For custom reporting, call getTaskInfo() and use the task info directly. | [
"Return",
"a",
"string",
"with",
"a",
"table",
"describing",
"all",
"tasks",
"performed",
".",
"For",
"custom",
"reporting",
"call",
"getTaskInfo",
"()",
"and",
"use",
"the",
"task",
"info",
"directly",
"."
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/core/util/StopWatch.java#L187-L212 |
Alfresco/alfresco-sdk | plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/AbstractRefreshWebappMojo.java | AbstractRefreshWebappMojo.refreshWebScripts | protected void refreshWebScripts(String url) {
"""
Perform a Refresh of Web Scripts container in webapp.
Called by specific refresh mojo implementation.
@param url the relative path to refresh webscripts
"""
// Create the Refresh URL for the Alfresco Tomcat server
URL alfrescoTomcatUrl = bu... | java | protected void refreshWebScripts(String url) {
// Create the Refresh URL for the Alfresco Tomcat server
URL alfrescoTomcatUrl = buildFinalUrl(url);
if (alfrescoTomcatUrl == null) {
getLog().error("Could not build refresh URL for " + refreshWebappName + ", " + getAbortedMsg());
... | [
"protected",
"void",
"refreshWebScripts",
"(",
"String",
"url",
")",
"{",
"// Create the Refresh URL for the Alfresco Tomcat server",
"URL",
"alfrescoTomcatUrl",
"=",
"buildFinalUrl",
"(",
"url",
")",
";",
"if",
"(",
"alfrescoTomcatUrl",
"==",
"null",
")",
"{",
"getLo... | Perform a Refresh of Web Scripts container in webapp.
Called by specific refresh mojo implementation.
@param url the relative path to refresh webscripts | [
"Perform",
"a",
"Refresh",
"of",
"Web",
"Scripts",
"container",
"in",
"webapp",
".",
"Called",
"by",
"specific",
"refresh",
"mojo",
"implementation",
"."
] | train | https://github.com/Alfresco/alfresco-sdk/blob/7f861a96726edb776293e2363ee85ef05643368b/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/AbstractRefreshWebappMojo.java#L170-L184 |
jenkinsci/jenkins | core/src/main/java/jenkins/security/apitoken/ApiTokenStore.java | ApiTokenStore.renameToken | public synchronized boolean renameToken(@Nonnull String tokenUuid, @Nonnull String newName) {
"""
Given a token identifier and a name, the system will try to find a corresponding token and rename it
@return {@code true} iff the token was found and the rename was successful
"""
for (HashedToken token :... | java | public synchronized boolean renameToken(@Nonnull String tokenUuid, @Nonnull String newName) {
for (HashedToken token : tokenList) {
if (token.uuid.equals(tokenUuid)) {
token.rename(newName);
return true;
}
}
LOGGER.log(Level.FINER,... | [
"public",
"synchronized",
"boolean",
"renameToken",
"(",
"@",
"Nonnull",
"String",
"tokenUuid",
",",
"@",
"Nonnull",
"String",
"newName",
")",
"{",
"for",
"(",
"HashedToken",
"token",
":",
"tokenList",
")",
"{",
"if",
"(",
"token",
".",
"uuid",
".",
"equal... | Given a token identifier and a name, the system will try to find a corresponding token and rename it
@return {@code true} iff the token was found and the rename was successful | [
"Given",
"a",
"token",
"identifier",
"and",
"a",
"name",
"the",
"system",
"will",
"try",
"to",
"find",
"a",
"corresponding",
"token",
"and",
"rename",
"it"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/security/apitoken/ApiTokenStore.java#L289-L299 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/MessagesApi.java | MessagesApi.getFieldPresenceAsync | public com.squareup.okhttp.Call getFieldPresenceAsync(Long startDate, Long endDate, String interval, String sdid, String fieldPresence, final ApiCallback<FieldPresenceEnvelope> callback) throws ApiException {
"""
Get normalized message presence (asynchronously)
Get normalized message presence.
@param startDate s... | java | public com.squareup.okhttp.Call getFieldPresenceAsync(Long startDate, Long endDate, String interval, String sdid, String fieldPresence, final ApiCallback<FieldPresenceEnvelope> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressReq... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"getFieldPresenceAsync",
"(",
"Long",
"startDate",
",",
"Long",
"endDate",
",",
"String",
"interval",
",",
"String",
"sdid",
",",
"String",
"fieldPresence",
",",
"final",
"ApiCallback",
"<",
"FieldP... | Get normalized message presence (asynchronously)
Get normalized message presence.
@param startDate startDate (required)
@param endDate endDate (required)
@param interval String representing grouping interval. One of: 'minute' (1 hour limit), 'hour' (1 day limit), 'day' (31 days limit), 'mont... | [
"Get",
"normalized",
"message",
"presence",
"(",
"asynchronously",
")",
"Get",
"normalized",
"message",
"presence",
"."
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/MessagesApi.java#L334-L359 |
nostra13/Android-Universal-Image-Loader | library/src/main/java/com/nostra13/universalimageloader/core/DefaultConfigurationFactory.java | DefaultConfigurationFactory.createReserveDiskCacheDir | private static File createReserveDiskCacheDir(Context context) {
"""
Creates reserve disk cache folder which will be used if primary disk cache folder becomes unavailable
"""
File cacheDir = StorageUtils.getCacheDirectory(context, false);
File individualDir = new File(cacheDir, "uil-images");
if (individ... | java | private static File createReserveDiskCacheDir(Context context) {
File cacheDir = StorageUtils.getCacheDirectory(context, false);
File individualDir = new File(cacheDir, "uil-images");
if (individualDir.exists() || individualDir.mkdir()) {
cacheDir = individualDir;
}
return cacheDir;
} | [
"private",
"static",
"File",
"createReserveDiskCacheDir",
"(",
"Context",
"context",
")",
"{",
"File",
"cacheDir",
"=",
"StorageUtils",
".",
"getCacheDirectory",
"(",
"context",
",",
"false",
")",
";",
"File",
"individualDir",
"=",
"new",
"File",
"(",
"cacheDir"... | Creates reserve disk cache folder which will be used if primary disk cache folder becomes unavailable | [
"Creates",
"reserve",
"disk",
"cache",
"folder",
"which",
"will",
"be",
"used",
"if",
"primary",
"disk",
"cache",
"folder",
"becomes",
"unavailable"
] | train | https://github.com/nostra13/Android-Universal-Image-Loader/blob/fc3c5f6779bb4f702e233653b61bd9d559e345cc/library/src/main/java/com/nostra13/universalimageloader/core/DefaultConfigurationFactory.java#L101-L108 |
actorapp/actor-platform | actor-sdk/sdk-core/runtime/runtime-android/src/main/java/im/actor/runtime/android/crypto/PRNGFixes.java | PRNGFixes.installLinuxPRNGSecureRandom | private static void installLinuxPRNGSecureRandom()
throws SecurityException {
"""
Installs a Linux PRNG-backed {@code SecureRandom} implementation as the
default. Does nothing if the implementation is already the default or if
there is not need to install the implementation.
@throws SecurityExcept... | java | private static void installLinuxPRNGSecureRandom()
throws SecurityException {
if (Build.VERSION.SDK_INT > VERSION_CODE_JELLY_BEAN_MR2) {
// No need to apply the fix
return;
}
// Install a Linux PRNG-based SecureRandom implementation as the
// default,... | [
"private",
"static",
"void",
"installLinuxPRNGSecureRandom",
"(",
")",
"throws",
"SecurityException",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">",
"VERSION_CODE_JELLY_BEAN_MR2",
")",
"{",
"// No need to apply the fix",
"return",
";",
"}",
"// Install ... | Installs a Linux PRNG-backed {@code SecureRandom} implementation as the
default. Does nothing if the implementation is already the default or if
there is not need to install the implementation.
@throws SecurityException if the fix is needed but could not be applied. | [
"Installs",
"a",
"Linux",
"PRNG",
"-",
"backed",
"{",
"@code",
"SecureRandom",
"}",
"implementation",
"as",
"the",
"default",
".",
"Does",
"nothing",
"if",
"the",
"implementation",
"is",
"already",
"the",
"default",
"or",
"if",
"there",
"is",
"not",
"need",
... | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/runtime/runtime-android/src/main/java/im/actor/runtime/android/crypto/PRNGFixes.java#L116-L157 |
apache/groovy | subprojects/groovy-templates/src/main/groovy/groovy/text/StreamingTemplateEngine.java | StreamingTemplateEngine.createTemplate | @Override
public Template createTemplate(final Reader reader) throws CompilationFailedException, ClassNotFoundException, IOException {
"""
Creates a template instance using the template source from the provided Reader.
The template can be applied repeatedly on different bindings to produce custom output.
... | java | @Override
public Template createTemplate(final Reader reader) throws CompilationFailedException, ClassNotFoundException, IOException {
return new StreamingTemplate(reader, parentLoader);
} | [
"@",
"Override",
"public",
"Template",
"createTemplate",
"(",
"final",
"Reader",
"reader",
")",
"throws",
"CompilationFailedException",
",",
"ClassNotFoundException",
",",
"IOException",
"{",
"return",
"new",
"StreamingTemplate",
"(",
"reader",
",",
"parentLoader",
")... | Creates a template instance using the template source from the provided Reader.
The template can be applied repeatedly on different bindings to produce custom output.
<strong>Technical detail</strong><br />
Under the hood the returned template is represented as a four argument
closure where the three first arguments ... | [
"Creates",
"a",
"template",
"instance",
"using",
"the",
"template",
"source",
"from",
"the",
"provided",
"Reader",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-templates/src/main/groovy/groovy/text/StreamingTemplateEngine.java#L213-L216 |
sap-production/xcode-maven-plugin | modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/XCodeProjectLayoutValidator.java | XCodeProjectLayoutValidator.verifyXcodeFolder | static void verifyXcodeFolder(final File xcodeFolder, final String projectName) throws XCodeVerificationException {
"""
Checks if a folder is a valid xcode folder. A folder is considered to be a valid xcode folder
if
<ul>
<li>it does exist
<li>it contains a folder named "<projectName>.xcodeproj"
<li>in ... | java | static void verifyXcodeFolder(final File xcodeFolder, final String projectName) throws XCodeVerificationException
{
if (!xcodeFolder.exists()) {
throw new XCodeRootFolderDoesNotExistException("The folder \"" + xcodeFolder
+ "\" that is the root folder of the xcode project \"" + projectName + "\... | [
"static",
"void",
"verifyXcodeFolder",
"(",
"final",
"File",
"xcodeFolder",
",",
"final",
"String",
"projectName",
")",
"throws",
"XCodeVerificationException",
"{",
"if",
"(",
"!",
"xcodeFolder",
".",
"exists",
"(",
")",
")",
"{",
"throw",
"new",
"XCodeRootFolde... | Checks if a folder is a valid xcode folder. A folder is considered to be a valid xcode folder
if
<ul>
<li>it does exist
<li>it contains a folder named "<projectName>.xcodeproj"
<li>in the folder(s) mentioned before we have a file named project.pbxproj
@throws XCodeException
is the folder is not a valid xcode pro... | [
"Checks",
"if",
"a",
"folder",
"is",
"a",
"valid",
"xcode",
"folder",
".",
"A",
"folder",
"is",
"considered",
"to",
"be",
"a",
"valid",
"xcode",
"folder",
"if",
"<ul",
">",
"<li",
">",
"it",
"does",
"exist",
"<li",
">",
"it",
"contains",
"a",
"folder... | train | https://github.com/sap-production/xcode-maven-plugin/blob/3f8aa380f501a1d7602f33fef2f6348354e7eb7c/modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/XCodeProjectLayoutValidator.java#L41-L83 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/AbstractSetEnable.java | AbstractSetEnable.applyAction | @Override
protected void applyAction(final SubordinateTarget target, final Object value) {
"""
Apply the action against the target.
@param target the target of this action
@param value is the evaluated value
"""
// Should always be Boolean, but check anyway
if (value instanceof Boolean) {
applyEnab... | java | @Override
protected void applyAction(final SubordinateTarget target, final Object value) {
// Should always be Boolean, but check anyway
if (value instanceof Boolean) {
applyEnableAction(target, ((Boolean) value));
}
} | [
"@",
"Override",
"protected",
"void",
"applyAction",
"(",
"final",
"SubordinateTarget",
"target",
",",
"final",
"Object",
"value",
")",
"{",
"// Should always be Boolean, but check anyway",
"if",
"(",
"value",
"instanceof",
"Boolean",
")",
"{",
"applyEnableAction",
"(... | Apply the action against the target.
@param target the target of this action
@param value is the evaluated value | [
"Apply",
"the",
"action",
"against",
"the",
"target",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/subordinate/AbstractSetEnable.java#L33-L39 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java | CmsDomUtil.ensureVisible | public static void ensureVisible(final Element containerElement, Element element, int animationTime) {
"""
Ensures that the given element is visible.<p>
Assuming the scrollbars are on the container element, and that the element is a child of the container element.<p>
@param containerElement the container ele... | java | public static void ensureVisible(final Element containerElement, Element element, int animationTime) {
Element item = element;
int realOffset = 0;
while ((item != null) && (item != containerElement)) {
realOffset += element.getOffsetTop();
item = item.getOffsetParent();
... | [
"public",
"static",
"void",
"ensureVisible",
"(",
"final",
"Element",
"containerElement",
",",
"Element",
"element",
",",
"int",
"animationTime",
")",
"{",
"Element",
"item",
"=",
"element",
";",
"int",
"realOffset",
"=",
"0",
";",
"while",
"(",
"(",
"item",... | Ensures that the given element is visible.<p>
Assuming the scrollbars are on the container element, and that the element is a child of the container element.<p>
@param containerElement the container element, has to be parent of the element
@param element the element to be seen
@param animationTime the animation time ... | [
"Ensures",
"that",
"the",
"given",
"element",
"is",
"visible",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/util/CmsDomUtil.java#L881-L908 |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java | Http2ConnectionHandler.onHttpClientUpgrade | public void onHttpClientUpgrade() throws Http2Exception {
"""
Handles the client-side (cleartext) upgrade from HTTP to HTTP/2.
Reserves local stream 1 for the HTTP/2 response.
"""
if (connection().isServer()) {
throw connectionError(PROTOCOL_ERROR, "Client-side HTTP upgrade requested for a... | java | public void onHttpClientUpgrade() throws Http2Exception {
if (connection().isServer()) {
throw connectionError(PROTOCOL_ERROR, "Client-side HTTP upgrade requested for a server");
}
if (!prefaceSent()) {
// If the preface was not sent yet it most likely means the handler w... | [
"public",
"void",
"onHttpClientUpgrade",
"(",
")",
"throws",
"Http2Exception",
"{",
"if",
"(",
"connection",
"(",
")",
".",
"isServer",
"(",
")",
")",
"{",
"throw",
"connectionError",
"(",
"PROTOCOL_ERROR",
",",
"\"Client-side HTTP upgrade requested for a server\"",
... | Handles the client-side (cleartext) upgrade from HTTP to HTTP/2.
Reserves local stream 1 for the HTTP/2 response. | [
"Handles",
"the",
"client",
"-",
"side",
"(",
"cleartext",
")",
"upgrade",
"from",
"HTTP",
"to",
"HTTP",
"/",
"2",
".",
"Reserves",
"local",
"stream",
"1",
"for",
"the",
"HTTP",
"/",
"2",
"response",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java#L143-L158 |
jeremylong/DependencyCheck | utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java | Settings.getConnectionString | public String getConnectionString(String connectionStringKey, String dbFileNameKey)
throws IOException, InvalidSettingException {
"""
Returns a connection string from the configured properties. If the
connection string contains a %s, this method will determine the 'data'
directory and replace the %s ... | java | public String getConnectionString(String connectionStringKey, String dbFileNameKey)
throws IOException, InvalidSettingException {
final String connStr = getString(connectionStringKey);
if (connStr == null) {
final String msg = String.format("Invalid properties file; %s is missing... | [
"public",
"String",
"getConnectionString",
"(",
"String",
"connectionStringKey",
",",
"String",
"dbFileNameKey",
")",
"throws",
"IOException",
",",
"InvalidSettingException",
"{",
"final",
"String",
"connStr",
"=",
"getString",
"(",
"connectionStringKey",
")",
";",
"i... | Returns a connection string from the configured properties. If the
connection string contains a %s, this method will determine the 'data'
directory and replace the %s with the path to the data directory. If the
data directory does not exist it will be created.
@param connectionStringKey the property file key for the c... | [
"Returns",
"a",
"connection",
"string",
"from",
"the",
"configured",
"properties",
".",
"If",
"the",
"connection",
"string",
"contains",
"a",
"%s",
"this",
"method",
"will",
"determine",
"the",
"data",
"directory",
"and",
"replace",
"the",
"%s",
"with",
"the",... | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java#L1095-L1124 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncGroupsInner.java | SyncGroupsInner.cancelSync | public void cancelSync(String resourceGroupName, String serverName, String databaseName, String syncGroupName) {
"""
Cancels a sync group synchronization.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the port... | java | public void cancelSync(String resourceGroupName, String serverName, String databaseName, String syncGroupName) {
cancelSyncWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName).toBlocking().single().body();
} | [
"public",
"void",
"cancelSync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"syncGroupName",
")",
"{",
"cancelSyncWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",
"databaseNam... | Cancels a sync group synchronization.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database on which the sync group is hosted... | [
"Cancels",
"a",
"sync",
"group",
"synchronization",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncGroupsInner.java#L916-L918 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dimensionalityreduction/PCA.java | PCA.estimateVariance | public double estimateVariance(INDArray data, int ndims) {
"""
Estimate the variance of a single record with reduced # of dimensions.
@param data A single record with the same <i>N</i> features as the constructing data set
@param ndims The number of dimensions to include in calculation
@return The fraction (0 t... | java | public double estimateVariance(INDArray data, int ndims) {
INDArray dx = data.sub(mean);
INDArray v = eigenvectors.transpose().mmul(dx.reshape(dx.columns(), 1));
INDArray t2 = Transforms.pow(v, 2);
double fraction = t2.get(NDArrayIndex.interval(0, ndims)).sumNumber().doubleValue();
... | [
"public",
"double",
"estimateVariance",
"(",
"INDArray",
"data",
",",
"int",
"ndims",
")",
"{",
"INDArray",
"dx",
"=",
"data",
".",
"sub",
"(",
"mean",
")",
";",
"INDArray",
"v",
"=",
"eigenvectors",
".",
"transpose",
"(",
")",
".",
"mmul",
"(",
"dx",
... | Estimate the variance of a single record with reduced # of dimensions.
@param data A single record with the same <i>N</i> features as the constructing data set
@param ndims The number of dimensions to include in calculation
@return The fraction (0 to 1) of the total variance covered by the <i>ndims</i> basis set. | [
"Estimate",
"the",
"variance",
"of",
"a",
"single",
"record",
"with",
"reduced",
"#",
"of",
"dimensions",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dimensionalityreduction/PCA.java#L106-L113 |
threerings/narya | core/src/main/java/com/threerings/presents/client/ClientDObjectMgr.java | ClientDObjectMgr.doUnsubscribe | protected void doUnsubscribe (int oid, Subscriber<?> target) {
"""
This is guaranteed to be invoked via the invoker and can safely do main thread type things
like call back to the subscriber.
"""
DObject dobj = _ocache.get(oid);
if (dobj != null) {
dobj.removeSubscriber(target);
... | java | protected void doUnsubscribe (int oid, Subscriber<?> target)
{
DObject dobj = _ocache.get(oid);
if (dobj != null) {
dobj.removeSubscriber(target);
} else if (_client.isFailureLoggable(Client.FailureType.UNSUBSCRIBE_NOT_PROXIED)) {
log.info("Requested to remove subscr... | [
"protected",
"void",
"doUnsubscribe",
"(",
"int",
"oid",
",",
"Subscriber",
"<",
"?",
">",
"target",
")",
"{",
"DObject",
"dobj",
"=",
"_ocache",
".",
"get",
"(",
"oid",
")",
";",
"if",
"(",
"dobj",
"!=",
"null",
")",
"{",
"dobj",
".",
"removeSubscri... | This is guaranteed to be invoked via the invoker and can safely do main thread type things
like call back to the subscriber. | [
"This",
"is",
"guaranteed",
"to",
"be",
"invoked",
"via",
"the",
"invoker",
"and",
"can",
"safely",
"do",
"main",
"thread",
"type",
"things",
"like",
"call",
"back",
"to",
"the",
"subscriber",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/ClientDObjectMgr.java#L439-L449 |
fabric8io/docker-maven-plugin | src/main/java/io/fabric8/maven/docker/util/AuthConfigFactory.java | AuthConfigFactory.createAuthConfig | public AuthConfig createAuthConfig(boolean isPush, boolean skipExtendedAuth, Map authConfig, Settings settings, String user, String registry)
throws MojoExecutionException {
"""
Create an authentication config object which can be used for communication with a Docker registry
The authentication infor... | java | public AuthConfig createAuthConfig(boolean isPush, boolean skipExtendedAuth, Map authConfig, Settings settings, String user, String registry)
throws MojoExecutionException {
AuthConfig ret = createStandardAuthConfig(isPush, authConfig, settings, user, registry);
if (ret != null) {
... | [
"public",
"AuthConfig",
"createAuthConfig",
"(",
"boolean",
"isPush",
",",
"boolean",
"skipExtendedAuth",
",",
"Map",
"authConfig",
",",
"Settings",
"settings",
",",
"String",
"user",
",",
"String",
"registry",
")",
"throws",
"MojoExecutionException",
"{",
"AuthConf... | Create an authentication config object which can be used for communication with a Docker registry
The authentication information is looked up at various places (in this order):
<ul>
<li>From system properties</li>
<li>From the provided map which can contain key-value pairs</li>
<li>From the openshift settings in ~/.c... | [
"Create",
"an",
"authentication",
"config",
"object",
"which",
"can",
"be",
"used",
"for",
"communication",
"with",
"a",
"Docker",
"registry"
] | train | https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/util/AuthConfigFactory.java#L120-L144 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/transform/ChainedTransformationTools.java | ChainedTransformationTools.initialiseChain | public static ResourceTransformationContext initialiseChain(ResourceTransformationContext context, PlaceholderResolver placeholderResolver) {
"""
Call when starting a new chain of model versions. This will copy the {@link ResourceTransformationContext} instance, using the extra resolver
to resolve the children of... | java | public static ResourceTransformationContext initialiseChain(ResourceTransformationContext context, PlaceholderResolver placeholderResolver) {
assert context instanceof ResourceTransformationContextImpl : "Wrong type of context";
ResourceTransformationContextImpl ctx = (ResourceTransformationContextImpl)... | [
"public",
"static",
"ResourceTransformationContext",
"initialiseChain",
"(",
"ResourceTransformationContext",
"context",
",",
"PlaceholderResolver",
"placeholderResolver",
")",
"{",
"assert",
"context",
"instanceof",
"ResourceTransformationContextImpl",
":",
"\"Wrong type of contex... | Call when starting a new chain of model versions. This will copy the {@link ResourceTransformationContext} instance, using the extra resolver
to resolve the children of the placeholder resource.
@param context the context to copy. It should be at a chained placeholder
@param placeholderResolver the extra resolver to u... | [
"Call",
"when",
"starting",
"a",
"new",
"chain",
"of",
"model",
"versions",
".",
"This",
"will",
"copy",
"the",
"{",
"@link",
"ResourceTransformationContext",
"}",
"instance",
"using",
"the",
"extra",
"resolver",
"to",
"resolve",
"the",
"children",
"of",
"the"... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/transform/ChainedTransformationTools.java#L45-L49 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.partialUpdateObjects | public JSONObject partialUpdateObjects(JSONArray objects, RequestOptions requestOptions) throws AlgoliaException {
"""
Partially Override the content of several objects
@param objects the array of objects to update (each object must contains an objectID attribute)
@param requestOptions Options to pass t... | java | public JSONObject partialUpdateObjects(JSONArray objects, RequestOptions requestOptions) throws AlgoliaException {
try {
JSONArray array = new JSONArray();
for (int n = 0; n < objects.length(); n++) {
array.put(partialUpdateObject(objects.getJSONObject(n)));
}
return batch(array, req... | [
"public",
"JSONObject",
"partialUpdateObjects",
"(",
"JSONArray",
"objects",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"try",
"{",
"JSONArray",
"array",
"=",
"new",
"JSONArray",
"(",
")",
";",
"for",
"(",
"int",
"n",
"=",
... | Partially Override the content of several objects
@param objects the array of objects to update (each object must contains an objectID attribute)
@param requestOptions Options to pass to this request | [
"Partially",
"Override",
"the",
"content",
"of",
"several",
"objects"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L417-L427 |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsCheckableDatePanel.java | CmsCheckableDatePanel.addDateWithCheckState | private void addDateWithCheckState(Date date, boolean checkState) {
"""
Add a date with a certain check state.
@param date the date to add.
@param checkState the check state.
"""
addCheckBox(date, checkState);
if (!m_dates.contains(date)) {
m_dates.add(date);
fireValu... | java | private void addDateWithCheckState(Date date, boolean checkState) {
addCheckBox(date, checkState);
if (!m_dates.contains(date)) {
m_dates.add(date);
fireValueChange();
}
} | [
"private",
"void",
"addDateWithCheckState",
"(",
"Date",
"date",
",",
"boolean",
"checkState",
")",
"{",
"addCheckBox",
"(",
"date",
",",
"checkState",
")",
";",
"if",
"(",
"!",
"m_dates",
".",
"contains",
"(",
"date",
")",
")",
"{",
"m_dates",
".",
"add... | Add a date with a certain check state.
@param date the date to add.
@param checkState the check state. | [
"Add",
"a",
"date",
"with",
"a",
"certain",
"check",
"state",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/widgets/serialdate/CmsCheckableDatePanel.java#L285-L292 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/DiagnosticsInner.java | DiagnosticsInner.listSiteDetectorResponsesWithServiceResponseAsync | public Observable<ServiceResponse<Page<DetectorResponseInner>>> listSiteDetectorResponsesWithServiceResponseAsync(final String resourceGroupName, final String siteName) {
"""
List Site Detector Responses.
List Site Detector Responses.
@param resourceGroupName Name of the resource group to which the resource be... | java | public Observable<ServiceResponse<Page<DetectorResponseInner>>> listSiteDetectorResponsesWithServiceResponseAsync(final String resourceGroupName, final String siteName) {
return listSiteDetectorResponsesSinglePageAsync(resourceGroupName, siteName)
.concatMap(new Func1<ServiceResponse<Page<DetectorRe... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"DetectorResponseInner",
">",
">",
">",
"listSiteDetectorResponsesWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"siteName",
")",
"{",
"return",
"listSiteD... | List Site Detector Responses.
List Site Detector Responses.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<DetectorResponseInner> object | [
"List",
"Site",
"Detector",
"Responses",
".",
"List",
"Site",
"Detector",
"Responses",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/DiagnosticsInner.java#L597-L609 |
knowm/XChange | xchange-exx/src/main/java/org/knowm/xchange/exx/EXXAdapters.java | EXXAdapters.adaptTrades | public static Trades adaptTrades(EXXTransaction[] transactions, CurrencyPair currencyPair) {
"""
Adapts a Transaction[] to a Trades Object
@param transactions The Bitstamp transactions
@param currencyPair (e.g. BTC/USD)
@return The XChange Trades
"""
List<Trade> trades = new ArrayList<>();
long la... | java | public static Trades adaptTrades(EXXTransaction[] transactions, CurrencyPair currencyPair) {
List<Trade> trades = new ArrayList<>();
long lastTradeId = 0;
for (EXXTransaction transaction : transactions) {
final long tradeId = transaction.getTid();
if (tradeId > lastTradeId) {
lastTradeId... | [
"public",
"static",
"Trades",
"adaptTrades",
"(",
"EXXTransaction",
"[",
"]",
"transactions",
",",
"CurrencyPair",
"currencyPair",
")",
"{",
"List",
"<",
"Trade",
">",
"trades",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"long",
"lastTradeId",
"=",
"0",
... | Adapts a Transaction[] to a Trades Object
@param transactions The Bitstamp transactions
@param currencyPair (e.g. BTC/USD)
@return The XChange Trades | [
"Adapts",
"a",
"Transaction",
"[]",
"to",
"a",
"Trades",
"Object"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-exx/src/main/java/org/knowm/xchange/exx/EXXAdapters.java#L135-L157 |
beders/Resty | src/main/java/us/monoid/web/Resty.java | Resty.setProxy | public void setProxy(String proxyhost, int proxyport) {
"""
Set the proxy for this instance of Resty.
Note, that the proxy settings will be carried over to Resty instances created by this instance only if you used
new Resty(Option.proxy(...))!
@param proxyhost name of the host
@param proxyport port to be use... | java | public void setProxy(String proxyhost, int proxyport) {
proxy = new java.net.Proxy(java.net.Proxy.Type.HTTP, new InetSocketAddress(proxyhost, proxyport));
} | [
"public",
"void",
"setProxy",
"(",
"String",
"proxyhost",
",",
"int",
"proxyport",
")",
"{",
"proxy",
"=",
"new",
"java",
".",
"net",
".",
"Proxy",
"(",
"java",
".",
"net",
".",
"Proxy",
".",
"Type",
".",
"HTTP",
",",
"new",
"InetSocketAddress",
"(",
... | Set the proxy for this instance of Resty.
Note, that the proxy settings will be carried over to Resty instances created by this instance only if you used
new Resty(Option.proxy(...))!
@param proxyhost name of the host
@param proxyport port to be used | [
"Set",
"the",
"proxy",
"for",
"this",
"instance",
"of",
"Resty",
".",
"Note",
"that",
"the",
"proxy",
"settings",
"will",
"be",
"carried",
"over",
"to",
"Resty",
"instances",
"created",
"by",
"this",
"instance",
"only",
"if",
"you",
"used",
"new",
"Resty",... | train | https://github.com/beders/Resty/blob/4493603e9689c942cc3e53b9c5018010e414a364/src/main/java/us/monoid/web/Resty.java#L678-L680 |
aalmiray/Json-lib | src/main/jdk15/net/sf/json/JSONArray.java | JSONArray._fromArray | private static JSONArray _fromArray( Enum e, JsonConfig jsonConfig ) {
"""
Construct a JSONArray from an Enum value.
@param e A enum value.
@throws JSONException If there is a syntax error.
"""
if( !addInstance( e ) ){
try{
return jsonConfig.getCycleDetectionStrategy()
... | java | private static JSONArray _fromArray( Enum e, JsonConfig jsonConfig ) {
if( !addInstance( e ) ){
try{
return jsonConfig.getCycleDetectionStrategy()
.handleRepeatedReferenceAsArray( e );
}catch( JSONException jsone ){
removeInstance( e );
fireE... | [
"private",
"static",
"JSONArray",
"_fromArray",
"(",
"Enum",
"e",
",",
"JsonConfig",
"jsonConfig",
")",
"{",
"if",
"(",
"!",
"addInstance",
"(",
"e",
")",
")",
"{",
"try",
"{",
"return",
"jsonConfig",
".",
"getCycleDetectionStrategy",
"(",
")",
".",
"handl... | Construct a JSONArray from an Enum value.
@param e A enum value.
@throws JSONException If there is a syntax error. | [
"Construct",
"a",
"JSONArray",
"from",
"an",
"Enum",
"value",
"."
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/jdk15/net/sf/json/JSONArray.java#L816-L847 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.beginCreateOrUpdateMultiRolePoolAsync | public Observable<WorkerPoolResourceInner> beginCreateOrUpdateMultiRolePoolAsync(String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) {
"""
Create or update a multi-role pool.
Create or update a multi-role pool.
@param resourceGroupName Name of the resource group to which the r... | java | public Observable<WorkerPoolResourceInner> beginCreateOrUpdateMultiRolePoolAsync(String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) {
return beginCreateOrUpdateMultiRolePoolWithServiceResponseAsync(resourceGroupName, name, multiRolePoolEnvelope).map(new Func1<ServiceResponse<W... | [
"public",
"Observable",
"<",
"WorkerPoolResourceInner",
">",
"beginCreateOrUpdateMultiRolePoolAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"WorkerPoolResourceInner",
"multiRolePoolEnvelope",
")",
"{",
"return",
"beginCreateOrUpdateMultiRolePoolWithServi... | Create or update a multi-role pool.
Create or update a multi-role pool.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@param multiRolePoolEnvelope Properties of the multi-role pool.
@throws IllegalArgumentException thrown if paramete... | [
"Create",
"or",
"update",
"a",
"multi",
"-",
"role",
"pool",
".",
"Create",
"or",
"update",
"a",
"multi",
"-",
"role",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L2383-L2390 |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/Cartographer.java | Cartographer.toJson | public void toJson(Map<?, ?> map, Writer writer) throws IOException {
"""
Serializes the map into it's json representation into the provided {@link Writer}. If you want
to retrieve the json as a string, use {@link #toJson(Map)} instead.
"""
if (map == null) {
throw new IllegalArgumentException("map ... | java | public void toJson(Map<?, ?> map, Writer writer) throws IOException {
if (map == null) {
throw new IllegalArgumentException("map == null");
}
if (writer == null) {
throw new IllegalArgumentException("writer == null");
}
JsonWriter jsonWriter = new JsonWriter(writer);
jsonWriter.setL... | [
"public",
"void",
"toJson",
"(",
"Map",
"<",
"?",
",",
"?",
">",
"map",
",",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"if",
"(",
"map",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"map == null\"",
")",
";",
... | Serializes the map into it's json representation into the provided {@link Writer}. If you want
to retrieve the json as a string, use {@link #toJson(Map)} instead. | [
"Serializes",
"the",
"map",
"into",
"it",
"s",
"json",
"representation",
"into",
"the",
"provided",
"{"
] | train | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/Cartographer.java#L105-L123 |
groupon/odo | proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java | OverrideService.removeOverride | public void removeOverride(int overrideId, int pathId, Integer ordinal, String clientUUID) {
"""
Remove specified override id from enabled overrides for path
@param overrideId ID of override to remove
@param pathId ID of path containing override
@param ordinal index to the instance of the enabled override
@p... | java | public void removeOverride(int overrideId, int pathId, Integer ordinal, String clientUUID) {
// TODO: reorder priorities after removal
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
int enabledId = getEnabledEndpoint(pathId, override... | [
"public",
"void",
"removeOverride",
"(",
"int",
"overrideId",
",",
"int",
"pathId",
",",
"Integer",
"ordinal",
",",
"String",
"clientUUID",
")",
"{",
"// TODO: reorder priorities after removal",
"PreparedStatement",
"statement",
"=",
"null",
";",
"try",
"(",
"Connec... | Remove specified override id from enabled overrides for path
@param overrideId ID of override to remove
@param pathId ID of path containing override
@param ordinal index to the instance of the enabled override
@param clientUUID UUID of client | [
"Remove",
"specified",
"override",
"id",
"from",
"enabled",
"overrides",
"for",
"path"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/OverrideService.java#L291-L312 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/sampling/StratifiedSampling.java | StratifiedSampling.optimumSampleSize | public static AssociativeArray optimumSampleSize(int n, AssociativeArray populationNh, AssociativeArray populationStdh) {
"""
Returns the optimum sample size per strata under Neyman Allocation
@param n
@param populationNh
@param populationStdh
@return
"""
AssociativeArray nh = new AssociativeArra... | java | public static AssociativeArray optimumSampleSize(int n, AssociativeArray populationNh, AssociativeArray populationStdh) {
AssociativeArray nh = new AssociativeArray();
double sumNhSh = 0.0;
for(Map.Entry<Object, Object> entry : populationNh.entrySet()) {
Object strata = entr... | [
"public",
"static",
"AssociativeArray",
"optimumSampleSize",
"(",
"int",
"n",
",",
"AssociativeArray",
"populationNh",
",",
"AssociativeArray",
"populationStdh",
")",
"{",
"AssociativeArray",
"nh",
"=",
"new",
"AssociativeArray",
"(",
")",
";",
"double",
"sumNhSh",
... | Returns the optimum sample size per strata under Neyman Allocation
@param n
@param populationNh
@param populationStdh
@return | [
"Returns",
"the",
"optimum",
"sample",
"size",
"per",
"strata",
"under",
"Neyman",
"Allocation"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/sampling/StratifiedSampling.java#L215-L245 |
killbill/killbill | util/src/main/java/org/killbill/billing/util/callcontext/InternalCallContextFactory.java | InternalCallContextFactory.createInternalTenantContext | public InternalTenantContext createInternalTenantContext(final Long tenantRecordId, @Nullable final Long accountRecordId) {
"""
Create an internal tenant callcontext
@param tenantRecordId tenant_record_id (cannot be null)
@param accountRecordId account_record_id (cannot be null for INSERT operations)
@return... | java | public InternalTenantContext createInternalTenantContext(final Long tenantRecordId, @Nullable final Long accountRecordId) {
populateMDCContext(null, accountRecordId, tenantRecordId);
if (accountRecordId == null) {
return new InternalTenantContext(tenantRecordId);
} else {
... | [
"public",
"InternalTenantContext",
"createInternalTenantContext",
"(",
"final",
"Long",
"tenantRecordId",
",",
"@",
"Nullable",
"final",
"Long",
"accountRecordId",
")",
"{",
"populateMDCContext",
"(",
"null",
",",
"accountRecordId",
",",
"tenantRecordId",
")",
";",
"i... | Create an internal tenant callcontext
@param tenantRecordId tenant_record_id (cannot be null)
@param accountRecordId account_record_id (cannot be null for INSERT operations)
@return internal tenant callcontext | [
"Create",
"an",
"internal",
"tenant",
"callcontext"
] | train | https://github.com/killbill/killbill/blob/6457b485fb32a182c76197a83f428123331f1380/util/src/main/java/org/killbill/billing/util/callcontext/InternalCallContextFactory.java#L156-L167 |
mnlipp/jgrapes | org.jgrapes.io/src/org/jgrapes/io/FileStorage.java | FileStorage.onSaveOutput | @Handler
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
public void onSaveOutput(SaveOutput event) throws InterruptedException {
"""
Opens a file for writing using the properties of the event. All data from
subsequent {@link Output} events is written to the file.
The end of record flag is igno... | java | @Handler
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
public void onSaveOutput(SaveOutput event) throws InterruptedException {
if (!Arrays.asList(event.options())
.contains(StandardOpenOption.WRITE)) {
throw new IllegalArgumentException(
"File must be... | [
"@",
"Handler",
"@",
"SuppressWarnings",
"(",
"\"PMD.AvoidInstantiatingObjectsInLoops\"",
")",
"public",
"void",
"onSaveOutput",
"(",
"SaveOutput",
"event",
")",
"throws",
"InterruptedException",
"{",
"if",
"(",
"!",
"Arrays",
".",
"asList",
"(",
"event",
".",
"op... | Opens a file for writing using the properties of the event. All data from
subsequent {@link Output} events is written to the file.
The end of record flag is ignored.
@param event the event
@throws InterruptedException if the execution was interrupted | [
"Opens",
"a",
"file",
"for",
"writing",
"using",
"the",
"properties",
"of",
"the",
"event",
".",
"All",
"data",
"from",
"subsequent",
"{",
"@link",
"Output",
"}",
"events",
"is",
"written",
"to",
"the",
"file",
".",
"The",
"end",
"of",
"record",
"flag",
... | train | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.io/src/org/jgrapes/io/FileStorage.java#L343-L359 |
unic/neba | spring/src/main/java/io/neba/spring/mvc/MvcServlet.java | MvcServlet.enableMvc | public void enableMvc(ConfigurableListableBeanFactory factory, BundleContext context) {
"""
Enables MVC capabilities in the given factory by injecting a {@link BundleSpecificDispatcherServlet}.
@param factory must not be <code>null</code>.
@param context must not be <code>null</code>.
"""
if (facto... | java | public void enableMvc(ConfigurableListableBeanFactory factory, BundleContext context) {
if (factory == null) {
throw new IllegalArgumentException("Method argument factory must not be null.");
}
if (context == null) {
throw new IllegalArgumentException("Method argument con... | [
"public",
"void",
"enableMvc",
"(",
"ConfigurableListableBeanFactory",
"factory",
",",
"BundleContext",
"context",
")",
"{",
"if",
"(",
"factory",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Method argument factory must not be null.\"",
"... | Enables MVC capabilities in the given factory by injecting a {@link BundleSpecificDispatcherServlet}.
@param factory must not be <code>null</code>.
@param context must not be <code>null</code>. | [
"Enables",
"MVC",
"capabilities",
"in",
"the",
"given",
"factory",
"by",
"injecting",
"a",
"{",
"@link",
"BundleSpecificDispatcherServlet",
"}",
"."
] | train | https://github.com/unic/neba/blob/4d762e60112a1fcb850926a56a9843d5aa424c4b/spring/src/main/java/io/neba/spring/mvc/MvcServlet.java#L75-L92 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/CopyConvertersHandler.java | CopyConvertersHandler.init | public void init(BaseField field, Converter converterDest, Converter converterSource, boolean bFreeChainedConverters) {
"""
Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param converterDest The destination converter.
@param converterSource The source conve... | java | public void init(BaseField field, Converter converterDest, Converter converterSource, boolean bFreeChainedConverters)
{
m_converterDest = converterDest;
m_converterSource = converterSource;
m_bFreeChainedConverters = bFreeChainedConverters;
super.init(field);
} | [
"public",
"void",
"init",
"(",
"BaseField",
"field",
",",
"Converter",
"converterDest",
",",
"Converter",
"converterSource",
",",
"boolean",
"bFreeChainedConverters",
")",
"{",
"m_converterDest",
"=",
"converterDest",
";",
"m_converterSource",
"=",
"converterSource",
... | Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param converterDest The destination converter.
@param converterSource The source converter. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/CopyConvertersHandler.java#L76-L82 |
axibase/atsd-api-java | src/main/java/com/axibase/tsd/client/AtsdPropertyExtractor.java | AtsdPropertyExtractor.getAsBoolean | public boolean getAsBoolean(final String name, final boolean defaultValue) {
"""
Get property by name as boolean value
@param name name of property without the prefix.
@param defaultValue default value for case when the property is not set.
@return property's value.
"""
return AtsdUtil.get... | java | public boolean getAsBoolean(final String name, final boolean defaultValue) {
return AtsdUtil.getPropertyBoolValue(fullName(name), clientProperties, defaultValue);
} | [
"public",
"boolean",
"getAsBoolean",
"(",
"final",
"String",
"name",
",",
"final",
"boolean",
"defaultValue",
")",
"{",
"return",
"AtsdUtil",
".",
"getPropertyBoolValue",
"(",
"fullName",
"(",
"name",
")",
",",
"clientProperties",
",",
"defaultValue",
")",
";",
... | Get property by name as boolean value
@param name name of property without the prefix.
@param defaultValue default value for case when the property is not set.
@return property's value. | [
"Get",
"property",
"by",
"name",
"as",
"boolean",
"value"
] | train | https://github.com/axibase/atsd-api-java/blob/63a0767d08b202dad2ebef4372ff947d6fba0246/src/main/java/com/axibase/tsd/client/AtsdPropertyExtractor.java#L45-L47 |
GistLabs/mechanize | src/main/java/com/gistlabs/mechanize/util/apache/URLEncodedUtils.java | URLEncodedUtils.encUserInfo | static String encUserInfo(final String content, final Charset charset) {
"""
Encode a String using the {@link #USERINFO} set of characters.
<p>
Used by URIBuilder to encode the userinfo segment.
@param content the string to encode, does not convert space to '+'
@param charset the charset to use
@return the ... | java | static String encUserInfo(final String content, final Charset charset) {
return urlencode(content, charset, USERINFO, false);
} | [
"static",
"String",
"encUserInfo",
"(",
"final",
"String",
"content",
",",
"final",
"Charset",
"charset",
")",
"{",
"return",
"urlencode",
"(",
"content",
",",
"charset",
",",
"USERINFO",
",",
"false",
")",
";",
"}"
] | Encode a String using the {@link #USERINFO} set of characters.
<p>
Used by URIBuilder to encode the userinfo segment.
@param content the string to encode, does not convert space to '+'
@param charset the charset to use
@return the encoded string | [
"Encode",
"a",
"String",
"using",
"the",
"{",
"@link",
"#USERINFO",
"}",
"set",
"of",
"characters",
".",
"<p",
">",
"Used",
"by",
"URIBuilder",
"to",
"encode",
"the",
"userinfo",
"segment",
"."
] | train | https://github.com/GistLabs/mechanize/blob/32ddd0774439a4c08513c05d7ac7416a3899efed/src/main/java/com/gistlabs/mechanize/util/apache/URLEncodedUtils.java#L494-L496 |
apereo/cas | core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java | WebUtils.putServiceResponseIntoRequestScope | public static void putServiceResponseIntoRequestScope(final RequestContext requestContext, final Response response) {
"""
Put service response into request scope.
@param requestContext the request context
@param response the response
"""
requestContext.getRequestScope().put("parameters", resp... | java | public static void putServiceResponseIntoRequestScope(final RequestContext requestContext, final Response response) {
requestContext.getRequestScope().put("parameters", response.getAttributes());
putServiceRedirectUrl(requestContext, response.getUrl());
} | [
"public",
"static",
"void",
"putServiceResponseIntoRequestScope",
"(",
"final",
"RequestContext",
"requestContext",
",",
"final",
"Response",
"response",
")",
"{",
"requestContext",
".",
"getRequestScope",
"(",
")",
".",
"put",
"(",
"\"parameters\"",
",",
"response",
... | Put service response into request scope.
@param requestContext the request context
@param response the response | [
"Put",
"service",
"response",
"into",
"request",
"scope",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java#L762-L765 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.subscription_subscriptionType_GET | public OvhSubscription subscription_subscriptionType_GET(String subscriptionType) throws IOException {
"""
Get this object properties
REST: GET /me/subscription/{subscriptionType}
@param subscriptionType [required] The type of subscription
"""
String qPath = "/me/subscription/{subscriptionType}";
Strin... | java | public OvhSubscription subscription_subscriptionType_GET(String subscriptionType) throws IOException {
String qPath = "/me/subscription/{subscriptionType}";
StringBuilder sb = path(qPath, subscriptionType);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhSubscription.class);
} | [
"public",
"OvhSubscription",
"subscription_subscriptionType_GET",
"(",
"String",
"subscriptionType",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/subscription/{subscriptionType}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"subscrip... | Get this object properties
REST: GET /me/subscription/{subscriptionType}
@param subscriptionType [required] The type of subscription | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2612-L2617 |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.hoverObjectChanged | protected void hoverObjectChanged (Object oldHover, Object newHover) {
"""
A place for subclasses to react to the hover object changing.
One of the supplied arguments may be null.
"""
// deal with objects that care about being hovered over
if (oldHover instanceof SceneObject) {
Sce... | java | protected void hoverObjectChanged (Object oldHover, Object newHover)
{
// deal with objects that care about being hovered over
if (oldHover instanceof SceneObject) {
SceneObject oldhov = (SceneObject)oldHover;
if (oldhov.setHovered(false)) {
_remgr.invalidateR... | [
"protected",
"void",
"hoverObjectChanged",
"(",
"Object",
"oldHover",
",",
"Object",
"newHover",
")",
"{",
"// deal with objects that care about being hovered over",
"if",
"(",
"oldHover",
"instanceof",
"SceneObject",
")",
"{",
"SceneObject",
"oldhov",
"=",
"(",
"SceneO... | A place for subclasses to react to the hover object changing.
One of the supplied arguments may be null. | [
"A",
"place",
"for",
"subclasses",
"to",
"react",
"to",
"the",
"hover",
"object",
"changing",
".",
"One",
"of",
"the",
"supplied",
"arguments",
"may",
"be",
"null",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L1129-L1148 |
io7m/jproperties | com.io7m.jproperties.core/src/main/java/com/io7m/jproperties/JProperties.java | JProperties.getBigInteger | public static BigInteger getBigInteger(
final Properties properties,
final String key)
throws JPropertyNonexistent,
JPropertyIncorrectType {
"""
<p> Returns the integer value associated with {@code key} in the
properties referenced by {@code properties}. </p>
@param properties The loaded proper... | java | public static BigInteger getBigInteger(
final Properties properties,
final String key)
throws JPropertyNonexistent,
JPropertyIncorrectType
{
Objects.requireNonNull(properties, "Properties");
Objects.requireNonNull(key, "Key");
final String text = getString(properties, key);
return par... | [
"public",
"static",
"BigInteger",
"getBigInteger",
"(",
"final",
"Properties",
"properties",
",",
"final",
"String",
"key",
")",
"throws",
"JPropertyNonexistent",
",",
"JPropertyIncorrectType",
"{",
"Objects",
".",
"requireNonNull",
"(",
"properties",
",",
"\"Properti... | <p> Returns the integer value associated with {@code key} in the
properties referenced by {@code properties}. </p>
@param properties The loaded properties.
@param key The requested key.
@return The value associated with the key, parsed as an integer.
@throws JPropertyNonexistent If the key does not exist in... | [
"<p",
">",
"Returns",
"the",
"integer",
"value",
"associated",
"with",
"{",
"@code",
"key",
"}",
"in",
"the",
"properties",
"referenced",
"by",
"{",
"@code",
"properties",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/io7m/jproperties/blob/b188b8fd87b3b078f1e2b564a9ed5996db0becfd/com.io7m.jproperties.core/src/main/java/com/io7m/jproperties/JProperties.java#L140-L151 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/config/ManagedBeanBuilder.java | ManagedBeanBuilder.getNarrowestScope | private String getNarrowestScope(FacesContext facesContext, String valueExpression) {
"""
Gets the narrowest scope to which the ValueExpression points.
@param facesContext
@param valueExpression
@return
"""
List<String> expressions = extractExpressions(valueExpression);
// exclude NONE scope... | java | private String getNarrowestScope(FacesContext facesContext, String valueExpression)
{
List<String> expressions = extractExpressions(valueExpression);
// exclude NONE scope, if there are more than one ValueExpressions (see Spec for details)
String narrowestScope = expressions.size() == 1 ? NO... | [
"private",
"String",
"getNarrowestScope",
"(",
"FacesContext",
"facesContext",
",",
"String",
"valueExpression",
")",
"{",
"List",
"<",
"String",
">",
"expressions",
"=",
"extractExpressions",
"(",
"valueExpression",
")",
";",
"// exclude NONE scope, if there are more tha... | Gets the narrowest scope to which the ValueExpression points.
@param facesContext
@param valueExpression
@return | [
"Gets",
"the",
"narrowest",
"scope",
"to",
"which",
"the",
"ValueExpression",
"points",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/config/ManagedBeanBuilder.java#L457-L480 |
recommenders/rival | rival-evaluate/src/main/java/net/recommenders/rival/evaluation/statistics/EffectSize.java | EffectSize.getEffectSize | public double getEffectSize(final String method) {
"""
Computes the effect size according to different methods: d and dLS are
adequate for not paired samples, whereas pairedT is better for paired
samples.
@param method one of "d", "dLS", "pairedT"
@return the effect size
"""
if ("d".equals(method... | java | public double getEffectSize(final String method) {
if ("d".equals(method)) {
return getCohenD(baselineMetricPerDimension, testMetricPerDimension, false);
} else if ("dLS".equals(method)) {
return getCohenD(baselineMetricPerDimension, testMetricPerDimension, true);
} else ... | [
"public",
"double",
"getEffectSize",
"(",
"final",
"String",
"method",
")",
"{",
"if",
"(",
"\"d\"",
".",
"equals",
"(",
"method",
")",
")",
"{",
"return",
"getCohenD",
"(",
"baselineMetricPerDimension",
",",
"testMetricPerDimension",
",",
"false",
")",
";",
... | Computes the effect size according to different methods: d and dLS are
adequate for not paired samples, whereas pairedT is better for paired
samples.
@param method one of "d", "dLS", "pairedT"
@return the effect size | [
"Computes",
"the",
"effect",
"size",
"according",
"to",
"different",
"methods",
":",
"d",
"and",
"dLS",
"are",
"adequate",
"for",
"not",
"paired",
"samples",
"whereas",
"pairedT",
"is",
"better",
"for",
"paired",
"samples",
"."
] | train | https://github.com/recommenders/rival/blob/6ee8223e91810ae1c6052899595af3906e0c34c6/rival-evaluate/src/main/java/net/recommenders/rival/evaluation/statistics/EffectSize.java#L64-L73 |
Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournal.java | UfsJournal.catchUp | private synchronized long catchUp(long nextSequenceNumber) {
"""
Reads and applies all journal entries starting from the specified sequence number.
@param nextSequenceNumber the sequence number to continue catching up from
@return the next sequence number after the final sequence number read
"""
Journa... | java | private synchronized long catchUp(long nextSequenceNumber) {
JournalReader journalReader = new UfsJournalReader(this, nextSequenceNumber, true);
try {
return catchUp(journalReader);
} finally {
try {
journalReader.close();
} catch (IOException e) {
LOG.warn("Failed to close... | [
"private",
"synchronized",
"long",
"catchUp",
"(",
"long",
"nextSequenceNumber",
")",
"{",
"JournalReader",
"journalReader",
"=",
"new",
"UfsJournalReader",
"(",
"this",
",",
"nextSequenceNumber",
",",
"true",
")",
";",
"try",
"{",
"return",
"catchUp",
"(",
"jou... | Reads and applies all journal entries starting from the specified sequence number.
@param nextSequenceNumber the sequence number to continue catching up from
@return the next sequence number after the final sequence number read | [
"Reads",
"and",
"applies",
"all",
"journal",
"entries",
"starting",
"from",
"the",
"specified",
"sequence",
"number",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournal.java#L349-L360 |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassInfo.java | ClassInfo.getClassesWithAnnotation | public ClassInfoList getClassesWithAnnotation() {
"""
Get the classes that have this class as an annotation.
@return A list of standard classes and non-annotation interfaces that are annotated by this class, if this is
an annotation class, or the empty list if none. Also handles the {@link Inherited} meta-anno... | java | public ClassInfoList getClassesWithAnnotation() {
if (!scanResult.scanSpec.enableAnnotationInfo) {
throw new IllegalArgumentException("Please call ClassGraph#enableAnnotationInfo() before #scan()");
}
if (!isAnnotation) {
throw new IllegalArgumentException("Class is not a... | [
"public",
"ClassInfoList",
"getClassesWithAnnotation",
"(",
")",
"{",
"if",
"(",
"!",
"scanResult",
".",
"scanSpec",
".",
"enableAnnotationInfo",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Please call ClassGraph#enableAnnotationInfo() before #scan()\"",
"... | Get the classes that have this class as an annotation.
@return A list of standard classes and non-annotation interfaces that are annotated by this class, if this is
an annotation class, or the empty list if none. Also handles the {@link Inherited} meta-annotation,
which causes an annotation on a class to be inherited ... | [
"Get",
"the",
"classes",
"that",
"have",
"this",
"class",
"as",
"an",
"annotation",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassInfo.java#L1691-L1716 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/transform/FourierTransform.java | FourierTransform.convolve | private static void convolve(double[] xreal, double[] ximag, double[] yreal, double[] yimag, double[] outreal, double[] outimag) {
"""
/*
Computes the circular convolution of the given complex vectors. Each vector's length must be the same.
"""
// if (xreal.length != ximag.length || xreal.length != yr... | java | private static void convolve(double[] xreal, double[] ximag, double[] yreal, double[] yimag, double[] outreal, double[] outimag) {
// if (xreal.length != ximag.length || xreal.length != yreal.length || yreal.length != yimag.length || xreal.length != outreal.length || outreal.length != outimag.length)
// ... | [
"private",
"static",
"void",
"convolve",
"(",
"double",
"[",
"]",
"xreal",
",",
"double",
"[",
"]",
"ximag",
",",
"double",
"[",
"]",
"yreal",
",",
"double",
"[",
"]",
"yimag",
",",
"double",
"[",
"]",
"outreal",
",",
"double",
"[",
"]",
"outimag",
... | /*
Computes the circular convolution of the given complex vectors. Each vector's length must be the same. | [
"/",
"*",
"Computes",
"the",
"circular",
"convolution",
"of",
"the",
"given",
"complex",
"vectors",
".",
"Each",
"vector",
"s",
"length",
"must",
"be",
"the",
"same",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/transform/FourierTransform.java#L357-L377 |
overturetool/overture | core/parser/src/main/java/org/overture/parser/syntax/SyntaxReader.java | SyntaxReader.throwMessage | protected void throwMessage(int number, String message)
throws ParserException, LexException {
"""
Raise a {@link ParserException} at the current location.
@param number
The error number.
@param message
The error message.
@throws ParserException
@throws LexException
"""
throw new ParserException(n... | java | protected void throwMessage(int number, String message)
throws ParserException, LexException
{
throw new ParserException(number, message, lastToken().location, reader.getTokensRead());
} | [
"protected",
"void",
"throwMessage",
"(",
"int",
"number",
",",
"String",
"message",
")",
"throws",
"ParserException",
",",
"LexException",
"{",
"throw",
"new",
"ParserException",
"(",
"number",
",",
"message",
",",
"lastToken",
"(",
")",
".",
"location",
",",... | Raise a {@link ParserException} at the current location.
@param number
The error number.
@param message
The error message.
@throws ParserException
@throws LexException | [
"Raise",
"a",
"{",
"@link",
"ParserException",
"}",
"at",
"the",
"current",
"location",
"."
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/parser/src/main/java/org/overture/parser/syntax/SyntaxReader.java#L489-L493 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/jdbc/internal/JDBCDrivers.java | JDBCDrivers.tryToLoad | private static String tryToLoad(Class<?> type, ClassLoader loader, String... classNames) {
"""
Attempt to load the specified class names, returning the first that successfully loads
and is an instance of the specified type.
@param type data source interface
@param loader class loader
@param classNames ordere... | java | private static String tryToLoad(Class<?> type, ClassLoader loader, String... classNames) {
final boolean trace = TraceComponent.isAnyTracingEnabled();
for (String className : classNames)
try {
Class<?> c = loader.loadClass(className);
boolean isInstance = typ... | [
"private",
"static",
"String",
"tryToLoad",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"ClassLoader",
"loader",
",",
"String",
"...",
"classNames",
")",
"{",
"final",
"boolean",
"trace",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"for",... | Attempt to load the specified class names, returning the first that successfully loads
and is an instance of the specified type.
@param type data source interface
@param loader class loader
@param classNames ordered list of class names to check
@return the first class name that successfully loads and is an instance of... | [
"Attempt",
"to",
"load",
"the",
"specified",
"class",
"names",
"returning",
"the",
"first",
"that",
"successfully",
"loads",
"and",
"is",
"an",
"instance",
"of",
"the",
"specified",
"type",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/jdbc/internal/JDBCDrivers.java#L504-L520 |
tvesalainen/util | util/src/main/java/org/vesalainen/navi/ElasticChain.java | ElasticChain.horizontalForce | public double horizontalForce(Double T, double d) {
"""
Horizontal force for a given fairlead tension T
@param T Fairlead tension
@param d depth
@return
"""
return AE*Math.sqrt(Math.pow(T/AE+1, 2)-2*w*d/AE)-AE;
} | java | public double horizontalForce(Double T, double d)
{
return AE*Math.sqrt(Math.pow(T/AE+1, 2)-2*w*d/AE)-AE;
} | [
"public",
"double",
"horizontalForce",
"(",
"Double",
"T",
",",
"double",
"d",
")",
"{",
"return",
"AE",
"*",
"Math",
".",
"sqrt",
"(",
"Math",
".",
"pow",
"(",
"T",
"/",
"AE",
"+",
"1",
",",
"2",
")",
"-",
"2",
"*",
"w",
"*",
"d",
"/",
"AE",... | Horizontal force for a given fairlead tension T
@param T Fairlead tension
@param d depth
@return | [
"Horizontal",
"force",
"for",
"a",
"given",
"fairlead",
"tension",
"T"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/navi/ElasticChain.java#L50-L53 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/opengl/InternalTextureLoader.java | InternalTextureLoader.createTexture | public Texture createTexture(final int width, final int height) throws IOException {
"""
Create an empty texture
@param width The width of the new texture
@param height The height of the new texture
@return The created empty texture
@throws IOException Indicates a failure to create the texture on the graphic... | java | public Texture createTexture(final int width, final int height) throws IOException {
return createTexture(width, height, SGL.GL_NEAREST);
} | [
"public",
"Texture",
"createTexture",
"(",
"final",
"int",
"width",
",",
"final",
"int",
"height",
")",
"throws",
"IOException",
"{",
"return",
"createTexture",
"(",
"width",
",",
"height",
",",
"SGL",
".",
"GL_NEAREST",
")",
";",
"}"
] | Create an empty texture
@param width The width of the new texture
@param height The height of the new texture
@return The created empty texture
@throws IOException Indicates a failure to create the texture on the graphics hardware | [
"Create",
"an",
"empty",
"texture"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/opengl/InternalTextureLoader.java#L359-L361 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ExamplesImpl.java | ExamplesImpl.batchAsync | public Observable<List<BatchLabelExample>> batchAsync(UUID appId, String versionId, List<ExampleLabelObject> exampleLabelObjectArray) {
"""
Adds a batch of labeled examples to the application.
@param appId The application ID.
@param versionId The version ID.
@param exampleLabelObjectArray Array of examples.
... | java | public Observable<List<BatchLabelExample>> batchAsync(UUID appId, String versionId, List<ExampleLabelObject> exampleLabelObjectArray) {
return batchWithServiceResponseAsync(appId, versionId, exampleLabelObjectArray).map(new Func1<ServiceResponse<List<BatchLabelExample>>, List<BatchLabelExample>>() {
... | [
"public",
"Observable",
"<",
"List",
"<",
"BatchLabelExample",
">",
">",
"batchAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"List",
"<",
"ExampleLabelObject",
">",
"exampleLabelObjectArray",
")",
"{",
"return",
"batchWithServiceResponseAsync",
"(",... | Adds a batch of labeled examples to the application.
@param appId The application ID.
@param versionId The version ID.
@param exampleLabelObjectArray Array of examples.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List<BatchLabelExample> object | [
"Adds",
"a",
"batch",
"of",
"labeled",
"examples",
"to",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ExamplesImpl.java#L216-L223 |
openbase/jul | extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/TimestampProcessor.java | TimestampProcessor.updateTimestamp | public static <M extends MessageOrBuilder> M updateTimestamp(final long milliseconds, final M messageOrBuilder) throws CouldNotPerformException {
"""
Method updates the timestamp field of the given message with the given timestamp.
@param <M> the message type of the message to milliseconds.
@param... | java | public static <M extends MessageOrBuilder> M updateTimestamp(final long milliseconds, final M messageOrBuilder) throws CouldNotPerformException {
return updateTimestamp(milliseconds, messageOrBuilder, TimeUnit.MILLISECONDS);
} | [
"public",
"static",
"<",
"M",
"extends",
"MessageOrBuilder",
">",
"M",
"updateTimestamp",
"(",
"final",
"long",
"milliseconds",
",",
"final",
"M",
"messageOrBuilder",
")",
"throws",
"CouldNotPerformException",
"{",
"return",
"updateTimestamp",
"(",
"milliseconds",
"... | Method updates the timestamp field of the given message with the given timestamp.
@param <M> the message type of the message to milliseconds.
@param milliseconds the time to update
@param messageOrBuilder the message
@return the updated message
@throws CouldNotPerformException is thrown in case the ... | [
"Method",
"updates",
"the",
"timestamp",
"field",
"of",
"the",
"given",
"message",
"with",
"the",
"given",
"timestamp",
"."
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/TimestampProcessor.java#L83-L85 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/Hdf5Archive.java | Hdf5Archive.readAttributeAsFixedLengthString | private String readAttributeAsFixedLengthString(Attribute attribute, int bufferSize)
throws UnsupportedKerasConfigurationException {
"""
Read attribute of fixed buffer size as string.
@param attribute HDF5 attribute to read as string.
@return Fixed-length string read from HDF5 attribute
@throws Un... | java | private String readAttributeAsFixedLengthString(Attribute attribute, int bufferSize)
throws UnsupportedKerasConfigurationException {
synchronized (Hdf5Archive.LOCK_OBJECT) {
VarLenType vl = attribute.getVarLenType();
byte[] attrBuffer = new byte[bufferSize];
ByteP... | [
"private",
"String",
"readAttributeAsFixedLengthString",
"(",
"Attribute",
"attribute",
",",
"int",
"bufferSize",
")",
"throws",
"UnsupportedKerasConfigurationException",
"{",
"synchronized",
"(",
"Hdf5Archive",
".",
"LOCK_OBJECT",
")",
"{",
"VarLenType",
"vl",
"=",
"at... | Read attribute of fixed buffer size as string.
@param attribute HDF5 attribute to read as string.
@return Fixed-length string read from HDF5 attribute
@throws UnsupportedKerasConfigurationException Unsupported Keras config | [
"Read",
"attribute",
"of",
"fixed",
"buffer",
"size",
"as",
"string",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/Hdf5Archive.java#L441-L452 |
pressgang-ccms/PressGangCCMSContentSpecProcessor | src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java | ContentSpecParser.parseEmptyOrCommentLine | protected boolean parseEmptyOrCommentLine(final ParserData parserData, final String line) {
"""
Processes a line that represents a comment or an empty line in a Content Specification.
@param parserData
@param line The line to be processed.
@return True if the line was processed without errors, otherwise... | java | protected boolean parseEmptyOrCommentLine(final ParserData parserData, final String line) {
if (isBlankLine(line)) {
if (parserData.getCurrentLevel().getLevelType() == LevelType.BASE) {
parserData.getContentSpec().appendChild(new TextNode("\n"));
} else {
... | [
"protected",
"boolean",
"parseEmptyOrCommentLine",
"(",
"final",
"ParserData",
"parserData",
",",
"final",
"String",
"line",
")",
"{",
"if",
"(",
"isBlankLine",
"(",
"line",
")",
")",
"{",
"if",
"(",
"parserData",
".",
"getCurrentLevel",
"(",
")",
".",
"getL... | Processes a line that represents a comment or an empty line in a Content Specification.
@param parserData
@param line The line to be processed.
@return True if the line was processed without errors, otherwise false. | [
"Processes",
"a",
"line",
"that",
"represents",
"a",
"comment",
"or",
"an",
"empty",
"line",
"in",
"a",
"Content",
"Specification",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java#L582-L598 |
wcm-io/wcm-io-handler | media/src/main/java/io/wcm/handler/media/markup/ResponsiveImageMediaMarkupBuilder.java | ResponsiveImageMediaMarkupBuilder.setResponsiveImageSource | protected void setResponsiveImageSource(HtmlElement<?> mediaElement, JSONArray responsiveImageSources, Media media) {
"""
Set attribute on media element for responsive image sources
@param mediaElement Media element
@param responsiveImageSources Responsive image sources JSON metadata
@param media Media
"""
... | java | protected void setResponsiveImageSource(HtmlElement<?> mediaElement, JSONArray responsiveImageSources, Media media) {
mediaElement.setData(PROP_RESPONSIVE_SOURCES, responsiveImageSources.toString());
} | [
"protected",
"void",
"setResponsiveImageSource",
"(",
"HtmlElement",
"<",
"?",
">",
"mediaElement",
",",
"JSONArray",
"responsiveImageSources",
",",
"Media",
"media",
")",
"{",
"mediaElement",
".",
"setData",
"(",
"PROP_RESPONSIVE_SOURCES",
",",
"responsiveImageSources"... | Set attribute on media element for responsive image sources
@param mediaElement Media element
@param responsiveImageSources Responsive image sources JSON metadata
@param media Media | [
"Set",
"attribute",
"on",
"media",
"element",
"for",
"responsive",
"image",
"sources"
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/media/src/main/java/io/wcm/handler/media/markup/ResponsiveImageMediaMarkupBuilder.java#L151-L153 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/view/ViewFactory.java | ViewFactory.getViewFactory | public static ViewFactory getViewFactory(String strSubPackage, char chPrefix) {
"""
Lookup a standard view factory.
@param strSubPackage The subpackage name (such as swing/xml/etc.).
@param chPrefix The prefix to add on the view classes.
@return The View Factory for this sub-package.
"""
ViewFactory... | java | public static ViewFactory getViewFactory(String strSubPackage, char chPrefix)
{
ViewFactory viewFactory = null;
viewFactory = (ViewFactory)m_htFactories.get(strSubPackage);
if (viewFactory == null)
{
viewFactory = new ViewFactory(strSubPackage, chPrefix);
m_ht... | [
"public",
"static",
"ViewFactory",
"getViewFactory",
"(",
"String",
"strSubPackage",
",",
"char",
"chPrefix",
")",
"{",
"ViewFactory",
"viewFactory",
"=",
"null",
";",
"viewFactory",
"=",
"(",
"ViewFactory",
")",
"m_htFactories",
".",
"get",
"(",
"strSubPackage",
... | Lookup a standard view factory.
@param strSubPackage The subpackage name (such as swing/xml/etc.).
@param chPrefix The prefix to add on the view classes.
@return The View Factory for this sub-package. | [
"Lookup",
"a",
"standard",
"view",
"factory",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/view/ViewFactory.java#L213-L223 |
adamfisk/littleshoot-commons-id | src/main/java/org/apache/commons/id/uuid/UUID.java | UUID.nameUUIDFromString | public static UUID nameUUIDFromString(String name, UUID namespace) {
"""
<p>Returns a new version three UUID given a name and the namespace's UUID.</p>
@param name String the name to calculate the UUID for.
@param namespace UUID assigned to this namespace.
@return a new version three UUID given a name and the... | java | public static UUID nameUUIDFromString(String name, UUID namespace) {
return nameUUIDFromString(name, namespace, UUID.MD5_ENCODING);
} | [
"public",
"static",
"UUID",
"nameUUIDFromString",
"(",
"String",
"name",
",",
"UUID",
"namespace",
")",
"{",
"return",
"nameUUIDFromString",
"(",
"name",
",",
"namespace",
",",
"UUID",
".",
"MD5_ENCODING",
")",
";",
"}"
] | <p>Returns a new version three UUID given a name and the namespace's UUID.</p>
@param name String the name to calculate the UUID for.
@param namespace UUID assigned to this namespace.
@return a new version three UUID given a name and the namespace's UUID. | [
"<p",
">",
"Returns",
"a",
"new",
"version",
"three",
"UUID",
"given",
"a",
"name",
"and",
"the",
"namespace",
"s",
"UUID",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/adamfisk/littleshoot-commons-id/blob/49a8f5f2b10831c509876ca463bf1a87e1e49ae9/src/main/java/org/apache/commons/id/uuid/UUID.java#L471-L473 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/TileSheetsConfig.java | TileSheetsConfig.exports | public static void exports(Media configSheets, int tileWidth, int tileHeight, Collection<String> sheets) {
"""
Export the sheets configuration.
@param configSheets The export media (must not be <code>null</code>).
@param tileWidth The tile width.
@param tileHeight The tile height.
@param sheets The sheets fi... | java | public static void exports(Media configSheets, int tileWidth, int tileHeight, Collection<String> sheets)
{
Check.notNull(configSheets);
Check.notNull(sheets);
final Xml nodeSheets = new Xml(NODE_TILE_SHEETS);
nodeSheets.writeString(Constant.XML_HEADER, Constant.ENGINE_WEBSITE)... | [
"public",
"static",
"void",
"exports",
"(",
"Media",
"configSheets",
",",
"int",
"tileWidth",
",",
"int",
"tileHeight",
",",
"Collection",
"<",
"String",
">",
"sheets",
")",
"{",
"Check",
".",
"notNull",
"(",
"configSheets",
")",
";",
"Check",
".",
"notNul... | Export the sheets configuration.
@param configSheets The export media (must not be <code>null</code>).
@param tileWidth The tile width.
@param tileHeight The tile height.
@param sheets The sheets filename (must not be <code>null</code>).
@throws LionEngineException If error on writing. | [
"Export",
"the",
"sheets",
"configuration",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/TileSheetsConfig.java#L80-L95 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L93_L1 | @Pure
public static Point2d L93_L1(double x, double y) {
"""
This function convert France Lambert 93 coordinate to
France Lambert I coordinate.
@param x is the coordinate in France Lambert 93
@param y is the coordinate in France Lambert 93
@return the France Lambert I coordinate.
"""
final Point2d ntf... | java | @Pure
public static Point2d L93_L1(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_93_N,
LAMBERT_93_C,
LAMBERT_93_XS,
LAMBERT_93_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_... | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L93_L1",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_93_N",
",",
"LAMBERT_93_C",
",",
"LAMBERT_93_XS",
",... | This function convert France Lambert 93 coordinate to
France Lambert I coordinate.
@param x is the coordinate in France Lambert 93
@param y is the coordinate in France Lambert 93
@return the France Lambert I coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"93",
"coordinate",
"to",
"France",
"Lambert",
"I",
"coordinate",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L846-L859 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/cors/AbstractCorsPolicyBuilder.java | AbstractCorsPolicyBuilder.preflightResponseHeader | public B preflightResponseHeader(CharSequence name, Supplier<?> valueSupplier) {
"""
Specifies HTTP response headers that should be added to a CORS preflight response.
<p>An intermediary like a load balancer might require that a CORS preflight request
have certain headers set. This enables such headers to be a... | java | public B preflightResponseHeader(CharSequence name, Supplier<?> valueSupplier) {
requireNonNull(name, "name");
requireNonNull(valueSupplier, "valueSupplier");
preflightResponseHeaders.put(HttpHeaderNames.of(name), valueSupplier);
return self();
} | [
"public",
"B",
"preflightResponseHeader",
"(",
"CharSequence",
"name",
",",
"Supplier",
"<",
"?",
">",
"valueSupplier",
")",
"{",
"requireNonNull",
"(",
"name",
",",
"\"name\"",
")",
";",
"requireNonNull",
"(",
"valueSupplier",
",",
"\"valueSupplier\"",
")",
";"... | Specifies HTTP response headers that should be added to a CORS preflight response.
<p>An intermediary like a load balancer might require that a CORS preflight request
have certain headers set. This enables such headers to be added.
<p>Some values must be dynamically created when the HTTP response is created, for
exam... | [
"Specifies",
"HTTP",
"response",
"headers",
"that",
"should",
"be",
"added",
"to",
"a",
"CORS",
"preflight",
"response",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/cors/AbstractCorsPolicyBuilder.java#L346-L351 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/inventory/MalisisInventoryContainer.java | MalisisInventoryContainer.addInventory | public int addInventory(MalisisInventory inventory) {
"""
Adds the {@link MalisisInventory} to this {@link MalisisInventoryContainer}.<br>
@param inventory the inventory
@return the inventoryId for the inventory
"""
inventories.put(nexInventoryId, inventory);
inventory.setInventoryId(nexInventoryId);
... | java | public int addInventory(MalisisInventory inventory)
{
inventories.put(nexInventoryId, inventory);
inventory.setInventoryId(nexInventoryId);
inventory.addOpenedContainer(this);
if (isServer())
inventoryCaches.put(inventory, new InventoryCache(owner, inventory, windowId));
return nexInventoryId++;
} | [
"public",
"int",
"addInventory",
"(",
"MalisisInventory",
"inventory",
")",
"{",
"inventories",
".",
"put",
"(",
"nexInventoryId",
",",
"inventory",
")",
";",
"inventory",
".",
"setInventoryId",
"(",
"nexInventoryId",
")",
";",
"inventory",
".",
"addOpenedContaine... | Adds the {@link MalisisInventory} to this {@link MalisisInventoryContainer}.<br>
@param inventory the inventory
@return the inventoryId for the inventory | [
"Adds",
"the",
"{",
"@link",
"MalisisInventory",
"}",
"to",
"this",
"{",
"@link",
"MalisisInventoryContainer",
"}",
".",
"<br",
">"
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/inventory/MalisisInventoryContainer.java#L163-L171 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/TableBuilder.java | TableBuilder.setConfigItem | public void setConfigItem(final String name, final String type, final String value) {
"""
Set a config item
@param name the item name
@param type the item type
@param value the item value
"""
this.configEntry.add(new ConfigItem(name, type, value));
} | java | public void setConfigItem(final String name, final String type, final String value) {
this.configEntry.add(new ConfigItem(name, type, value));
} | [
"public",
"void",
"setConfigItem",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"type",
",",
"final",
"String",
"value",
")",
"{",
"this",
".",
"configEntry",
".",
"add",
"(",
"new",
"ConfigItem",
"(",
"name",
",",
"type",
",",
"value",
")",
... | Set a config item
@param name the item name
@param type the item type
@param value the item value | [
"Set",
"a",
"config",
"item"
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/TableBuilder.java#L383-L385 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.