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
knowm/XChart
xchart/src/main/java/org/knowm/xchart/RadarChart.java
RadarChart.addSeries
public RadarSeries addSeries(String seriesName, double[] values, String[] tooltipOverrides) { """ Add a series for a Radar type chart @param seriesName @param values @param tooltipOverrides @return """ // Sanity checks sanityCheck(seriesName, values, tooltipOverrides); RadarSeries series = ...
java
public RadarSeries addSeries(String seriesName, double[] values, String[] tooltipOverrides) { // Sanity checks sanityCheck(seriesName, values, tooltipOverrides); RadarSeries series = new RadarSeries(seriesName, values, tooltipOverrides); seriesMap.put(seriesName, series); return series; }
[ "public", "RadarSeries", "addSeries", "(", "String", "seriesName", ",", "double", "[", "]", "values", ",", "String", "[", "]", "tooltipOverrides", ")", "{", "// Sanity checks", "sanityCheck", "(", "seriesName", ",", "values", ",", "tooltipOverrides", ")", ";", ...
Add a series for a Radar type chart @param seriesName @param values @param tooltipOverrides @return
[ "Add", "a", "series", "for", "a", "Radar", "type", "chart" ]
train
https://github.com/knowm/XChart/blob/677a105753a855edf24782fab1bf1f5aec3e642b/xchart/src/main/java/org/knowm/xchart/RadarChart.java#L87-L97
abel533/ECharts
src/main/java/com/github/abel533/echarts/series/Pie.java
Pie.radius
public Pie radius(Object width, Object height) { """ 半径,支持绝对值(px)和百分比,百分比计算比,min(width, height) / 2 * 75%, 传数组实现环形图,[内半径,外半径] @param width 内半径 @param height 外半径 @return """ radius = new Object[]{width, height}; return this; }
java
public Pie radius(Object width, Object height) { radius = new Object[]{width, height}; return this; }
[ "public", "Pie", "radius", "(", "Object", "width", ",", "Object", "height", ")", "{", "radius", "=", "new", "Object", "[", "]", "{", "width", ",", "height", "}", ";", "return", "this", ";", "}" ]
半径,支持绝对值(px)和百分比,百分比计算比,min(width, height) / 2 * 75%, 传数组实现环形图,[内半径,外半径] @param width 内半径 @param height 外半径 @return
[ "半径,支持绝对值(px)和百分比,百分比计算比,min", "(", "width", "height", ")", "/", "2", "*", "75%,", "传数组实现环形图,", "[", "内半径,外半径", "]" ]
train
https://github.com/abel533/ECharts/blob/73e031e51b75e67480701404ccf16e76fd5aa278/src/main/java/com/github/abel533/echarts/series/Pie.java#L157-L160
czyzby/gdx-lml
mvc/src/main/java/com/github/czyzby/autumn/mvc/component/ui/InterfaceService.java
InterfaceService.addViewAction
public void addViewAction(final String actionId, final ActorConsumer<?, ?> action) { """ Registers an action globally for all views. @param actionId ID of the action. @param action will be available in views with the selected ID. """ parser.getData().addActorConsumer(actionId, action); }
java
public void addViewAction(final String actionId, final ActorConsumer<?, ?> action) { parser.getData().addActorConsumer(actionId, action); }
[ "public", "void", "addViewAction", "(", "final", "String", "actionId", ",", "final", "ActorConsumer", "<", "?", ",", "?", ">", "action", ")", "{", "parser", ".", "getData", "(", ")", ".", "addActorConsumer", "(", "actionId", ",", "action", ")", ";", "}" ...
Registers an action globally for all views. @param actionId ID of the action. @param action will be available in views with the selected ID.
[ "Registers", "an", "action", "globally", "for", "all", "views", "." ]
train
https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/mvc/src/main/java/com/github/czyzby/autumn/mvc/component/ui/InterfaceService.java#L142-L144
mygreen/excel-cellformatter
src/main/java/com/github/mygreen/cellformatter/lang/Utils.java
Utils.reverse
public static List<String> reverse(final String[] array) { """ 辞書の逆順で並び替える @param array 並び替える配列 @return @throws IllegalArgumentException array is null. """ ArgUtils.notNull(array, "array"); if(array.length == 0) { return new ArrayList<String>(); } ...
java
public static List<String> reverse(final String[] array) { ArgUtils.notNull(array, "array"); if(array.length == 0) { return new ArrayList<String>(); } final List<String> list = Arrays.asList(array); Collections.sort(list, new Comparator<Strin...
[ "public", "static", "List", "<", "String", ">", "reverse", "(", "final", "String", "[", "]", "array", ")", "{", "ArgUtils", ".", "notNull", "(", "array", ",", "\"array\"", ")", ";", "if", "(", "array", ".", "length", "==", "0", ")", "{", "return", ...
辞書の逆順で並び替える @param array 並び替える配列 @return @throws IllegalArgumentException array is null.
[ "辞書の逆順で並び替える" ]
train
https://github.com/mygreen/excel-cellformatter/blob/e802af273d49889500591e03799c9262cbf29185/src/main/java/com/github/mygreen/cellformatter/lang/Utils.java#L45-L72
couchbase/couchbase-java-client
src/main/java/com/couchbase/client/java/CouchbaseAsyncBucket.java
CouchbaseAsyncBucket.addDetails
private static <X extends CouchbaseException, R extends CouchbaseResponse> X addDetails(X ex, R r) { """ Helper method to encapsulate the logic of enriching the exception with detailed status info. """ return Utils.addDetails(ex, r); }
java
private static <X extends CouchbaseException, R extends CouchbaseResponse> X addDetails(X ex, R r) { return Utils.addDetails(ex, r); }
[ "private", "static", "<", "X", "extends", "CouchbaseException", ",", "R", "extends", "CouchbaseResponse", ">", "X", "addDetails", "(", "X", "ex", ",", "R", "r", ")", "{", "return", "Utils", ".", "addDetails", "(", "ex", ",", "r", ")", ";", "}" ]
Helper method to encapsulate the logic of enriching the exception with detailed status info.
[ "Helper", "method", "to", "encapsulate", "the", "logic", "of", "enriching", "the", "exception", "with", "detailed", "status", "info", "." ]
train
https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/CouchbaseAsyncBucket.java#L2102-L2104
petergeneric/stdlib
stdlib/src/main/java/com/peterphi/std/types/CompareHelper.java
CompareHelper.gt
public static <T> boolean gt(Comparable<T> a, T b) { """ <code>a > b</code> @param <T> @param a @param b @return true if a > b """ return gt(a.compareTo(b)); }
java
public static <T> boolean gt(Comparable<T> a, T b) { return gt(a.compareTo(b)); }
[ "public", "static", "<", "T", ">", "boolean", "gt", "(", "Comparable", "<", "T", ">", "a", ",", "T", "b", ")", "{", "return", "gt", "(", "a", ".", "compareTo", "(", "b", ")", ")", ";", "}" ]
<code>a > b</code> @param <T> @param a @param b @return true if a > b
[ "<code", ">", "a", ">", "b<", "/", "code", ">" ]
train
https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/types/CompareHelper.java#L113-L116
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/stats/Counters.java
Counters.retainTopKeyComparable
public static <E extends Comparable> void retainTopKeyComparable(Counter<E> c, int num) { """ Removes all entries from c except for the top <code>num</code> """ int numToPurge = c.size() - num; if (numToPurge <= 0) { return; } List<E> l = Counters.toSortedListKeyComparable(c); ...
java
public static <E extends Comparable> void retainTopKeyComparable(Counter<E> c, int num) { int numToPurge = c.size() - num; if (numToPurge <= 0) { return; } List<E> l = Counters.toSortedListKeyComparable(c); Collections.reverse(l); for (int i = 0; i < numToPurge; i++) { c.re...
[ "public", "static", "<", "E", "extends", "Comparable", ">", "void", "retainTopKeyComparable", "(", "Counter", "<", "E", ">", "c", ",", "int", "num", ")", "{", "int", "numToPurge", "=", "c", ".", "size", "(", ")", "-", "num", ";", "if", "(", "numToPur...
Removes all entries from c except for the top <code>num</code>
[ "Removes", "all", "entries", "from", "c", "except", "for", "the", "top", "<code", ">", "num<", "/", "code", ">" ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L528-L539
tdomzal/junit-docker-rule
src/main/java/pl/domzal/junit/docker/rule/WaitFor.java
WaitFor.logMessage
public static StartCondition logMessage(final String logMessage) { """ Wait for specified text in log on container start. Whole log content (from container start) is checked so this condition will work independent of any other wait conditions. Rule startup will fail when message will not be found. @param log...
java
public static StartCondition logMessage(final String logMessage) { return new StartCondition() { @Override public StartConditionCheck build(DockerRule currentRule) { log.debug("new wait for condition - message: '{}'", logMessage); return new LogChecker(cur...
[ "public", "static", "StartCondition", "logMessage", "(", "final", "String", "logMessage", ")", "{", "return", "new", "StartCondition", "(", ")", "{", "@", "Override", "public", "StartConditionCheck", "build", "(", "DockerRule", "currentRule", ")", "{", "log", "....
Wait for specified text in log on container start. Whole log content (from container start) is checked so this condition will work independent of any other wait conditions. Rule startup will fail when message will not be found. @param logMessage Message to wait for.
[ "Wait", "for", "specified", "text", "in", "log", "on", "container", "start", ".", "Whole", "log", "content", "(", "from", "container", "start", ")", "is", "checked", "so", "this", "condition", "will", "work", "independent", "of", "any", "other", "wait", "c...
train
https://github.com/tdomzal/junit-docker-rule/blob/5a0ba2fd095d201530d3f9e614bc5e88d0afaeb2/src/main/java/pl/domzal/junit/docker/rule/WaitFor.java#L33-L41
calrissian/mango
mango-json/src/main/java/org/calrissian/mango/json/mappings/JsonMetadata.java
JsonMetadata.getArrayIndex
static Integer getArrayIndex(Map<String,String> meta, int level) { """ Returns an array index for a specific level from the metadata from a flattened json tree. @param meta @param level @return """ return Integer.parseInt(meta.get(level + ARRAY_IDX_SUFFIX)); }
java
static Integer getArrayIndex(Map<String,String> meta, int level) { return Integer.parseInt(meta.get(level + ARRAY_IDX_SUFFIX)); }
[ "static", "Integer", "getArrayIndex", "(", "Map", "<", "String", ",", "String", ">", "meta", ",", "int", "level", ")", "{", "return", "Integer", ".", "parseInt", "(", "meta", ".", "get", "(", "level", "+", "ARRAY_IDX_SUFFIX", ")", ")", ";", "}" ]
Returns an array index for a specific level from the metadata from a flattened json tree. @param meta @param level @return
[ "Returns", "an", "array", "index", "for", "a", "specific", "level", "from", "the", "metadata", "from", "a", "flattened", "json", "tree", "." ]
train
https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-json/src/main/java/org/calrissian/mango/json/mappings/JsonMetadata.java#L54-L56
lukin0110/poeditor-java
src/main/java/be/lukin/poeditor/POEditorClient.java
POEditorClient.uploadTerms
public UploadDetails uploadTerms(String projectId, File translationFile, String[] allTags, String[] newTags, String[] obsoleteTags) { """ Uploads a translation file. For the moment it only takes terms into account. @param projectId id of the project @param translationFile terms file to upload @param allTags -...
java
public UploadDetails uploadTerms(String projectId, File translationFile, String[] allTags, String[] newTags, String[] obsoleteTags){ Map<String, String[]> tags = new HashMap<String, String[]>(); if(allTags != null) { tags.put("all", allTags); } if(newTags != null) { ...
[ "public", "UploadDetails", "uploadTerms", "(", "String", "projectId", ",", "File", "translationFile", ",", "String", "[", "]", "allTags", ",", "String", "[", "]", "newTags", ",", "String", "[", "]", "obsoleteTags", ")", "{", "Map", "<", "String", ",", "Str...
Uploads a translation file. For the moment it only takes terms into account. @param projectId id of the project @param translationFile terms file to upload @param allTags - for the all the imported terms @param newTags - for the terms which aren't already in the project @param obsoleteTags - for the terms which are in...
[ "Uploads", "a", "translation", "file", ".", "For", "the", "moment", "it", "only", "takes", "terms", "into", "account", "." ]
train
https://github.com/lukin0110/poeditor-java/blob/42a2cd3136da1276b29a57a483c94050cc7d1d01/src/main/java/be/lukin/poeditor/POEditorClient.java#L287-L307
looly/hutool
hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java
FileUtil.writeLines
public static <T> File writeLines(Collection<T> list, String path, String charset, boolean isAppend) throws IORuntimeException { """ 将列表写入文件 @param <T> 集合元素类型 @param list 列表 @param path 文件路径 @param charset 字符集 @param isAppend 是否追加 @return 目标文件 @throws IORuntimeException IO异常 """ return writeLines(l...
java
public static <T> File writeLines(Collection<T> list, String path, String charset, boolean isAppend) throws IORuntimeException { return writeLines(list, file(path), charset, isAppend); }
[ "public", "static", "<", "T", ">", "File", "writeLines", "(", "Collection", "<", "T", ">", "list", ",", "String", "path", ",", "String", "charset", ",", "boolean", "isAppend", ")", "throws", "IORuntimeException", "{", "return", "writeLines", "(", "list", "...
将列表写入文件 @param <T> 集合元素类型 @param list 列表 @param path 文件路径 @param charset 字符集 @param isAppend 是否追加 @return 目标文件 @throws IORuntimeException IO异常
[ "将列表写入文件" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L3026-L3028
bbossgroups/bboss-elasticsearch
bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java
RestClientUtil.addAlias
public String addAlias(String indice,String alias) { """ Associating the alias alias with index indice more detail see : https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html @param indice @param alias @return """ String aliasJson = new StringBuilder().append("{\"actions\"...
java
public String addAlias(String indice,String alias){ String aliasJson = new StringBuilder().append("{\"actions\": [{\"add\": {\"index\":\"").append(indice).append("\",\"alias\": \"").append(alias).append("\"}}]}").toString(); return this.client.executeHttp("_aliases",aliasJson,ClientUtil.HTTP_POST); }
[ "public", "String", "addAlias", "(", "String", "indice", ",", "String", "alias", ")", "{", "String", "aliasJson", "=", "new", "StringBuilder", "(", ")", ".", "append", "(", "\"{\\\"actions\\\": [{\\\"add\\\": {\\\"index\\\":\\\"\"", ")", ".", "append", "(", "indic...
Associating the alias alias with index indice more detail see : https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html @param indice @param alias @return
[ "Associating", "the", "alias", "alias", "with", "index", "indice", "more", "detail", "see", ":", "https", ":", "//", "www", ".", "elastic", ".", "co", "/", "guide", "/", "en", "/", "elasticsearch", "/", "reference", "/", "current", "/", "indices", "-", ...
train
https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java#L3500-L3503
Abnaxos/markdown-doclet
doclet/jdk8/src/main/java/ch/raffael/mddoclet/mdtaglet/argval/PredefinedArgumentValidators.java
PredefinedArgumentValidators.argumentTypeValidator
public static ArgumentValidator argumentTypeValidator(String description, ArgumentPredicate argumentPredicate) { """ # Creates a {@link ArgumentValidator} which apply the {@link ArgumentPredicate} on all arguments. This is convenient for ```java {@linkplain #argumentTypeValidator(String, IndexFilter, Argument...
java
public static ArgumentValidator argumentTypeValidator(String description, ArgumentPredicate argumentPredicate) { return argumentTypeValidator(description, IndexFilter.all(), argumentPredicate); }
[ "public", "static", "ArgumentValidator", "argumentTypeValidator", "(", "String", "description", ",", "ArgumentPredicate", "argumentPredicate", ")", "{", "return", "argumentTypeValidator", "(", "description", ",", "IndexFilter", ".", "all", "(", ")", ",", "argumentPredic...
# Creates a {@link ArgumentValidator} which apply the {@link ArgumentPredicate} on all arguments. This is convenient for ```java {@linkplain #argumentTypeValidator(String, IndexFilter, ArgumentPredicate) argumentTypeValidator}( description, PredefinedIndexFilters.all(), argumentPredicate ); ``` @param description the...
[ "#", "Creates", "a", "{", "@link", "ArgumentValidator", "}", "which", "apply", "the", "{", "@link", "ArgumentPredicate", "}", "on", "all", "arguments", "." ]
train
https://github.com/Abnaxos/markdown-doclet/blob/e98a9630206fc9c8d813cf2349ff594be8630054/doclet/jdk8/src/main/java/ch/raffael/mddoclet/mdtaglet/argval/PredefinedArgumentValidators.java#L343-L345
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableDocument.java
MutableDocument.setNumber
@NonNull @Override public MutableDocument setNumber(@NonNull String key, Number value) { """ Set a Number value for the given key @param key the key. @param key the Number value. @return this MutableDocument instance """ return setValue(key, value); }
java
@NonNull @Override public MutableDocument setNumber(@NonNull String key, Number value) { return setValue(key, value); }
[ "@", "NonNull", "@", "Override", "public", "MutableDocument", "setNumber", "(", "@", "NonNull", "String", "key", ",", "Number", "value", ")", "{", "return", "setValue", "(", "key", ",", "value", ")", ";", "}" ]
Set a Number value for the given key @param key the key. @param key the Number value. @return this MutableDocument instance
[ "Set", "a", "Number", "value", "for", "the", "given", "key" ]
train
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableDocument.java#L171-L175
VoltDB/voltdb
third_party/java/src/com/google_voltpatches/common/io/Files.java
Files.readLines
@CanIgnoreReturnValue // some processors won't return a useful result public static <T> T readLines(File file, Charset charset, LineProcessor<T> callback) throws IOException { """ Streams lines from a {@link File}, stopping when our callback returns false, or we have read all of the lines. @param file ...
java
@CanIgnoreReturnValue // some processors won't return a useful result public static <T> T readLines(File file, Charset charset, LineProcessor<T> callback) throws IOException { return asCharSource(file, charset).readLines(callback); }
[ "@", "CanIgnoreReturnValue", "// some processors won't return a useful result", "public", "static", "<", "T", ">", "T", "readLines", "(", "File", "file", ",", "Charset", "charset", ",", "LineProcessor", "<", "T", ">", "callback", ")", "throws", "IOException", "{", ...
Streams lines from a {@link File}, stopping when our callback returns false, or we have read all of the lines. @param file the file to read from @param charset the charset used to decode the input stream; see {@link StandardCharsets} for helpful predefined constants @param callback the {@link LineProcessor} to use to ...
[ "Streams", "lines", "from", "a", "{", "@link", "File", "}", "stopping", "when", "our", "callback", "returns", "false", "or", "we", "have", "read", "all", "of", "the", "lines", "." ]
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/io/Files.java#L550-L554
jqm4gwt/jqm4gwt
library/src/main/java/com/sksamuel/jqm4gwt/JQMContext.java
JQMContext.changePage
public static void changePage(JQMContainer container, TransitionIntf<?> transition, boolean reverse) { """ Change the displayed page to the given {@link JQMPage} instance using the supplied transition and reverse setting. """ changePage(container, false/*dialog*/, transition, reverse); }
java
public static void changePage(JQMContainer container, TransitionIntf<?> transition, boolean reverse) { changePage(container, false/*dialog*/, transition, reverse); }
[ "public", "static", "void", "changePage", "(", "JQMContainer", "container", ",", "TransitionIntf", "<", "?", ">", "transition", ",", "boolean", "reverse", ")", "{", "changePage", "(", "container", ",", "false", "/*dialog*/", ",", "transition", ",", "reverse", ...
Change the displayed page to the given {@link JQMPage} instance using the supplied transition and reverse setting.
[ "Change", "the", "displayed", "page", "to", "the", "given", "{" ]
train
https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/library/src/main/java/com/sksamuel/jqm4gwt/JQMContext.java#L111-L113
ManfredTremmel/gwt-commons-lang3
src/main/java/org/apache/commons/lang3/Validate.java
Validate.validIndex
public static <T extends Collection<?>> T validIndex(final T collection, final int index, final String message, final Object... values) { """ <p>Validates that the index is within the bounds of the argument collection; otherwise throwing an exception with the specified message.</p> <pre>Validate.validIndex(myC...
java
public static <T extends Collection<?>> T validIndex(final T collection, final int index, final String message, final Object... values) { Validate.notNull(collection); if (index < 0 || index >= collection.size()) { throw new IndexOutOfBoundsException(StringUtils.simpleFormat(message, values)...
[ "public", "static", "<", "T", "extends", "Collection", "<", "?", ">", ">", "T", "validIndex", "(", "final", "T", "collection", ",", "final", "int", "index", ",", "final", "String", "message", ",", "final", "Object", "...", "values", ")", "{", "Validate",...
<p>Validates that the index is within the bounds of the argument collection; otherwise throwing an exception with the specified message.</p> <pre>Validate.validIndex(myCollection, 2, "The collection index is invalid: ");</pre> <p>If the collection is {@code null}, then the message of the exception is &quot;The valida...
[ "<p", ">", "Validates", "that", "the", "index", "is", "within", "the", "bounds", "of", "the", "argument", "collection", ";", "otherwise", "throwing", "an", "exception", "with", "the", "specified", "message", ".", "<", "/", "p", ">" ]
train
https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/Validate.java#L696-L702
Netflix/karyon
karyon2-governator/src/main/java/netflix/karyon/Karyon.java
Karyon.forServer
public static KaryonServer forServer(KaryonServer server, BootstrapModule... bootstrapModules) { """ Creates a new {@link KaryonServer} which combines lifecycle of the passed {@link KaryonServer} with it's own lifecycle. This is useful when a {@link KaryonServer} is already present and the passed {@link Bootstra...
java
public static KaryonServer forServer(KaryonServer server, BootstrapModule... bootstrapModules) { return new KaryonServerBackedServer((AbstractKaryonServer)server, bootstrapModules); }
[ "public", "static", "KaryonServer", "forServer", "(", "KaryonServer", "server", ",", "BootstrapModule", "...", "bootstrapModules", ")", "{", "return", "new", "KaryonServerBackedServer", "(", "(", "AbstractKaryonServer", ")", "server", ",", "bootstrapModules", ")", ";"...
Creates a new {@link KaryonServer} which combines lifecycle of the passed {@link KaryonServer} with it's own lifecycle. This is useful when a {@link KaryonServer} is already present and the passed {@link BootstrapModule}s are to be added to that server. @param server An existing karyon server @param bootstrapModules A...
[ "Creates", "a", "new", "{", "@link", "KaryonServer", "}", "which", "combines", "lifecycle", "of", "the", "passed", "{", "@link", "KaryonServer", "}", "with", "it", "s", "own", "lifecycle", ".", "This", "is", "useful", "when", "a", "{", "@link", "KaryonServ...
train
https://github.com/Netflix/karyon/blob/d50bc0ff37693ef3fbda373e90a109d1f92e0b9a/karyon2-governator/src/main/java/netflix/karyon/Karyon.java#L272-L274
awslabs/amazon-sqs-java-messaging-lib
src/main/java/com/amazon/sqs/javamessaging/SQSSession.java
SQSSession.createReceiver
@Override public QueueReceiver createReceiver(Queue queue, String messageSelector) throws JMSException { """ Creates a <code>QueueReceiver</code> for the specified queue. Does not support messageSelector. It will drop anything in messageSelector. @param queue a queue destination @param messageSelector @...
java
@Override public QueueReceiver createReceiver(Queue queue, String messageSelector) throws JMSException { return createReceiver(queue); }
[ "@", "Override", "public", "QueueReceiver", "createReceiver", "(", "Queue", "queue", ",", "String", "messageSelector", ")", "throws", "JMSException", "{", "return", "createReceiver", "(", "queue", ")", ";", "}" ]
Creates a <code>QueueReceiver</code> for the specified queue. Does not support messageSelector. It will drop anything in messageSelector. @param queue a queue destination @param messageSelector @return new message receiver @throws JMSException If session is closed
[ "Creates", "a", "<code", ">", "QueueReceiver<", "/", "code", ">", "for", "the", "specified", "queue", ".", "Does", "not", "support", "messageSelector", ".", "It", "will", "drop", "anything", "in", "messageSelector", "." ]
train
https://github.com/awslabs/amazon-sqs-java-messaging-lib/blob/efa716d34d51ef1c5572790626cdb795419cb342/src/main/java/com/amazon/sqs/javamessaging/SQSSession.java#L241-L244
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/util/StringUtil.java
StringUtil.isDecimal
public static boolean isDecimal(String str, int beginIndex, int endIndex) { """ check the specified char is a decimal including the full-width char @param str @param beginIndex @param endIndex @return boolean """ if ( str.charAt(str.length() - 1) == '.' || str.charAt(0) == ...
java
public static boolean isDecimal(String str, int beginIndex, int endIndex) { if ( str.charAt(str.length() - 1) == '.' || str.charAt(0) == '.' ) { return false; } char c; int p= 0; //number of point for ( int j = 1; j < str.length(); j++ ) { ...
[ "public", "static", "boolean", "isDecimal", "(", "String", "str", ",", "int", "beginIndex", ",", "int", "endIndex", ")", "{", "if", "(", "str", ".", "charAt", "(", "str", ".", "length", "(", ")", "-", "1", ")", "==", "'", "'", "||", "str", ".", "...
check the specified char is a decimal including the full-width char @param str @param beginIndex @param endIndex @return boolean
[ "check", "the", "specified", "char", "is", "a", "decimal", "including", "the", "full", "-", "width", "char" ]
train
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/StringUtil.java#L298-L319
GII/broccoli
broccoli-impl/src/main/java/com/hi3project/broccoli/bsdl/impl/parsing/xml/BSDLXMLStAXParser.java
BSDLXMLStAXParser.processXMLEvent
private ISyntaxElement processXMLEvent(XMLEvent event, Stack<IElementParser> parsersStack) throws ModelException { """ /* Parses an XMLEvent, delegating on the configured parsers. The parsersStack is used to hold the ancestor elements whose properties or contained elements are being parsed. """ for (...
java
private ISyntaxElement processXMLEvent(XMLEvent event, Stack<IElementParser> parsersStack) throws ModelException { for (IElementParser parser : parsers) { if (parser.canParse(event)) { IElementParser newParser = parser.createNewInstance(); ISyn...
[ "private", "ISyntaxElement", "processXMLEvent", "(", "XMLEvent", "event", ",", "Stack", "<", "IElementParser", ">", "parsersStack", ")", "throws", "ModelException", "{", "for", "(", "IElementParser", "parser", ":", "parsers", ")", "{", "if", "(", "parser", ".", ...
/* Parses an XMLEvent, delegating on the configured parsers. The parsersStack is used to hold the ancestor elements whose properties or contained elements are being parsed.
[ "/", "*", "Parses", "an", "XMLEvent", "delegating", "on", "the", "configured", "parsers", ".", "The", "parsersStack", "is", "used", "to", "hold", "the", "ancestor", "elements", "whose", "properties", "or", "contained", "elements", "are", "being", "parsed", "."...
train
https://github.com/GII/broccoli/blob/a3033a90322cbcee4dc0f1719143b84b822bc4ba/broccoli-impl/src/main/java/com/hi3project/broccoli/bsdl/impl/parsing/xml/BSDLXMLStAXParser.java#L135-L155
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/core/encoding/impl/ImplConvertNV21.java
ImplConvertNV21.nv21ToGray
public static void nv21ToGray(byte[] dataNV, GrayU8 output) { """ First block contains gray-scale information and UV data can be ignored. """ final int yStride = output.width; // see if the whole thing can be copied as one big block to maximize speed if( yStride == output.width && !output.isSubimage() ...
java
public static void nv21ToGray(byte[] dataNV, GrayU8 output) { final int yStride = output.width; // see if the whole thing can be copied as one big block to maximize speed if( yStride == output.width && !output.isSubimage() ) { System.arraycopy(dataNV,0,output.data,0,output.width*output.height); } else { ...
[ "public", "static", "void", "nv21ToGray", "(", "byte", "[", "]", "dataNV", ",", "GrayU8", "output", ")", "{", "final", "int", "yStride", "=", "output", ".", "width", ";", "// see if the whole thing can be copied as one big block to maximize speed", "if", "(", "yStri...
First block contains gray-scale information and UV data can be ignored.
[ "First", "block", "contains", "gray", "-", "scale", "information", "and", "UV", "data", "can", "be", "ignored", "." ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/core/encoding/impl/ImplConvertNV21.java#L36-L52
jenkinsci/jenkins
core/src/main/java/hudson/Util.java
Util.changeExtension
@Nonnull public static File changeExtension(@Nonnull File dst, @Nonnull String ext) { """ Returns a file name by changing its extension. @param ext For example, ".zip" """ String p = dst.getPath(); int pos = p.lastIndexOf('.'); if (pos<0) return new File(p+ext); else ...
java
@Nonnull public static File changeExtension(@Nonnull File dst, @Nonnull String ext) { String p = dst.getPath(); int pos = p.lastIndexOf('.'); if (pos<0) return new File(p+ext); else return new File(p.substring(0,pos)+ext); }
[ "@", "Nonnull", "public", "static", "File", "changeExtension", "(", "@", "Nonnull", "File", "dst", ",", "@", "Nonnull", "String", "ext", ")", "{", "String", "p", "=", "dst", ".", "getPath", "(", ")", ";", "int", "pos", "=", "p", ".", "lastIndexOf", "...
Returns a file name by changing its extension. @param ext For example, ".zip"
[ "Returns", "a", "file", "name", "by", "changing", "its", "extension", "." ]
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/Util.java#L1371-L1377
alkacon/opencms-core
src/org/opencms/acacia/shared/CmsSerialDateUtil.java
CmsSerialDateUtil.toIntWithDefault
public static int toIntWithDefault(String value, int defaultValue) { """ Parses int value and returns the provided default if the value can't be parsed. @param value the int to parse. @param defaultValue the default value. @return the parsed int, or the default value if parsing fails. """ int resul...
java
public static int toIntWithDefault(String value, int defaultValue) { int result = defaultValue; try { result = Integer.parseInt(value); } catch (@SuppressWarnings("unused") Exception e) { // Do nothing, return default. } return result; }
[ "public", "static", "int", "toIntWithDefault", "(", "String", "value", ",", "int", "defaultValue", ")", "{", "int", "result", "=", "defaultValue", ";", "try", "{", "result", "=", "Integer", ".", "parseInt", "(", "value", ")", ";", "}", "catch", "(", "@",...
Parses int value and returns the provided default if the value can't be parsed. @param value the int to parse. @param defaultValue the default value. @return the parsed int, or the default value if parsing fails.
[ "Parses", "int", "value", "and", "returns", "the", "provided", "default", "if", "the", "value", "can", "t", "be", "parsed", "." ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/acacia/shared/CmsSerialDateUtil.java#L48-L57
centic9/commons-test
src/main/java/org/dstadler/commons/email/SafeCloseSmtpServer.java
SafeCloseSmtpServer.sendResponse
private static void sendResponse(PrintWriter out, SmtpResponse smtpResponse) { """ Send response to client. @param out socket output stream @param smtpResponse response object """ if (smtpResponse.getCode() > 0) { int code = smtpResponse.getCode(); String message = smtpResponse.getMessage(); out...
java
private static void sendResponse(PrintWriter out, SmtpResponse smtpResponse) { if (smtpResponse.getCode() > 0) { int code = smtpResponse.getCode(); String message = smtpResponse.getMessage(); out.print(code + " " + message + "\r\n"); out.flush(); } }
[ "private", "static", "void", "sendResponse", "(", "PrintWriter", "out", ",", "SmtpResponse", "smtpResponse", ")", "{", "if", "(", "smtpResponse", ".", "getCode", "(", ")", ">", "0", ")", "{", "int", "code", "=", "smtpResponse", ".", "getCode", "(", ")", ...
Send response to client. @param out socket output stream @param smtpResponse response object
[ "Send", "response", "to", "client", "." ]
train
https://github.com/centic9/commons-test/blob/562047c198133ecb116f2472e9aeb15e866579f5/src/main/java/org/dstadler/commons/email/SafeCloseSmtpServer.java#L251-L258
dkmfbk/knowledgestore
ks-server/src/main/java/eu/fbk/knowledgestore/triplestore/SelectQuery.java
SelectQuery.from
public static SelectQuery from(final TupleExpr expression, @Nullable final Dataset dataset) throws ParseException { """ Returns an <tt>SelectQuery</tt> for the algebraic expression and optional dataset specified. @param expression the algebraic expression for the query @param dataset the dataset...
java
public static SelectQuery from(final TupleExpr expression, @Nullable final Dataset dataset) throws ParseException { Preconditions.checkNotNull(expression); try { // Sesame rendering facilities are definitely broken, so we use our own final String string = new SPARQL...
[ "public", "static", "SelectQuery", "from", "(", "final", "TupleExpr", "expression", ",", "@", "Nullable", "final", "Dataset", "dataset", ")", "throws", "ParseException", "{", "Preconditions", ".", "checkNotNull", "(", "expression", ")", ";", "try", "{", "// Sesa...
Returns an <tt>SelectQuery</tt> for the algebraic expression and optional dataset specified. @param expression the algebraic expression for the query @param dataset the dataset optionally associated to the query @return the corresponding <tt>SelectQuery</tt> object @throws ParseException in case the supplied algebraic...
[ "Returns", "an", "<tt", ">", "SelectQuery<", "/", "tt", ">", "for", "the", "algebraic", "expression", "and", "optional", "dataset", "specified", "." ]
train
https://github.com/dkmfbk/knowledgestore/blob/a548101b1dd67fcf72a1ec6f838ea7539bdbbe7a/ks-server/src/main/java/eu/fbk/knowledgestore/triplestore/SelectQuery.java#L118-L137
geomajas/geomajas-project-client-gwt
plugin/javascript-api/javascript-api-gwt/src/main/java/org/geomajas/plugin/jsapi/gwt/client/exporter/map/MapImpl.java
MapImpl.getMapController
public MapController getMapController() { """ Return the currently active controller on the map. @return The currently active controller. """ final GraphicsController controller = mapWidget.getController(); MapController mapController = new MapController(this, controller); mapController.setActivationH...
java
public MapController getMapController() { final GraphicsController controller = mapWidget.getController(); MapController mapController = new MapController(this, controller); mapController.setActivationHandler(new ExportableFunction() { public void execute() { controller.onActivate(); } }); mapContr...
[ "public", "MapController", "getMapController", "(", ")", "{", "final", "GraphicsController", "controller", "=", "mapWidget", ".", "getController", "(", ")", ";", "MapController", "mapController", "=", "new", "MapController", "(", "this", ",", "controller", ")", ";...
Return the currently active controller on the map. @return The currently active controller.
[ "Return", "the", "currently", "active", "controller", "on", "the", "map", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/javascript-api/javascript-api-gwt/src/main/java/org/geomajas/plugin/jsapi/gwt/client/exporter/map/MapImpl.java#L147-L163
nyla-solutions/nyla
nyla.solutions.core/src/main/java/nyla/solutions/core/util/SettingsInMemory.java
SettingsInMemory.getInteger
public Integer getInteger(Class<?> aClass, String key, int defaultValue) { """ Get a Setting property as an Integer object. @param aClass calling class @param key the key name of the numeric property to be returned. @param defaultValue the default value @return Value of the property as an Integer or null if ...
java
public Integer getInteger(Class<?> aClass, String key, int defaultValue) { return getInteger(aClass.getName()+".key",defaultValue); }
[ "public", "Integer", "getInteger", "(", "Class", "<", "?", ">", "aClass", ",", "String", "key", ",", "int", "defaultValue", ")", "{", "return", "getInteger", "(", "aClass", ".", "getName", "(", ")", "+", "\".key\"", ",", "defaultValue", ")", ";", "}" ]
Get a Setting property as an Integer object. @param aClass calling class @param key the key name of the numeric property to be returned. @param defaultValue the default value @return Value of the property as an Integer or null if no property found.
[ "Get", "a", "Setting", "property", "as", "an", "Integer", "object", "." ]
train
https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/util/SettingsInMemory.java#L171-L174
qzagarese/hyaline-dto
hyaline-dto/src/main/java/org/hyalinedto/api/Hyaline.java
Hyaline.dtoFromClass
public static <T> T dtoFromClass(T entity, DTO dtoTemplate, String proxyClassName) throws HyalineException { """ It lets you create a new DTO starting from the annotation-based configuration of your entity. This means that any annotation-based configuration for JAXB, Jackson or whatever serialization framework y...
java
public static <T> T dtoFromClass(T entity, DTO dtoTemplate, String proxyClassName) throws HyalineException { try { return createDTO(entity, dtoTemplate, false, proxyClassName); } catch (CannotInstantiateProxyException | DTODefinitionException e) { e.printStackTrace(); throw new HyalineException(); } }
[ "public", "static", "<", "T", ">", "T", "dtoFromClass", "(", "T", "entity", ",", "DTO", "dtoTemplate", ",", "String", "proxyClassName", ")", "throws", "HyalineException", "{", "try", "{", "return", "createDTO", "(", "entity", ",", "dtoTemplate", ",", "false"...
It lets you create a new DTO starting from the annotation-based configuration of your entity. This means that any annotation-based configuration for JAXB, Jackson or whatever serialization framework you are using on your entity T will be kept. However, if you insert an annotation on a field that exists also in your cla...
[ "It", "lets", "you", "create", "a", "new", "DTO", "starting", "from", "the", "annotation", "-", "based", "configuration", "of", "your", "entity", ".", "This", "means", "that", "any", "annotation", "-", "based", "configuration", "for", "JAXB", "Jackson", "or"...
train
https://github.com/qzagarese/hyaline-dto/blob/3392de5b7f93cdb3a1c53aa977ee682c141df5f4/hyaline-dto/src/main/java/org/hyalinedto/api/Hyaline.java#L169-L176
hellosign/hellosign-java-sdk
src/main/java/com/hellosign/sdk/resource/SignatureRequest.java
SignatureRequest.addSigner
public void addSigner(String email, String name) throws HelloSignException { """ Adds the signer to the list of signers for this request. @param email String @param name String @throws HelloSignException thrown if there is a problem adding the signer. """ signers.add(new Signer(email, name)); ...
java
public void addSigner(String email, String name) throws HelloSignException { signers.add(new Signer(email, name)); }
[ "public", "void", "addSigner", "(", "String", "email", ",", "String", "name", ")", "throws", "HelloSignException", "{", "signers", ".", "add", "(", "new", "Signer", "(", "email", ",", "name", ")", ")", ";", "}" ]
Adds the signer to the list of signers for this request. @param email String @param name String @throws HelloSignException thrown if there is a problem adding the signer.
[ "Adds", "the", "signer", "to", "the", "list", "of", "signers", "for", "this", "request", "." ]
train
https://github.com/hellosign/hellosign-java-sdk/blob/08fa7aeb3b0c68ddb6c7ea797d114d55d36d36b1/src/main/java/com/hellosign/sdk/resource/SignatureRequest.java#L176-L178
aalmiray/Json-lib
src/main/java/net/sf/json/JSONObject.java
JSONObject.setInternal
private JSONObject setInternal( String key, Object value, JsonConfig jsonConfig ) { """ Put a key/value pair in the JSONObject. @param key A key string. @param value An object which is the value. It should be of one of these types: Boolean, Double, Integer, JSONArray, JSONObject, Long, String, or the JSONNul...
java
private JSONObject setInternal( String key, Object value, JsonConfig jsonConfig ) { return _setInternal( key, processValue( key, value, jsonConfig ), jsonConfig ); }
[ "private", "JSONObject", "setInternal", "(", "String", "key", ",", "Object", "value", ",", "JsonConfig", "jsonConfig", ")", "{", "return", "_setInternal", "(", "key", ",", "processValue", "(", "key", ",", "value", ",", "jsonConfig", ")", ",", "jsonConfig", "...
Put a key/value pair in the JSONObject. @param key A key string. @param value An object which is the value. It should be of one of these types: Boolean, Double, Integer, JSONArray, JSONObject, Long, String, or the JSONNull object. @return this. @throws JSONException If the value is non-finite number or if the key is n...
[ "Put", "a", "key", "/", "value", "pair", "in", "the", "JSONObject", "." ]
train
https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONObject.java#L2644-L2646
alipay/sofa-rpc
extension-impl/metrics-lookout/src/main/java/com/alipay/sofa/rpc/metrics/lookout/RpcLookout.java
RpcLookout.recordSize
private void recordSize(MixinMetric mixinMetric, RpcClientLookoutModel model) { """ Record request size and response size @param mixinMetric MixinMetric @param model information model """ Long requestSize = model.getRequestSize(); Long responseSize = model.getResponseSize(); ...
java
private void recordSize(MixinMetric mixinMetric, RpcClientLookoutModel model) { Long requestSize = model.getRequestSize(); Long responseSize = model.getResponseSize(); if (requestSize != null) { DistributionSummary requestSizeDS = mixinMetric.distributionSummary("request_size"); ...
[ "private", "void", "recordSize", "(", "MixinMetric", "mixinMetric", ",", "RpcClientLookoutModel", "model", ")", "{", "Long", "requestSize", "=", "model", ".", "getRequestSize", "(", ")", ";", "Long", "responseSize", "=", "model", ".", "getResponseSize", "(", ")"...
Record request size and response size @param mixinMetric MixinMetric @param model information model
[ "Record", "request", "size", "and", "response", "size" ]
train
https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/metrics-lookout/src/main/java/com/alipay/sofa/rpc/metrics/lookout/RpcLookout.java#L190-L204
vlingo/vlingo-http
src/main/java/io/vlingo/http/resource/Client.java
Client.using
public static Client using(final Configuration configuration, final ClientConsumerType type, final int poolSize) throws Exception { """ Answer a new {@code Client} from the {@code configuration}. @param configuration the Configuration @param type the ClientConsumerType @param poolSize the int size of the pool o...
java
public static Client using(final Configuration configuration, final ClientConsumerType type, final int poolSize) throws Exception { return new Client(configuration, type, poolSize); }
[ "public", "static", "Client", "using", "(", "final", "Configuration", "configuration", ",", "final", "ClientConsumerType", "type", ",", "final", "int", "poolSize", ")", "throws", "Exception", "{", "return", "new", "Client", "(", "configuration", ",", "type", ","...
Answer a new {@code Client} from the {@code configuration}. @param configuration the Configuration @param type the ClientConsumerType @param poolSize the int size of the pool of workers @return Client @throws Exception when the Client cannot be created
[ "Answer", "a", "new", "{" ]
train
https://github.com/vlingo/vlingo-http/blob/746065fb1eaf1609c550ae45e96e3dbb9bfa37a2/src/main/java/io/vlingo/http/resource/Client.java#L42-L44
dynjs/dynjs
src/main/java/org/dynjs/runtime/linker/js/undefined/JavascriptStrictUndefinedLinker.java
JavascriptStrictUndefinedLinker.linkSetProperty
@Override public Link linkSetProperty(Invocation invocation, String propertyName) throws Exception { """ /* @Override public Link linkGetProperty(Invocation invocation, String propertyName) throws Exception { return new JSObjectPropertyGetLink( invocation.builder() ); } """ return new JSUndefin...
java
@Override public Link linkSetProperty(Invocation invocation, String propertyName) throws Exception { return new JSUndefinedPropertySetLink( invocation.builder() ); }
[ "@", "Override", "public", "Link", "linkSetProperty", "(", "Invocation", "invocation", ",", "String", "propertyName", ")", "throws", "Exception", "{", "return", "new", "JSUndefinedPropertySetLink", "(", "invocation", ".", "builder", "(", ")", ")", ";", "}" ]
/* @Override public Link linkGetProperty(Invocation invocation, String propertyName) throws Exception { return new JSObjectPropertyGetLink( invocation.builder() ); }
[ "/", "*" ]
train
https://github.com/dynjs/dynjs/blob/4bc6715eff8768f8cd92c6a167d621bbfc1e1a91/src/main/java/org/dynjs/runtime/linker/js/undefined/JavascriptStrictUndefinedLinker.java#L21-L24
petergeneric/stdlib
stdlib/src/main/java/com/peterphi/std/util/HexHelper.java
HexHelper.generateHex
public static final String generateHex(final Random random, final int characters) { """ Generates a hexidecimal String of length <code>characters</code> @param random the random number generator to use @param characters the number of characters in the resulting String @return """ if (characters < 1)...
java
public static final String generateHex(final Random random, final int characters) { if (characters < 1) throw new IllegalArgumentException("characters must be >= 1"); final char[] str = new char[characters]; for (int i = 0; i < characters; i++) { str[i] = hex[random.nextInt(16)]; } return new Stri...
[ "public", "static", "final", "String", "generateHex", "(", "final", "Random", "random", ",", "final", "int", "characters", ")", "{", "if", "(", "characters", "<", "1", ")", "throw", "new", "IllegalArgumentException", "(", "\"characters must be >= 1\"", ")", ";",...
Generates a hexidecimal String of length <code>characters</code> @param random the random number generator to use @param characters the number of characters in the resulting String @return
[ "Generates", "a", "hexidecimal", "String", "of", "length", "<code", ">", "characters<", "/", "code", ">" ]
train
https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/util/HexHelper.java#L142-L155
stanfy/goro
goro/src/main/java/com/stanfy/enroscar/goro/GoroService.java
GoroService.foregroundTaskIntent
public static <T extends Callable<?> & Parcelable> Intent foregroundTaskIntent(final Context context, final String queueName, final T task, ...
java
public static <T extends Callable<?> & Parcelable> Intent foregroundTaskIntent(final Context context, final String queueName, final T task, ...
[ "public", "static", "<", "T", "extends", "Callable", "<", "?", ">", "&", "Parcelable", ">", "Intent", "foregroundTaskIntent", "(", "final", "Context", "context", ",", "final", "String", "queueName", ",", "final", "T", "task", ",", "final", "int", "notificati...
Create an intent that contains a task that should be scheduled on a defined queue. The Service will run in the foreground and display notification. Intent can be used as an argument for {@link android.content.Context#startService(android.content.Intent)} or {@link android.content.Context#startForegroundService(Intent)}...
[ "Create", "an", "intent", "that", "contains", "a", "task", "that", "should", "be", "scheduled", "on", "a", "defined", "queue", ".", "The", "Service", "will", "run", "in", "the", "foreground", "and", "display", "notification", ".", "Intent", "can", "be", "u...
train
https://github.com/stanfy/goro/blob/6618e63a926833d61f492ec611ee77668d756820/goro/src/main/java/com/stanfy/enroscar/goro/GoroService.java#L127-L144
looly/hutool
hutool-crypto/src/main/java/cn/hutool/crypto/digest/HMac.java
HMac.init
public HMac init(String algorithm, SecretKey key) { """ 初始化 @param algorithm 算法 @param key 密钥 {@link SecretKey} @return {@link HMac} @throws CryptoException Cause by IOException """ try { mac = Mac.getInstance(algorithm); if(null != key){ this.secretKey = key; }else{ this.secretKey...
java
public HMac init(String algorithm, SecretKey key){ try { mac = Mac.getInstance(algorithm); if(null != key){ this.secretKey = key; }else{ this.secretKey = SecureUtil.generateKey(algorithm); } mac.init(this.secretKey); } catch (Exception e) { throw new CryptoException(e); } r...
[ "public", "HMac", "init", "(", "String", "algorithm", ",", "SecretKey", "key", ")", "{", "try", "{", "mac", "=", "Mac", ".", "getInstance", "(", "algorithm", ")", ";", "if", "(", "null", "!=", "key", ")", "{", "this", ".", "secretKey", "=", "key", ...
初始化 @param algorithm 算法 @param key 密钥 {@link SecretKey} @return {@link HMac} @throws CryptoException Cause by IOException
[ "初始化" ]
train
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/digest/HMac.java#L80-L93
h2oai/h2o-2
src/main/java/water/fvec/Chunk.java
Chunk.set0
public final long set0(int idx, long l) { """ Set a long element in a chunk given a 0-based chunk local index. Write into a chunk. May rewrite/replace chunks if the chunk needs to be "inflated" to hold larger values. Returns the input value. Note that the idx is an int (instead of a long), which tells you...
java
public final long set0(int idx, long l) { setWrite(); if( _chk2.set_impl(idx,l) ) return l; (_chk2 = inflate_impl(new NewChunk(this))).set_impl(idx,l); return l; }
[ "public", "final", "long", "set0", "(", "int", "idx", ",", "long", "l", ")", "{", "setWrite", "(", ")", ";", "if", "(", "_chk2", ".", "set_impl", "(", "idx", ",", "l", ")", ")", "return", "l", ";", "(", "_chk2", "=", "inflate_impl", "(", "new", ...
Set a long element in a chunk given a 0-based chunk local index. Write into a chunk. May rewrite/replace chunks if the chunk needs to be "inflated" to hold larger values. Returns the input value. Note that the idx is an int (instead of a long), which tells you that index 0 is the first row in the chunk, not the whol...
[ "Set", "a", "long", "element", "in", "a", "chunk", "given", "a", "0", "-", "based", "chunk", "local", "index", "." ]
train
https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/water/fvec/Chunk.java#L129-L134
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java
CoverageUtilities.createWritableRasterFromMatrix
public static WritableRaster createWritableRasterFromMatrix( float[][] matrix, boolean matrixIsRowCol ) { """ Create a {@link WritableRaster} from a float matrix. @param matrix the matrix to take the data from. @param matrixIsRowCol a flag to tell if the matrix has rowCol or colRow order. @return the produced...
java
public static WritableRaster createWritableRasterFromMatrix( float[][] matrix, boolean matrixIsRowCol ) { int height = matrix.length; int width = matrix[0].length; if (!matrixIsRowCol) { int tmp = height; height = width; width = tmp; } Writable...
[ "public", "static", "WritableRaster", "createWritableRasterFromMatrix", "(", "float", "[", "]", "[", "]", "matrix", ",", "boolean", "matrixIsRowCol", ")", "{", "int", "height", "=", "matrix", ".", "length", ";", "int", "width", "=", "matrix", "[", "0", "]", ...
Create a {@link WritableRaster} from a float matrix. @param matrix the matrix to take the data from. @param matrixIsRowCol a flag to tell if the matrix has rowCol or colRow order. @return the produced raster.
[ "Create", "a", "{", "@link", "WritableRaster", "}", "from", "a", "float", "matrix", "." ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java#L741-L764
apache/reef
lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/formats/CommandLine.java
CommandLine.parseToConfiguration
public static Configuration parseToConfiguration(final String[] args, final Class<? extends Name<?>>... argClasses) throws ParseException { """ Utility method to quickly parse a command line to a Configuration. <p> This is equivalent to <code>parseToConfi...
java
public static Configuration parseToConfiguration(final String[] args, final Class<? extends Name<?>>... argClasses) throws ParseException { return parseToConfigurationBuilder(args, argClasses).build(); }
[ "public", "static", "Configuration", "parseToConfiguration", "(", "final", "String", "[", "]", "args", ",", "final", "Class", "<", "?", "extends", "Name", "<", "?", ">", ">", "...", "argClasses", ")", "throws", "ParseException", "{", "return", "parseToConfigur...
Utility method to quickly parse a command line to a Configuration. <p> This is equivalent to <code>parseToConfigurationBuilder(args, argClasses).build()</code> @param args the command line parameters to parse. @param argClasses the named parameters to look for. @return a Configuration with the parsed parameters ...
[ "Utility", "method", "to", "quickly", "parse", "a", "command", "line", "to", "a", "Configuration", ".", "<p", ">", "This", "is", "equivalent", "to", "<code", ">", "parseToConfigurationBuilder", "(", "args", "argClasses", ")", ".", "build", "()", "<", "/", ...
train
https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/formats/CommandLine.java#L182-L186
signit-wesign/java-sdk
src/main/java/cn/signit/sdk/util/HmacSignatureBuilder.java
HmacSignatureBuilder.isHashEquals
public boolean isHashEquals(byte[] expectedSignature, BuilderMode builderMode) { """ 判断期望摘要是否与已构建的摘要相等. @param expectedSignature 传入的期望摘要 @param builderMode 采用的构建模式 @return <code>true</code> - 期望摘要与已构建的摘要相等; <code>false</code> - 期望摘要与已构建的摘要不相等 @author zhd @since 1.0.0 """ final byte[] signatur...
java
public boolean isHashEquals(byte[] expectedSignature, BuilderMode builderMode) { final byte[] signature = build(builderMode); return MessageDigest.isEqual(signature, expectedSignature); }
[ "public", "boolean", "isHashEquals", "(", "byte", "[", "]", "expectedSignature", ",", "BuilderMode", "builderMode", ")", "{", "final", "byte", "[", "]", "signature", "=", "build", "(", "builderMode", ")", ";", "return", "MessageDigest", ".", "isEqual", "(", ...
判断期望摘要是否与已构建的摘要相等. @param expectedSignature 传入的期望摘要 @param builderMode 采用的构建模式 @return <code>true</code> - 期望摘要与已构建的摘要相等; <code>false</code> - 期望摘要与已构建的摘要不相等 @author zhd @since 1.0.0
[ "判断期望摘要是否与已构建的摘要相等", "." ]
train
https://github.com/signit-wesign/java-sdk/blob/6f3196c9d444818a953396fdaa8ffed9794d9530/src/main/java/cn/signit/sdk/util/HmacSignatureBuilder.java#L680-L683
ironjacamar/ironjacamar
codegenerator/src/main/java/org/ironjacamar/codegenerator/BaseProfile.java
BaseProfile.generatePackageInfo
void generatePackageInfo(Definition def, String outputDir, String subDir) { """ generate package.html @param def Definition @param outputDir main or test @param subDir sub-directory """ try { FileWriter fw; PackageInfoGen phGen; if (outputDir.equals("test"))...
java
void generatePackageInfo(Definition def, String outputDir, String subDir) { try { FileWriter fw; PackageInfoGen phGen; if (outputDir.equals("test")) { fw = Utils.createTestFile("package-info.java", def.getRaPackage(), def.getOutputDir()); phGen ...
[ "void", "generatePackageInfo", "(", "Definition", "def", ",", "String", "outputDir", ",", "String", "subDir", ")", "{", "try", "{", "FileWriter", "fw", ";", "PackageInfoGen", "phGen", ";", "if", "(", "outputDir", ".", "equals", "(", "\"test\"", ")", ")", "...
generate package.html @param def Definition @param outputDir main or test @param subDir sub-directory
[ "generate", "package", ".", "html" ]
train
https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/BaseProfile.java#L545-L578
facebookarchive/hadoop-20
src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/PersistentState.java
PersistentState.updateState
public static void updateState(String filename, String firstLine, long offset) { """ Upadate the state of parsing for a particular log file. @param filename the log file for which to update the state @param firstLine the first line of the log file currently @param offset the byte offset of the last character ...
java
public static void updateState(String filename, String firstLine, long offset) { ParseState ps = getState(filename); if (firstLine != null) ps.firstLine = firstLine; ps.offset = offset; setState(ps); }
[ "public", "static", "void", "updateState", "(", "String", "filename", ",", "String", "firstLine", ",", "long", "offset", ")", "{", "ParseState", "ps", "=", "getState", "(", "filename", ")", ";", "if", "(", "firstLine", "!=", "null", ")", "ps", ".", "firs...
Upadate the state of parsing for a particular log file. @param filename the log file for which to update the state @param firstLine the first line of the log file currently @param offset the byte offset of the last character parsed
[ "Upadate", "the", "state", "of", "parsing", "for", "a", "particular", "log", "file", "." ]
train
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/failmon/src/java/org/apache/hadoop/contrib/failmon/PersistentState.java#L116-L126
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/charset/CoderResult.java
CoderResult.unmappableForLength
public static synchronized CoderResult unmappableForLength(int length) throws IllegalArgumentException { """ Gets a <code>CoderResult</code> object indicating an unmappable character error. @param length the length of the input unit sequence denoting the unmappable character. @return a <code>Cod...
java
public static synchronized CoderResult unmappableForLength(int length) throws IllegalArgumentException { if (length > 0) { Integer key = Integer.valueOf(length); synchronized (_unmappableErrors) { CoderResult r = _unmappableErrors.get(key); if ...
[ "public", "static", "synchronized", "CoderResult", "unmappableForLength", "(", "int", "length", ")", "throws", "IllegalArgumentException", "{", "if", "(", "length", ">", "0", ")", "{", "Integer", "key", "=", "Integer", ".", "valueOf", "(", "length", ")", ";", ...
Gets a <code>CoderResult</code> object indicating an unmappable character error. @param length the length of the input unit sequence denoting the unmappable character. @return a <code>CoderResult</code> object indicating an unmappable character error. @throws IllegalArgumentException if <code>length</code> is non-posi...
[ "Gets", "a", "<code", ">", "CoderResult<", "/", "code", ">", "object", "indicating", "an", "unmappable", "character", "error", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/nio/charset/CoderResult.java#L140-L154
Gant/Gant
src/main/groovy/org/codehaus/gant/GantMetaClass.java
GantMetaClass.invokeMethod
@SuppressWarnings("rawtypes") @Override public Object invokeMethod(final Class sender, final Object receiver, final String methodName, final Object[] arguments, final boolean isCallToSuper, final boolean fromInsideClass) { """ Invoke a method on the given receiver for the specified arguments. The sender is the c...
java
@SuppressWarnings("rawtypes") @Override public Object invokeMethod(final Class sender, final Object receiver, final String methodName, final Object[] arguments, final boolean isCallToSuper, final boolean fromInsideClass) { return invokeMethod(receiver, methodName, arguments); }
[ "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "@", "Override", "public", "Object", "invokeMethod", "(", "final", "Class", "sender", ",", "final", "Object", "receiver", ",", "final", "String", "methodName", ",", "final", "Object", "[", "]", "arguments", ",...
Invoke a method on the given receiver for the specified arguments. The sender is the class that invoked the method on the object. Attempt to establish the method to invoke based on the name and arguments provided. <p>The {@code isCallToSuper} and {@code fromInsideClass} help the Groovy runtime perform optimizations o...
[ "Invoke", "a", "method", "on", "the", "given", "receiver", "for", "the", "specified", "arguments", ".", "The", "sender", "is", "the", "class", "that", "invoked", "the", "method", "on", "the", "object", ".", "Attempt", "to", "establish", "the", "method", "t...
train
https://github.com/Gant/Gant/blob/8f82b3cd8968d5595dc44e2beae9f7948172868b/src/main/groovy/org/codehaus/gant/GantMetaClass.java#L205-L208
carewebframework/carewebframework-core
org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/action/ActionUtil.java
ActionUtil.addAction
public static ActionListener addAction(BaseComponent component, String action) { """ Adds/removes an action listener to/from a component using the default click trigger event. @param component Component to be associated with the action. @param action Action to invoke when listener event is triggered. This may ...
java
public static ActionListener addAction(BaseComponent component, String action) { return addAction(component, createAction(action)); }
[ "public", "static", "ActionListener", "addAction", "(", "BaseComponent", "component", ",", "String", "action", ")", "{", "return", "addAction", "(", "component", ",", "createAction", "(", "action", ")", ")", ";", "}" ]
Adds/removes an action listener to/from a component using the default click trigger event. @param component Component to be associated with the action. @param action Action to invoke when listener event is triggered. This may be either the action script or a registered action name. If empty or null, dissociates the ev...
[ "Adds", "/", "removes", "an", "action", "listener", "to", "/", "from", "a", "component", "using", "the", "default", "click", "trigger", "event", "." ]
train
https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/action/ActionUtil.java#L72-L74
wellner/jcarafe
jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java
ObjectArrayList.partFromTo
public ObjectArrayList partFromTo(int from, int to) { """ Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive. @param from the index of the first element (inclusive). @param to the index of the last element (inclusive). @return a new list @excepti...
java
public ObjectArrayList partFromTo(int from, int to) { if (size==0) return new ObjectArrayList(0); checkRangeFromTo(from, to, size); Object[] part = new Object[to-from+1]; System.arraycopy(elements, from, part, 0, to-from+1); return new ObjectArrayList(part); }
[ "public", "ObjectArrayList", "partFromTo", "(", "int", "from", ",", "int", "to", ")", "{", "if", "(", "size", "==", "0", ")", "return", "new", "ObjectArrayList", "(", "0", ")", ";", "checkRangeFromTo", "(", "from", ",", "to", ",", "size", ")", ";", "...
Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive. @param from the index of the first element (inclusive). @param to the index of the last element (inclusive). @return a new list @exception IndexOutOfBoundsException index is out of range (<tt>size()&gt;0...
[ "Returns", "a", "new", "list", "of", "the", "part", "of", "the", "receiver", "between", "<code", ">", "from<", "/", "code", ">", "inclusive", "and", "<code", ">", "to<", "/", "code", ">", "inclusive", "." ]
train
https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java#L596-L604
TheHortonMachine/hortonmachine
hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/utils/Utility.java
Utility.verifyProjectType
public static boolean verifyProjectType( SimpleFeatureType schema, IHMProgressMonitor pm ) { """ Verify the schema. <p> Verify if the FeatureCollection contains all the needed fields. </p> @param schema is yhe type for the project mode. @param pm @return true if there is the percentage of the area. """...
java
public static boolean verifyProjectType( SimpleFeatureType schema, IHMProgressMonitor pm ) { String searchedField = PipesTrentoP.ID.getAttributeName(); verifyFeatureKey(findAttributeName(schema, searchedField), searchedField, pm); searchedField = PipesTrentoP.DRAIN_AREA.getAttributeName(); ...
[ "public", "static", "boolean", "verifyProjectType", "(", "SimpleFeatureType", "schema", ",", "IHMProgressMonitor", "pm", ")", "{", "String", "searchedField", "=", "PipesTrentoP", ".", "ID", ".", "getAttributeName", "(", ")", ";", "verifyFeatureKey", "(", "findAttrib...
Verify the schema. <p> Verify if the FeatureCollection contains all the needed fields. </p> @param schema is yhe type for the project mode. @param pm @return true if there is the percentage of the area.
[ "Verify", "the", "schema", "." ]
train
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/utils/Utility.java#L357-L386
Jasig/spring-portlet-contrib
spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/context/PortletContextLoader.java
PortletContextLoader.customizeContext
protected void customizeContext(PortletContext portletContext, ConfigurablePortletApplicationContext applicationContext) { """ Customize the {@link org.springframework.web.portlet.context.ConfigurablePortletApplicationContext} created by this PortletContextLoader after config locations have been supplied to the c...
java
protected void customizeContext(PortletContext portletContext, ConfigurablePortletApplicationContext applicationContext) { List<Class<ApplicationContextInitializer<ConfigurableApplicationContext>>> initializerClasses = determineContextInitializerClasses(portletContext); if (initializerC...
[ "protected", "void", "customizeContext", "(", "PortletContext", "portletContext", ",", "ConfigurablePortletApplicationContext", "applicationContext", ")", "{", "List", "<", "Class", "<", "ApplicationContextInitializer", "<", "ConfigurableApplicationContext", ">>>", "initializer...
Customize the {@link org.springframework.web.portlet.context.ConfigurablePortletApplicationContext} created by this PortletContextLoader after config locations have been supplied to the context but before the context is <em>refreshed</em>. <p>The default implementation {@linkplain #determineContextInitializerClasses(Po...
[ "Customize", "the", "{", "@link", "org", ".", "springframework", ".", "web", ".", "portlet", ".", "context", ".", "ConfigurablePortletApplicationContext", "}", "created", "by", "this", "PortletContextLoader", "after", "config", "locations", "have", "been", "supplied...
train
https://github.com/Jasig/spring-portlet-contrib/blob/719240fa268ddc69900ce9775d9cad3b9c543c6b/spring-webmvc-portlet-contrib/src/main/java/org/jasig/springframework/web/portlet/context/PortletContextLoader.java#L403-L433
landawn/AbacusUtil
src/com/landawn/abacus/util/JdbcUtil.java
JdbcUtil.prepareQuery
public static PreparedQuery prepareQuery(final Connection conn, final String sql) throws SQLException { """ Never write below code because it will definitely cause {@code Connection} leak: <pre> <code> JdbcUtil.prepareQuery(dataSource.getConnection(), sql); </code> </pre> @param conn the specified {@code c...
java
public static PreparedQuery prepareQuery(final Connection conn, final String sql) throws SQLException { return new PreparedQuery(conn.prepareStatement(sql)); }
[ "public", "static", "PreparedQuery", "prepareQuery", "(", "final", "Connection", "conn", ",", "final", "String", "sql", ")", "throws", "SQLException", "{", "return", "new", "PreparedQuery", "(", "conn", ".", "prepareStatement", "(", "sql", ")", ")", ";", "}" ]
Never write below code because it will definitely cause {@code Connection} leak: <pre> <code> JdbcUtil.prepareQuery(dataSource.getConnection(), sql); </code> </pre> @param conn the specified {@code conn} won't be close after this query is executed. @param sql @return @throws SQLException
[ "Never", "write", "below", "code", "because", "it", "will", "definitely", "cause", "{", "@code", "Connection", "}", "leak", ":", "<pre", ">", "<code", ">", "JdbcUtil", ".", "prepareQuery", "(", "dataSource", ".", "getConnection", "()", "sql", ")", ";", "<"...
train
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/JdbcUtil.java#L1273-L1275
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/trees/MemoryTreebank.java
MemoryTreebank.loadPath
@Override public void loadPath(File path, FileFilter filt) { """ Load trees from given directory. @param path file or directory to load from @param filt a FilenameFilter of files to load """ FilePathProcessor.processPath(path, filt, this); }
java
@Override public void loadPath(File path, FileFilter filt) { FilePathProcessor.processPath(path, filt, this); }
[ "@", "Override", "public", "void", "loadPath", "(", "File", "path", ",", "FileFilter", "filt", ")", "{", "FilePathProcessor", ".", "processPath", "(", "path", ",", "filt", ",", "this", ")", ";", "}" ]
Load trees from given directory. @param path file or directory to load from @param filt a FilenameFilter of files to load
[ "Load", "trees", "from", "given", "directory", "." ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/MemoryTreebank.java#L148-L151
spring-projects/spring-ldap
core/src/main/java/org/springframework/ldap/control/AbstractFallbackRequestAndResponseControlDirContextProcessor.java
AbstractFallbackRequestAndResponseControlDirContextProcessor.invokeMethod
protected Object invokeMethod(String method, Class<?> clazz, Object control) { """ Utility method for invoking a method on a Control. @param method name of method to invoke @param clazz Class of the object that the method should be invoked on @param control Instance that the method should be invoked on @return...
java
protected Object invokeMethod(String method, Class<?> clazz, Object control) { Method actualMethod = ReflectionUtils.findMethod(clazz, method); return ReflectionUtils.invokeMethod(actualMethod, control); }
[ "protected", "Object", "invokeMethod", "(", "String", "method", ",", "Class", "<", "?", ">", "clazz", ",", "Object", "control", ")", "{", "Method", "actualMethod", "=", "ReflectionUtils", ".", "findMethod", "(", "clazz", ",", "method", ")", ";", "return", ...
Utility method for invoking a method on a Control. @param method name of method to invoke @param clazz Class of the object that the method should be invoked on @param control Instance that the method should be invoked on @return the invocation result, if any
[ "Utility", "method", "for", "invoking", "a", "method", "on", "a", "Control", "." ]
train
https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/control/AbstractFallbackRequestAndResponseControlDirContextProcessor.java#L147-L150
wcm-io/wcm-io-sling
commons/src/main/java/io/wcm/sling/commons/request/RequestParam.java
RequestParam.getFloat
public static float getFloat(@NotNull ServletRequest request, @NotNull String param) { """ Returns a request parameter as float. @param request Request. @param param Parameter name. @return Parameter value or 0 if it does not exist or is not a number. """ return getFloat(request, param, 0f); }
java
public static float getFloat(@NotNull ServletRequest request, @NotNull String param) { return getFloat(request, param, 0f); }
[ "public", "static", "float", "getFloat", "(", "@", "NotNull", "ServletRequest", "request", ",", "@", "NotNull", "String", "param", ")", "{", "return", "getFloat", "(", "request", ",", "param", ",", "0f", ")", ";", "}" ]
Returns a request parameter as float. @param request Request. @param param Parameter name. @return Parameter value or 0 if it does not exist or is not a number.
[ "Returns", "a", "request", "parameter", "as", "float", "." ]
train
https://github.com/wcm-io/wcm-io-sling/blob/90adbe432469378794b5695c72e9cdfa2b7d36f1/commons/src/main/java/io/wcm/sling/commons/request/RequestParam.java#L189-L191
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java
NodeSequence.batchOf
public static Batch batchOf( final Collection<CachedNode> nodes, final float score, final String workspaceName ) { """ Create a batch of nodes around the supplied iterable container. Note that the supplied iterator is accessed lazily only when the ...
java
public static Batch batchOf( final Collection<CachedNode> nodes, final float score, final String workspaceName ) { if (nodes == null) return emptyBatch(workspaceName, 1); return batchOf(nodes.iterator(), nodes.size(), score, workspaceName...
[ "public", "static", "Batch", "batchOf", "(", "final", "Collection", "<", "CachedNode", ">", "nodes", ",", "final", "float", "score", ",", "final", "String", "workspaceName", ")", "{", "if", "(", "nodes", "==", "null", ")", "return", "emptyBatch", "(", "wor...
Create a batch of nodes around the supplied iterable container. Note that the supplied iterator is accessed lazily only when the batch is {@link Batch#nextRow() used}. @param nodes the collection of nodes to be returned; if null, an {@link #emptySequence empty instance} is returned @param score the score to return for...
[ "Create", "a", "batch", "of", "nodes", "around", "the", "supplied", "iterable", "container", ".", "Note", "that", "the", "supplied", "iterator", "is", "accessed", "lazily", "only", "when", "the", "batch", "is", "{", "@link", "Batch#nextRow", "()", "used", "}...
train
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L1312-L1317
Azure/azure-sdk-for-java
sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasesInner.java
DatabasesInner.beginExportAsync
public Observable<ImportExportOperationResultInner> beginExportAsync(String resourceGroupName, String serverName, String databaseName, ImportExportDatabaseDefinition parameters) { """ Exports a database. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this valu...
java
public Observable<ImportExportOperationResultInner> beginExportAsync(String resourceGroupName, String serverName, String databaseName, ImportExportDatabaseDefinition parameters) { return beginExportWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1<ServiceResponse<Im...
[ "public", "Observable", "<", "ImportExportOperationResultInner", ">", "beginExportAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "databaseName", ",", "ImportExportDatabaseDefinition", "parameters", ")", "{", "return", "beginExportWit...
Exports a database. @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. @param parameters The database export request para...
[ "Exports", "a", "database", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/DatabasesInner.java#L1026-L1033
googleads/googleads-java-lib
modules/ads_lib/src/main/java/com/google/api/ads/admanager/lib/utils/DateTimesHelper.java
DateTimesHelper.toDateTime
public T toDateTime(String dateTime, String timeZoneId) { """ Converts a string in the form of {@code yyyy-MM-dd'T'HH:mm:ss} to an API date time in the time zone supplied. """ return toDateTime(ISODateTimeFormat.dateHourMinuteSecond().parseDateTime(dateTime) .withZoneRetainFields(DateTimeZone.forT...
java
public T toDateTime(String dateTime, String timeZoneId) { return toDateTime(ISODateTimeFormat.dateHourMinuteSecond().parseDateTime(dateTime) .withZoneRetainFields(DateTimeZone.forTimeZone(TimeZone.getTimeZone(timeZoneId)))); }
[ "public", "T", "toDateTime", "(", "String", "dateTime", ",", "String", "timeZoneId", ")", "{", "return", "toDateTime", "(", "ISODateTimeFormat", ".", "dateHourMinuteSecond", "(", ")", ".", "parseDateTime", "(", "dateTime", ")", ".", "withZoneRetainFields", "(", ...
Converts a string in the form of {@code yyyy-MM-dd'T'HH:mm:ss} to an API date time in the time zone supplied.
[ "Converts", "a", "string", "in", "the", "form", "of", "{" ]
train
https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/ads_lib/src/main/java/com/google/api/ads/admanager/lib/utils/DateTimesHelper.java#L109-L112
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/utilities/FeatureIO.java
FeatureIO.writeBinary
public static void writeBinary(String featuresFileName, double[][] features) throws Exception { """ Takes a two-dimensional double array with features and writes them in a binary file. @param featuresFileName The binary file's name. @param features The features. @throws Exception """ DataOutputStream...
java
public static void writeBinary(String featuresFileName, double[][] features) throws Exception { DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream( featuresFileName))); for (int i = 0; i < features.length; i++) { for (int j = 0; j < features[i].length; j++) { o...
[ "public", "static", "void", "writeBinary", "(", "String", "featuresFileName", ",", "double", "[", "]", "[", "]", "features", ")", "throws", "Exception", "{", "DataOutputStream", "out", "=", "new", "DataOutputStream", "(", "new", "BufferedOutputStream", "(", "new...
Takes a two-dimensional double array with features and writes them in a binary file. @param featuresFileName The binary file's name. @param features The features. @throws Exception
[ "Takes", "a", "two", "-", "dimensional", "double", "array", "with", "features", "and", "writes", "them", "in", "a", "binary", "file", "." ]
train
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/utilities/FeatureIO.java#L101-L110
vkostyukov/la4j
src/main/java/org/la4j/Matrices.java
Matrices.asProductFunctionAccumulator
public static MatrixAccumulator asProductFunctionAccumulator(final double neutral, final MatrixFunction function) { """ Creates a product function accumulator, that calculates the product of all elements in the matrix after applying given {@code fun...
java
public static MatrixAccumulator asProductFunctionAccumulator(final double neutral, final MatrixFunction function) { return new MatrixAccumulator() { private final MatrixAccumulator productAccumulator = Matrices.asProductAccumulator(neu...
[ "public", "static", "MatrixAccumulator", "asProductFunctionAccumulator", "(", "final", "double", "neutral", ",", "final", "MatrixFunction", "function", ")", "{", "return", "new", "MatrixAccumulator", "(", ")", "{", "private", "final", "MatrixAccumulator", "productAccumu...
Creates a product function accumulator, that calculates the product of all elements in the matrix after applying given {@code function} to each of them. @param neutral the neutral value @param function the matrix function @return a product function accumulator
[ "Creates", "a", "product", "function", "accumulator", "that", "calculates", "the", "product", "of", "all", "elements", "in", "the", "matrix", "after", "applying", "given", "{", "@code", "function", "}", "to", "each", "of", "them", "." ]
train
https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Matrices.java#L718-L733
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/ContextManager.java
ContextManager.getURLIndex
private int getURLIndex(String url, List<String> urlList) { """ Returns URL index in the URL list. @param url URL @param urlList List of URLs @return URL index """ int urlIndex = 0; int numURLs = urlList.size(); // get URL index if (url != null) for (int i = 0;...
java
private int getURLIndex(String url, List<String> urlList) { int urlIndex = 0; int numURLs = urlList.size(); // get URL index if (url != null) for (int i = 0; i < numURLs; i++) if ((urlList.get(i)).equalsIgnoreCase(url)) { urlIndex = i; ...
[ "private", "int", "getURLIndex", "(", "String", "url", ",", "List", "<", "String", ">", "urlList", ")", "{", "int", "urlIndex", "=", "0", ";", "int", "numURLs", "=", "urlList", ".", "size", "(", ")", ";", "// get URL index", "if", "(", "url", "!=", "...
Returns URL index in the URL list. @param url URL @param urlList List of URLs @return URL index
[ "Returns", "URL", "index", "in", "the", "URL", "list", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/ContextManager.java#L932-L945
intive-FDV/DynamicJasper
src/main/java/ar/com/fdvs/dj/domain/builders/FastReportBuilder.java
FastReportBuilder.addBarcodeColumn
public FastReportBuilder addBarcodeColumn(String title, String property,String className, int barcodeType,boolean showText, int width, boolean fixedWidth,ImageScaleMode imageScaleMode, Style style) throws ColumnBuilderException, ClassNotFoundException { """ By default uses InputStream as the type of the image @p...
java
public FastReportBuilder addBarcodeColumn(String title, String property,String className, int barcodeType,boolean showText, int width, boolean fixedWidth,ImageScaleMode imageScaleMode, Style style) throws ColumnBuilderException, ClassNotFoundException { AbstractColumn column = ColumnBuilder.getNew() .setColumnProp...
[ "public", "FastReportBuilder", "addBarcodeColumn", "(", "String", "title", ",", "String", "property", ",", "String", "className", ",", "int", "barcodeType", ",", "boolean", "showText", ",", "int", "width", ",", "boolean", "fixedWidth", ",", "ImageScaleMode", "imag...
By default uses InputStream as the type of the image @param title @param property @param width @param fixedWidth @param imageScaleMode @param style @return @throws ColumnBuilderException @throws ClassNotFoundException
[ "By", "default", "uses", "InputStream", "as", "the", "type", "of", "the", "image" ]
train
https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/domain/builders/FastReportBuilder.java#L343-L361
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/network/onlinkipv6prefix.java
onlinkipv6prefix.get
public static onlinkipv6prefix get(nitro_service service, String ipv6prefix) throws Exception { """ Use this API to fetch onlinkipv6prefix resource of given name . """ onlinkipv6prefix obj = new onlinkipv6prefix(); obj.set_ipv6prefix(ipv6prefix); onlinkipv6prefix response = (onlinkipv6prefix) obj.get_res...
java
public static onlinkipv6prefix get(nitro_service service, String ipv6prefix) throws Exception{ onlinkipv6prefix obj = new onlinkipv6prefix(); obj.set_ipv6prefix(ipv6prefix); onlinkipv6prefix response = (onlinkipv6prefix) obj.get_resource(service); return response; }
[ "public", "static", "onlinkipv6prefix", "get", "(", "nitro_service", "service", ",", "String", "ipv6prefix", ")", "throws", "Exception", "{", "onlinkipv6prefix", "obj", "=", "new", "onlinkipv6prefix", "(", ")", ";", "obj", ".", "set_ipv6prefix", "(", "ipv6prefix",...
Use this API to fetch onlinkipv6prefix resource of given name .
[ "Use", "this", "API", "to", "fetch", "onlinkipv6prefix", "resource", "of", "given", "name", "." ]
train
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/network/onlinkipv6prefix.java#L432-L437
xvik/dropwizard-guicey
src/main/java/ru/vyarus/dropwizard/guice/module/context/ConfigurationContext.java
ConfigurationContext.getOrRegisterExtension
public ExtensionItemInfoImpl getOrRegisterExtension(final Class<?> extension, final boolean fromScan) { """ Extensions classpath scan requires testing with all installers to recognize actual extensions. To avoid duplicate installers recognition, extensions resolved by classpath scan are registered immediately. I...
java
public ExtensionItemInfoImpl getOrRegisterExtension(final Class<?> extension, final boolean fromScan) { final ExtensionItemInfoImpl info; if (fromScan) { setScope(ConfigScope.ClasspathScan.getType()); info = register(ConfigItem.Extension, extension); closeScope(); ...
[ "public", "ExtensionItemInfoImpl", "getOrRegisterExtension", "(", "final", "Class", "<", "?", ">", "extension", ",", "final", "boolean", "fromScan", ")", "{", "final", "ExtensionItemInfoImpl", "info", ";", "if", "(", "fromScan", ")", "{", "setScope", "(", "Confi...
Extensions classpath scan requires testing with all installers to recognize actual extensions. To avoid duplicate installers recognition, extensions resolved by classpath scan are registered immediately. It's required because of not obvious method used for both manually registered extensions (to obtain container) and t...
[ "Extensions", "classpath", "scan", "requires", "testing", "with", "all", "installers", "to", "recognize", "actual", "extensions", ".", "To", "avoid", "duplicate", "installers", "recognition", "extensions", "resolved", "by", "classpath", "scan", "are", "registered", ...
train
https://github.com/xvik/dropwizard-guicey/blob/dd39ad77283555be21f606d5ebf0f11207a733d4/src/main/java/ru/vyarus/dropwizard/guice/module/context/ConfigurationContext.java#L382-L394
aws/aws-sdk-java
aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/ListJobsRequest.java
ListJobsRequest.withTags
public ListJobsRequest withTags(java.util.Map<String, String> tags) { """ <p> Specifies to return only these tagged resources. </p> @param tags Specifies to return only these tagged resources. @return Returns a reference to this object so that method calls can be chained together. """ setTags(ta...
java
public ListJobsRequest withTags(java.util.Map<String, String> tags) { setTags(tags); return this; }
[ "public", "ListJobsRequest", "withTags", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "setTags", "(", "tags", ")", ";", "return", "this", ";", "}" ]
<p> Specifies to return only these tagged resources. </p> @param tags Specifies to return only these tagged resources. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "Specifies", "to", "return", "only", "these", "tagged", "resources", ".", "<", "/", "p", ">" ]
train
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-glue/src/main/java/com/amazonaws/services/glue/model/ListJobsRequest.java#L162-L165
cdk/cdk
legacy/src/main/java/org/openscience/cdk/smsd/tools/ExtAtomContainerManipulator.java
ExtAtomContainerManipulator.makeDeepCopy
public static IAtomContainer makeDeepCopy(IAtomContainer container) { """ Retrurns deep copy of the molecule @param container @return deep copy of the mol """ IAtomContainer newAtomContainer = container.getBuilder().newInstance(IAtomContainer.class); // Deep copy of the Atoms IA...
java
public static IAtomContainer makeDeepCopy(IAtomContainer container) { IAtomContainer newAtomContainer = container.getBuilder().newInstance(IAtomContainer.class); // Deep copy of the Atoms IAtom[] atoms = copyAtoms(container, newAtomContainer); // Deep copy of the bonds ...
[ "public", "static", "IAtomContainer", "makeDeepCopy", "(", "IAtomContainer", "container", ")", "{", "IAtomContainer", "newAtomContainer", "=", "container", ".", "getBuilder", "(", ")", ".", "newInstance", "(", "IAtomContainer", ".", "class", ")", ";", "// Deep ...
Retrurns deep copy of the molecule @param container @return deep copy of the mol
[ "Retrurns", "deep", "copy", "of", "the", "molecule" ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/tools/ExtAtomContainerManipulator.java#L89-L118
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/value/binary/FileSystemBinaryStore.java
FileSystemBinaryStore.pruneEmptyDirectories
protected void pruneEmptyDirectories( File directory, File removeable ) { """ Remove any empty directories above <code>removeable</code> but below <code>directory</code> @param directory the top-level directory to keep; may not be null and must be an ancestor of <code>r...
java
protected void pruneEmptyDirectories( File directory, File removeable ) { assert directory != null; assert removeable != null; if (directory.equals(removeable)) { return; } assert isAncestor(directory, removeable); wh...
[ "protected", "void", "pruneEmptyDirectories", "(", "File", "directory", ",", "File", "removeable", ")", "{", "assert", "directory", "!=", "null", ";", "assert", "removeable", "!=", "null", ";", "if", "(", "directory", ".", "equals", "(", "removeable", ")", "...
Remove any empty directories above <code>removeable</code> but below <code>directory</code> @param directory the top-level directory to keep; may not be null and must be an ancestor of <code>removeable</code> @param removeable the file or directory above which any empty directories can be removed; may not be null
[ "Remove", "any", "empty", "directories", "above", "<code", ">", "removeable<", "/", "code", ">", "but", "below", "<code", ">", "directory<", "/", "code", ">" ]
train
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/value/binary/FileSystemBinaryStore.java#L443-L462
square/otto
otto/src/main/java/com/squareup/otto/Bus.java
Bus.throwRuntimeException
private static void throwRuntimeException(String msg, InvocationTargetException e) { """ Throw a {@link RuntimeException} with given message and cause lifted from an {@link InvocationTargetException}. If the specified {@link InvocationTargetException} does not have a cause, neither will the {@link RuntimeExcepti...
java
private static void throwRuntimeException(String msg, InvocationTargetException e) { Throwable cause = e.getCause(); if (cause != null) { throw new RuntimeException(msg + ": " + cause.getMessage(), cause); } else { throw new RuntimeException(msg + ": " + e.getMessage(), e); } }
[ "private", "static", "void", "throwRuntimeException", "(", "String", "msg", ",", "InvocationTargetException", "e", ")", "{", "Throwable", "cause", "=", "e", ".", "getCause", "(", ")", ";", "if", "(", "cause", "!=", "null", ")", "{", "throw", "new", "Runtim...
Throw a {@link RuntimeException} with given message and cause lifted from an {@link InvocationTargetException}. If the specified {@link InvocationTargetException} does not have a cause, neither will the {@link RuntimeException}.
[ "Throw", "a", "{" ]
train
https://github.com/square/otto/blob/2a67589abd91879cf23a8c96542b59349485ec3d/otto/src/main/java/com/squareup/otto/Bus.java#L457-L464
graknlabs/grakn
server/src/server/exception/TransactionException.java
TransactionException.changingSuperWillDisconnectRole
public static TransactionException changingSuperWillDisconnectRole(Type oldSuper, Type newSuper, Role role) { """ Thrown when changing the super of a Type will result in a Role disconnection which is in use. """ return create(String.format("Cannot change the super type {%s} to {%s} because {%s} is conn...
java
public static TransactionException changingSuperWillDisconnectRole(Type oldSuper, Type newSuper, Role role) { return create(String.format("Cannot change the super type {%s} to {%s} because {%s} is connected to role {%s} which {%s} is not connected to.", oldSuper.label(), newS...
[ "public", "static", "TransactionException", "changingSuperWillDisconnectRole", "(", "Type", "oldSuper", ",", "Type", "newSuper", ",", "Role", "role", ")", "{", "return", "create", "(", "String", ".", "format", "(", "\"Cannot change the super type {%s} to {%s} because {%s}...
Thrown when changing the super of a Type will result in a Role disconnection which is in use.
[ "Thrown", "when", "changing", "the", "super", "of", "a", "Type", "will", "result", "in", "a", "Role", "disconnection", "which", "is", "in", "use", "." ]
train
https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/exception/TransactionException.java#L284-L287
buschmais/jqa-core-framework
rule/src/main/java/com/buschmais/jqassistant/core/rule/api/executor/RuleSetExecutor.java
RuleSetExecutor.validateConstraint
private void validateConstraint(RuleSet ruleSet, Constraint constraint, Severity severity) throws RuleException { """ Validates the given constraint. @param constraint The constraint. @throws RuleException If the constraint cannot be validated. """ if (!executedConstraints.contains(constraint)) {...
java
private void validateConstraint(RuleSet ruleSet, Constraint constraint, Severity severity) throws RuleException { if (!executedConstraints.contains(constraint)) { if (applyRequiredConcepts(ruleSet, constraint)) { ruleVisitor.visitConstraint(constraint, severity); } else {...
[ "private", "void", "validateConstraint", "(", "RuleSet", "ruleSet", ",", "Constraint", "constraint", ",", "Severity", "severity", ")", "throws", "RuleException", "{", "if", "(", "!", "executedConstraints", ".", "contains", "(", "constraint", ")", ")", "{", "if",...
Validates the given constraint. @param constraint The constraint. @throws RuleException If the constraint cannot be validated.
[ "Validates", "the", "given", "constraint", "." ]
train
https://github.com/buschmais/jqa-core-framework/blob/0e63ff509cfe52f9063539a23d5f9f183b2ea4a5/rule/src/main/java/com/buschmais/jqassistant/core/rule/api/executor/RuleSetExecutor.java#L145-L154
VoltDB/voltdb
src/frontend/org/voltdb/OpsAgent.java
OpsAgent.distributeOpsWork
protected void distributeOpsWork(PendingOpsRequest newRequest, JSONObject obj) throws Exception { """ For OPS actions which run on every node, this method will distribute the necessary parameters to its peers on the other cluster nodes. Additionally, it will pre-check for excessive outstanding requests,...
java
protected void distributeOpsWork(PendingOpsRequest newRequest, JSONObject obj) throws Exception { if (m_pendingRequests.size() > MAX_IN_FLIGHT_REQUESTS) { /* * Defensively check for an expired request not caught * by timeout check. Should never happen. ...
[ "protected", "void", "distributeOpsWork", "(", "PendingOpsRequest", "newRequest", ",", "JSONObject", "obj", ")", "throws", "Exception", "{", "if", "(", "m_pendingRequests", ".", "size", "(", ")", ">", "MAX_IN_FLIGHT_REQUESTS", ")", "{", "/*\n * Defensively...
For OPS actions which run on every node, this method will distribute the necessary parameters to its peers on the other cluster nodes. Additionally, it will pre-check for excessive outstanding requests, and initialize the tracking and timeout of the new request. Subclasses of OpsAgent should use this when they need t...
[ "For", "OPS", "actions", "which", "run", "on", "every", "node", "this", "method", "will", "distribute", "the", "necessary", "parameters", "to", "its", "peers", "on", "the", "other", "cluster", "nodes", ".", "Additionally", "it", "will", "pre", "-", "check", ...
train
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/OpsAgent.java#L308-L355
basho/riak-java-client
src/main/java/com/basho/riak/client/core/query/functions/Function.java
Function.newErlangFunction
public static Function newErlangFunction(String module, String function) { """ Static factory method for Erlang Functions. @param module the module that contains the Erlang function. @param function the name of the erlang function. @return a Function representing a Erlang function. """ return new Bu...
java
public static Function newErlangFunction(String module, String function) { return new Builder().withModule(module).withFunction(function).build(); }
[ "public", "static", "Function", "newErlangFunction", "(", "String", "module", ",", "String", "function", ")", "{", "return", "new", "Builder", "(", ")", ".", "withModule", "(", "module", ")", ".", "withFunction", "(", "function", ")", ".", "build", "(", ")...
Static factory method for Erlang Functions. @param module the module that contains the Erlang function. @param function the name of the erlang function. @return a Function representing a Erlang function.
[ "Static", "factory", "method", "for", "Erlang", "Functions", "." ]
train
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/query/functions/Function.java#L188-L191
hawkular/hawkular-agent
hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SecurityDomainJBossASClient.java
SecurityDomainJBossASClient.createNewDatabaseServerSecurityDomain72
public void createNewDatabaseServerSecurityDomain72(String securityDomainName, String dsJndiName, String principalsQuery, String rolesQuery, String hashAlgorithm, String hashEncoding) throws Exception { """ Create a new security domain using the database server authentication method. This ...
java
public void createNewDatabaseServerSecurityDomain72(String securityDomainName, String dsJndiName, String principalsQuery, String rolesQuery, String hashAlgorithm, String hashEncoding) throws Exception { Address addr = Address.root().add(SUBSYSTEM, SUBSYSTEM_SECURITY, SECURITY_DOMAIN, se...
[ "public", "void", "createNewDatabaseServerSecurityDomain72", "(", "String", "securityDomainName", ",", "String", "dsJndiName", ",", "String", "principalsQuery", ",", "String", "rolesQuery", ",", "String", "hashAlgorithm", ",", "String", "hashEncoding", ")", "throws", "E...
Create a new security domain using the database server authentication method. This is used when you want to directly authenticate against a db entry. This is for AS 7.2+ (e.g. EAP 6.1) and works around https://issues.jboss.org/browse/AS7-6527 @param securityDomainName the name of the new security domain @param dsJndiN...
[ "Create", "a", "new", "security", "domain", "using", "the", "database", "server", "authentication", "method", ".", "This", "is", "used", "when", "you", "want", "to", "directly", "authenticate", "against", "a", "db", "entry", ".", "This", "is", "for", "AS", ...
train
https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SecurityDomainJBossASClient.java#L207-L238
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/CocoaPodsAnalyzer.java
CocoaPodsAnalyzer.determineEvidence
private String determineEvidence(String contents, String blockVariable, String fieldPattern) { """ Extracts evidence from the contents and adds it to the given evidence collection. @param contents the text to extract evidence from @param blockVariable the block variable within the content to search for @para...
java
private String determineEvidence(String contents, String blockVariable, String fieldPattern) { String value = ""; //capture array value between [ ] final Matcher arrayMatcher = Pattern.compile( String.format("\\s*?%s\\.%s\\s*?=\\s*?\\{\\s*?(.*?)\\s*?\\}", blockVariable, fieldPat...
[ "private", "String", "determineEvidence", "(", "String", "contents", ",", "String", "blockVariable", ",", "String", "fieldPattern", ")", "{", "String", "value", "=", "\"\"", ";", "//capture array value between [ ]", "final", "Matcher", "arrayMatcher", "=", "Pattern", ...
Extracts evidence from the contents and adds it to the given evidence collection. @param contents the text to extract evidence from @param blockVariable the block variable within the content to search for @param fieldPattern the field pattern within the contents to search for @return the evidence
[ "Extracts", "evidence", "from", "the", "contents", "and", "adds", "it", "to", "the", "given", "evidence", "collection", "." ]
train
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/CocoaPodsAnalyzer.java#L290-L308
brianwhu/xillium
base/src/main/java/org/xillium/base/text/Balanced.java
Balanced.indexOf
public static int indexOf( Functor<Integer, Integer> symbols, String text, int begin, int end, char target, Functor<Integer, Integer> extra ) { """ Returns the index within a string of the first occurrence of the specified character, similar to {@code String.indexOf}. However, any occurrence of the specif...
java
public static int indexOf( Functor<Integer, Integer> symbols, String text, int begin, int end, char target, Functor<Integer, Integer> extra ) { ArrayDeque<Integer> deque = new ArrayDeque<>(); while (begin < end) { int c = text.charAt(begin); if (deque.size() > 0 && c == b...
[ "public", "static", "int", "indexOf", "(", "Functor", "<", "Integer", ",", "Integer", ">", "symbols", ",", "String", "text", ",", "int", "begin", ",", "int", "end", ",", "char", "target", ",", "Functor", "<", "Integer", ",", "Integer", ">", "extra", ")...
Returns the index within a string of the first occurrence of the specified character, similar to {@code String.indexOf}. However, any occurrence of the specified character enclosed between balanced symbols is ignored. @param symbols an optional functor to provide the complete set of balancing symbols @param text a Str...
[ "Returns", "the", "index", "within", "a", "string", "of", "the", "first", "occurrence", "of", "the", "specified", "character", "similar", "to", "{", "@code", "String", ".", "indexOf", "}", ".", "However", "any", "occurrence", "of", "the", "specified", "chara...
train
https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/text/Balanced.java#L39-L55
mabe02/lanterna
src/main/java/com/googlecode/lanterna/terminal/swing/TerminalEmulatorColorConfiguration.java
TerminalEmulatorColorConfiguration.toAWTColor
public Color toAWTColor(TextColor color, boolean isForeground, boolean inBoldContext) { """ Given a TextColor and a hint as to if the color is to be used as foreground or not and if we currently have bold text enabled or not, it returns the closest AWT color that matches this. @param color What text color to con...
java
public Color toAWTColor(TextColor color, boolean isForeground, boolean inBoldContext) { if(color instanceof TextColor.ANSI) { return colorPalette.get((TextColor.ANSI)color, isForeground, inBoldContext && useBrightColorsOnBold); } return color.toColor(); }
[ "public", "Color", "toAWTColor", "(", "TextColor", "color", ",", "boolean", "isForeground", ",", "boolean", "inBoldContext", ")", "{", "if", "(", "color", "instanceof", "TextColor", ".", "ANSI", ")", "{", "return", "colorPalette", ".", "get", "(", "(", "Text...
Given a TextColor and a hint as to if the color is to be used as foreground or not and if we currently have bold text enabled or not, it returns the closest AWT color that matches this. @param color What text color to convert @param isForeground Is the color intended to be used as foreground color @param inBoldContext ...
[ "Given", "a", "TextColor", "and", "a", "hint", "as", "to", "if", "the", "color", "is", "to", "be", "used", "as", "foreground", "or", "not", "and", "if", "we", "currently", "have", "bold", "text", "enabled", "or", "not", "it", "returns", "the", "closest...
train
https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/terminal/swing/TerminalEmulatorColorConfiguration.java#L66-L71
super-csv/super-csv
super-csv/src/main/java/org/supercsv/cellprocessor/ParseDateTimeAbstract.java
ParseDateTimeAbstract.checkPreconditions
private static void checkPreconditions(final String dateFormat, final Locale locale) { """ Checks the preconditions for creating a new ParseDateTimeAbstract processor with date format and locale. @param dateFormat the date format to use @param locale the Locale used to parse the date @throws NullPointerExce...
java
private static void checkPreconditions(final String dateFormat, final Locale locale) { if( dateFormat == null ) { throw new NullPointerException("dateFormat should not be null"); } else if( locale == null ) { throw new NullPointerException("locale should not be null"); } }
[ "private", "static", "void", "checkPreconditions", "(", "final", "String", "dateFormat", ",", "final", "Locale", "locale", ")", "{", "if", "(", "dateFormat", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"dateFormat should not be null\"", ...
Checks the preconditions for creating a new ParseDateTimeAbstract processor with date format and locale. @param dateFormat the date format to use @param locale the Locale used to parse the date @throws NullPointerException if dateFormat or locale is null
[ "Checks", "the", "preconditions", "for", "creating", "a", "new", "ParseDateTimeAbstract", "processor", "with", "date", "format", "and", "locale", "." ]
train
https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/cellprocessor/ParseDateTimeAbstract.java#L196-L202
geomajas/geomajas-project-hammer-gwt
hammer-gwt/src/main/java/org/geomajas/hammergwt/client/HammerTime.java
HammerTime.setOption
@Api public <T> void setOption(GestureOption<T> option, T value) { """ Change the initial settings of hammer Gwt. @param option {@link org.geomajas.hammergwt.client.option.GestureOption} @param value T look at {@link org.geomajas.hammergwt.client.option.GestureOptions} interface for all possible types @pa...
java
@Api public <T> void setOption(GestureOption<T> option, T value) { if (value == null) { throw new IllegalArgumentException("Null value passed."); } if (value instanceof Boolean) { setOption(this, (Boolean) value, option.getName()); } else if (value instanceof Integer) { setOption(this, (Integer) valu...
[ "@", "Api", "public", "<", "T", ">", "void", "setOption", "(", "GestureOption", "<", "T", ">", "option", ",", "T", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Null value passed.\"", "...
Change the initial settings of hammer Gwt. @param option {@link org.geomajas.hammergwt.client.option.GestureOption} @param value T look at {@link org.geomajas.hammergwt.client.option.GestureOptions} interface for all possible types @param <T> @since 1.0.0
[ "Change", "the", "initial", "settings", "of", "hammer", "Gwt", "." ]
train
https://github.com/geomajas/geomajas-project-hammer-gwt/blob/bc764171bed55e5a9eced72f0078ec22b8105b62/hammer-gwt/src/main/java/org/geomajas/hammergwt/client/HammerTime.java#L56-L73
Azure/azure-sdk-for-java
compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineImagesInner.java
VirtualMachineImagesInner.listSkus
public List<VirtualMachineImageResourceInner> listSkus(String location, String publisherName, String offer) { """ Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. @param location The name of a supported Azure region. @param publisherName A valid image publisher. @par...
java
public List<VirtualMachineImageResourceInner> listSkus(String location, String publisherName, String offer) { return listSkusWithServiceResponseAsync(location, publisherName, offer).toBlocking().single().body(); }
[ "public", "List", "<", "VirtualMachineImageResourceInner", ">", "listSkus", "(", "String", "location", ",", "String", "publisherName", ",", "String", "offer", ")", "{", "return", "listSkusWithServiceResponseAsync", "(", "location", ",", "publisherName", ",", "offer", ...
Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. @param location The name of a supported Azure region. @param publisherName A valid image publisher. @param offer A valid image publisher offer. @throws IllegalArgumentException thrown if parameters fail the validation @throws C...
[ "Gets", "a", "list", "of", "virtual", "machine", "image", "SKUs", "for", "the", "specified", "location", "publisher", "and", "offer", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineImagesInner.java#L568-L570
cryptomator/cryptofs
src/main/java/org/cryptomator/cryptofs/fh/ChunkIO.java
ChunkIO.registerChannel
public void registerChannel(FileChannel channel, boolean writable) { """ Makes the given channel a candidate to read (always) and write (only if writable) ciphertext from/to. @param channel @param writable """ readableChannels.add(channel); if (writable) { writableChannels.add(channel); } }
java
public void registerChannel(FileChannel channel, boolean writable) { readableChannels.add(channel); if (writable) { writableChannels.add(channel); } }
[ "public", "void", "registerChannel", "(", "FileChannel", "channel", ",", "boolean", "writable", ")", "{", "readableChannels", ".", "add", "(", "channel", ")", ";", "if", "(", "writable", ")", "{", "writableChannels", ".", "add", "(", "channel", ")", ";", "...
Makes the given channel a candidate to read (always) and write (only if writable) ciphertext from/to. @param channel @param writable
[ "Makes", "the", "given", "channel", "a", "candidate", "to", "read", "(", "always", ")", "and", "write", "(", "only", "if", "writable", ")", "ciphertext", "from", "/", "to", "." ]
train
https://github.com/cryptomator/cryptofs/blob/67fc1a4950dd1c150cd2e2c75bcabbeb7c9ac82e/src/main/java/org/cryptomator/cryptofs/fh/ChunkIO.java#L29-L34
apache/flink
flink-core/src/main/java/org/apache/flink/api/common/io/FileInputFormat.java
FileInputFormat.getStatistics
@Override public FileBaseStatistics getStatistics(BaseStatistics cachedStats) throws IOException { """ Obtains basic file statistics containing only file size. If the input is a directory, then the size is the sum of all contained files. @see org.apache.flink.api.common.io.InputFormat#getStatistics(org.apache....
java
@Override public FileBaseStatistics getStatistics(BaseStatistics cachedStats) throws IOException { final FileBaseStatistics cachedFileStats = cachedStats instanceof FileBaseStatistics ? (FileBaseStatistics) cachedStats : null; try { return getFileStats(cachedFileStats, getFilePaths(), new ArrayList<>...
[ "@", "Override", "public", "FileBaseStatistics", "getStatistics", "(", "BaseStatistics", "cachedStats", ")", "throws", "IOException", "{", "final", "FileBaseStatistics", "cachedFileStats", "=", "cachedStats", "instanceof", "FileBaseStatistics", "?", "(", "FileBaseStatistics...
Obtains basic file statistics containing only file size. If the input is a directory, then the size is the sum of all contained files. @see org.apache.flink.api.common.io.InputFormat#getStatistics(org.apache.flink.api.common.io.statistics.BaseStatistics)
[ "Obtains", "basic", "file", "statistics", "containing", "only", "file", "size", ".", "If", "the", "input", "is", "a", "directory", "then", "the", "size", "is", "the", "sum", "of", "all", "contained", "files", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/io/FileInputFormat.java#L473-L496
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java
SDBaseOps.matchConditionCount
public SDVariable matchConditionCount(String name, SDVariable in, Condition condition) { """ Returns a count of the number of elements that satisfy the condition @param name Name of the output variable @param in Input @param condition Condition @return Number of elements that the condition is sat...
java
public SDVariable matchConditionCount(String name, SDVariable in, Condition condition) { return matchConditionCount(name, in, condition, false); }
[ "public", "SDVariable", "matchConditionCount", "(", "String", "name", ",", "SDVariable", "in", ",", "Condition", "condition", ")", "{", "return", "matchConditionCount", "(", "name", ",", "in", ",", "condition", ",", "false", ")", ";", "}" ]
Returns a count of the number of elements that satisfy the condition @param name Name of the output variable @param in Input @param condition Condition @return Number of elements that the condition is satisfied for
[ "Returns", "a", "count", "of", "the", "number", "of", "elements", "that", "satisfy", "the", "condition" ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L1009-L1011
UrielCh/ovh-java-sdk
ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java
ApiOvhHostingweb.serviceName_localSeo_account_GET
public ArrayList<Long> serviceName_localSeo_account_GET(String serviceName, String email) throws IOException { """ Local SEO accounts associated to the hosting REST: GET /hosting/web/{serviceName}/localSeo/account @param email [required] Filter the value of email property (like) @param serviceName [required] ...
java
public ArrayList<Long> serviceName_localSeo_account_GET(String serviceName, String email) throws IOException { String qPath = "/hosting/web/{serviceName}/localSeo/account"; StringBuilder sb = path(qPath, serviceName); query(sb, "email", email); String resp = exec(qPath, "GET", sb.toString(), null); return con...
[ "public", "ArrayList", "<", "Long", ">", "serviceName_localSeo_account_GET", "(", "String", "serviceName", ",", "String", "email", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/hosting/web/{serviceName}/localSeo/account\"", ";", "StringBuilder", "sb", "...
Local SEO accounts associated to the hosting REST: GET /hosting/web/{serviceName}/localSeo/account @param email [required] Filter the value of email property (like) @param serviceName [required] The internal name of your hosting
[ "Local", "SEO", "accounts", "associated", "to", "the", "hosting" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L880-L886
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/shared/MultiTable.java
MultiTable.setHandle
public FieldList setHandle(Object bookmark, int iHandleType) throws DBException { """ Reposition to this record Using this bookmark. @exception DBException File exception. """ if ((iHandleType == DBConstants.OBJECT_ID_HANDLE) || (iHandleType == DBConstants.BOOKMARK_HANDLE)) { BaseT...
java
public FieldList setHandle(Object bookmark, int iHandleType) throws DBException { if ((iHandleType == DBConstants.OBJECT_ID_HANDLE) || (iHandleType == DBConstants.BOOKMARK_HANDLE)) { BaseTable table = null; Object strTable = this.getInfoFromHandle(bookmark, true, iHandleType)...
[ "public", "FieldList", "setHandle", "(", "Object", "bookmark", ",", "int", "iHandleType", ")", "throws", "DBException", "{", "if", "(", "(", "iHandleType", "==", "DBConstants", ".", "OBJECT_ID_HANDLE", ")", "||", "(", "iHandleType", "==", "DBConstants", ".", "...
Reposition to this record Using this bookmark. @exception DBException File exception.
[ "Reposition", "to", "this", "record", "Using", "this", "bookmark", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/shared/MultiTable.java#L142-L172
lmdbjava/lmdbjava
src/main/java/org/lmdbjava/Cursor.java
Cursor.get
public boolean get(final T key, final GetOp op) { """ Reposition the key/value buffers based on the passed key and operation. @param key to search for @param op options for this operation @return false if key not found """ if (SHOULD_CHECK) { requireNonNull(key); requireNonNull(op); ...
java
public boolean get(final T key, final GetOp op) { if (SHOULD_CHECK) { requireNonNull(key); requireNonNull(op); checkNotClosed(); txn.checkReady(); } kv.keyIn(key); final int rc = LIB.mdb_cursor_get(ptrCursor, kv.pointerKey(), kv .pointerVal(...
[ "public", "boolean", "get", "(", "final", "T", "key", ",", "final", "GetOp", "op", ")", "{", "if", "(", "SHOULD_CHECK", ")", "{", "requireNonNull", "(", "key", ")", ";", "requireNonNull", "(", "op", ")", ";", "checkNotClosed", "(", ")", ";", "txn", "...
Reposition the key/value buffers based on the passed key and operation. @param key to search for @param op options for this operation @return false if key not found
[ "Reposition", "the", "key", "/", "value", "buffers", "based", "on", "the", "passed", "key", "and", "operation", "." ]
train
https://github.com/lmdbjava/lmdbjava/blob/5912beb1037722c71f3ddc05e70fcbe739dfa272/src/main/java/org/lmdbjava/Cursor.java#L135-L155
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/mappings/BundlePathMapping.java
BundlePathMapping.setPathMappings
public void setPathMappings(List<String> pathMappings) { """ Sets the path mapping @param pathMappings the pathMappings to set """ this.pathMappings.clear(); if (pathMappings != null) { for (String mapping : pathMappings) { this.pathMappings.add(new PathMapping(bundle, mapping)); } } }
java
public void setPathMappings(List<String> pathMappings) { this.pathMappings.clear(); if (pathMappings != null) { for (String mapping : pathMappings) { this.pathMappings.add(new PathMapping(bundle, mapping)); } } }
[ "public", "void", "setPathMappings", "(", "List", "<", "String", ">", "pathMappings", ")", "{", "this", ".", "pathMappings", ".", "clear", "(", ")", ";", "if", "(", "pathMappings", "!=", "null", ")", "{", "for", "(", "String", "mapping", ":", "pathMappin...
Sets the path mapping @param pathMappings the pathMappings to set
[ "Sets", "the", "path", "mapping" ]
train
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/mappings/BundlePathMapping.java#L99-L108
google/closure-templates
java/src/com/google/template/soy/pysrc/internal/GenPyCallExprVisitor.java
GenPyCallExprVisitor.visitCallDelegateNode
@Override protected PyExpr visitCallDelegateNode(CallDelegateNode node) { """ Visits a delegate call node and builds the call expression to retrieve the function and execute it. The get_delegate_fn returns the function directly, so its output can be called directly. @param node The delegate call node. @retu...
java
@Override protected PyExpr visitCallDelegateNode(CallDelegateNode node) { ExprRootNode variantSoyExpr = node.getDelCalleeVariantExpr(); PyExpr variantPyExpr; if (variantSoyExpr == null) { // Case 1: Delegate call with empty variant. variantPyExpr = new PyStringExpr("''"); } else { //...
[ "@", "Override", "protected", "PyExpr", "visitCallDelegateNode", "(", "CallDelegateNode", "node", ")", "{", "ExprRootNode", "variantSoyExpr", "=", "node", ".", "getDelCalleeVariantExpr", "(", ")", ";", "PyExpr", "variantPyExpr", ";", "if", "(", "variantSoyExpr", "==...
Visits a delegate call node and builds the call expression to retrieve the function and execute it. The get_delegate_fn returns the function directly, so its output can be called directly. @param node The delegate call node. @return The call Python expression.
[ "Visits", "a", "delegate", "call", "node", "and", "builds", "the", "call", "expression", "to", "retrieve", "the", "function", "and", "execute", "it", ".", "The", "get_delegate_fn", "returns", "the", "function", "directly", "so", "its", "output", "can", "be", ...
train
https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/pysrc/internal/GenPyCallExprVisitor.java#L157-L179
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/KeyArea.java
KeyArea.lastModified
public int lastModified(int iAreaDesc, boolean bForceUniqueKey) { """ Any of these key fields modified? @param iAreaDesc The key field area to get the values from. @param iStartKeyFieldSeq The starting key field to check (from here on). @return true if any have been modified. """ // Set up the end key ...
java
public int lastModified(int iAreaDesc, boolean bForceUniqueKey) { // Set up the end key int iLastKeyField = this.getKeyFields(bForceUniqueKey, false) - 1; for (int iKeyFieldSeq = iLastKeyField; iKeyFieldSeq >= DBConstants.MAIN_KEY_FIELD; iKeyFieldSeq--) { KeyField keyField = th...
[ "public", "int", "lastModified", "(", "int", "iAreaDesc", ",", "boolean", "bForceUniqueKey", ")", "{", "// Set up the end key", "int", "iLastKeyField", "=", "this", ".", "getKeyFields", "(", "bForceUniqueKey", ",", "false", ")", "-", "1", ";", "for", "(", "int...
Any of these key fields modified? @param iAreaDesc The key field area to get the values from. @param iStartKeyFieldSeq The starting key field to check (from here on). @return true if any have been modified.
[ "Any", "of", "these", "key", "fields", "modified?" ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/KeyArea.java#L391-L401
google/error-prone-javac
src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java
EnumConstantBuilder.buildEnumConstant
public void buildEnumConstant(XMLNode node, Content memberDetailsTree) { """ Build the enum constant documentation. @param node the XML element that specifies which components to document @param memberDetailsTree the content tree to which the documentation will be added """ if (writer == null) { ...
java
public void buildEnumConstant(XMLNode node, Content memberDetailsTree) { if (writer == null) { return; } int size = enumConstants.size(); if (size > 0) { Content enumConstantsDetailsTree = writer.getEnumConstantsDetailsTreeHeader( classDoc, mem...
[ "public", "void", "buildEnumConstant", "(", "XMLNode", "node", ",", "Content", "memberDetailsTree", ")", "{", "if", "(", "writer", "==", "null", ")", "{", "return", ";", "}", "int", "size", "=", "enumConstants", ".", "size", "(", ")", ";", "if", "(", "...
Build the enum constant documentation. @param node the XML element that specifies which components to document @param memberDetailsTree the content tree to which the documentation will be added
[ "Build", "the", "enum", "constant", "documentation", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java#L151-L171
lessthanoptimal/BoofCV
applications/src/main/java/boofcv/app/calib/ImageSelectorAndSaver.java
ImageSelectorAndSaver.setTemplate
public void setTemplate(GrayF32 image, List<Point2D_F64> sides) { """ Creates a template of the fiducial and this is then used to determine how blurred the image is """ if( sides.size() != 4 ) throw new IllegalArgumentException("Expected 4 sidesCollision"); removePerspective.apply(image,sides.get(0),si...
java
public void setTemplate(GrayF32 image, List<Point2D_F64> sides) { if( sides.size() != 4 ) throw new IllegalArgumentException("Expected 4 sidesCollision"); removePerspective.apply(image,sides.get(0),sides.get(1),sides.get(2),sides.get(3)); templateOriginal.setTo(removePerspective.getOutput()); // blur the ...
[ "public", "void", "setTemplate", "(", "GrayF32", "image", ",", "List", "<", "Point2D_F64", ">", "sides", ")", "{", "if", "(", "sides", ".", "size", "(", ")", "!=", "4", ")", "throw", "new", "IllegalArgumentException", "(", "\"Expected 4 sidesCollision\"", ")...
Creates a template of the fiducial and this is then used to determine how blurred the image is
[ "Creates", "a", "template", "of", "the", "fiducial", "and", "this", "is", "then", "used", "to", "determine", "how", "blurred", "the", "image", "is" ]
train
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/applications/src/main/java/boofcv/app/calib/ImageSelectorAndSaver.java#L82-L110
cdk/cdk
legacy/src/main/java/org/openscience/cdk/math/qm/AngularMomentum.java
AngularMomentum.getSpinVector
public Vector getSpinVector(double theta, double phi) { """ Calculates a spin vector by a direction specified by theta and phi """ Vector spinvector = new Vector(3); spinvector.vector[0] = Math.sin(theta) * Math.cos(phi); spinvector.vector[1] = Math.sin(theta) * Math.sin(phi); s...
java
public Vector getSpinVector(double theta, double phi) { Vector spinvector = new Vector(3); spinvector.vector[0] = Math.sin(theta) * Math.cos(phi); spinvector.vector[1] = Math.sin(theta) * Math.sin(phi); spinvector.vector[2] = Math.cos(phi); return spinvector; }
[ "public", "Vector", "getSpinVector", "(", "double", "theta", ",", "double", "phi", ")", "{", "Vector", "spinvector", "=", "new", "Vector", "(", "3", ")", ";", "spinvector", ".", "vector", "[", "0", "]", "=", "Math", ".", "sin", "(", "theta", ")", "*"...
Calculates a spin vector by a direction specified by theta and phi
[ "Calculates", "a", "spin", "vector", "by", "a", "direction", "specified", "by", "theta", "and", "phi" ]
train
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/math/qm/AngularMomentum.java#L120-L126
ow2-chameleon/fuchsia
bases/knx/calimero/src/main/java/tuwien/auto/calimero/tools/IPConfig.java
IPConfig.createLocalDMAdapter
private PropertyAdapter createLocalDMAdapter(InetSocketAddress local, InetSocketAddress host, Map options) throws KNXException { """ Creates a local device management adapter. <p> @param local local socket address @param host remote socket address of host @param options contains parameters for property ad...
java
private PropertyAdapter createLocalDMAdapter(InetSocketAddress local, InetSocketAddress host, Map options) throws KNXException { return new KnIPDeviceMgmtAdapter(local, host, options.containsKey("nat"), null, false); }
[ "private", "PropertyAdapter", "createLocalDMAdapter", "(", "InetSocketAddress", "local", ",", "InetSocketAddress", "host", ",", "Map", "options", ")", "throws", "KNXException", "{", "return", "new", "KnIPDeviceMgmtAdapter", "(", "local", ",", "host", ",", "options", ...
Creates a local device management adapter. <p> @param local local socket address @param host remote socket address of host @param options contains parameters for property adapter creation @return local DM adapter @throws KNXException on adapter creation problem
[ "Creates", "a", "local", "device", "management", "adapter", ".", "<p", ">" ]
train
https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/tools/IPConfig.java#L422-L427
intellimate/Izou
src/main/java/org/intellimate/izou/output/OutputManager.java
OutputManager.getAssociatedOutputExtension
public List<Identification> getAssociatedOutputExtension(OutputPluginModel<?, ?> outputPlugin) { """ returns all the associated OutputExtensions @param outputPlugin the OutputPlugin to search for @return a List of Identifications """ IdentifiableSet<OutputExtensionModel<?, ?>> outputExtensions = th...
java
public List<Identification> getAssociatedOutputExtension(OutputPluginModel<?, ?> outputPlugin) { IdentifiableSet<OutputExtensionModel<?, ?>> outputExtensions = this.outputExtensions.get(outputPlugin.getID()); IdentificationManagerM identificationManager = IdentificationManager.getInstance(); ret...
[ "public", "List", "<", "Identification", ">", "getAssociatedOutputExtension", "(", "OutputPluginModel", "<", "?", ",", "?", ">", "outputPlugin", ")", "{", "IdentifiableSet", "<", "OutputExtensionModel", "<", "?", ",", "?", ">", ">", "outputExtensions", "=", "thi...
returns all the associated OutputExtensions @param outputPlugin the OutputPlugin to search for @return a List of Identifications
[ "returns", "all", "the", "associated", "OutputExtensions" ]
train
https://github.com/intellimate/Izou/blob/40a808b97998e17655c4a78e30ce7326148aed27/src/main/java/org/intellimate/izou/output/OutputManager.java#L210-L218
jenkinsci/jenkins
core/src/main/java/jenkins/org/apache/commons/validator/routines/DomainValidator.java
DomainValidator.updateTLDOverride
public static synchronized void updateTLDOverride(DomainValidator.ArrayType table, String [] tlds) { """ Update one of the TLD override arrays. This must only be done at program startup, before any instances are accessed using getInstance. <p> For example: <p> {@code DomainValidator.updateTLDOverride(ArrayTyp...
java
public static synchronized void updateTLDOverride(DomainValidator.ArrayType table, String [] tlds) { if (inUse) { throw new IllegalStateException("Can only invoke this method before calling getInstance"); } String [] copy = new String[tlds.length]; // Comparisons are always d...
[ "public", "static", "synchronized", "void", "updateTLDOverride", "(", "DomainValidator", ".", "ArrayType", "table", ",", "String", "[", "]", "tlds", ")", "{", "if", "(", "inUse", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Can only invoke this metho...
Update one of the TLD override arrays. This must only be done at program startup, before any instances are accessed using getInstance. <p> For example: <p> {@code DomainValidator.updateTLDOverride(ArrayType.GENERIC_PLUS, new String[]{"apache"})} <p> To clear an override array, provide an empty array. @param table the ...
[ "Update", "one", "of", "the", "TLD", "override", "arrays", ".", "This", "must", "only", "be", "done", "at", "program", "startup", "before", "any", "instances", "are", "accessed", "using", "getInstance", ".", "<p", ">", "For", "example", ":", "<p", ">", "...
train
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/org/apache/commons/validator/routines/DomainValidator.java#L1922-L1953
JRebirth/JRebirth
org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/service/AbstractService.java
AbstractService.bindProgressProperty
private void bindProgressProperty(final ServiceTaskBase<?> task, final DoubleProperty progressProperty) { """ Bind a task to a progress property to follow its progression. @param task the service task that we need to follow the progression @param progressBar graphical progress bar """ // Perform t...
java
private void bindProgressProperty(final ServiceTaskBase<?> task, final DoubleProperty progressProperty) { // Perform this binding into the JAT to respect widget and task API JRebirth.runIntoJAT("Bind Progress Property to " + task.getServiceHandlerName(), () -> { ...
[ "private", "void", "bindProgressProperty", "(", "final", "ServiceTaskBase", "<", "?", ">", "task", ",", "final", "DoubleProperty", "progressProperty", ")", "{", "// Perform this binding into the JAT to respect widget and task API", "JRebirth", ".", "runIntoJAT", "(", "\"Bin...
Bind a task to a progress property to follow its progression. @param task the service task that we need to follow the progression @param progressBar graphical progress bar
[ "Bind", "a", "task", "to", "a", "progress", "property", "to", "follow", "its", "progression", "." ]
train
https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/service/AbstractService.java#L186-L197
googleapis/google-cloud-java
google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java
InsertAllRequest.newBuilder
public static Builder newBuilder(String datasetId, String tableId, Iterable<RowToInsert> rows) { """ Returns a builder for an {@code InsertAllRequest} object given the destination table and the rows to insert. """ return newBuilder(TableId.of(datasetId, tableId), rows); }
java
public static Builder newBuilder(String datasetId, String tableId, Iterable<RowToInsert> rows) { return newBuilder(TableId.of(datasetId, tableId), rows); }
[ "public", "static", "Builder", "newBuilder", "(", "String", "datasetId", ",", "String", "tableId", ",", "Iterable", "<", "RowToInsert", ">", "rows", ")", "{", "return", "newBuilder", "(", "TableId", ".", "of", "(", "datasetId", ",", "tableId", ")", ",", "r...
Returns a builder for an {@code InsertAllRequest} object given the destination table and the rows to insert.
[ "Returns", "a", "builder", "for", "an", "{" ]
train
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java#L364-L366
FasterXML/woodstox
src/main/java/com/ctc/wstx/util/ElementIdMap.java
ElementIdMap.addReferenced
public ElementId addReferenced(char[] buffer, int start, int len, int hash, Location loc, PrefixedName elemName, PrefixedName attrName) { """ Method called when a reference to id is encountered. If so, need to check if specified id entry (ref or definiton) exists; and if not, t...
java
public ElementId addReferenced(char[] buffer, int start, int len, int hash, Location loc, PrefixedName elemName, PrefixedName attrName) { int index = (hash & mIndexMask); ElementId id = mTable[index]; while (id != null) { if (id.idMatches(buffe...
[ "public", "ElementId", "addReferenced", "(", "char", "[", "]", "buffer", ",", "int", "start", ",", "int", "len", ",", "int", "hash", ",", "Location", "loc", ",", "PrefixedName", "elemName", ",", "PrefixedName", "attrName", ")", "{", "int", "index", "=", ...
Method called when a reference to id is encountered. If so, need to check if specified id entry (ref or definiton) exists; and if not, to add a reference marker.
[ "Method", "called", "when", "a", "reference", "to", "id", "is", "encountered", ".", "If", "so", "need", "to", "check", "if", "specified", "id", "entry", "(", "ref", "or", "definiton", ")", "exists", ";", "and", "if", "not", "to", "add", "a", "reference...
train
https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/util/ElementIdMap.java#L143-L182
primefaces/primefaces
src/main/java/org/primefaces/model/timeline/TimelineModel.java
TimelineModel.deleteAll
public void deleteAll(Collection<TimelineEvent> events, TimelineUpdater timelineUpdater) { """ Deletes all given events in the model with UI update. @param events collection of events to be deleted @param timelineUpdater TimelineUpdater instance to delete the events in UI """ if (events !=...
java
public void deleteAll(Collection<TimelineEvent> events, TimelineUpdater timelineUpdater) { if (events != null && !events.isEmpty()) { for (TimelineEvent event : events) { delete(event, timelineUpdater); } } }
[ "public", "void", "deleteAll", "(", "Collection", "<", "TimelineEvent", ">", "events", ",", "TimelineUpdater", "timelineUpdater", ")", "{", "if", "(", "events", "!=", "null", "&&", "!", "events", ".", "isEmpty", "(", ")", ")", "{", "for", "(", "TimelineEve...
Deletes all given events in the model with UI update. @param events collection of events to be deleted @param timelineUpdater TimelineUpdater instance to delete the events in UI
[ "Deletes", "all", "given", "events", "in", "the", "model", "with", "UI", "update", "." ]
train
https://github.com/primefaces/primefaces/blob/b8cdd5ed395d09826e40e3302d6b14901d3ef4e7/src/main/java/org/primefaces/model/timeline/TimelineModel.java#L233-L239
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.createOrUpdate
public SyncGroupInner createOrUpdate(String resourceGroupName, String serverName, String databaseName, String syncGroupName, SyncGroupInner parameters) { """ Creates or updates a sync group. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Az...
java
public SyncGroupInner createOrUpdate(String resourceGroupName, String serverName, String databaseName, String syncGroupName, SyncGroupInner parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName, parameters).toBlocking().last().body(); }
[ "public", "SyncGroupInner", "createOrUpdate", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "String", "databaseName", ",", "String", "syncGroupName", ",", "SyncGroupInner", "parameters", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", ...
Creates or updates a sync group. @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. @pa...
[ "Creates", "or", "updates", "a", "sync", "group", "." ]
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#L1216-L1218
intendia-oss/rxjava-gwt
src/main/modified/io/reactivex/super/io/reactivex/Observable.java
Observable.fromFuture
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T> Observable<T> fromFuture(Future<? extends T> future, long timeout, TimeUnit unit) { """ Converts a {@link Future} into an ObservableSource, with a timeout on the Future. <p> <img width="640" height="287" src="https://raw.github....
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T> Observable<T> fromFuture(Future<? extends T> future, long timeout, TimeUnit unit) { ObjectHelper.requireNonNull(future, "future is null"); ObjectHelper.requireNonNull(unit, "unit is null"); return RxJavaPlugins....
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "static", "<", "T", ">", "Observable", "<", "T", ">", "fromFuture", "(", "Future", "<", "?", "extends", "T", ">", "future", ",", "long", "timeout", ",", ...
Converts a {@link Future} into an ObservableSource, with a timeout on the Future. <p> <img width="640" height="287" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/fromFuture.timeout.png" alt=""> <p> You can convert any object that supports the {@link Future} interface into an ObservableSource tha...
[ "Converts", "a", "{", "@link", "Future", "}", "into", "an", "ObservableSource", "with", "a", "timeout", "on", "the", "Future", ".", "<p", ">", "<img", "width", "=", "640", "height", "=", "287", "src", "=", "https", ":", "//", "raw", ".", "github", "....
train
https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Observable.java#L1847-L1853
classgraph/classgraph
src/main/java/nonapi/io/github/classgraph/fastzipfilereader/ZipFileSliceReader.java
ZipFileSliceReader.getShort
static int getShort(final byte[] arr, final long off) throws IndexOutOfBoundsException { """ Get a short from a byte array. @param arr the byte array @param off the offset to start reading from @return the short @throws IndexOutOfBoundsException the index out of bounds exception """ final int ...
java
static int getShort(final byte[] arr, final long off) throws IndexOutOfBoundsException { final int ioff = (int) off; if (ioff < 0 || ioff > arr.length - 2) { throw new IndexOutOfBoundsException(); } return ((arr[ioff + 1] & 0xff) << 8) | (arr[ioff] & 0xff); }
[ "static", "int", "getShort", "(", "final", "byte", "[", "]", "arr", ",", "final", "long", "off", ")", "throws", "IndexOutOfBoundsException", "{", "final", "int", "ioff", "=", "(", "int", ")", "off", ";", "if", "(", "ioff", "<", "0", "||", "ioff", ">"...
Get a short from a byte array. @param arr the byte array @param off the offset to start reading from @return the short @throws IndexOutOfBoundsException the index out of bounds exception
[ "Get", "a", "short", "from", "a", "byte", "array", "." ]
train
https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/fastzipfilereader/ZipFileSliceReader.java#L154-L160
LevelFourAB/commons
commons-config/src/main/java/se/l4/commons/config/internal/RawFormatReader.java
RawFormatReader.read
public static Map<String, Object> read(InputStream stream) throws IOException { """ Convert the given stream to a map. @param stream @return @throws IOException """ ConfigJsonInput input = new ConfigJsonInput(new InputStreamReader(stream, StandardCharsets.UTF_8)); return read(input); }
java
public static Map<String, Object> read(InputStream stream) throws IOException { ConfigJsonInput input = new ConfigJsonInput(new InputStreamReader(stream, StandardCharsets.UTF_8)); return read(input); }
[ "public", "static", "Map", "<", "String", ",", "Object", ">", "read", "(", "InputStream", "stream", ")", "throws", "IOException", "{", "ConfigJsonInput", "input", "=", "new", "ConfigJsonInput", "(", "new", "InputStreamReader", "(", "stream", ",", "StandardCharse...
Convert the given stream to a map. @param stream @return @throws IOException
[ "Convert", "the", "given", "stream", "to", "a", "map", "." ]
train
https://github.com/LevelFourAB/commons/blob/aa121b3a5504b43d0c10450a1b984694fcd2b8ee/commons-config/src/main/java/se/l4/commons/config/internal/RawFormatReader.java#L39-L44