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 |
|---|---|---|---|---|---|---|---|---|---|---|
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/list/primitive/IntInterval.java | IntInterval.oddsFromTo | public static IntInterval oddsFromTo(int from, int to) {
"""
Returns an IntInterval representing the odd values from the value from to the value to.
"""
if (from % 2 == 0)
{
if (from < to)
{
from++;
}
else
{
... | java | public static IntInterval oddsFromTo(int from, int to)
{
if (from % 2 == 0)
{
if (from < to)
{
from++;
}
else
{
from--;
}
}
if (to % 2 == 0)
{
if (to > from)
... | [
"public",
"static",
"IntInterval",
"oddsFromTo",
"(",
"int",
"from",
",",
"int",
"to",
")",
"{",
"if",
"(",
"from",
"%",
"2",
"==",
"0",
")",
"{",
"if",
"(",
"from",
"<",
"to",
")",
"{",
"from",
"++",
";",
"}",
"else",
"{",
"from",
"--",
";",
... | Returns an IntInterval representing the odd values from the value from to the value to. | [
"Returns",
"an",
"IntInterval",
"representing",
"the",
"odd",
"values",
"from",
"the",
"value",
"from",
"to",
"the",
"value",
"to",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/list/primitive/IntInterval.java#L207-L232 |
JoeKerouac/utils | src/main/java/com/joe/utils/common/DateUtil.java | DateUtil.add | public static Date add(DateUnit dateUnit, int amount, String date, String format) {
"""
将指定日期增加指定时长
@param dateUnit 单位
@param amount 时长
@param date 指定日期
@param format 指定日期字符串的格式
@return 增加后的日期
"""
LocalDateTime localDateTime = getTime(format, date);
localDateTime = localDateTime.... | java | public static Date add(DateUnit dateUnit, int amount, String date, String format) {
LocalDateTime localDateTime = getTime(format, date);
localDateTime = localDateTime.plus(amount, create(dateUnit));
return Date.from(localDateTime.toInstant(ZoneOffset.ofTotalSeconds(60 * 60 * 8)));
} | [
"public",
"static",
"Date",
"add",
"(",
"DateUnit",
"dateUnit",
",",
"int",
"amount",
",",
"String",
"date",
",",
"String",
"format",
")",
"{",
"LocalDateTime",
"localDateTime",
"=",
"getTime",
"(",
"format",
",",
"date",
")",
";",
"localDateTime",
"=",
"l... | 将指定日期增加指定时长
@param dateUnit 单位
@param amount 时长
@param date 指定日期
@param format 指定日期字符串的格式
@return 增加后的日期 | [
"将指定日期增加指定时长"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/common/DateUtil.java#L135-L139 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/LookasideCacheFileSystem.java | LookasideCacheFileSystem.evictCache | public void evictCache(Path hdfsPath, Path localPath, long size)
throws IOException {
"""
Evicts a file from the cache. If the cache is exceeding capacity,
then the cache calls this method to indicate that it is evicting
a file from the cache. This is part of the Eviction Interface.
"""
boolean done ... | java | public void evictCache(Path hdfsPath, Path localPath, long size)
throws IOException {
boolean done = cacheFs.delete(localPath, false);
if (!done) {
if (LOG.isDebugEnabled()) {
LOG.debug("Evict for path: " + hdfsPath +
" local path " + localPath + " unsuccessful.");
}
... | [
"public",
"void",
"evictCache",
"(",
"Path",
"hdfsPath",
",",
"Path",
"localPath",
",",
"long",
"size",
")",
"throws",
"IOException",
"{",
"boolean",
"done",
"=",
"cacheFs",
".",
"delete",
"(",
"localPath",
",",
"false",
")",
";",
"if",
"(",
"!",
"done",... | Evicts a file from the cache. If the cache is exceeding capacity,
then the cache calls this method to indicate that it is evicting
a file from the cache. This is part of the Eviction Interface. | [
"Evicts",
"a",
"file",
"from",
"the",
"cache",
".",
"If",
"the",
"cache",
"is",
"exceeding",
"capacity",
"then",
"the",
"cache",
"calls",
"this",
"method",
"to",
"indicate",
"that",
"it",
"is",
"evicting",
"a",
"file",
"from",
"the",
"cache",
".",
"This"... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/LookasideCacheFileSystem.java#L203-L212 |
alkacon/opencms-core | src/org/opencms/ui/apps/user/CmsUserEditDialog.java | CmsUserEditDialog.iniRole | protected static void iniRole(CmsObject cms, String ou, com.vaadin.ui.ComboBox<CmsRole> roleComboBox, Log log) {
"""
Initialized the role ComboBox.<p>
@param cms CmsObject
@param ou to load roles for
@param roleComboBox ComboBox
@param log LOG
"""
try {
List<CmsRole> roles = OpenCms.... | java | protected static void iniRole(CmsObject cms, String ou, com.vaadin.ui.ComboBox<CmsRole> roleComboBox, Log log) {
try {
List<CmsRole> roles = OpenCms.getRoleManager().getRoles(cms, ou, false);
CmsRole.applySystemRoleOrder(roles);
DataProvider provider = new ListDataProvider<... | [
"protected",
"static",
"void",
"iniRole",
"(",
"CmsObject",
"cms",
",",
"String",
"ou",
",",
"com",
".",
"vaadin",
".",
"ui",
".",
"ComboBox",
"<",
"CmsRole",
">",
"roleComboBox",
",",
"Log",
"log",
")",
"{",
"try",
"{",
"List",
"<",
"CmsRole",
">",
... | Initialized the role ComboBox.<p>
@param cms CmsObject
@param ou to load roles for
@param roleComboBox ComboBox
@param log LOG | [
"Initialized",
"the",
"role",
"ComboBox",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/user/CmsUserEditDialog.java#L507-L530 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java | MapMessage.newInstance | @SuppressWarnings("unchecked")
public M newInstance(final Map<String, V> map) {
"""
Constructs a new instance based on an existing Map.
@param map The Map.
@return A new MapMessage
"""
return (M) new MapMessage<>(map);
} | java | @SuppressWarnings("unchecked")
public M newInstance(final Map<String, V> map) {
return (M) new MapMessage<>(map);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"M",
"newInstance",
"(",
"final",
"Map",
"<",
"String",
",",
"V",
">",
"map",
")",
"{",
"return",
"(",
"M",
")",
"new",
"MapMessage",
"<>",
"(",
"map",
")",
";",
"}"
] | Constructs a new instance based on an existing Map.
@param map The Map.
@return A new MapMessage | [
"Constructs",
"a",
"new",
"instance",
"based",
"on",
"an",
"existing",
"Map",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java#L419-L422 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/cmp/cmppolicylabel.java | cmppolicylabel.get | public static cmppolicylabel get(nitro_service service, String labelname) throws Exception {
"""
Use this API to fetch cmppolicylabel resource of given name .
"""
cmppolicylabel obj = new cmppolicylabel();
obj.set_labelname(labelname);
cmppolicylabel response = (cmppolicylabel) obj.get_resource(service);... | java | public static cmppolicylabel get(nitro_service service, String labelname) throws Exception{
cmppolicylabel obj = new cmppolicylabel();
obj.set_labelname(labelname);
cmppolicylabel response = (cmppolicylabel) obj.get_resource(service);
return response;
} | [
"public",
"static",
"cmppolicylabel",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"labelname",
")",
"throws",
"Exception",
"{",
"cmppolicylabel",
"obj",
"=",
"new",
"cmppolicylabel",
"(",
")",
";",
"obj",
".",
"set_labelname",
"(",
"labelname",
")",
... | Use this API to fetch cmppolicylabel resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"cmppolicylabel",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/cmp/cmppolicylabel.java#L337-L342 |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java | HttpBuilder.deleteAsync | public <T> CompletableFuture<T> deleteAsync(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) {
"""
Executes an asynchronous DELETE request on the configured URI (asynchronous alias to the `delete(Class,Closure)` method), with additional
configuration provided by the configuration closure... | java | public <T> CompletableFuture<T> deleteAsync(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) {
return CompletableFuture.supplyAsync(() -> delete(type, closure), getExecutor());
} | [
"public",
"<",
"T",
">",
"CompletableFuture",
"<",
"T",
">",
"deleteAsync",
"(",
"final",
"Class",
"<",
"T",
">",
"type",
",",
"@",
"DelegatesTo",
"(",
"HttpConfig",
".",
"class",
")",
"final",
"Closure",
"closure",
")",
"{",
"return",
"CompletableFuture",... | Executes an asynchronous DELETE request on the configured URI (asynchronous alias to the `delete(Class,Closure)` method), with additional
configuration provided by the configuration closure. The result will be cast to the specified `type`.
[source,groovy]
----
def http = HttpBuilder.configure {
request.uri = 'http://l... | [
"Executes",
"an",
"asynchronous",
"DELETE",
"request",
"on",
"the",
"configured",
"URI",
"(",
"asynchronous",
"alias",
"to",
"the",
"delete",
"(",
"Class",
"Closure",
")",
"method",
")",
"with",
"additional",
"configuration",
"provided",
"by",
"the",
"configurat... | train | https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L1247-L1249 |
cloudendpoints/endpoints-management-java | endpoints-control/src/main/java/com/google/api/control/aggregator/CheckAggregationOptions.java | CheckAggregationOptions.createCache | @Nullable
public <T> Cache<String, T> createCache(final ConcurrentLinkedDeque<T> out, Ticker ticker) {
"""
Creates a {@link Cache} configured by this instance.
@param <T>
the type of the value stored in the Cache
@param out
a concurrent {@code Deque} to which the cached values are
added as they are remove... | java | @Nullable
public <T> Cache<String, T> createCache(final ConcurrentLinkedDeque<T> out, Ticker ticker) {
Preconditions.checkNotNull(out, "The out deque cannot be null");
Preconditions.checkNotNull(ticker, "The ticker cannot be null");
if (numEntries <= 0) {
return null;
}
final RemovalListener... | [
"@",
"Nullable",
"public",
"<",
"T",
">",
"Cache",
"<",
"String",
",",
"T",
">",
"createCache",
"(",
"final",
"ConcurrentLinkedDeque",
"<",
"T",
">",
"out",
",",
"Ticker",
"ticker",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"out",
",",
"\"The ... | Creates a {@link Cache} configured by this instance.
@param <T>
the type of the value stored in the Cache
@param out
a concurrent {@code Deque} to which the cached values are
added as they are removed from the cache
@param ticker
the time source used to determine expiration
@return a {@link Cache} corresponding to thi... | [
"Creates",
"a",
"{",
"@link",
"Cache",
"}",
"configured",
"by",
"this",
"instance",
"."
] | train | https://github.com/cloudendpoints/endpoints-management-java/blob/5bbf20ddadbbd51b890049e3c338c28abe2c9f94/endpoints-control/src/main/java/com/google/api/control/aggregator/CheckAggregationOptions.java#L142-L161 |
stapler/stapler | core/src/main/java/org/kohsuke/stapler/Function.java | Function.bindAndInvokeAndServeResponse | boolean bindAndInvokeAndServeResponse(Object node, RequestImpl req, ResponseImpl rsp, Object... headArgs) throws IllegalAccessException, InvocationTargetException, ServletException, IOException {
"""
Calls {@link #bindAndInvoke(Object, StaplerRequest, StaplerResponse, Object...)} and then
optionally serve the res... | java | boolean bindAndInvokeAndServeResponse(Object node, RequestImpl req, ResponseImpl rsp, Object... headArgs) throws IllegalAccessException, InvocationTargetException, ServletException, IOException {
try {
Object r = bindAndInvoke(node, req, rsp, headArgs);
if (getReturnType() != void.class)... | [
"boolean",
"bindAndInvokeAndServeResponse",
"(",
"Object",
"node",
",",
"RequestImpl",
"req",
",",
"ResponseImpl",
"rsp",
",",
"Object",
"...",
"headArgs",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
",",
"ServletException",
",",
"IOExcept... | Calls {@link #bindAndInvoke(Object, StaplerRequest, StaplerResponse, Object...)} and then
optionally serve the response object.
@return
true if the request was dispatched and processed. false if the dispatch was cancelled
and the search for the next request handler should continue. An exception is thrown
if the reques... | [
"Calls",
"{",
"@link",
"#bindAndInvoke",
"(",
"Object",
"StaplerRequest",
"StaplerResponse",
"Object",
"...",
")",
"}",
"and",
"then",
"optionally",
"serve",
"the",
"response",
"object",
"."
] | train | https://github.com/stapler/stapler/blob/11ad5af185e062fb46e01bf9fbed66f3ebf2a8f7/core/src/main/java/org/kohsuke/stapler/Function.java#L143-L160 |
opencb/java-common-libs | commons-datastore/commons-datastore-solr/src/main/java/org/opencb/commons/datastore/solr/SolrManager.java | SolrManager.existsCollection | public boolean existsCollection(String collectionName) throws SolrException {
"""
Check if a given collection exists.
@param collectionName Collection name
@return True or false
@throws SolrException SolrException
"""
try {
List<String> collections = CollectionAdminRequest.listCollecti... | java | public boolean existsCollection(String collectionName) throws SolrException {
try {
List<String> collections = CollectionAdminRequest.listCollections(solrClient);
for (String collection : collections) {
if (collection.equals(collectionName)) {
return t... | [
"public",
"boolean",
"existsCollection",
"(",
"String",
"collectionName",
")",
"throws",
"SolrException",
"{",
"try",
"{",
"List",
"<",
"String",
">",
"collections",
"=",
"CollectionAdminRequest",
".",
"listCollections",
"(",
"solrClient",
")",
";",
"for",
"(",
... | Check if a given collection exists.
@param collectionName Collection name
@return True or false
@throws SolrException SolrException | [
"Check",
"if",
"a",
"given",
"collection",
"exists",
"."
] | train | https://github.com/opencb/java-common-libs/blob/5c97682530d0be55828e1e4e374ff01fceb5f198/commons-datastore/commons-datastore-solr/src/main/java/org/opencb/commons/datastore/solr/SolrManager.java#L204-L216 |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/client/DriverLauncher.java | DriverLauncher.waitForStatus | public LauncherStatus waitForStatus(final long waitTime, final LauncherStatus... statuses) {
"""
Wait for one of the specified statuses of the REEF job.
This method is called after the job is submitted to the RM via submit().
@param waitTime wait time in milliseconds.
@param statuses array of statuses to wait f... | java | public LauncherStatus waitForStatus(final long waitTime, final LauncherStatus... statuses) {
final long endTime = System.currentTimeMillis() + waitTime;
final HashSet<LauncherStatus> statSet = new HashSet<>(statuses.length * 2);
Collections.addAll(statSet, statuses);
Collections.addAll(statSet, Launch... | [
"public",
"LauncherStatus",
"waitForStatus",
"(",
"final",
"long",
"waitTime",
",",
"final",
"LauncherStatus",
"...",
"statuses",
")",
"{",
"final",
"long",
"endTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"waitTime",
";",
"final",
"HashSet",
... | Wait for one of the specified statuses of the REEF job.
This method is called after the job is submitted to the RM via submit().
@param waitTime wait time in milliseconds.
@param statuses array of statuses to wait for.
@return the state of the job after the wait. | [
"Wait",
"for",
"one",
"of",
"the",
"specified",
"statuses",
"of",
"the",
"REEF",
"job",
".",
"This",
"method",
"is",
"called",
"after",
"the",
"job",
"is",
"submitted",
"to",
"the",
"RM",
"via",
"submit",
"()",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/client/DriverLauncher.java#L154-L184 |
gosu-lang/gosu-lang | gosu-core/src/main/java/gw/internal/gosu/compiler/protocols/gosuclass/GosuClassesUrlConnection.java | GosuClassesUrlConnection.hasClassFileOnDiskInParentLoaderPath | private boolean hasClassFileOnDiskInParentLoaderPath( ClassLoader loader, IType type ) {
"""
## perf: this is probably not an insignificant perf issue while class loading i.e., the onslaught of ClassNotFoundExceptions handled here is puke worthy
"""
if( !(loader instanceof IInjectableClassLoader) ) {
... | java | private boolean hasClassFileOnDiskInParentLoaderPath( ClassLoader loader, IType type ) {
if( !(loader instanceof IInjectableClassLoader) ) {
return false;
}
ClassLoader parent = loader.getParent();
while( parent instanceof IInjectableClassLoader ) {
parent = parent.getParent();
}
ITy... | [
"private",
"boolean",
"hasClassFileOnDiskInParentLoaderPath",
"(",
"ClassLoader",
"loader",
",",
"IType",
"type",
")",
"{",
"if",
"(",
"!",
"(",
"loader",
"instanceof",
"IInjectableClassLoader",
")",
")",
"{",
"return",
"false",
";",
"}",
"ClassLoader",
"parent",
... | ## perf: this is probably not an insignificant perf issue while class loading i.e., the onslaught of ClassNotFoundExceptions handled here is puke worthy | [
"##",
"perf",
":",
"this",
"is",
"probably",
"not",
"an",
"insignificant",
"perf",
"issue",
"while",
"class",
"loading",
"i",
".",
"e",
".",
"the",
"onslaught",
"of",
"ClassNotFoundExceptions",
"handled",
"here",
"is",
"puke",
"worthy"
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core/src/main/java/gw/internal/gosu/compiler/protocols/gosuclass/GosuClassesUrlConnection.java#L177-L193 |
casmi/casmi | src/main/java/casmi/graphics/element/Arc.java | Arc.setCenterColor | public void setCenterColor(ColorSet colorSet) {
"""
Sets the colorSet of the center of this Arc.
@param colorSet The colorSet of the center of the Arc.
"""
if (this.centerColor == null) {
this.centerColor = new RGBColor(0.0, 0.0, 0.0);
}
setGradation(true);
this.c... | java | public void setCenterColor(ColorSet colorSet) {
if (this.centerColor == null) {
this.centerColor = new RGBColor(0.0, 0.0, 0.0);
}
setGradation(true);
this.centerColor = RGBColor.color(colorSet);
} | [
"public",
"void",
"setCenterColor",
"(",
"ColorSet",
"colorSet",
")",
"{",
"if",
"(",
"this",
".",
"centerColor",
"==",
"null",
")",
"{",
"this",
".",
"centerColor",
"=",
"new",
"RGBColor",
"(",
"0.0",
",",
"0.0",
",",
"0.0",
")",
";",
"}",
"setGradati... | Sets the colorSet of the center of this Arc.
@param colorSet The colorSet of the center of the Arc. | [
"Sets",
"the",
"colorSet",
"of",
"the",
"center",
"of",
"this",
"Arc",
"."
] | train | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/element/Arc.java#L423-L429 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/TextEnterer.java | TextEnterer.setEditText | public void setEditText(final EditText editText, final String text) {
"""
Sets an {@code EditText} text
@param index the index of the {@code EditText}
@param text the text that should be set
"""
if(editText != null){
final String previousText = editText.getText().toString();
inst.runOnMainSync(ne... | java | public void setEditText(final EditText editText, final String text) {
if(editText != null){
final String previousText = editText.getText().toString();
inst.runOnMainSync(new Runnable()
{
public void run()
{
editText.setInputType(InputType.TYPE_NULL);
editText.performClick();
dialogU... | [
"public",
"void",
"setEditText",
"(",
"final",
"EditText",
"editText",
",",
"final",
"String",
"text",
")",
"{",
"if",
"(",
"editText",
"!=",
"null",
")",
"{",
"final",
"String",
"previousText",
"=",
"editText",
".",
"getText",
"(",
")",
".",
"toString",
... | Sets an {@code EditText} text
@param index the index of the {@code EditText}
@param text the text that should be set | [
"Sets",
"an",
"{",
"@code",
"EditText",
"}",
"text"
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/TextEnterer.java#L44-L64 |
mikepenz/Android-Iconics | library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java | IconicsDrawable.backgroundColorListRes | @NonNull
public IconicsDrawable backgroundColorListRes(@ColorRes int colorResId) {
"""
Set background contour colors from color res.
@return The current IconicsDrawable for chaining.
"""
return backgroundColor(ContextCompat.getColorStateList(mContext, colorResId));
} | java | @NonNull
public IconicsDrawable backgroundColorListRes(@ColorRes int colorResId) {
return backgroundColor(ContextCompat.getColorStateList(mContext, colorResId));
} | [
"@",
"NonNull",
"public",
"IconicsDrawable",
"backgroundColorListRes",
"(",
"@",
"ColorRes",
"int",
"colorResId",
")",
"{",
"return",
"backgroundColor",
"(",
"ContextCompat",
".",
"getColorStateList",
"(",
"mContext",
",",
"colorResId",
")",
")",
";",
"}"
] | Set background contour colors from color res.
@return The current IconicsDrawable for chaining. | [
"Set",
"background",
"contour",
"colors",
"from",
"color",
"res",
"."
] | train | https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L860-L863 |
landawn/AbacusUtil | src/com/landawn/abacus/util/FilenameUtil.java | FilenameUtil.isExtension | public static boolean isExtension(final String filename, final String extension) {
"""
Checks whether the extension of the filename is that specified.
<p>
This method obtains the extension as the textual part of the filename
after the last dot. There must be no directory separator after the dot.
The extension ... | java | public static boolean isExtension(final String filename, final String extension) {
if (filename == null) {
return false;
}
if (extension == null || extension.isEmpty()) {
return indexOfExtension(filename) == NOT_FOUND;
}
final String fileExt = getEx... | [
"public",
"static",
"boolean",
"isExtension",
"(",
"final",
"String",
"filename",
",",
"final",
"String",
"extension",
")",
"{",
"if",
"(",
"filename",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"extension",
"==",
"null",
"||",
"exte... | Checks whether the extension of the filename is that specified.
<p>
This method obtains the extension as the textual part of the filename
after the last dot. There must be no directory separator after the dot.
The extension check is case-sensitive on all platforms.
@param filename the filename to query, null returns ... | [
"Checks",
"whether",
"the",
"extension",
"of",
"the",
"filename",
"is",
"that",
"specified",
".",
"<p",
">",
"This",
"method",
"obtains",
"the",
"extension",
"as",
"the",
"textual",
"part",
"of",
"the",
"filename",
"after",
"the",
"last",
"dot",
".",
"Ther... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/FilenameUtil.java#L1168-L1177 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java | FindbugsPlugin.getFindBugsEnginePluginLocation | public static String getFindBugsEnginePluginLocation() {
"""
Find the filesystem path of the FindBugs plugin directory.
@return the filesystem path of the FindBugs plugin directory, or null if
the FindBugs plugin directory cannot be found
"""
// findbugs.home should be set to the directory the plug... | java | public static String getFindBugsEnginePluginLocation() {
// findbugs.home should be set to the directory the plugin is
// installed in.
URL u = plugin.getBundle().getEntry("/");
try {
URL bundleRoot = FileLocator.resolve(u);
String path = bundleRoot.getPath();
... | [
"public",
"static",
"String",
"getFindBugsEnginePluginLocation",
"(",
")",
"{",
"// findbugs.home should be set to the directory the plugin is",
"// installed in.",
"URL",
"u",
"=",
"plugin",
".",
"getBundle",
"(",
")",
".",
"getEntry",
"(",
"\"/\"",
")",
";",
"try",
... | Find the filesystem path of the FindBugs plugin directory.
@return the filesystem path of the FindBugs plugin directory, or null if
the FindBugs plugin directory cannot be found | [
"Find",
"the",
"filesystem",
"path",
"of",
"the",
"FindBugs",
"plugin",
"directory",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java#L508-L530 |
b3dgs/lionengine | lionengine-core-awt/src/main/java/com/b3dgs/lionengine/awt/graphic/ToolsAwt.java | ToolsAwt.createImage | public static BufferedImage createImage(int width, int height, int transparency) {
"""
Create an image.
@param width The image width (must be strictly positive).
@param height The image height (must be strictly positive).
@param transparency The image transparency.
@return The image instance.
@throws LionEn... | java | public static BufferedImage createImage(int width, int height, int transparency)
{
Check.superiorStrict(width, 0);
Check.superiorStrict(height, 0);
return CONFIG.createCompatibleImage(width, height, transparency);
} | [
"public",
"static",
"BufferedImage",
"createImage",
"(",
"int",
"width",
",",
"int",
"height",
",",
"int",
"transparency",
")",
"{",
"Check",
".",
"superiorStrict",
"(",
"width",
",",
"0",
")",
";",
"Check",
".",
"superiorStrict",
"(",
"height",
",",
"0",
... | Create an image.
@param width The image width (must be strictly positive).
@param height The image height (must be strictly positive).
@param transparency The image transparency.
@return The image instance.
@throws LionEngineException If invalid parameters. | [
"Create",
"an",
"image",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core-awt/src/main/java/com/b3dgs/lionengine/awt/graphic/ToolsAwt.java#L104-L110 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/handler/HandleHelper.java | HandleHelper.getColumnValue | private static <T> Object getColumnValue(ResultSet rs, String label, int type, Type targetColumnType) throws SQLException {
"""
获取字段值<br>
针对日期时间等做单独处理判断
@param <T> 返回类型
@param rs {@link ResultSet}
@param label 字段标签或者字段名
@param type 字段类型,默认Object
@param targetColumnType 结果要求的类型,需进行二次转换(null或者Object不转换)
@re... | java | private static <T> Object getColumnValue(ResultSet rs, String label, int type, Type targetColumnType) throws SQLException {
Object rawValue;
switch (type) {
case Types.TIMESTAMP:
rawValue = rs.getTimestamp(label);
break;
case Types.TIME:
rawValue = rs.getTime(label);
break;
default:
r... | [
"private",
"static",
"<",
"T",
">",
"Object",
"getColumnValue",
"(",
"ResultSet",
"rs",
",",
"String",
"label",
",",
"int",
"type",
",",
"Type",
"targetColumnType",
")",
"throws",
"SQLException",
"{",
"Object",
"rawValue",
";",
"switch",
"(",
"type",
")",
... | 获取字段值<br>
针对日期时间等做单独处理判断
@param <T> 返回类型
@param rs {@link ResultSet}
@param label 字段标签或者字段名
@param type 字段类型,默认Object
@param targetColumnType 结果要求的类型,需进行二次转换(null或者Object不转换)
@return 字段值
@throws SQLException SQL异常 | [
"获取字段值<br",
">",
"针对日期时间等做单独处理判断"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/handler/HandleHelper.java#L212-L231 |
Azure/azure-sdk-for-java | privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZonesInner.java | PrivateZonesInner.beginCreateOrUpdateAsync | public Observable<PrivateZoneInner> beginCreateOrUpdateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch, String ifNoneMatch) {
"""
Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone.
@param resourceGr... | java | public Observable<PrivateZoneInner> beginCreateOrUpdateAsync(String resourceGroupName, String privateZoneName, PrivateZoneInner parameters, String ifMatch, String ifNoneMatch) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, privateZoneName, parameters, ifMatch, ifNoneMatch).map(new Func1... | [
"public",
"Observable",
"<",
"PrivateZoneInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"privateZoneName",
",",
"PrivateZoneInner",
"parameters",
",",
"String",
"ifMatch",
",",
"String",
"ifNoneMatch",
")",
"{",
"return",
"... | Creates or updates a Private DNS zone. Does not modify Links to virtual networks or DNS records within the zone.
@param resourceGroupName The name of the resource group.
@param privateZoneName The name of the Private DNS zone (without a terminating dot).
@param parameters Parameters supplied to the CreateOrUpdate oper... | [
"Creates",
"or",
"updates",
"a",
"Private",
"DNS",
"zone",
".",
"Does",
"not",
"modify",
"Links",
"to",
"virtual",
"networks",
"or",
"DNS",
"records",
"within",
"the",
"zone",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZonesInner.java#L410-L417 |
jimmoores/quandl4j | core/src/main/java/com/jimmoores/quandl/util/ArgumentChecker.java | ArgumentChecker.notNullOrEmpty | public static <E> void notNullOrEmpty(final Collection<E> argument, final String name) {
"""
Throws an exception if the collection argument is not null or empty.
@param <E> type of array
@param argument the object to check
@param name the name of the parameter
"""
if (argument == null) {
s_logge... | java | public static <E> void notNullOrEmpty(final Collection<E> argument, final String name) {
if (argument == null) {
s_logger.error("Argument {} was null", name);
throw new QuandlRuntimeException("Value " + name + " was null");
} else if (argument.size() == 0) {
s_logger.error("Argument {} was emp... | [
"public",
"static",
"<",
"E",
">",
"void",
"notNullOrEmpty",
"(",
"final",
"Collection",
"<",
"E",
">",
"argument",
",",
"final",
"String",
"name",
")",
"{",
"if",
"(",
"argument",
"==",
"null",
")",
"{",
"s_logger",
".",
"error",
"(",
"\"Argument {} was... | Throws an exception if the collection argument is not null or empty.
@param <E> type of array
@param argument the object to check
@param name the name of the parameter | [
"Throws",
"an",
"exception",
"if",
"the",
"collection",
"argument",
"is",
"not",
"null",
"or",
"empty",
"."
] | train | https://github.com/jimmoores/quandl4j/blob/5d67ae60279d889da93ae7aa3bf6b7d536f88822/core/src/main/java/com/jimmoores/quandl/util/ArgumentChecker.java#L54-L62 |
TheHortonMachine/hortonmachine | apps/src/main/java/org/hortonmachine/database/SqlDocument.java | SqlDocument.processChangedLines | private void processChangedLines( int offset, int length ) throws BadLocationException {
"""
/*
Determine how many lines have been changed,
then apply highlighting to each line
"""
String content = doc.getText(0, doc.getLength());
// The lines affected by the latest document update
in... | java | private void processChangedLines( int offset, int length ) throws BadLocationException {
String content = doc.getText(0, doc.getLength());
// The lines affected by the latest document update
int startLine = rootElement.getElementIndex(offset);
int endLine = rootElement.getElementIndex(of... | [
"private",
"void",
"processChangedLines",
"(",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"BadLocationException",
"{",
"String",
"content",
"=",
"doc",
".",
"getText",
"(",
"0",
",",
"doc",
".",
"getLength",
"(",
")",
")",
";",
"// The lines affec... | /*
Determine how many lines have been changed,
then apply highlighting to each line | [
"/",
"*",
"Determine",
"how",
"many",
"lines",
"have",
"been",
"changed",
"then",
"apply",
"highlighting",
"to",
"each",
"line"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/apps/src/main/java/org/hortonmachine/database/SqlDocument.java#L106-L122 |
LearnLib/automatalib | commons/util/src/main/java/net/automatalib/commons/util/IOUtil.java | IOUtil.copy | public static void copy(Reader r, Writer w, boolean close) throws IOException {
"""
Copies all text from the given reader to the given writer.
@param r
the reader.
@param w
the writer.
@param close
<code>true</code> if both reader and writer are closed afterwards, <code>false</code> otherwise.
@throws I... | java | public static void copy(Reader r, Writer w, boolean close) throws IOException {
char[] buf = new char[DEFAULT_BUFFER_SIZE];
int len;
try {
while ((len = r.read(buf)) != -1) {
w.write(buf, 0, len);
}
} finally {
if (close) {
... | [
"public",
"static",
"void",
"copy",
"(",
"Reader",
"r",
",",
"Writer",
"w",
",",
"boolean",
"close",
")",
"throws",
"IOException",
"{",
"char",
"[",
"]",
"buf",
"=",
"new",
"char",
"[",
"DEFAULT_BUFFER_SIZE",
"]",
";",
"int",
"len",
";",
"try",
"{",
... | Copies all text from the given reader to the given writer.
@param r
the reader.
@param w
the writer.
@param close
<code>true</code> if both reader and writer are closed afterwards, <code>false</code> otherwise.
@throws IOException
if an I/O error occurs. | [
"Copies",
"all",
"text",
"from",
"the",
"given",
"reader",
"to",
"the",
"given",
"writer",
"."
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/commons/util/src/main/java/net/automatalib/commons/util/IOUtil.java#L144-L157 |
aws/aws-sdk-java | aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DescribeThingResult.java | DescribeThingResult.withAttributes | public DescribeThingResult withAttributes(java.util.Map<String, String> attributes) {
"""
<p>
The thing attributes.
</p>
@param attributes
The thing attributes.
@return Returns a reference to this object so that method calls can be chained together.
"""
setAttributes(attributes);
return ... | java | public DescribeThingResult withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"DescribeThingResult",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The thing attributes.
</p>
@param attributes
The thing attributes.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"thing",
"attributes",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/DescribeThingResult.java#L316-L319 |
ziccardi/jnrpe | jnrpe-lib/src/main/java/it/jnrpe/plugins/MetricBuilder.java | MetricBuilder.withValue | public MetricBuilder withValue(Number value, String prettyPrintFormat) {
"""
Sets the value of the metric to be built.
@param value the value of the metric
@param prettyPrintFormat the format of the output (@see {@link DecimalFormat})
@return this
"""
current = new MetricValue(value.toString(), pr... | java | public MetricBuilder withValue(Number value, String prettyPrintFormat) {
current = new MetricValue(value.toString(), prettyPrintFormat);
return this;
} | [
"public",
"MetricBuilder",
"withValue",
"(",
"Number",
"value",
",",
"String",
"prettyPrintFormat",
")",
"{",
"current",
"=",
"new",
"MetricValue",
"(",
"value",
".",
"toString",
"(",
")",
",",
"prettyPrintFormat",
")",
";",
"return",
"this",
";",
"}"
] | Sets the value of the metric to be built.
@param value the value of the metric
@param prettyPrintFormat the format of the output (@see {@link DecimalFormat})
@return this | [
"Sets",
"the",
"value",
"of",
"the",
"metric",
"to",
"be",
"built",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-lib/src/main/java/it/jnrpe/plugins/MetricBuilder.java#L81-L84 |
line/armeria | saml/src/main/java/com/linecorp/armeria/server/saml/HttpRedirectBindingUtil.java | HttpRedirectBindingUtil.fromDeflatedBase64 | static XMLObject fromDeflatedBase64(String base64Encoded) {
"""
Decodes, inflates and deserializes the specified base64-encoded message to an {@link XMLObject}.
"""
requireNonNull(base64Encoded, "base64Encoded");
final byte[] base64decoded;
try {
base64decoded = Base64.getM... | java | static XMLObject fromDeflatedBase64(String base64Encoded) {
requireNonNull(base64Encoded, "base64Encoded");
final byte[] base64decoded;
try {
base64decoded = Base64.getMimeDecoder().decode(base64Encoded);
} catch (IllegalArgumentException e) {
throw new SamlExcep... | [
"static",
"XMLObject",
"fromDeflatedBase64",
"(",
"String",
"base64Encoded",
")",
"{",
"requireNonNull",
"(",
"base64Encoded",
",",
"\"base64Encoded\"",
")",
";",
"final",
"byte",
"[",
"]",
"base64decoded",
";",
"try",
"{",
"base64decoded",
"=",
"Base64",
".",
"... | Decodes, inflates and deserializes the specified base64-encoded message to an {@link XMLObject}. | [
"Decodes",
"inflates",
"and",
"deserializes",
"the",
"specified",
"base64",
"-",
"encoded",
"message",
"to",
"an",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/saml/src/main/java/com/linecorp/armeria/server/saml/HttpRedirectBindingUtil.java#L210-L229 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/Criteria.java | Criteria.splitInCriteria | protected List splitInCriteria(Object attribute, Collection values, boolean negative, int inLimit) {
"""
Answer a List of InCriteria based on values, each InCriteria
contains only inLimit values
@param attribute
@param values
@param negative
@param inLimit the maximum number of values for IN (-1 for no limit)... | java | protected List splitInCriteria(Object attribute, Collection values, boolean negative, int inLimit)
{
List result = new ArrayList();
Collection inCollection = new ArrayList();
if (values == null || values.isEmpty())
{
// OQL creates empty Criteria for late binding
... | [
"protected",
"List",
"splitInCriteria",
"(",
"Object",
"attribute",
",",
"Collection",
"values",
",",
"boolean",
"negative",
",",
"int",
"inLimit",
")",
"{",
"List",
"result",
"=",
"new",
"ArrayList",
"(",
")",
";",
"Collection",
"inCollection",
"=",
"new",
... | Answer a List of InCriteria based on values, each InCriteria
contains only inLimit values
@param attribute
@param values
@param negative
@param inLimit the maximum number of values for IN (-1 for no limit)
@return List of InCriteria | [
"Answer",
"a",
"List",
"of",
"InCriteria",
"based",
"on",
"values",
"each",
"InCriteria",
"contains",
"only",
"inLimit",
"values"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/Criteria.java#L186-L211 |
Jasig/uPortal | uPortal-portlets/src/main/java/org/apereo/portal/portlets/importexport/ImportExportPortletController.java | ImportExportPortletController.getDeleteView | @RequestMapping(params = "action=delete")
public ModelAndView getDeleteView(PortletRequest request) {
"""
Display the entity deletion form view.
@param request
@return
"""
Map<String, Object> model = new HashMap<String, Object>();
// add a list of all permitted deletion types
f... | java | @RequestMapping(params = "action=delete")
public ModelAndView getDeleteView(PortletRequest request) {
Map<String, Object> model = new HashMap<String, Object>();
// add a list of all permitted deletion types
final Iterable<IPortalDataType> deletePortalDataTypes =
this.portalD... | [
"@",
"RequestMapping",
"(",
"params",
"=",
"\"action=delete\"",
")",
"public",
"ModelAndView",
"getDeleteView",
"(",
"PortletRequest",
"request",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"model",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
... | Display the entity deletion form view.
@param request
@return | [
"Display",
"the",
"entity",
"deletion",
"form",
"view",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-portlets/src/main/java/org/apereo/portal/portlets/importexport/ImportExportPortletController.java#L104-L116 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java | RevisionApi.buildRevisionMetaData | private Revision buildRevisionMetaData(final int fullRevPK, final int limit)
throws SQLException {
"""
This method queries and builds the specified revision.
@param fullRevPK
PK of the full revision
@param limit
number of revision to query
@return Revision
@throws SQLException
if an error occurs... | java | private Revision buildRevisionMetaData(final int fullRevPK, final int limit)
throws SQLException
{
PreparedStatement statement = null;
ResultSet result = null;
try {
String query = "SELECT Revision, PrimaryKey, RevisionCounter, RevisionID, ArticleID, Timestamp, Comment,... | [
"private",
"Revision",
"buildRevisionMetaData",
"(",
"final",
"int",
"fullRevPK",
",",
"final",
"int",
"limit",
")",
"throws",
"SQLException",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"ResultSet",
"result",
"=",
"null",
";",
"try",
"{",
"String",... | This method queries and builds the specified revision.
@param fullRevPK
PK of the full revision
@param limit
number of revision to query
@return Revision
@throws SQLException
if an error occurs while retrieving data from the sql database.
@throws IOException
if an error occurs while reading the content stream
@throws... | [
"This",
"method",
"queries",
"and",
"builds",
"the",
"specified",
"revision",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/RevisionApi.java#L1995-L2050 |
joniles/mpxj | src/main/java/net/sf/mpxj/conceptdraw/ConceptDrawProjectReader.java | ConceptDrawProjectReader.getDuration | private Duration getDuration(TimeUnit units, Double duration) {
"""
Read a duration.
@param units duration units
@param duration duration value
@return Duration instance
"""
Duration result = null;
if (duration != null)
{
double durationValue = duration.doubleValue() * 100.0;
... | java | private Duration getDuration(TimeUnit units, Double duration)
{
Duration result = null;
if (duration != null)
{
double durationValue = duration.doubleValue() * 100.0;
switch (units)
{
case MINUTES:
{
durationValue *= MINUTES_PER_DAY... | [
"private",
"Duration",
"getDuration",
"(",
"TimeUnit",
"units",
",",
"Double",
"duration",
")",
"{",
"Duration",
"result",
"=",
"null",
";",
"if",
"(",
"duration",
"!=",
"null",
")",
"{",
"double",
"durationValue",
"=",
"duration",
".",
"doubleValue",
"(",
... | Read a duration.
@param units duration units
@param duration duration value
@return Duration instance | [
"Read",
"a",
"duration",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/conceptdraw/ConceptDrawProjectReader.java#L516-L567 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/activator/Activator.java | Activator.activateBean | public BeanO activateBean(EJBThreadData threadData, ContainerTx tx, BeanId beanId)
throws RemoteException {
"""
Activate a bean in the context of a transaction. If an instance of the
bean is already active in the transaction, that instance is returned.
Otherwise, one of several strategies is ... | java | public BeanO activateBean(EJBThreadData threadData, ContainerTx tx, BeanId beanId)
throws RemoteException
{
BeanO beanO = null;
try
{
beanO = beanId.getActivationStrategy().atActivate(threadData, tx, beanId); // d630940
} finally
{
... | [
"public",
"BeanO",
"activateBean",
"(",
"EJBThreadData",
"threadData",
",",
"ContainerTx",
"tx",
",",
"BeanId",
"beanId",
")",
"throws",
"RemoteException",
"{",
"BeanO",
"beanO",
"=",
"null",
";",
"try",
"{",
"beanO",
"=",
"beanId",
".",
"getActivationStrategy",... | Activate a bean in the context of a transaction. If an instance of the
bean is already active in the transaction, that instance is returned.
Otherwise, one of several strategies is used to activate an instance
depending on what the bean supports. <p>
If this method completes normally, it must be balanced with a call t... | [
"Activate",
"a",
"bean",
"in",
"the",
"context",
"of",
"a",
"transaction",
".",
"If",
"an",
"instance",
"of",
"the",
"bean",
"is",
"already",
"active",
"in",
"the",
"transaction",
"that",
"instance",
"is",
"returned",
".",
"Otherwise",
"one",
"of",
"severa... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/activator/Activator.java#L288-L305 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftScaleSpace.java | SiftScaleSpace.applyGaussian | void applyGaussian(GrayF32 input, GrayF32 output, Kernel1D kernel) {
"""
Applies the separable kernel to the input image and stores the results in the output image.
"""
tempBlur.reshape(input.width, input.height);
GConvolveImageOps.horizontalNormalized(kernel, input, tempBlur);
GConvolveImageOps.vertical... | java | void applyGaussian(GrayF32 input, GrayF32 output, Kernel1D kernel) {
tempBlur.reshape(input.width, input.height);
GConvolveImageOps.horizontalNormalized(kernel, input, tempBlur);
GConvolveImageOps.verticalNormalized(kernel, tempBlur,output);
} | [
"void",
"applyGaussian",
"(",
"GrayF32",
"input",
",",
"GrayF32",
"output",
",",
"Kernel1D",
"kernel",
")",
"{",
"tempBlur",
".",
"reshape",
"(",
"input",
".",
"width",
",",
"input",
".",
"height",
")",
";",
"GConvolveImageOps",
".",
"horizontalNormalized",
... | Applies the separable kernel to the input image and stores the results in the output image. | [
"Applies",
"the",
"separable",
"kernel",
"to",
"the",
"input",
"image",
"and",
"stores",
"the",
"results",
"in",
"the",
"output",
"image",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/interest/SiftScaleSpace.java#L241-L245 |
Metatavu/edelphi | rest/src/main/java/fi/metatavu/edelphi/permissions/PermissionController.java | PermissionController.getPanelRole | private UserRole getPanelRole(User user, Panel panel) {
"""
Returns user's panel role
@param user user
@param panel panel
@return user's panel role
"""
if (panel != null) {
PanelUserDAO panelUserDAO = new PanelUserDAO();
PanelUser panelUser = panelUserDAO.findByPanelAndUserAndStamp(panel, ... | java | private UserRole getPanelRole(User user, Panel panel) {
if (panel != null) {
PanelUserDAO panelUserDAO = new PanelUserDAO();
PanelUser panelUser = panelUserDAO.findByPanelAndUserAndStamp(panel, user, panel.getCurrentStamp());
return panelUser == null ? getEveryoneRole() : panelUser.getRole();
... | [
"private",
"UserRole",
"getPanelRole",
"(",
"User",
"user",
",",
"Panel",
"panel",
")",
"{",
"if",
"(",
"panel",
"!=",
"null",
")",
"{",
"PanelUserDAO",
"panelUserDAO",
"=",
"new",
"PanelUserDAO",
"(",
")",
";",
"PanelUser",
"panelUser",
"=",
"panelUserDAO",... | Returns user's panel role
@param user user
@param panel panel
@return user's panel role | [
"Returns",
"user",
"s",
"panel",
"role"
] | train | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/permissions/PermissionController.java#L122-L130 |
wcm-io/wcm-io-handler | link/src/main/java/io/wcm/handler/link/spi/LinkHandlerConfig.java | LinkHandlerConfig.getLinkRootPath | public @Nullable String getLinkRootPath(@NotNull Page page, @NotNull String linkTypeId) {
"""
Get root path for picking links using path field widgets.
@param page Context page
@param linkTypeId Link type ID
@return Root path or null
"""
if (StringUtils.equals(linkTypeId, InternalLinkType.ID)) {
/... | java | public @Nullable String getLinkRootPath(@NotNull Page page, @NotNull String linkTypeId) {
if (StringUtils.equals(linkTypeId, InternalLinkType.ID)) {
// inside an experience fragment it does not make sense to use a site root path
if (Path.isExperienceFragmentPath(page.getPath())) {
return DEFAULT... | [
"public",
"@",
"Nullable",
"String",
"getLinkRootPath",
"(",
"@",
"NotNull",
"Page",
"page",
",",
"@",
"NotNull",
"String",
"linkTypeId",
")",
"{",
"if",
"(",
"StringUtils",
".",
"equals",
"(",
"linkTypeId",
",",
"InternalLinkType",
".",
"ID",
")",
")",
"{... | Get root path for picking links using path field widgets.
@param page Context page
@param linkTypeId Link type ID
@return Root path or null | [
"Get",
"root",
"path",
"for",
"picking",
"links",
"using",
"path",
"field",
"widgets",
"."
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/link/src/main/java/io/wcm/handler/link/spi/LinkHandlerConfig.java#L133-L148 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/os/BundleUtils.java | BundleUtils.optFloat | public static float optFloat(@Nullable Bundle bundle, @Nullable String key, float fallback) {
"""
Returns a optional float value. In other words, returns the value mapped by key if it exists and is a float.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns a fallback va... | java | public static float optFloat(@Nullable Bundle bundle, @Nullable String key, float fallback) {
if (bundle == null) {
return fallback;
}
return bundle.getFloat(key, fallback);
} | [
"public",
"static",
"float",
"optFloat",
"(",
"@",
"Nullable",
"Bundle",
"bundle",
",",
"@",
"Nullable",
"String",
"key",
",",
"float",
"fallback",
")",
"{",
"if",
"(",
"bundle",
"==",
"null",
")",
"{",
"return",
"fallback",
";",
"}",
"return",
"bundle",... | Returns a optional float value. In other words, returns the value mapped by key if it exists and is a float.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns a fallback value.
@param bundle a bundle. If the bundle is null, this method will return a fallback value.
@param key... | [
"Returns",
"a",
"optional",
"float",
"value",
".",
"In",
"other",
"words",
"returns",
"the",
"value",
"mapped",
"by",
"key",
"if",
"it",
"exists",
"and",
"is",
"a",
"float",
".",
"The",
"bundle",
"argument",
"is",
"allowed",
"to",
"be",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L496-L501 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/InitFieldHandler.java | InitFieldHandler.fieldChanged | public int fieldChanged(boolean bDisplayOption, int iMoveMode) {
"""
The Field has Changed.
Move the source field or string to this listener's owner.
@param bDisplayOption If true, display the change.
@param iMoveMode The type of move being done (init/read/screen).
@return The error code (or NORMAL_RETURN if o... | java | public int fieldChanged(boolean bDisplayOption, int iMoveMode)
{
if (m_fldSource != null)
{
if (((m_bInitIfSourceNull == true) || (!m_fldSource.isNull()))
&& ((m_bOnlyInitIfDestNull == false)
|| (m_bOnlyInitIfDestNull == true) && (this.getOwner... | [
"public",
"int",
"fieldChanged",
"(",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"if",
"(",
"m_fldSource",
"!=",
"null",
")",
"{",
"if",
"(",
"(",
"(",
"m_bInitIfSourceNull",
"==",
"true",
")",
"||",
"(",
"!",
"m_fldSource",
".",
"is... | The Field has Changed.
Move the source field or string to this listener's owner.
@param bDisplayOption If true, display the change.
@param iMoveMode The type of move being done (init/read/screen).
@return The error code (or NORMAL_RETURN if okay).
Field Changed, init the field. | [
"The",
"Field",
"has",
"Changed",
".",
"Move",
"the",
"source",
"field",
"or",
"string",
"to",
"this",
"listener",
"s",
"owner",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/InitFieldHandler.java#L157-L180 |
brettwooldridge/SansOrm | src/main/java/com/zaxxer/sansorm/transaction/TransactionElf.java | TransactionElf.beginOrJoinTransaction | public static boolean beginOrJoinTransaction() {
"""
Start or join a transaction.
@return true if a new transaction was started (this means the caller "owns"
the commit()), false if a transaction was joined.
"""
boolean newTransaction = false;
try {
newTransaction = userTransaction.get... | java | public static boolean beginOrJoinTransaction()
{
boolean newTransaction = false;
try {
newTransaction = userTransaction.getStatus() == Status.STATUS_NO_TRANSACTION;
if (newTransaction) {
userTransaction.begin();
}
}
catch (Exception e) {
throw n... | [
"public",
"static",
"boolean",
"beginOrJoinTransaction",
"(",
")",
"{",
"boolean",
"newTransaction",
"=",
"false",
";",
"try",
"{",
"newTransaction",
"=",
"userTransaction",
".",
"getStatus",
"(",
")",
"==",
"Status",
".",
"STATUS_NO_TRANSACTION",
";",
"if",
"("... | Start or join a transaction.
@return true if a new transaction was started (this means the caller "owns"
the commit()), false if a transaction was joined. | [
"Start",
"or",
"join",
"a",
"transaction",
"."
] | train | https://github.com/brettwooldridge/SansOrm/blob/ab22721db79c5f20c0e8483f09eda2844d596557/src/main/java/com/zaxxer/sansorm/transaction/TransactionElf.java#L69-L83 |
j256/simplecsv | src/main/java/com/j256/simplecsv/processor/ColumnInfo.java | ColumnInfo.setValue | public void setValue(Object obj, T value) throws IllegalAccessException, InvocationTargetException {
"""
Set the value associated with this field from the object parameter either by setting via the field or calling the
set method.
"""
if (field == null) {
setMethod.invoke(obj, value);
} else {
field... | java | public void setValue(Object obj, T value) throws IllegalAccessException, InvocationTargetException {
if (field == null) {
setMethod.invoke(obj, value);
} else {
field.set(obj, value);
}
} | [
"public",
"void",
"setValue",
"(",
"Object",
"obj",
",",
"T",
"value",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"if",
"(",
"field",
"==",
"null",
")",
"{",
"setMethod",
".",
"invoke",
"(",
"obj",
",",
"value",
")",
";... | Set the value associated with this field from the object parameter either by setting via the field or calling the
set method. | [
"Set",
"the",
"value",
"associated",
"with",
"this",
"field",
"from",
"the",
"object",
"parameter",
"either",
"by",
"setting",
"via",
"the",
"field",
"or",
"calling",
"the",
"set",
"method",
"."
] | train | https://github.com/j256/simplecsv/blob/964fe53073c43e2a311341e3f8fd2c94372f60cb/src/main/java/com/j256/simplecsv/processor/ColumnInfo.java#L85-L91 |
mpetazzoni/ttorrent | common/src/main/java/com/turn/ttorrent/common/creation/MetadataBuilder.java | MetadataBuilder.addFile | public MetadataBuilder addFile(@NotNull File source, @NotNull String path) {
"""
add specified file in torrent with custom path. The file will be stored in .torrent
by specified path. Path can be separated with any slash. In case of single-file torrent
this path will be used as name of source file
"""
if... | java | public MetadataBuilder addFile(@NotNull File source, @NotNull String path) {
if (!source.isFile()) {
throw new IllegalArgumentException(source + " is not exist");
}
checkHashingResultIsNotSet();
filesPaths.add(path);
dataSources.add(new FileSourceHolder(source));
return this;
} | [
"public",
"MetadataBuilder",
"addFile",
"(",
"@",
"NotNull",
"File",
"source",
",",
"@",
"NotNull",
"String",
"path",
")",
"{",
"if",
"(",
"!",
"source",
".",
"isFile",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"source",
"+",
"... | add specified file in torrent with custom path. The file will be stored in .torrent
by specified path. Path can be separated with any slash. In case of single-file torrent
this path will be used as name of source file | [
"add",
"specified",
"file",
"in",
"torrent",
"with",
"custom",
"path",
".",
"The",
"file",
"will",
"be",
"stored",
"in",
".",
"torrent",
"by",
"specified",
"path",
".",
"Path",
"can",
"be",
"separated",
"with",
"any",
"slash",
".",
"In",
"case",
"of",
... | train | https://github.com/mpetazzoni/ttorrent/blob/ecd0e6caf853b63393c4ab63cfd8f20114f73f70/common/src/main/java/com/turn/ttorrent/common/creation/MetadataBuilder.java#L217-L225 |
davidmoten/rxjava-extras | src/main/java/com/github/davidmoten/rx/Transformers.java | Transformers.collectWhile | public static <T, R extends Collection<T>> Transformer<T, R> collectWhile(
final Func0<R> factory, final Action2<? super R, ? super T> collect) {
"""
<p>
Returns a {@link Transformer} that returns an {@link Observable} that is
collected into {@code Collection} instances created by {@code factory}
th... | java | public static <T, R extends Collection<T>> Transformer<T, R> collectWhile(
final Func0<R> factory, final Action2<? super R, ? super T> collect) {
return collectWhile(factory, collect, HolderEquals.<T> instance());
} | [
"public",
"static",
"<",
"T",
",",
"R",
"extends",
"Collection",
"<",
"T",
">",
">",
"Transformer",
"<",
"T",
",",
"R",
">",
"collectWhile",
"(",
"final",
"Func0",
"<",
"R",
">",
"factory",
",",
"final",
"Action2",
"<",
"?",
"super",
"R",
",",
"?",... | <p>
Returns a {@link Transformer} that returns an {@link Observable} that is
collected into {@code Collection} instances created by {@code factory}
that are emitted when items are not equal or on completion.
<p>
<img src=
"https://github.com/davidmoten/rxjava-extras/blob/master/src/docs/collectWhile.png?raw=true"
alt=... | [
"<p",
">",
"Returns",
"a",
"{",
"@link",
"Transformer",
"}",
"that",
"returns",
"an",
"{",
"@link",
"Observable",
"}",
"that",
"is",
"collected",
"into",
"{",
"@code",
"Collection",
"}",
"instances",
"created",
"by",
"{",
"@code",
"factory",
"}",
"that",
... | train | https://github.com/davidmoten/rxjava-extras/blob/a91d2ba7d454843250e0b0fce36084f9fb02a551/src/main/java/com/github/davidmoten/rx/Transformers.java#L598-L601 |
wisdom-framework/wisdom | framework/resource-controller/src/main/java/org/wisdom/resources/WebJarController.java | WebJarController.removedBundle | @Override
public void removedBundle(Bundle bundle, BundleEvent bundleEvent, List<BundleWebJarLib> webJarLibs) {
"""
A bundle is removed.
@param bundle the bundle
@param bundleEvent the event
@param webJarLibs the webjars that were embedded in the bundle.
"""
removeWebJarLibs(webJarLibs);... | java | @Override
public void removedBundle(Bundle bundle, BundleEvent bundleEvent, List<BundleWebJarLib> webJarLibs) {
removeWebJarLibs(webJarLibs);
} | [
"@",
"Override",
"public",
"void",
"removedBundle",
"(",
"Bundle",
"bundle",
",",
"BundleEvent",
"bundleEvent",
",",
"List",
"<",
"BundleWebJarLib",
">",
"webJarLibs",
")",
"{",
"removeWebJarLibs",
"(",
"webJarLibs",
")",
";",
"}"
] | A bundle is removed.
@param bundle the bundle
@param bundleEvent the event
@param webJarLibs the webjars that were embedded in the bundle. | [
"A",
"bundle",
"is",
"removed",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/resource-controller/src/main/java/org/wisdom/resources/WebJarController.java#L356-L359 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/ZonedDateTime.java | ZonedDateTime.now | public static ZonedDateTime now(Clock clock) {
"""
Obtains the current date-time from the specified clock.
<p>
This will query the specified clock to obtain the current date-time.
The zone and offset will be set based on the time-zone in the clock.
<p>
Using this method allows the use of an alternate clock fo... | java | public static ZonedDateTime now(Clock clock) {
Jdk8Methods.requireNonNull(clock, "clock");
final Instant now = clock.instant(); // called once
return ofInstant(now, clock.getZone());
} | [
"public",
"static",
"ZonedDateTime",
"now",
"(",
"Clock",
"clock",
")",
"{",
"Jdk8Methods",
".",
"requireNonNull",
"(",
"clock",
",",
"\"clock\"",
")",
";",
"final",
"Instant",
"now",
"=",
"clock",
".",
"instant",
"(",
")",
";",
"// called once",
"return",
... | Obtains the current date-time from the specified clock.
<p>
This will query the specified clock to obtain the current date-time.
The zone and offset will be set based on the time-zone in the clock.
<p>
Using this method allows the use of an alternate clock for testing.
The alternate clock may be introduced using {@link... | [
"Obtains",
"the",
"current",
"date",
"-",
"time",
"from",
"the",
"specified",
"clock",
".",
"<p",
">",
"This",
"will",
"query",
"the",
"specified",
"clock",
"to",
"obtain",
"the",
"current",
"date",
"-",
"time",
".",
"The",
"zone",
"and",
"offset",
"will... | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/ZonedDateTime.java#L200-L204 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-graph/src/main/java/org/deeplearning4j/graph/data/GraphLoader.java | GraphLoader.loadWeightedEdgeListFile | public static Graph<String, Double> loadWeightedEdgeListFile(String path, int numVertices, String delim,
boolean directed, String... ignoreLinesStartingWith) throws IOException {
"""
Method for loading a weighted graph from an edge list file, where each edge (inc. weight) is represented by a
s... | java | public static Graph<String, Double> loadWeightedEdgeListFile(String path, int numVertices, String delim,
boolean directed, String... ignoreLinesStartingWith) throws IOException {
return loadWeightedEdgeListFile(path, numVertices, delim, directed, true, ignoreLinesStartingWith);
} | [
"public",
"static",
"Graph",
"<",
"String",
",",
"Double",
">",
"loadWeightedEdgeListFile",
"(",
"String",
"path",
",",
"int",
"numVertices",
",",
"String",
"delim",
",",
"boolean",
"directed",
",",
"String",
"...",
"ignoreLinesStartingWith",
")",
"throws",
"IOE... | Method for loading a weighted graph from an edge list file, where each edge (inc. weight) is represented by a
single line. Graph may be directed or undirected<br>
This method assumes that edges are of the format: {@code fromIndex<delim>toIndex<delim>edgeWeight} where {@code <delim>}
is the delimiter.
<b>Note</b>: this ... | [
"Method",
"for",
"loading",
"a",
"weighted",
"graph",
"from",
"an",
"edge",
"list",
"file",
"where",
"each",
"edge",
"(",
"inc",
".",
"weight",
")",
"is",
"represented",
"by",
"a",
"single",
"line",
".",
"Graph",
"may",
"be",
"directed",
"or",
"undirecte... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-graph/src/main/java/org/deeplearning4j/graph/data/GraphLoader.java#L97-L100 |
deeplearning4j/deeplearning4j | datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/loader/ImageLoader.java | ImageLoader.asImageMiniBatches | public INDArray asImageMiniBatches(File f, int numMiniBatches, int numRowsPerSlice) {
"""
Slices up an image in to a mini batch.
@param f the file to load from
@param numMiniBatches the number of images in a mini batch
@param numRowsPerSlice the number of rows for each image
@return a tensor r... | java | public INDArray asImageMiniBatches(File f, int numMiniBatches, int numRowsPerSlice) {
try {
INDArray d = asMatrix(f);
return Nd4j.create(numMiniBatches, numRowsPerSlice, d.columns());
} catch (Exception e) {
throw new RuntimeException(e);
}
} | [
"public",
"INDArray",
"asImageMiniBatches",
"(",
"File",
"f",
",",
"int",
"numMiniBatches",
",",
"int",
"numRowsPerSlice",
")",
"{",
"try",
"{",
"INDArray",
"d",
"=",
"asMatrix",
"(",
"f",
")",
";",
"return",
"Nd4j",
".",
"create",
"(",
"numMiniBatches",
"... | Slices up an image in to a mini batch.
@param f the file to load from
@param numMiniBatches the number of images in a mini batch
@param numRowsPerSlice the number of rows for each image
@return a tensor representing one image as a mini batch | [
"Slices",
"up",
"an",
"image",
"in",
"to",
"a",
"mini",
"batch",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-data/datavec-data-image/src/main/java/org/datavec/image/loader/ImageLoader.java#L324-L331 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfContentByte.java | PdfContentByte.escapeString | static void escapeString(byte b[], ByteBuffer content) {
"""
Escapes a <CODE>byte</CODE> array according to the PDF conventions.
@param b the <CODE>byte</CODE> array to escape
@param content the content
"""
content.append_i('(');
for (int k = 0; k < b.length; ++k) {
byte c = b[k... | java | static void escapeString(byte b[], ByteBuffer content) {
content.append_i('(');
for (int k = 0; k < b.length; ++k) {
byte c = b[k];
switch (c) {
case '\r':
content.append("\\r");
break;
case '\n':
... | [
"static",
"void",
"escapeString",
"(",
"byte",
"b",
"[",
"]",
",",
"ByteBuffer",
"content",
")",
"{",
"content",
".",
"append_i",
"(",
"'",
"'",
")",
";",
"for",
"(",
"int",
"k",
"=",
"0",
";",
"k",
"<",
"b",
".",
"length",
";",
"++",
"k",
")",... | Escapes a <CODE>byte</CODE> array according to the PDF conventions.
@param b the <CODE>byte</CODE> array to escape
@param content the content | [
"Escapes",
"a",
"<CODE",
">",
"byte<",
"/",
"CODE",
">",
"array",
"according",
"to",
"the",
"PDF",
"conventions",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfContentByte.java#L1614-L1644 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/SimpleTimeZone.java | SimpleTimeZone.setEndRule | public void setEndRule(int month, int dayOfMonth, int dayOfWeek, int time, boolean after) {
"""
Sets the DST end rule to a weekday before or after a give date within
a month, e.g., the first Monday on or after the 8th.
@param month The month in which this rule occurs (0-based).
@param dayOfMonth A ... | java | public void setEndRule(int month, int dayOfMonth, int dayOfWeek, int time, boolean after) {
if (isFrozen()) {
throw new UnsupportedOperationException("Attempt to modify a frozen SimpleTimeZone instance.");
}
getSTZInfo().setEnd(month, -1, dayOfWeek, time, dayOfMonth, after);
... | [
"public",
"void",
"setEndRule",
"(",
"int",
"month",
",",
"int",
"dayOfMonth",
",",
"int",
"dayOfWeek",
",",
"int",
"time",
",",
"boolean",
"after",
")",
"{",
"if",
"(",
"isFrozen",
"(",
")",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
... | Sets the DST end rule to a weekday before or after a give date within
a month, e.g., the first Monday on or after the 8th.
@param month The month in which this rule occurs (0-based).
@param dayOfMonth A date within that month (1-based).
@param dayOfWeek The day of the week on which this rule occurs.
@pa... | [
"Sets",
"the",
"DST",
"end",
"rule",
"to",
"a",
"weekday",
"before",
"or",
"after",
"a",
"give",
"date",
"within",
"a",
"month",
"e",
".",
"g",
".",
"the",
"first",
"Monday",
"on",
"or",
"after",
"the",
"8th",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/SimpleTimeZone.java#L477-L484 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-uima/src/main/java/org/deeplearning4j/text/corpora/treeparser/TreeFactory.java | TreeFactory.toTree | public static Tree toTree(TreebankNode node, Pair<String, MultiDimensionalMap<Integer, Integer, String>> labels)
throws Exception {
"""
Converts a treebank node to a tree
@param node the node to convert
@param labels the labels to assign for each span
@return the tree with the same tokens an... | java | public static Tree toTree(TreebankNode node, Pair<String, MultiDimensionalMap<Integer, Integer, String>> labels)
throws Exception {
List<String> tokens = tokens(node);
Tree ret = new Tree(tokens);
ret.setValue(node.getNodeValue());
ret.setLabel(node.getNodeType());
... | [
"public",
"static",
"Tree",
"toTree",
"(",
"TreebankNode",
"node",
",",
"Pair",
"<",
"String",
",",
"MultiDimensionalMap",
"<",
"Integer",
",",
"Integer",
",",
"String",
">",
">",
"labels",
")",
"throws",
"Exception",
"{",
"List",
"<",
"String",
">",
"toke... | Converts a treebank node to a tree
@param node the node to convert
@param labels the labels to assign for each span
@return the tree with the same tokens and type as
the given tree bank node
@throws Exception | [
"Converts",
"a",
"treebank",
"node",
"to",
"a",
"tree"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-uima/src/main/java/org/deeplearning4j/text/corpora/treeparser/TreeFactory.java#L90-L105 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxDevicePin.java | BoxDevicePin.getEnterpriceDevicePins | public static Iterable<BoxDevicePin.Info> getEnterpriceDevicePins(final BoxAPIConnection api, String enterpriseID,
int limit, String ... fields) {
"""
Returns iterable with all the device pins within a given enterprise.
Must be an enterprise a... | java | public static Iterable<BoxDevicePin.Info> getEnterpriceDevicePins(final BoxAPIConnection api, String enterpriseID,
int limit, String ... fields) {
QueryStringBuilder builder = new QueryStringBuilder();
if (fields.length > 0) {
... | [
"public",
"static",
"Iterable",
"<",
"BoxDevicePin",
".",
"Info",
">",
"getEnterpriceDevicePins",
"(",
"final",
"BoxAPIConnection",
"api",
",",
"String",
"enterpriseID",
",",
"int",
"limit",
",",
"String",
"...",
"fields",
")",
"{",
"QueryStringBuilder",
"builder"... | Returns iterable with all the device pins within a given enterprise.
Must be an enterprise admin with the manage enterprise scope to make this call.
@param api API used to connect the Box.
@param enterpriseID ID of the enterprise to get all the device pins within.
@param limit the maximum number of items per single res... | [
"Returns",
"iterable",
"with",
"all",
"the",
"device",
"pins",
"within",
"a",
"given",
"enterprise",
".",
"Must",
"be",
"an",
"enterprise",
"admin",
"with",
"the",
"manage",
"enterprise",
"scope",
"to",
"make",
"this",
"call",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxDevicePin.java#L84-L100 |
logic-ng/LogicNG | src/main/java/org/logicng/formulas/printer/FormulaStringRepresentation.java | FormulaStringRepresentation.pbLhs | protected String pbLhs(final Literal[] operands, final int[] coefficients) {
"""
Returns the string representation of the left-hand side of a pseudo-Boolean constraint.
@param operands the literals of the constraint
@param coefficients the coefficients of the constraint
@return the string representation
... | java | protected String pbLhs(final Literal[] operands, final int[] coefficients) {
assert operands.length == coefficients.length;
final StringBuilder sb = new StringBuilder();
final String mul = this.pbMul();
final String add = this.pbAdd();
for (int i = 0; i < operands.length - 1; i++... | [
"protected",
"String",
"pbLhs",
"(",
"final",
"Literal",
"[",
"]",
"operands",
",",
"final",
"int",
"[",
"]",
"coefficients",
")",
"{",
"assert",
"operands",
".",
"length",
"==",
"coefficients",
".",
"length",
";",
"final",
"StringBuilder",
"sb",
"=",
"new... | Returns the string representation of the left-hand side of a pseudo-Boolean constraint.
@param operands the literals of the constraint
@param coefficients the coefficients of the constraint
@return the string representation | [
"Returns",
"the",
"string",
"representation",
"of",
"the",
"left",
"-",
"hand",
"side",
"of",
"a",
"pseudo",
"-",
"Boolean",
"constraint",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/printer/FormulaStringRepresentation.java#L139-L159 |
nostra13/Android-Universal-Image-Loader | library/src/main/java/com/nostra13/universalimageloader/core/download/BaseImageDownloader.java | BaseImageDownloader.getStreamFromContent | protected InputStream getStreamFromContent(String imageUri, Object extra) throws FileNotFoundException {
"""
Retrieves {@link InputStream} of image by URI (image is accessed using {@link ContentResolver}).
@param imageUri Image URI
@param extra Auxiliary object which was passed to {@link DisplayImageOptions... | java | protected InputStream getStreamFromContent(String imageUri, Object extra) throws FileNotFoundException {
ContentResolver res = context.getContentResolver();
Uri uri = Uri.parse(imageUri);
if (isVideoContentUri(uri)) { // video thumbnail
Long origId = Long.valueOf(uri.getLastPathSegment());
Bitmap bitmap = ... | [
"protected",
"InputStream",
"getStreamFromContent",
"(",
"String",
"imageUri",
",",
"Object",
"extra",
")",
"throws",
"FileNotFoundException",
"{",
"ContentResolver",
"res",
"=",
"context",
".",
"getContentResolver",
"(",
")",
";",
"Uri",
"uri",
"=",
"Uri",
".",
... | Retrieves {@link InputStream} of image by URI (image is accessed using {@link ContentResolver}).
@param imageUri Image URI
@param extra Auxiliary object which was passed to {@link DisplayImageOptions.Builder#extraForDownloader(Object)
DisplayImageOptions.extraForDownloader(Object)}; can be null
@return {@link Input... | [
"Retrieves",
"{",
"@link",
"InputStream",
"}",
"of",
"image",
"by",
"URI",
"(",
"image",
"is",
"accessed",
"using",
"{",
"@link",
"ContentResolver",
"}",
")",
"."
] | train | https://github.com/nostra13/Android-Universal-Image-Loader/blob/fc3c5f6779bb4f702e233653b61bd9d559e345cc/library/src/main/java/com/nostra13/universalimageloader/core/download/BaseImageDownloader.java#L208-L226 |
aspectran/aspectran | web/src/main/java/com/aspectran/web/service/AspectranWebService.java | AspectranWebService.create | public static AspectranWebService create(ServletContext servletContext, CoreService rootService) {
"""
Returns a new instance of {@code AspectranWebService}.
@param servletContext the servlet context
@param rootService the root service
@return the instance of {@code AspectranWebService}
"""
Aspect... | java | public static AspectranWebService create(ServletContext servletContext, CoreService rootService) {
AspectranWebService service = new AspectranWebService(rootService);
service.setDefaultServletHttpRequestHandler(servletContext);
AspectranConfig aspectranConfig = rootService.getAspectranConfig();
... | [
"public",
"static",
"AspectranWebService",
"create",
"(",
"ServletContext",
"servletContext",
",",
"CoreService",
"rootService",
")",
"{",
"AspectranWebService",
"service",
"=",
"new",
"AspectranWebService",
"(",
"rootService",
")",
";",
"service",
".",
"setDefaultServl... | Returns a new instance of {@code AspectranWebService}.
@param servletContext the servlet context
@param rootService the root service
@return the instance of {@code AspectranWebService} | [
"Returns",
"a",
"new",
"instance",
"of",
"{",
"@code",
"AspectranWebService",
"}",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/web/src/main/java/com/aspectran/web/service/AspectranWebService.java#L205-L224 |
Viascom/groundwork | foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/annotation/processor/FoxHttpAnnotationParser.java | FoxHttpAnnotationParser.parseInterface | @SuppressWarnings("unchecked")
public <T> T parseInterface(final Class<T> serviceInterface, FoxHttpClient foxHttpClient) throws FoxHttpException {
"""
Parse the given interface for the use of FoxHttp
@param serviceInterface interface to parse
@param foxHttpClient FoxHttpClient to use
@param <T> ... | java | @SuppressWarnings("unchecked")
public <T> T parseInterface(final Class<T> serviceInterface, FoxHttpClient foxHttpClient) throws FoxHttpException {
try {
Method[] methods = serviceInterface.getDeclaredMethods();
for (Method method : methods) {
FoxHttpMethodParser fox... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"parseInterface",
"(",
"final",
"Class",
"<",
"T",
">",
"serviceInterface",
",",
"FoxHttpClient",
"foxHttpClient",
")",
"throws",
"FoxHttpException",
"{",
"try",
"{",
"Method",
"... | Parse the given interface for the use of FoxHttp
@param serviceInterface interface to parse
@param foxHttpClient FoxHttpClient to use
@param <T> interface class to parse
@return Proxy of the interface
@throws FoxHttpRequestException | [
"Parse",
"the",
"given",
"interface",
"for",
"the",
"use",
"of",
"FoxHttp"
] | train | https://github.com/Viascom/groundwork/blob/d3f7d0df65e2e75861fc7db938090683f2cdf919/foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/annotation/processor/FoxHttpAnnotationParser.java#L41-L67 |
GerdHolz/TOVAL | src/de/invation/code/toval/os/WindowsRegistry.java | WindowsRegistry.keyParts | private static Object[] keyParts(String fullKeyName) throws RegistryException {
"""
Splits a path such as HKEY_LOCAL_MACHINE\Software\Microsoft into a pair
of values used by the underlying API: An integer hive constant and a byte
array of the key path within that hive.
@param fullKeyName Key name to split in ... | java | private static Object[] keyParts(String fullKeyName) throws RegistryException {
int x = fullKeyName.indexOf(REG_PATH_SEPARATOR);
String hiveName = x >= 0 ? fullKeyName.substring(0, x) : fullKeyName;
String keyName = x >= 0 ? fullKeyName.substring(x + 1) : "";
if (Hive.getHive(hiveName) =... | [
"private",
"static",
"Object",
"[",
"]",
"keyParts",
"(",
"String",
"fullKeyName",
")",
"throws",
"RegistryException",
"{",
"int",
"x",
"=",
"fullKeyName",
".",
"indexOf",
"(",
"REG_PATH_SEPARATOR",
")",
";",
"String",
"hiveName",
"=",
"x",
">=",
"0",
"?",
... | Splits a path such as HKEY_LOCAL_MACHINE\Software\Microsoft into a pair
of values used by the underlying API: An integer hive constant and a byte
array of the key path within that hive.
@param fullKeyName Key name to split in its single keys.
@return Array with the hive key as first element and a following byte
array ... | [
"Splits",
"a",
"path",
"such",
"as",
"HKEY_LOCAL_MACHINE",
"\\",
"Software",
"\\",
"Microsoft",
"into",
"a",
"pair",
"of",
"values",
"used",
"by",
"the",
"underlying",
"API",
":",
"An",
"integer",
"hive",
"constant",
"and",
"a",
"byte",
"array",
"of",
"the... | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/os/WindowsRegistry.java#L208-L217 |
js-lib-com/dom | src/main/java/js/dom/w3c/DocumentBuilderImpl.java | DocumentBuilderImpl.loadXML | private Document loadXML(URL url, boolean useNamespace) {
"""
Helper method to load XML document from URL.
@param url source URL,
@param useNamespace flag to control name space awareness.
@return newly created XML document.
"""
InputStream stream = null;
try {
stream = url.openConnection().getIn... | java | private Document loadXML(URL url, boolean useNamespace) {
InputStream stream = null;
try {
stream = url.openConnection().getInputStream();
InputSource source = new InputSource(stream);
return useNamespace ? loadXMLNS(source) : loadXML(source);
} catch (Exception e) {
throw new DomException(e);
... | [
"private",
"Document",
"loadXML",
"(",
"URL",
"url",
",",
"boolean",
"useNamespace",
")",
"{",
"InputStream",
"stream",
"=",
"null",
";",
"try",
"{",
"stream",
"=",
"url",
".",
"openConnection",
"(",
")",
".",
"getInputStream",
"(",
")",
";",
"InputSource"... | Helper method to load XML document from URL.
@param url source URL,
@param useNamespace flag to control name space awareness.
@return newly created XML document. | [
"Helper",
"method",
"to",
"load",
"XML",
"document",
"from",
"URL",
"."
] | train | https://github.com/js-lib-com/dom/blob/8c7cd7c802977f210674dec7c2a8f61e8de05b63/src/main/java/js/dom/w3c/DocumentBuilderImpl.java#L195-L206 |
taskadapter/redmine-java-api | src/main/java/com/taskadapter/redmineapi/RedmineManagerFactory.java | RedmineManagerFactory.createWithApiKey | public static RedmineManager createWithApiKey(String uri,
String apiAccessKey, HttpClient httpClient) {
"""
Creates an instance of RedmineManager class. Host and apiAccessKey are
not checked at this moment.
@param uri complete Redmine server web URI, i... | java | public static RedmineManager createWithApiKey(String uri,
String apiAccessKey, HttpClient httpClient) {
return new RedmineManager(new Transport(new URIConfigurator(uri,
apiAccessKey), httpClient));
} | [
"public",
"static",
"RedmineManager",
"createWithApiKey",
"(",
"String",
"uri",
",",
"String",
"apiAccessKey",
",",
"HttpClient",
"httpClient",
")",
"{",
"return",
"new",
"RedmineManager",
"(",
"new",
"Transport",
"(",
"new",
"URIConfigurator",
"(",
"uri",
",",
... | Creates an instance of RedmineManager class. Host and apiAccessKey are
not checked at this moment.
@param uri complete Redmine server web URI, including protocol and port
number. Example: http://demo.redmine.org:8080
@param apiAccessKey Redmine API access key. It is shown on "My Account" /
"API access key" we... | [
"Creates",
"an",
"instance",
"of",
"RedmineManager",
"class",
".",
"Host",
"and",
"apiAccessKey",
"are",
"not",
"checked",
"at",
"this",
"moment",
"."
] | train | https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/RedmineManagerFactory.java#L112-L116 |
yanzhenjie/Album | album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java | AlbumUtils.getAlphaColor | @ColorInt
public static int getAlphaColor(@ColorInt int color, @IntRange(from = 0, to = 255) int alpha) {
"""
Return a color-int from alpha, red, green, blue components.
@param color color.
@param alpha alpha, alpha component [0..255] of the color.
"""
int red = Color.red(color);
int gr... | java | @ColorInt
public static int getAlphaColor(@ColorInt int color, @IntRange(from = 0, to = 255) int alpha) {
int red = Color.red(color);
int green = Color.green(color);
int blue = Color.blue(color);
return Color.argb(alpha, red, green, blue);
} | [
"@",
"ColorInt",
"public",
"static",
"int",
"getAlphaColor",
"(",
"@",
"ColorInt",
"int",
"color",
",",
"@",
"IntRange",
"(",
"from",
"=",
"0",
",",
"to",
"=",
"255",
")",
"int",
"alpha",
")",
"{",
"int",
"red",
"=",
"Color",
".",
"red",
"(",
"colo... | Return a color-int from alpha, red, green, blue components.
@param color color.
@param alpha alpha, alpha component [0..255] of the color. | [
"Return",
"a",
"color",
"-",
"int",
"from",
"alpha",
"red",
"green",
"blue",
"components",
"."
] | train | https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java#L364-L370 |
tvesalainen/bcc | src/main/java/org/vesalainen/bcc/SubClass.java | SubClass.defineConstantField | public void defineConstantField(int modifier, String fieldName, int constant) {
"""
Define constant field and set the constant value.
@param modifier
@param fieldName
@param constant
"""
DeclaredType dt = (DeclaredType)asType();
VariableBuilder builder = new VariableBuilder(this, fieldName... | java | public void defineConstantField(int modifier, String fieldName, int constant)
{
DeclaredType dt = (DeclaredType)asType();
VariableBuilder builder = new VariableBuilder(this, fieldName, dt.getTypeArguments(), typeParameterMap);
builder.addModifiers(modifier);
builder.addModifier(... | [
"public",
"void",
"defineConstantField",
"(",
"int",
"modifier",
",",
"String",
"fieldName",
",",
"int",
"constant",
")",
"{",
"DeclaredType",
"dt",
"=",
"(",
"DeclaredType",
")",
"asType",
"(",
")",
";",
"VariableBuilder",
"builder",
"=",
"new",
"VariableBuil... | Define constant field and set the constant value.
@param modifier
@param fieldName
@param constant | [
"Define",
"constant",
"field",
"and",
"set",
"the",
"constant",
"value",
"."
] | train | https://github.com/tvesalainen/bcc/blob/4e84e313018d487f1a8cca3952d71bc21e77d16b/src/main/java/org/vesalainen/bcc/SubClass.java#L636-L646 |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/PrimaveraReader.java | PrimaveraReader.populateField | private void populateField(FieldContainer container, FieldType target, FieldType baseline, FieldType actual) {
"""
Populates a field based on baseline and actual values.
@param container field container
@param target target field
@param baseline baseline field
@param actual actual field
"""
Object ... | java | private void populateField(FieldContainer container, FieldType target, FieldType baseline, FieldType actual)
{
Object value = container.getCachedValue(actual);
if (value == null)
{
value = container.getCachedValue(baseline);
}
container.set(target, value);
} | [
"private",
"void",
"populateField",
"(",
"FieldContainer",
"container",
",",
"FieldType",
"target",
",",
"FieldType",
"baseline",
",",
"FieldType",
"actual",
")",
"{",
"Object",
"value",
"=",
"container",
".",
"getCachedValue",
"(",
"actual",
")",
";",
"if",
"... | Populates a field based on baseline and actual values.
@param container field container
@param target target field
@param baseline baseline field
@param actual actual field | [
"Populates",
"a",
"field",
"based",
"on",
"baseline",
"and",
"actual",
"values",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraReader.java#L991-L999 |
cdk/cdk | storage/io/src/main/java/org/openscience/cdk/io/iterator/event/EventCMLReader.java | EventCMLReader.process | public void process() throws CDKException {
"""
Starts the reading of the CML file. Whenever a new Molecule is read,
a event is thrown to the ReaderListener.
"""
logger.debug("Started parsing from input...");
try {
parser.setFeature("http://xml.org/sax/features/validation", false);... | java | public void process() throws CDKException {
logger.debug("Started parsing from input...");
try {
parser.setFeature("http://xml.org/sax/features/validation", false);
logger.info("Deactivated validation");
} catch (SAXException e) {
logger.warn("Cannot deactivat... | [
"public",
"void",
"process",
"(",
")",
"throws",
"CDKException",
"{",
"logger",
".",
"debug",
"(",
"\"Started parsing from input...\"",
")",
";",
"try",
"{",
"parser",
".",
"setFeature",
"(",
"\"http://xml.org/sax/features/validation\"",
",",
"false",
")",
";",
"l... | Starts the reading of the CML file. Whenever a new Molecule is read,
a event is thrown to the ReaderListener. | [
"Starts",
"the",
"reading",
"of",
"the",
"CML",
"file",
".",
"Whenever",
"a",
"new",
"Molecule",
"is",
"read",
"a",
"event",
"is",
"thrown",
"to",
"the",
"ReaderListener",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/io/src/main/java/org/openscience/cdk/io/iterator/event/EventCMLReader.java#L149-L180 |
square/okhttp | okhttp/src/main/java/okhttp3/internal/Util.java | Util.sameConnection | public static boolean sameConnection(HttpUrl a, HttpUrl b) {
"""
Returns true if an HTTP request for {@code a} and {@code b} can reuse a connection.
"""
return a.host().equals(b.host())
&& a.port() == b.port()
&& a.scheme().equals(b.scheme());
} | java | public static boolean sameConnection(HttpUrl a, HttpUrl b) {
return a.host().equals(b.host())
&& a.port() == b.port()
&& a.scheme().equals(b.scheme());
} | [
"public",
"static",
"boolean",
"sameConnection",
"(",
"HttpUrl",
"a",
",",
"HttpUrl",
"b",
")",
"{",
"return",
"a",
".",
"host",
"(",
")",
".",
"equals",
"(",
"b",
".",
"host",
"(",
")",
")",
"&&",
"a",
".",
"port",
"(",
")",
"==",
"b",
".",
"p... | Returns true if an HTTP request for {@code a} and {@code b} can reuse a connection. | [
"Returns",
"true",
"if",
"an",
"HTTP",
"request",
"for",
"{"
] | train | https://github.com/square/okhttp/blob/a8c65a822dd6cadd2de7d115bf94adf312e67868/okhttp/src/main/java/okhttp3/internal/Util.java#L647-L651 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.deleteCustomPrebuiltDomainAsync | public Observable<OperationStatus> deleteCustomPrebuiltDomainAsync(UUID appId, String versionId, String domainName) {
"""
Deletes a prebuilt domain's models from the application.
@param appId The application ID.
@param versionId The version ID.
@param domainName Domain name.
@throws IllegalArgumentException ... | java | public Observable<OperationStatus> deleteCustomPrebuiltDomainAsync(UUID appId, String versionId, String domainName) {
return deleteCustomPrebuiltDomainWithServiceResponseAsync(appId, versionId, domainName).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() {
@Override
pub... | [
"public",
"Observable",
"<",
"OperationStatus",
">",
"deleteCustomPrebuiltDomainAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"String",
"domainName",
")",
"{",
"return",
"deleteCustomPrebuiltDomainWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",... | Deletes a prebuilt domain's models from the application.
@param appId The application ID.
@param versionId The version ID.
@param domainName Domain name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the OperationStatus object | [
"Deletes",
"a",
"prebuilt",
"domain",
"s",
"models",
"from",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L6176-L6183 |
google/j2objc | jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java | ParserAdapter.ignorableWhitespace | public void ignorableWhitespace (char ch[], int start, int length)
throws SAXException {
"""
Adapter implementation method; do not call.
Adapt a SAX1 ignorable whitespace event.
@param ch An array of characters.
@param start The starting position in the array.
@param length The number of characters to us... | java | public void ignorableWhitespace (char ch[], int start, int length)
throws SAXException
{
if (contentHandler != null) {
contentHandler.ignorableWhitespace(ch, start, length);
}
} | [
"public",
"void",
"ignorableWhitespace",
"(",
"char",
"ch",
"[",
"]",
",",
"int",
"start",
",",
"int",
"length",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"contentHandler",
"!=",
"null",
")",
"{",
"contentHandler",
".",
"ignorableWhitespace",
"(",
"ch",... | Adapter implementation method; do not call.
Adapt a SAX1 ignorable whitespace event.
@param ch An array of characters.
@param start The starting position in the array.
@param length The number of characters to use.
@exception SAXException The client may raise a
processing exception.
@see org.xml.sax.DocumentHandler#ig... | [
"Adapter",
"implementation",
"method",
";",
"do",
"not",
"call",
".",
"Adapt",
"a",
"SAX1",
"ignorable",
"whitespace",
"event",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java#L664-L670 |
SUSE/salt-netapi-client | src/main/java/com/suse/salt/netapi/event/AbstractEventStream.java | AbstractEventStream.clearListeners | protected void clearListeners(int code, String phrase) {
"""
Removes all listeners.
@param code an integer code to represent the reason for closing
@param phrase a String representation of code
"""
listeners.forEach(listener -> listener.eventStreamClosed(code, phrase));
// Clear out the li... | java | protected void clearListeners(int code, String phrase) {
listeners.forEach(listener -> listener.eventStreamClosed(code, phrase));
// Clear out the listeners
listeners.clear();
} | [
"protected",
"void",
"clearListeners",
"(",
"int",
"code",
",",
"String",
"phrase",
")",
"{",
"listeners",
".",
"forEach",
"(",
"listener",
"->",
"listener",
".",
"eventStreamClosed",
"(",
"code",
",",
"phrase",
")",
")",
";",
"// Clear out the listeners",
"li... | Removes all listeners.
@param code an integer code to represent the reason for closing
@param phrase a String representation of code | [
"Removes",
"all",
"listeners",
"."
] | train | https://github.com/SUSE/salt-netapi-client/blob/a0bdf643c8e34fa4def4b915366594c1491fdad5/src/main/java/com/suse/salt/netapi/event/AbstractEventStream.java#L74-L79 |
scottbw/spaws | src/main/java/uk/ac/bolton/spaws/ParadataManager.java | ParadataManager.getExternalRatingSubmissions | public List<ISubmission> getExternalRatingSubmissions(String resourceUrl) throws Exception {
"""
Return all rating submissions from other submitters for the resource
@param resourceUrl
@return
@throws Exception
"""
return getExternalSubmissions(resourceUrl, IRating.VERB);
} | java | public List<ISubmission> getExternalRatingSubmissions(String resourceUrl) throws Exception{
return getExternalSubmissions(resourceUrl, IRating.VERB);
} | [
"public",
"List",
"<",
"ISubmission",
">",
"getExternalRatingSubmissions",
"(",
"String",
"resourceUrl",
")",
"throws",
"Exception",
"{",
"return",
"getExternalSubmissions",
"(",
"resourceUrl",
",",
"IRating",
".",
"VERB",
")",
";",
"}"
] | Return all rating submissions from other submitters for the resource
@param resourceUrl
@return
@throws Exception | [
"Return",
"all",
"rating",
"submissions",
"from",
"other",
"submitters",
"for",
"the",
"resource"
] | train | https://github.com/scottbw/spaws/blob/9b1e07453091f6a8d60c6046d194b1a8f1236502/src/main/java/uk/ac/bolton/spaws/ParadataManager.java#L83-L85 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ThreadLocalRandom.java | ThreadLocalRandom.nextLong | public long nextLong(long origin, long bound) {
"""
Returns a pseudorandom {@code long} value between the specified
origin (inclusive) and the specified bound (exclusive).
@param origin the least value returned
@param bound the upper bound (exclusive)
@return a pseudorandom {@code long} value between the ori... | java | public long nextLong(long origin, long bound) {
if (origin >= bound)
throw new IllegalArgumentException(BAD_RANGE);
return internalNextLong(origin, bound);
} | [
"public",
"long",
"nextLong",
"(",
"long",
"origin",
",",
"long",
"bound",
")",
"{",
"if",
"(",
"origin",
">=",
"bound",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"BAD_RANGE",
")",
";",
"return",
"internalNextLong",
"(",
"origin",
",",
"bound",
... | Returns a pseudorandom {@code long} value between the specified
origin (inclusive) and the specified bound (exclusive).
@param origin the least value returned
@param bound the upper bound (exclusive)
@return a pseudorandom {@code long} value between the origin
(inclusive) and the bound (exclusive)
@throws IllegalArgum... | [
"Returns",
"a",
"pseudorandom",
"{",
"@code",
"long",
"}",
"value",
"between",
"the",
"specified",
"origin",
"(",
"inclusive",
")",
"and",
"the",
"specified",
"bound",
"(",
"exclusive",
")",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ThreadLocalRandom.java#L373-L377 |
JodaOrg/joda-time | src/main/java/org/joda/time/field/FieldUtils.java | FieldUtils.verifyValueBounds | public static void verifyValueBounds(DateTimeFieldType fieldType,
int value, int lowerBound, int upperBound) {
"""
Verify that input values are within specified bounds.
@param value the value to check
@param lowerBound the lower bound allowed for value
@param upperB... | java | public static void verifyValueBounds(DateTimeFieldType fieldType,
int value, int lowerBound, int upperBound) {
if ((value < lowerBound) || (value > upperBound)) {
throw new IllegalFieldValueException
(fieldType, Integer.valueOf(value),
... | [
"public",
"static",
"void",
"verifyValueBounds",
"(",
"DateTimeFieldType",
"fieldType",
",",
"int",
"value",
",",
"int",
"lowerBound",
",",
"int",
"upperBound",
")",
"{",
"if",
"(",
"(",
"value",
"<",
"lowerBound",
")",
"||",
"(",
"value",
">",
"upperBound",... | Verify that input values are within specified bounds.
@param value the value to check
@param lowerBound the lower bound allowed for value
@param upperBound the upper bound allowed for value
@throws IllegalFieldValueException if value is not in the specified bounds
@since 1.1 | [
"Verify",
"that",
"input",
"values",
"are",
"within",
"specified",
"bounds",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/FieldUtils.java#L272-L279 |
netty/netty | handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java | SslContextBuilder.keyManager | public SslContextBuilder keyManager(File keyCertChainFile, File keyFile) {
"""
Identifying certificate for this host. {@code keyCertChainFile} and {@code keyFile} may
be {@code null} for client contexts, which disables mutual authentication.
@param keyCertChainFile an X.509 certificate chain file in PEM format... | java | public SslContextBuilder keyManager(File keyCertChainFile, File keyFile) {
return keyManager(keyCertChainFile, keyFile, null);
} | [
"public",
"SslContextBuilder",
"keyManager",
"(",
"File",
"keyCertChainFile",
",",
"File",
"keyFile",
")",
"{",
"return",
"keyManager",
"(",
"keyCertChainFile",
",",
"keyFile",
",",
"null",
")",
";",
"}"
] | Identifying certificate for this host. {@code keyCertChainFile} and {@code keyFile} may
be {@code null} for client contexts, which disables mutual authentication.
@param keyCertChainFile an X.509 certificate chain file in PEM format
@param keyFile a PKCS#8 private key file in PEM format | [
"Identifying",
"certificate",
"for",
"this",
"host",
".",
"{",
"@code",
"keyCertChainFile",
"}",
"and",
"{",
"@code",
"keyFile",
"}",
"may",
"be",
"{",
"@code",
"null",
"}",
"for",
"client",
"contexts",
"which",
"disables",
"mutual",
"authentication",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java#L224-L226 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxFile.java | BoxFile.getThumbnail | public byte[] getThumbnail(ThumbnailFileType fileType, int minWidth, int minHeight, int maxWidth, int maxHeight) {
"""
Retrieves a thumbnail, or smaller image representation, of this file. Sizes of 32x32, 64x64, 128x128,
and 256x256 can be returned in the .png format and sizes of 32x32, 94x94, 160x160, and 320x32... | java | public byte[] getThumbnail(ThumbnailFileType fileType, int minWidth, int minHeight, int maxWidth, int maxHeight) {
QueryStringBuilder builder = new QueryStringBuilder();
builder.appendParam("min_width", minWidth);
builder.appendParam("min_height", minHeight);
builder.appendParam("max_wid... | [
"public",
"byte",
"[",
"]",
"getThumbnail",
"(",
"ThumbnailFileType",
"fileType",
",",
"int",
"minWidth",
",",
"int",
"minHeight",
",",
"int",
"maxWidth",
",",
"int",
"maxHeight",
")",
"{",
"QueryStringBuilder",
"builder",
"=",
"new",
"QueryStringBuilder",
"(",
... | Retrieves a thumbnail, or smaller image representation, of this file. Sizes of 32x32, 64x64, 128x128,
and 256x256 can be returned in the .png format and sizes of 32x32, 94x94, 160x160, and 320x320 can be returned
in the .jpg format.
@param fileType either PNG of JPG
@param minWidth minimum width
@param minHeight min... | [
"Retrieves",
"a",
"thumbnail",
"or",
"smaller",
"image",
"representation",
"of",
"this",
"file",
".",
"Sizes",
"of",
"32x32",
"64x64",
"128x128",
"and",
"256x256",
"can",
"be",
"returned",
"in",
"the",
".",
"png",
"format",
"and",
"sizes",
"of",
"32x32",
"... | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFile.java#L911-L947 |
elki-project/elki | addons/xtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/xtree/AbstractXTreeNode.java | AbstractXTreeNode.readSuperNode | public <T extends AbstractXTree<N>> void readSuperNode(ObjectInput in, T tree) throws IOException, ClassNotFoundException {
"""
Reads the id of this supernode, the numEntries and the entries array from
the specified stream.
@param in the stream to read data from in order to restore the object
@param tree the ... | java | public <T extends AbstractXTree<N>> void readSuperNode(ObjectInput in, T tree) throws IOException, ClassNotFoundException {
readExternal(in);
if(capacity_to_be_filled <= 0 || !isSuperNode()) {
throw new IllegalStateException("This node does not appear to be a supernode");
}
if(isLeaf) {
thro... | [
"public",
"<",
"T",
"extends",
"AbstractXTree",
"<",
"N",
">",
">",
"void",
"readSuperNode",
"(",
"ObjectInput",
"in",
",",
"T",
"tree",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"readExternal",
"(",
"in",
")",
";",
"if",
"(",
"capa... | Reads the id of this supernode, the numEntries and the entries array from
the specified stream.
@param in the stream to read data from in order to restore the object
@param tree the tree this supernode is to be assigned to
@throws java.io.IOException if I/O errors occur
@throws ClassNotFoundException If the class for ... | [
"Reads",
"the",
"id",
"of",
"this",
"supernode",
"the",
"numEntries",
"and",
"the",
"entries",
"array",
"from",
"the",
"specified",
"stream",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/xtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/xtree/AbstractXTreeNode.java#L238-L260 |
threerings/nenya | core/src/main/java/com/threerings/media/tile/TrimmedTileSet.java | TrimmedTileSet.trimTileSet | public static TrimmedTileSet trimTileSet (TileSet source, OutputStream destImage)
throws IOException {
"""
Convenience function to trim the tile set and save it using FastImageIO.
"""
return trimTileSet(source, destImage, FastImageIO.FILE_SUFFIX);
} | java | public static TrimmedTileSet trimTileSet (TileSet source, OutputStream destImage)
throws IOException
{
return trimTileSet(source, destImage, FastImageIO.FILE_SUFFIX);
} | [
"public",
"static",
"TrimmedTileSet",
"trimTileSet",
"(",
"TileSet",
"source",
",",
"OutputStream",
"destImage",
")",
"throws",
"IOException",
"{",
"return",
"trimTileSet",
"(",
"source",
",",
"destImage",
",",
"FastImageIO",
".",
"FILE_SUFFIX",
")",
";",
"}"
] | Convenience function to trim the tile set and save it using FastImageIO. | [
"Convenience",
"function",
"to",
"trim",
"the",
"tile",
"set",
"and",
"save",
"it",
"using",
"FastImageIO",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/TrimmedTileSet.java#L67-L71 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/client/ApiClient.java | ApiClient.configureJWTAuthorizationFlow | @Deprecated public void configureJWTAuthorizationFlow(String publicKeyFilename, String privateKeyFilename, String oAuthBasePath, String clientId, String userId, long expiresIn) throws IOException, ApiException {
"""
Configures the current instance of ApiClient with a fresh OAuth JWT access token from DocuSign
@pa... | java | @Deprecated public void configureJWTAuthorizationFlow(String publicKeyFilename, String privateKeyFilename, String oAuthBasePath, String clientId, String userId, long expiresIn) throws IOException, ApiException {
try {
String assertion = JWTUtils.generateJWTAssertion(publicKeyFilename, privateKeyFilename, oAut... | [
"@",
"Deprecated",
"public",
"void",
"configureJWTAuthorizationFlow",
"(",
"String",
"publicKeyFilename",
",",
"String",
"privateKeyFilename",
",",
"String",
"oAuthBasePath",
",",
"String",
"clientId",
",",
"String",
"userId",
",",
"long",
"expiresIn",
")",
"throws",
... | Configures the current instance of ApiClient with a fresh OAuth JWT access token from DocuSign
@param publicKeyFilename the filename of the RSA public key
@param privateKeyFilename the filename of the RSA private key
@param oAuthBasePath DocuSign OAuth base path (account-d.docusign.com for the developer sandbox
and acc... | [
"Configures",
"the",
"current",
"instance",
"of",
"ApiClient",
"with",
"a",
"fresh",
"OAuth",
"JWT",
"access",
"token",
"from",
"DocuSign"
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/client/ApiClient.java#L674-L703 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/HibernateSession.java | HibernateSession.updateAll | public long updateAll(final QueryableCriteria criteria, final Map<String, Object> properties) {
"""
Updates all objects matching the given criteria and property values.
@param criteria The criteria
@param properties The properties
@return The total number of records updated
"""
return getHibernate... | java | public long updateAll(final QueryableCriteria criteria, final Map<String, Object> properties) {
return getHibernateTemplate().execute((GrailsHibernateTemplate.HibernateCallback<Integer>) session -> {
JpaQueryBuilder builder = new JpaQueryBuilder(criteria);
builder.setConversionService(ge... | [
"public",
"long",
"updateAll",
"(",
"final",
"QueryableCriteria",
"criteria",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"return",
"getHibernateTemplate",
"(",
")",
".",
"execute",
"(",
"(",
"GrailsHibernateTemplate",
".",
... | Updates all objects matching the given criteria and property values.
@param criteria The criteria
@param properties The properties
@return The total number of records updated | [
"Updates",
"all",
"objects",
"matching",
"the",
"given",
"criteria",
"and",
"property",
"values",
"."
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/HibernateSession.java#L124-L156 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/CategoricalResults.java | CategoricalResults.setProb | public void setProb(int cat, double prob) {
"""
Sets the probability that a sample belongs to a given category.
@param cat the category
@param prob the value to set, may be greater then one.
@throws IndexOutOfBoundsException if a non existent category is specified
@throws ArithmeticException if the value set i... | java | public void setProb(int cat, double prob)
{
if(cat > probabilities.length)
throw new IndexOutOfBoundsException("There are only " + probabilities.length + " posibilties, " + cat + " is invalid");
else if(prob < 0 || Double.isInfinite(prob) || Double.isNaN(prob))
throw new Arit... | [
"public",
"void",
"setProb",
"(",
"int",
"cat",
",",
"double",
"prob",
")",
"{",
"if",
"(",
"cat",
">",
"probabilities",
".",
"length",
")",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"There are only \"",
"+",
"probabilities",
".",
"length",
"+",
"\... | Sets the probability that a sample belongs to a given category.
@param cat the category
@param prob the value to set, may be greater then one.
@throws IndexOutOfBoundsException if a non existent category is specified
@throws ArithmeticException if the value set is negative or not a number | [
"Sets",
"the",
"probability",
"that",
"a",
"sample",
"belongs",
"to",
"a",
"given",
"category",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/CategoricalResults.java#L56-L63 |
jbundle/jbundle | app/program/db/src/main/java/org/jbundle/app/program/db/util/ResourcesUtilities.java | ResourcesUtilities.encodeLine | public static String encodeLine(String string, boolean bResourceListBundle) {
"""
Encode the utf-16 characters in this line to escaped java strings.
"""
if (string == null)
return string;
for (int i = 0; i < string.length(); i++)
{
if (((string.charAt(i) == '\"')... | java | public static String encodeLine(String string, boolean bResourceListBundle)
{
if (string == null)
return string;
for (int i = 0; i < string.length(); i++)
{
if (((string.charAt(i) == '\"') || (string.charAt(i) == '\\'))
|| ((!bResourceListBundle) && (stri... | [
"public",
"static",
"String",
"encodeLine",
"(",
"String",
"string",
",",
"boolean",
"bResourceListBundle",
")",
"{",
"if",
"(",
"string",
"==",
"null",
")",
"return",
"string",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"string",
".",
"leng... | Encode the utf-16 characters in this line to escaped java strings. | [
"Encode",
"the",
"utf",
"-",
"16",
"characters",
"in",
"this",
"line",
"to",
"escaped",
"java",
"strings",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/app/program/db/src/main/java/org/jbundle/app/program/db/util/ResourcesUtilities.java#L87-L112 |
gwtplus/google-gin | src/main/java/com/google/gwt/inject/rebind/util/SourceSnippets.java | SourceSnippets.callMemberInject | public static SourceSnippet callMemberInject(final TypeLiteral<?> type, final String input) {
"""
Creates a snippet (including a trailing semicolon) that performs member
injection on a value of the given type.
@param type the type of value to perform member injection on
@param input a Java expression that eva... | java | public static SourceSnippet callMemberInject(final TypeLiteral<?> type, final String input) {
return new SourceSnippet() {
public String getSource(InjectorWriteContext writeContext) {
return writeContext.callMemberInject(type, input);
}
};
} | [
"public",
"static",
"SourceSnippet",
"callMemberInject",
"(",
"final",
"TypeLiteral",
"<",
"?",
">",
"type",
",",
"final",
"String",
"input",
")",
"{",
"return",
"new",
"SourceSnippet",
"(",
")",
"{",
"public",
"String",
"getSource",
"(",
"InjectorWriteContext",... | Creates a snippet (including a trailing semicolon) that performs member
injection on a value of the given type.
@param type the type of value to perform member injection on
@param input a Java expression that evaluates to the object that should be
member-injected | [
"Creates",
"a",
"snippet",
"(",
"including",
"a",
"trailing",
"semicolon",
")",
"that",
"performs",
"member",
"injection",
"on",
"a",
"value",
"of",
"the",
"given",
"type",
"."
] | train | https://github.com/gwtplus/google-gin/blob/595e61ee0d2fa508815c016e924ec0e5cea2a2aa/src/main/java/com/google/gwt/inject/rebind/util/SourceSnippets.java#L63-L69 |
intel/jndn-utils | src/main/java/com/intel/jndn/utils/server/impl/SimpleServer.java | SimpleServer.respondUsing | public void respondUsing(final RespondWithBlob callback) throws IOException {
"""
Convenience method for responding to an {@link Interest} by returning the
{@link Blob} content only; when an Interest arrives, this method wraps the
returned Blob with a {@link Data} using the exact {@link Name} of the
incoming In... | java | public void respondUsing(final RespondWithBlob callback) throws IOException {
RespondWithData dataCallback = new RespondWithData() {
@Override
public Data onInterest(Name prefix, Interest interest) throws Exception {
Data data = new Data(interest.getName());
Blob content = callback.onInt... | [
"public",
"void",
"respondUsing",
"(",
"final",
"RespondWithBlob",
"callback",
")",
"throws",
"IOException",
"{",
"RespondWithData",
"dataCallback",
"=",
"new",
"RespondWithData",
"(",
")",
"{",
"@",
"Override",
"public",
"Data",
"onInterest",
"(",
"Name",
"prefix... | Convenience method for responding to an {@link Interest} by returning the
{@link Blob} content only; when an Interest arrives, this method wraps the
returned Blob with a {@link Data} using the exact {@link Name} of the
incoming Interest.
@param callback the callback function to retrieve content when an
{@link Interest... | [
"Convenience",
"method",
"for",
"responding",
"to",
"an",
"{",
"@link",
"Interest",
"}",
"by",
"returning",
"the",
"{",
"@link",
"Blob",
"}",
"content",
"only",
";",
"when",
"an",
"Interest",
"arrives",
"this",
"method",
"wraps",
"the",
"returned",
"Blob",
... | train | https://github.com/intel/jndn-utils/blob/7f670b259484c35d51a6c5acce5715b0573faedd/src/main/java/com/intel/jndn/utils/server/impl/SimpleServer.java#L70-L81 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java | DateFormat.getDateTimeInstance | public final static DateFormat getDateTimeInstance(int dateStyle,
int timeStyle) {
"""
Returns the date/time formatter with the given date and time
formatting styles for the default <code>FORMAT</code> locale.
@param dateStyle the given date formatting style... | java | public final static DateFormat getDateTimeInstance(int dateStyle,
int timeStyle)
{
return get(dateStyle, timeStyle, ULocale.getDefault(Category.FORMAT), null);
} | [
"public",
"final",
"static",
"DateFormat",
"getDateTimeInstance",
"(",
"int",
"dateStyle",
",",
"int",
"timeStyle",
")",
"{",
"return",
"get",
"(",
"dateStyle",
",",
"timeStyle",
",",
"ULocale",
".",
"getDefault",
"(",
"Category",
".",
"FORMAT",
")",
",",
"n... | Returns the date/time formatter with the given date and time
formatting styles for the default <code>FORMAT</code> locale.
@param dateStyle the given date formatting style. For example,
SHORT for "M/d/yy" in the US locale. As currently implemented, relative date
formatting only affects a limited range of calendar days ... | [
"Returns",
"the",
"date",
"/",
"time",
"formatter",
"with",
"the",
"given",
"date",
"and",
"time",
"formatting",
"styles",
"for",
"the",
"default",
"<code",
">",
"FORMAT<",
"/",
"code",
">",
"locale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java#L1366-L1370 |
threerings/narya | core/src/main/java/com/threerings/presents/client/Client.java | Client.setServer | public void setServer (String hostname, int[] ports, int[] datagramPorts) {
"""
Configures the client to communicate with the server on the supplied hostname, set of
ports (which will be tried in succession), and datagram ports.
@see #logon
@see #moveToServer
"""
_hostname = hostname;
_por... | java | public void setServer (String hostname, int[] ports, int[] datagramPorts)
{
_hostname = hostname;
_ports = ports;
_datagramPorts = datagramPorts;
} | [
"public",
"void",
"setServer",
"(",
"String",
"hostname",
",",
"int",
"[",
"]",
"ports",
",",
"int",
"[",
"]",
"datagramPorts",
")",
"{",
"_hostname",
"=",
"hostname",
";",
"_ports",
"=",
"ports",
";",
"_datagramPorts",
"=",
"datagramPorts",
";",
"}"
] | Configures the client to communicate with the server on the supplied hostname, set of
ports (which will be tried in succession), and datagram ports.
@see #logon
@see #moveToServer | [
"Configures",
"the",
"client",
"to",
"communicate",
"with",
"the",
"server",
"on",
"the",
"supplied",
"hostname",
"set",
"of",
"ports",
"(",
"which",
"will",
"be",
"tried",
"in",
"succession",
")",
"and",
"datagram",
"ports",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/Client.java#L143-L148 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingprivateDatabase/src/main/java/net/minidev/ovh/api/ApiOvhHostingprivateDatabase.java | ApiOvhHostingprivateDatabase.serviceName_whitelist_POST | public OvhTask serviceName_whitelist_POST(String serviceName, String ip, String name, Boolean service, Boolean sftp) throws IOException {
"""
Create a new IP whitelist
REST: POST /hosting/privateDatabase/{serviceName}/whitelist
@param name [required] Custom name for your Whitelisted IP
@param sftp [required] ... | java | public OvhTask serviceName_whitelist_POST(String serviceName, String ip, String name, Boolean service, Boolean sftp) throws IOException {
String qPath = "/hosting/privateDatabase/{serviceName}/whitelist";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addB... | [
"public",
"OvhTask",
"serviceName_whitelist_POST",
"(",
"String",
"serviceName",
",",
"String",
"ip",
",",
"String",
"name",
",",
"Boolean",
"service",
",",
"Boolean",
"sftp",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/privateDatabase/{se... | Create a new IP whitelist
REST: POST /hosting/privateDatabase/{serviceName}/whitelist
@param name [required] Custom name for your Whitelisted IP
@param sftp [required] Authorize this IP to access sftp port
@param ip [required] The IP to whitelist in your instance
@param service [required] Authorize this IP to access s... | [
"Create",
"a",
"new",
"IP",
"whitelist"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingprivateDatabase/src/main/java/net/minidev/ovh/api/ApiOvhHostingprivateDatabase.java#L868-L878 |
trellis-ldp-archive/trellis-http | src/main/java/org/trellisldp/http/impl/MementoResource.java | MementoResource.getTimeGateBuilder | public Response.ResponseBuilder getTimeGateBuilder(final LdpRequest req, final String baseUrl) {
"""
Create a response builder for a TimeGate response
@param req the LDP request
@param baseUrl the base URL
@return a response builder object
"""
final String identifier = getBaseUrl(baseUrl, req) + req... | java | public Response.ResponseBuilder getTimeGateBuilder(final LdpRequest req, final String baseUrl) {
final String identifier = getBaseUrl(baseUrl, req) + req.getPartition() + req.getPath();
return Response.status(FOUND)
.location(fromUri(identifier + "?version=" + req.getDatetime().getInstant().... | [
"public",
"Response",
".",
"ResponseBuilder",
"getTimeGateBuilder",
"(",
"final",
"LdpRequest",
"req",
",",
"final",
"String",
"baseUrl",
")",
"{",
"final",
"String",
"identifier",
"=",
"getBaseUrl",
"(",
"baseUrl",
",",
"req",
")",
"+",
"req",
".",
"getPartit... | Create a response builder for a TimeGate response
@param req the LDP request
@param baseUrl the base URL
@return a response builder object | [
"Create",
"a",
"response",
"builder",
"for",
"a",
"TimeGate",
"response"
] | train | https://github.com/trellis-ldp-archive/trellis-http/blob/bc762f88602c49c2b137a7adf68d576666e55fff/src/main/java/org/trellisldp/http/impl/MementoResource.java#L170-L177 |
elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/LOF.java | LOF.computeLRDs | private void computeLRDs(KNNQuery<O> knnq, DBIDs ids, WritableDoubleDataStore lrds) {
"""
Compute local reachability distances.
@param knnq KNN query
@param ids IDs to process
@param lrds Reachability storage
"""
FiniteProgress lrdsProgress = LOG.isVerbose() ? new FiniteProgress("Local Reachability De... | java | private void computeLRDs(KNNQuery<O> knnq, DBIDs ids, WritableDoubleDataStore lrds) {
FiniteProgress lrdsProgress = LOG.isVerbose() ? new FiniteProgress("Local Reachability Densities (LRD)", ids.size(), LOG) : null;
double lrd;
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
lrd = comp... | [
"private",
"void",
"computeLRDs",
"(",
"KNNQuery",
"<",
"O",
">",
"knnq",
",",
"DBIDs",
"ids",
",",
"WritableDoubleDataStore",
"lrds",
")",
"{",
"FiniteProgress",
"lrdsProgress",
"=",
"LOG",
".",
"isVerbose",
"(",
")",
"?",
"new",
"FiniteProgress",
"(",
"\"L... | Compute local reachability distances.
@param knnq KNN query
@param ids IDs to process
@param lrds Reachability storage | [
"Compute",
"local",
"reachability",
"distances",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/LOF.java#L159-L168 |
tvesalainen/lpg | src/main/java/org/vesalainen/regex/RegexMatcher.java | RegexMatcher.split | public static Stream<CharSequence> split(CharSequence seq, String regex, Option... options) {
"""
Returns stream that contains subsequences delimited by given regex
@param seq
@param regex
@param options
@return
"""
return StreamSupport.stream(new SpliteratorImpl(seq, regex, options), false);
... | java | public static Stream<CharSequence> split(CharSequence seq, String regex, Option... options)
{
return StreamSupport.stream(new SpliteratorImpl(seq, regex, options), false);
} | [
"public",
"static",
"Stream",
"<",
"CharSequence",
">",
"split",
"(",
"CharSequence",
"seq",
",",
"String",
"regex",
",",
"Option",
"...",
"options",
")",
"{",
"return",
"StreamSupport",
".",
"stream",
"(",
"new",
"SpliteratorImpl",
"(",
"seq",
",",
"regex",... | Returns stream that contains subsequences delimited by given regex
@param seq
@param regex
@param options
@return | [
"Returns",
"stream",
"that",
"contains",
"subsequences",
"delimited",
"by",
"given",
"regex"
] | train | https://github.com/tvesalainen/lpg/blob/0917b8d295e9772b9f8a0affc258a08530cd567a/src/main/java/org/vesalainen/regex/RegexMatcher.java#L261-L264 |
gfk-ba/senbot | SenBotRunner/src/main/java/com/gfk/senbot/framework/services/selenium/SynchronisationService.java | SynchronisationService.waitAndAssertForExpectedCondition | public void waitAndAssertForExpectedCondition(ExpectedCondition<?> condition, int timeout) {
"""
Waits until the expectations are met and throws an assert if not
@param condition The conditions the element should meet
@param timeout The timeout to wait
"""
if (!waitForExpectedCondition(condition, t... | java | public void waitAndAssertForExpectedCondition(ExpectedCondition<?> condition, int timeout) {
if (!waitForExpectedCondition(condition, timeout)) {
fail(String.format("Element does not meet condition %1$s", condition.toString()));
}
} | [
"public",
"void",
"waitAndAssertForExpectedCondition",
"(",
"ExpectedCondition",
"<",
"?",
">",
"condition",
",",
"int",
"timeout",
")",
"{",
"if",
"(",
"!",
"waitForExpectedCondition",
"(",
"condition",
",",
"timeout",
")",
")",
"{",
"fail",
"(",
"String",
".... | Waits until the expectations are met and throws an assert if not
@param condition The conditions the element should meet
@param timeout The timeout to wait | [
"Waits",
"until",
"the",
"expectations",
"are",
"met",
"and",
"throws",
"an",
"assert",
"if",
"not"
] | train | https://github.com/gfk-ba/senbot/blob/e9a152aa67be48b1bb13a4691655caf6d873b553/SenBotRunner/src/main/java/com/gfk/senbot/framework/services/selenium/SynchronisationService.java#L64-L68 |
openbase/jul | visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java | SVGIcon.startBackgroundIconRotateAnimation | public void startBackgroundIconRotateAnimation(final double fromAngle, final double toAngle, final int cycleCount, final double duration, final Interpolator interpolator, final boolean autoReverse) {
"""
Method starts the rotate animation of the background icon.
@param fromAngle the rotation angle where the ... | java | public void startBackgroundIconRotateAnimation(final double fromAngle, final double toAngle, final int cycleCount, final double duration, final Interpolator interpolator, final boolean autoReverse) {
stopBackgroundIconRotateAnimation();
backgroundRotateAnimation = Animations.createRotateTransition(backg... | [
"public",
"void",
"startBackgroundIconRotateAnimation",
"(",
"final",
"double",
"fromAngle",
",",
"final",
"double",
"toAngle",
",",
"final",
"int",
"cycleCount",
",",
"final",
"double",
"duration",
",",
"final",
"Interpolator",
"interpolator",
",",
"final",
"boolea... | Method starts the rotate animation of the background icon.
@param fromAngle the rotation angle where the transition should start.
@param toAngle the rotation angle where the transition should end.
@param cycleCount the number of times the animation should be played (use Animation.INDEFINITE for endless).
@pa... | [
"Method",
"starts",
"the",
"rotate",
"animation",
"of",
"the",
"background",
"icon",
"."
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/geometry/svg/SVGIcon.java#L376-L381 |
alkacon/opencms-core | src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditorModel.java | CmsMessageBundleEditorModel.initEditorStates | private void initEditorStates() {
"""
Initializes the editor states for the different modes, depending on the type of the opened file.
"""
m_editorState = new HashMap<CmsMessageBundleEditorTypes.EditMode, EditorState>();
List<TableProperty> cols = null;
switch (m_bundleType) {
... | java | private void initEditorStates() {
m_editorState = new HashMap<CmsMessageBundleEditorTypes.EditMode, EditorState>();
List<TableProperty> cols = null;
switch (m_bundleType) {
case PROPERTY:
case XML:
if (hasDescriptor()) { // bundle descriptor is present, k... | [
"private",
"void",
"initEditorStates",
"(",
")",
"{",
"m_editorState",
"=",
"new",
"HashMap",
"<",
"CmsMessageBundleEditorTypes",
".",
"EditMode",
",",
"EditorState",
">",
"(",
")",
";",
"List",
"<",
"TableProperty",
">",
"cols",
"=",
"null",
";",
"switch",
... | Initializes the editor states for the different modes, depending on the type of the opened file. | [
"Initializes",
"the",
"editor",
"states",
"for",
"the",
"different",
"modes",
"depending",
"on",
"the",
"type",
"of",
"the",
"opened",
"file",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/editors/messagebundle/CmsMessageBundleEditorModel.java#L1342-L1372 |
Whiley/WhileyCompiler | src/main/java/wyil/util/AbstractTypedVisitor.java | AbstractTypedVisitor.selectCandidate | public <T extends Type> T selectCandidate(T candidate, T next, T actual, Environment environment) {
"""
Given two candidates, return the more precise one. If no viable candidate,
return null;
@param candidate
The current best candidate.
@param next
The next candidate being considered
@param environment
@r... | java | public <T extends Type> T selectCandidate(T candidate, T next, T actual, Environment environment) {
// Found a viable candidate
boolean left = subtypeOperator.isSubtype(candidate, next, environment);
boolean right = subtypeOperator.isSubtype(next, candidate, environment);
if (left && !right) {
// Yes, is bet... | [
"public",
"<",
"T",
"extends",
"Type",
">",
"T",
"selectCandidate",
"(",
"T",
"candidate",
",",
"T",
"next",
",",
"T",
"actual",
",",
"Environment",
"environment",
")",
"{",
"// Found a viable candidate",
"boolean",
"left",
"=",
"subtypeOperator",
".",
"isSubt... | Given two candidates, return the more precise one. If no viable candidate,
return null;
@param candidate
The current best candidate.
@param next
The next candidate being considered
@param environment
@return
@throws ResolutionError | [
"Given",
"two",
"candidates",
"return",
"the",
"more",
"precise",
"one",
".",
"If",
"no",
"viable",
"candidate",
"return",
"null",
";"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/util/AbstractTypedVisitor.java#L1258-L1280 |
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.exportAsync | public Observable<ImportExportOperationResultInner> exportAsync(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 value fro... | java | public Observable<ImportExportOperationResultInner> exportAsync(String resourceGroupName, String serverName, String databaseName, ImportExportDatabaseDefinition parameters) {
return exportWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).map(new Func1<ServiceResponse<ImportExport... | [
"public",
"Observable",
"<",
"ImportExportOperationResultInner",
">",
"exportAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"ImportExportDatabaseDefinition",
"parameters",
")",
"{",
"return",
"exportWithServiceRe... | 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#L942-L949 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsBytesMessageImpl.java | JmsBytesMessageImpl.checkProducerPromise | private void checkProducerPromise(String jmsMethod, String ffdcProbeID) throws JMSException {
"""
Checks to see if the producer has promised not to modify the payload after it's been set.
If they have, then throw a JMS exception based on the parameters
@throws JMSException
"""
if (TraceComponent.is... | java | private void checkProducerPromise(String jmsMethod, String ffdcProbeID) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "checkProducerPromise", new Object[] { jmsMethod, ffdcProbeID });
// Only proceed if the producer hasn't promi... | [
"private",
"void",
"checkProducerPromise",
"(",
"String",
"jmsMethod",
",",
"String",
"ffdcProbeID",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",... | Checks to see if the producer has promised not to modify the payload after it's been set.
If they have, then throw a JMS exception based on the parameters
@throws JMSException | [
"Checks",
"to",
"see",
"if",
"the",
"producer",
"has",
"promised",
"not",
"to",
"modify",
"the",
"payload",
"after",
"it",
"s",
"been",
"set",
".",
"If",
"they",
"have",
"then",
"throw",
"a",
"JMS",
"exception",
"based",
"on",
"the",
"parameters"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsBytesMessageImpl.java#L2277-L2295 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/SingletonBeanO.java | SingletonBeanO.callTransactionalLifecycleInterceptors | private void callTransactionalLifecycleInterceptors(InterceptorProxy[] proxies, int methodId) throws RemoteException {
"""
Invoke PostConstruct or PreDestroy interceptors associated with this bean
using the transaction and security context specified in the method info.
@param proxies the non-null reference to ... | java | private void callTransactionalLifecycleInterceptors(InterceptorProxy[] proxies, int methodId) throws RemoteException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
LifecycleInterceptorWrapper wrapper = new LifecycleInterceptorWrapper(container, this);
EJSDeployedSupport s = ... | [
"private",
"void",
"callTransactionalLifecycleInterceptors",
"(",
"InterceptorProxy",
"[",
"]",
"proxies",
",",
"int",
"methodId",
")",
"throws",
"RemoteException",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",... | Invoke PostConstruct or PreDestroy interceptors associated with this bean
using the transaction and security context specified in the method info.
@param proxies the non-null reference to InterceptorProxy array that
contains the PostConstruct interceptor methods to invoke.
@param methodInfo the method info for transac... | [
"Invoke",
"PostConstruct",
"or",
"PreDestroy",
"interceptors",
"associated",
"with",
"this",
"bean",
"using",
"the",
"transaction",
"and",
"security",
"context",
"specified",
"in",
"the",
"method",
"info",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/SingletonBeanO.java#L194-L231 |
Sciss/abc4j | abc/src/main/java/abc/parser/AbcGrammar.java | AbcGrammar.LatinExtendedAndOtherAlphabet | Rule LatinExtendedAndOtherAlphabet() {
"""
chars between 0080 and FFEF with exclusions.
It contains various alphabets such as latin extended,
hebrew, arabic, chinese, tamil... and symbols
"""
return FirstOf(
CharRange('\u0080', '\u074F'), //Latin to Syriac
CharRange('\u0780', '\u07BF'), //Thaana... | java | Rule LatinExtendedAndOtherAlphabet() {
return FirstOf(
CharRange('\u0080', '\u074F'), //Latin to Syriac
CharRange('\u0780', '\u07BF'), //Thaana
CharRange('\u0900', '\u137F'), //Devanagari to Ethiopic
CharRange('\u13A0', '\u18AF'), //Cherokee to Mongolian
CharRange('\u1900', '\u197F'), //Limb... | [
"Rule",
"LatinExtendedAndOtherAlphabet",
"(",
")",
"{",
"return",
"FirstOf",
"(",
"CharRange",
"(",
"'",
"'",
",",
"'",
"'",
")",
",",
"//Latin to Syriac\r",
"CharRange",
"(",
"'",
"'",
",",
"'",
"'",
")",
",",
"//Thaana\r",
"CharRange",
"(",
"'",
"'",
... | chars between 0080 and FFEF with exclusions.
It contains various alphabets such as latin extended,
hebrew, arabic, chinese, tamil... and symbols | [
"chars",
"between",
"0080",
"and",
"FFEF",
"with",
"exclusions",
".",
"It",
"contains",
"various",
"alphabets",
"such",
"as",
"latin",
"extended",
"hebrew",
"arabic",
"chinese",
"tamil",
"...",
"and",
"symbols"
] | train | https://github.com/Sciss/abc4j/blob/117b405642c84a7bfca4e3e13668838258b90ca7/abc/src/main/java/abc/parser/AbcGrammar.java#L2558-L2576 |
codegist/crest | core/src/main/java/org/codegist/crest/CRestBuilder.java | CRestBuilder.deserializeXmlWith | public CRestBuilder deserializeXmlWith(Class<? extends Deserializer> deserializer) {
"""
<p>Overrides the default {@link org.codegist.crest.serializer.jaxb.JaxbDeserializer} XML deserializer with the given one</p>
<p>By default, <b>CRest</b> will use this deserializer for the following response Content-Type:</p>
... | java | public CRestBuilder deserializeXmlWith(Class<? extends Deserializer> deserializer) {
return deserializeXmlWith(deserializer, Collections.<String, Object>emptyMap());
} | [
"public",
"CRestBuilder",
"deserializeXmlWith",
"(",
"Class",
"<",
"?",
"extends",
"Deserializer",
">",
"deserializer",
")",
"{",
"return",
"deserializeXmlWith",
"(",
"deserializer",
",",
"Collections",
".",
"<",
"String",
",",
"Object",
">",
"emptyMap",
"(",
")... | <p>Overrides the default {@link org.codegist.crest.serializer.jaxb.JaxbDeserializer} XML deserializer with the given one</p>
<p>By default, <b>CRest</b> will use this deserializer for the following response Content-Type:</p>
<ul>
<li>application/xml</li>
<li>text/xml</li>
</ul>
@param deserializer deserializer to use f... | [
"<p",
">",
"Overrides",
"the",
"default",
"{"
] | train | https://github.com/codegist/crest/blob/e99ba7728b27d2ddb2c247261350f1b6fa7a6698/core/src/main/java/org/codegist/crest/CRestBuilder.java#L740-L742 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/components/TimePickerSettings.java | TimePickerSettings.zApplyAllowKeyboardEditing | private void zApplyAllowKeyboardEditing() {
"""
zApplyAllowKeyboardEditing, This applies the named setting to the parent component.
"""
// Set the editability of the time picker text field.
parent.getComponentTimeTextField().setEditable(allowKeyboardEditing);
// Set the text field borde... | java | private void zApplyAllowKeyboardEditing() {
// Set the editability of the time picker text field.
parent.getComponentTimeTextField().setEditable(allowKeyboardEditing);
// Set the text field border color based on whether the text field is editable.
Color textFieldBorderColor = (allowKeybo... | [
"private",
"void",
"zApplyAllowKeyboardEditing",
"(",
")",
"{",
"// Set the editability of the time picker text field.",
"parent",
".",
"getComponentTimeTextField",
"(",
")",
".",
"setEditable",
"(",
"allowKeyboardEditing",
")",
";",
"// Set the text field border color based on w... | zApplyAllowKeyboardEditing, This applies the named setting to the parent component. | [
"zApplyAllowKeyboardEditing",
"This",
"applies",
"the",
"named",
"setting",
"to",
"the",
"parent",
"component",
"."
] | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/components/TimePickerSettings.java#L884-L893 |
Impetus/Kundera | src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/datahandler/CassandraDataHandlerBase.java | CassandraDataHandlerBase.getFieldValueViaCQL | private Object getFieldValueViaCQL(Object thriftColumnValue, Attribute attribute) {
"""
Gets the field value via cql.
@param thriftColumnValue
the thrift column value
@param attribute
the attribute
@return the field value via cql
"""
PropertyAccessor<?> accessor = PropertyAccessorFactory.getProp... | java | private Object getFieldValueViaCQL(Object thriftColumnValue, Attribute attribute)
{
PropertyAccessor<?> accessor = PropertyAccessorFactory.getPropertyAccessor((Field) attribute.getJavaMember());
Object objValue;
try
{
if (CassandraDataTranslator.isCassandraDataTypeClass((... | [
"private",
"Object",
"getFieldValueViaCQL",
"(",
"Object",
"thriftColumnValue",
",",
"Attribute",
"attribute",
")",
"{",
"PropertyAccessor",
"<",
"?",
">",
"accessor",
"=",
"PropertyAccessorFactory",
".",
"getPropertyAccessor",
"(",
"(",
"Field",
")",
"attribute",
"... | Gets the field value via cql.
@param thriftColumnValue
the thrift column value
@param attribute
the attribute
@return the field value via cql | [
"Gets",
"the",
"field",
"value",
"via",
"cql",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/datahandler/CassandraDataHandlerBase.java#L1828-L1852 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/AbstractJobLauncher.java | AbstractJobLauncher.cleanupStagingData | private void cleanupStagingData(JobState jobState)
throws JobException {
"""
Cleanup the job's task staging data. This is not doing anything in case job succeeds
and data is successfully committed because the staging data has already been moved
to the job output directory. But in case the job fails and dat... | java | private void cleanupStagingData(JobState jobState)
throws JobException {
if (jobState.getPropAsBoolean(ConfigurationKeys.CLEANUP_STAGING_DATA_BY_INITIALIZER, false)) {
//Clean up will be done by initializer.
return;
}
try {
if (!canCleanStagingData(jobState)) {
LOG.error("Jo... | [
"private",
"void",
"cleanupStagingData",
"(",
"JobState",
"jobState",
")",
"throws",
"JobException",
"{",
"if",
"(",
"jobState",
".",
"getPropAsBoolean",
"(",
"ConfigurationKeys",
".",
"CLEANUP_STAGING_DATA_BY_INITIALIZER",
",",
"false",
")",
")",
"{",
"//Clean up wil... | Cleanup the job's task staging data. This is not doing anything in case job succeeds
and data is successfully committed because the staging data has already been moved
to the job output directory. But in case the job fails and data is not committed,
we want the staging data to be cleaned up.
Property {@link Configurat... | [
"Cleanup",
"the",
"job",
"s",
"task",
"staging",
"data",
".",
"This",
"is",
"not",
"doing",
"anything",
"in",
"case",
"job",
"succeeds",
"and",
"data",
"is",
"successfully",
"committed",
"because",
"the",
"staging",
"data",
"has",
"already",
"been",
"moved",... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/AbstractJobLauncher.java#L893-L914 |
joniles/mpxj | src/main/java/net/sf/mpxj/ganttproject/GanttProjectReader.java | GanttProjectReader.addException | private void addException(ProjectCalendar mpxjCalendar, net.sf.mpxj.ganttproject.schema.Date date) {
"""
Add a single exception to a calendar.
@param mpxjCalendar MPXJ calendar
@param date calendar exception
"""
String year = date.getYear();
if (year == null || year.isEmpty())
{
... | java | private void addException(ProjectCalendar mpxjCalendar, net.sf.mpxj.ganttproject.schema.Date date)
{
String year = date.getYear();
if (year == null || year.isEmpty())
{
// In order to process recurring exceptions using MPXJ, we need a start and end date
// to constrain the number ... | [
"private",
"void",
"addException",
"(",
"ProjectCalendar",
"mpxjCalendar",
",",
"net",
".",
"sf",
".",
"mpxj",
".",
"ganttproject",
".",
"schema",
".",
"Date",
"date",
")",
"{",
"String",
"year",
"=",
"date",
".",
"getYear",
"(",
")",
";",
"if",
"(",
"... | Add a single exception to a calendar.
@param mpxjCalendar MPXJ calendar
@param date calendar exception | [
"Add",
"a",
"single",
"exception",
"to",
"a",
"calendar",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ganttproject/GanttProjectReader.java#L307-L334 |
osglworks/java-mvc | src/main/java/org/osgl/mvc/result/BadRequest.java | BadRequest.of | public static BadRequest of(Throwable cause) {
"""
Returns a static BadRequest instance and set the {@link #payload} thread local
with cause specified.
When calling the instance on {@link #getMessage()} method, it will return whatever
stored in the {@link #payload} thread local
@param cause the cause
@ret... | java | public static BadRequest of(Throwable cause) {
if (_localizedErrorMsg()) {
return of(cause, defaultMessage(BAD_REQUEST));
} else {
touchPayload().cause(cause);
return _INSTANCE;
}
} | [
"public",
"static",
"BadRequest",
"of",
"(",
"Throwable",
"cause",
")",
"{",
"if",
"(",
"_localizedErrorMsg",
"(",
")",
")",
"{",
"return",
"of",
"(",
"cause",
",",
"defaultMessage",
"(",
"BAD_REQUEST",
")",
")",
";",
"}",
"else",
"{",
"touchPayload",
"(... | Returns a static BadRequest instance and set the {@link #payload} thread local
with cause specified.
When calling the instance on {@link #getMessage()} method, it will return whatever
stored in the {@link #payload} thread local
@param cause the cause
@return a static BadRequest instance as described above | [
"Returns",
"a",
"static",
"BadRequest",
"instance",
"and",
"set",
"the",
"{",
"@link",
"#payload",
"}",
"thread",
"local",
"with",
"cause",
"specified",
"."
] | train | https://github.com/osglworks/java-mvc/blob/4d2b2ec40498ac6ee7040c0424377cbeacab124b/src/main/java/org/osgl/mvc/result/BadRequest.java#L126-L133 |
prestodb/presto | presto-orc/src/main/java/com/facebook/presto/orc/metadata/statistics/StringStatisticsBuilder.java | StringStatisticsBuilder.addStringStatistics | private void addStringStatistics(long valueCount, StringStatistics value) {
"""
This method can only be used in merging stats.
It assumes min or max could be nulls.
"""
requireNonNull(value, "value is null");
checkArgument(valueCount > 0, "valueCount is 0");
checkArgument(value.getMin(... | java | private void addStringStatistics(long valueCount, StringStatistics value)
{
requireNonNull(value, "value is null");
checkArgument(valueCount > 0, "valueCount is 0");
checkArgument(value.getMin() != null || value.getMax() != null, "min and max cannot both be null");
if (nonNullValueC... | [
"private",
"void",
"addStringStatistics",
"(",
"long",
"valueCount",
",",
"StringStatistics",
"value",
")",
"{",
"requireNonNull",
"(",
"value",
",",
"\"value is null\"",
")",
";",
"checkArgument",
"(",
"valueCount",
">",
"0",
",",
"\"valueCount is 0\"",
")",
";",... | This method can only be used in merging stats.
It assumes min or max could be nulls. | [
"This",
"method",
"can",
"only",
"be",
"used",
"in",
"merging",
"stats",
".",
"It",
"assumes",
"min",
"or",
"max",
"could",
"be",
"nulls",
"."
] | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-orc/src/main/java/com/facebook/presto/orc/metadata/statistics/StringStatisticsBuilder.java#L89-L111 |
canoo/dolphin-platform | platform/dolphin-platform-core/src/main/java/com/canoo/dp/impl/platform/core/commons/lang/TypeUtils.java | TypeUtils.isAssignable | private static boolean isAssignable(final Type type, final Type toType,
final Map<TypeVariable<?>, Type> typeVarAssigns) {
"""
<p>Checks if the subject type may be implicitly cast to the target type
following the Java generics rules.</p>
@param type the subject... | java | private static boolean isAssignable(final Type type, final Type toType,
final Map<TypeVariable<?>, Type> typeVarAssigns) {
if (toType == null || toType instanceof Class<?>) {
return isAssignable(type, (Class<?>) toType);
}
if (toType instanceo... | [
"private",
"static",
"boolean",
"isAssignable",
"(",
"final",
"Type",
"type",
",",
"final",
"Type",
"toType",
",",
"final",
"Map",
"<",
"TypeVariable",
"<",
"?",
">",
",",
"Type",
">",
"typeVarAssigns",
")",
"{",
"if",
"(",
"toType",
"==",
"null",
"||",
... | <p>Checks if the subject type may be implicitly cast to the target type
following the Java generics rules.</p>
@param type the subject type to be assigned to the target type
@param toType the target type
@param typeVarAssigns optional map of type variable assignments
@return {@code true} if {@code ty... | [
"<p",
">",
"Checks",
"if",
"the",
"subject",
"type",
"may",
"be",
"implicitly",
"cast",
"to",
"the",
"target",
"type",
"following",
"the",
"Java",
"generics",
"rules",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/canoo/dolphin-platform/blob/fb99c1fab24df80d2fa094d8688b546140146874/platform/dolphin-platform-core/src/main/java/com/canoo/dp/impl/platform/core/commons/lang/TypeUtils.java#L252-L275 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/internal/PageFlowTagUtils.java | PageFlowTagUtils.isAction | public static boolean isAction(HttpServletRequest request, String action) {
"""
Determine whether a given URI is an Action.
@param request the current HttpServletRequest.
@param action the URI to check.
@return <code>true</code> if the action is defined in the current page flow
or in a shared flow. Otherwise,... | java | public static boolean isAction(HttpServletRequest request, String action)
{
FlowController flowController = PageFlowUtils.getCurrentPageFlow(request);
if (flowController != null) {
if (action.endsWith(PageFlowConstants.ACTION_EXTENSION)) {
action = action.substring(0, ac... | [
"public",
"static",
"boolean",
"isAction",
"(",
"HttpServletRequest",
"request",
",",
"String",
"action",
")",
"{",
"FlowController",
"flowController",
"=",
"PageFlowUtils",
".",
"getCurrentPageFlow",
"(",
"request",
")",
";",
"if",
"(",
"flowController",
"!=",
"n... | Determine whether a given URI is an Action.
@param request the current HttpServletRequest.
@param action the URI to check.
@return <code>true</code> if the action is defined in the current page flow
or in a shared flow. Otherwise, return <code>false</code>. | [
"Determine",
"whether",
"a",
"given",
"URI",
"is",
"an",
"Action",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/internal/PageFlowTagUtils.java#L122-L137 |
kaazing/gateway | mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMResponses.java | NTLMResponses.getLMv2Response | public static byte[] getLMv2Response(String target, String user,
String password, byte[] challenge, byte[] clientNonce)
throws Exception {
"""
Calculates the LMv2 Response for the given challenge, using the
specified authentication target, username, password, and client
challenge.
@par... | java | public static byte[] getLMv2Response(String target, String user,
String password, byte[] challenge, byte[] clientNonce)
throws Exception {
byte[] ntlmv2Hash = ntlmv2Hash(target, user, password);
return lmv2Response(ntlmv2Hash, clientNonce, challenge);
} | [
"public",
"static",
"byte",
"[",
"]",
"getLMv2Response",
"(",
"String",
"target",
",",
"String",
"user",
",",
"String",
"password",
",",
"byte",
"[",
"]",
"challenge",
",",
"byte",
"[",
"]",
"clientNonce",
")",
"throws",
"Exception",
"{",
"byte",
"[",
"]... | Calculates the LMv2 Response for the given challenge, using the
specified authentication target, username, password, and client
challenge.
@param target The authentication target (i.e., domain).
@param user The username.
@param password The user's password.
@param challenge The Type 2 challenge from the server.
@param... | [
"Calculates",
"the",
"LMv2",
"Response",
"for",
"the",
"given",
"challenge",
"using",
"the",
"specified",
"authentication",
"target",
"username",
"password",
"and",
"client",
"challenge",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/proxy/handlers/http/ntlm/NTLMResponses.java#L142-L147 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.