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 |
|---|---|---|---|---|---|---|---|---|---|---|
alkacon/opencms-core | src/org/opencms/publish/CmsPublishEngine.java | CmsPublishEngine.sendMessage | protected void sendMessage(CmsUUID toUserId, String message, boolean hasErrors) {
"""
Sends a message to the given user, if publish notification is enabled or an error is shown in the message.<p>
@param toUserId the id of the user to send the message to
@param message the message to send
@param hasErrors flag... | java | protected void sendMessage(CmsUUID toUserId, String message, boolean hasErrors) {
CmsDbContext dbc = m_dbContextFactory.getDbContext();
try {
CmsUser toUser = m_driverManager.readUser(dbc, toUserId);
CmsUserSettings settings = new CmsUserSettings(toUser);
if (setting... | [
"protected",
"void",
"sendMessage",
"(",
"CmsUUID",
"toUserId",
",",
"String",
"message",
",",
"boolean",
"hasErrors",
")",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
")",
";",
"try",
"{",
"CmsUser",
"toUser",
"=",
"m_driv... | Sends a message to the given user, if publish notification is enabled or an error is shown in the message.<p>
@param toUserId the id of the user to send the message to
@param message the message to send
@param hasErrors flag to determine if the message to send shows an error | [
"Sends",
"a",
"message",
"to",
"the",
"given",
"user",
"if",
"publish",
"notification",
"is",
"enabled",
"or",
"an",
"error",
"is",
"shown",
"in",
"the",
"message",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/publish/CmsPublishEngine.java#L748-L764 |
liferay/com-liferay-commerce | commerce-product-api/src/main/java/com/liferay/commerce/product/model/CPOptionWrapper.java | CPOptionWrapper.getDescription | @Override
public String getDescription(String languageId, boolean useDefault) {
"""
Returns the localized description of this cp option in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault whethe... | java | @Override
public String getDescription(String languageId, boolean useDefault) {
return _cpOption.getDescription(languageId, useDefault);
} | [
"@",
"Override",
"public",
"String",
"getDescription",
"(",
"String",
"languageId",
",",
"boolean",
"useDefault",
")",
"{",
"return",
"_cpOption",
".",
"getDescription",
"(",
"languageId",
",",
"useDefault",
")",
";",
"}"
] | Returns the localized description of this cp option in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault whether to use the default language if no localization exists for the requested language
@return th... | [
"Returns",
"the",
"localized",
"description",
"of",
"this",
"cp",
"option",
"in",
"the",
"language",
"optionally",
"using",
"the",
"default",
"language",
"if",
"no",
"localization",
"exists",
"for",
"the",
"requested",
"language",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/model/CPOptionWrapper.java#L306-L309 |
fcrepo3/fcrepo | fcrepo-common/src/main/java/org/fcrepo/utilities/NamespaceContextImpl.java | NamespaceContextImpl.addNamespace | public void addNamespace(String prefix, String namespaceURI) {
"""
Add a prefix to namespace mapping.
@param prefix
@param namespaceURI
@throws IllegalArgumentException if namespaceURI is one of
{@value XMLConstants#XML_NS_URI} or {@value XMLConstants#XMLNS_ATTRIBUTE_NS_URI}
"""
if (prefix == nul... | java | public void addNamespace(String prefix, String namespaceURI) {
if (prefix == null || namespaceURI == null) {
throw new IllegalArgumentException("null arguments not allowed.");
}
if (namespaceURI.equals(XMLConstants.XML_NS_URI)) {
throw new IllegalArgumentException("Adding... | [
"public",
"void",
"addNamespace",
"(",
"String",
"prefix",
",",
"String",
"namespaceURI",
")",
"{",
"if",
"(",
"prefix",
"==",
"null",
"||",
"namespaceURI",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"null arguments not allowed.\"",... | Add a prefix to namespace mapping.
@param prefix
@param namespaceURI
@throws IllegalArgumentException if namespaceURI is one of
{@value XMLConstants#XML_NS_URI} or {@value XMLConstants#XMLNS_ATTRIBUTE_NS_URI} | [
"Add",
"a",
"prefix",
"to",
"namespace",
"mapping",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-common/src/main/java/org/fcrepo/utilities/NamespaceContextImpl.java#L107-L119 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/ftp/FTPFileSystem.java | FTPFileSystem.rename | @Override
public boolean rename(Path src, Path dst) throws IOException {
"""
/*
Assuming that parent of both source and destination is the same. Is the
assumption correct or it is suppose to work like 'move' ?
"""
FTPClient client = connect();
try {
boolean success = rename(client, src, dst);... | java | @Override
public boolean rename(Path src, Path dst) throws IOException {
FTPClient client = connect();
try {
boolean success = rename(client, src, dst);
return success;
} finally {
disconnect(client);
}
} | [
"@",
"Override",
"public",
"boolean",
"rename",
"(",
"Path",
"src",
",",
"Path",
"dst",
")",
"throws",
"IOException",
"{",
"FTPClient",
"client",
"=",
"connect",
"(",
")",
";",
"try",
"{",
"boolean",
"success",
"=",
"rename",
"(",
"client",
",",
"src",
... | /*
Assuming that parent of both source and destination is the same. Is the
assumption correct or it is suppose to work like 'move' ? | [
"/",
"*",
"Assuming",
"that",
"parent",
"of",
"both",
"source",
"and",
"destination",
"is",
"the",
"same",
".",
"Is",
"the",
"assumption",
"correct",
"or",
"it",
"is",
"suppose",
"to",
"work",
"like",
"move",
"?"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/ftp/FTPFileSystem.java#L508-L517 |
facebookarchive/nifty | nifty-ssl/src/main/java/com/facebook/nifty/ssl/PollingMultiFileWatcher.java | PollingMultiFileWatcher.computeFileHash | private static String computeFileHash(File file, MessageDigest md) throws IOException {
"""
Computes a hash of the given file's contents using the provided MessageDigest.
@param file the file.
@param md the message digest.
@return the hash of the file contents.
@throws IOException if the file contents cannot... | java | private static String computeFileHash(File file, MessageDigest md) throws IOException {
md.reset();
return BaseEncoding.base16().encode(md.digest(Files.toByteArray(file)));
} | [
"private",
"static",
"String",
"computeFileHash",
"(",
"File",
"file",
",",
"MessageDigest",
"md",
")",
"throws",
"IOException",
"{",
"md",
".",
"reset",
"(",
")",
";",
"return",
"BaseEncoding",
".",
"base16",
"(",
")",
".",
"encode",
"(",
"md",
".",
"di... | Computes a hash of the given file's contents using the provided MessageDigest.
@param file the file.
@param md the message digest.
@return the hash of the file contents.
@throws IOException if the file contents cannot be read. | [
"Computes",
"a",
"hash",
"of",
"the",
"given",
"file",
"s",
"contents",
"using",
"the",
"provided",
"MessageDigest",
"."
] | train | https://github.com/facebookarchive/nifty/blob/ccacff7f0a723abe0b9ed399bcc3bc85784e7396/nifty-ssl/src/main/java/com/facebook/nifty/ssl/PollingMultiFileWatcher.java#L234-L237 |
alkacon/opencms-core | src/org/opencms/relations/CmsCategoryService.java | CmsCategoryService.readCategory | public CmsCategory readCategory(CmsObject cms, String categoryPath, String referencePath) throws CmsException {
"""
Reads all categories identified by the given category path for the given reference path.<p>
@param cms the current cms context
@param categoryPath the path of the category to read
@param referen... | java | public CmsCategory readCategory(CmsObject cms, String categoryPath, String referencePath) throws CmsException {
// iterate all possible category repositories, starting with the most global one
Iterator<String> it = getCategoryRepositories(cms, referencePath).iterator();
while (it.hasNext()) {
... | [
"public",
"CmsCategory",
"readCategory",
"(",
"CmsObject",
"cms",
",",
"String",
"categoryPath",
",",
"String",
"referencePath",
")",
"throws",
"CmsException",
"{",
"// iterate all possible category repositories, starting with the most global one",
"Iterator",
"<",
"String",
... | Reads all categories identified by the given category path for the given reference path.<p>
@param cms the current cms context
@param categoryPath the path of the category to read
@param referencePath the reference path to find all the category repositories
@return a list of matching categories, could also be empty, ... | [
"Reads",
"all",
"categories",
"identified",
"by",
"the",
"given",
"category",
"path",
"for",
"the",
"given",
"reference",
"path",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsCategoryService.java#L552-L569 |
pmwmedia/tinylog | tinylog-impl/src/main/java/org/tinylog/writers/LogcatWriter.java | LogcatWriter.reuseOrCreate | private static StringBuilder reuseOrCreate(final StringBuilder builder, final int capacity) {
"""
Clears an existing string builder or creates a new one if given string builder is {@code null}.
@param builder
String builder instance or {@code null}
@param capacity
Initial capacity for new string builder if c... | java | private static StringBuilder reuseOrCreate(final StringBuilder builder, final int capacity) {
if (builder == null) {
return new StringBuilder(capacity);
} else {
builder.setLength(0);
return builder;
}
} | [
"private",
"static",
"StringBuilder",
"reuseOrCreate",
"(",
"final",
"StringBuilder",
"builder",
",",
"final",
"int",
"capacity",
")",
"{",
"if",
"(",
"builder",
"==",
"null",
")",
"{",
"return",
"new",
"StringBuilder",
"(",
"capacity",
")",
";",
"}",
"else"... | Clears an existing string builder or creates a new one if given string builder is {@code null}.
@param builder
String builder instance or {@code null}
@param capacity
Initial capacity for new string builder if created
@return Empty string builder | [
"Clears",
"an",
"existing",
"string",
"builder",
"or",
"creates",
"a",
"new",
"one",
"if",
"given",
"string",
"builder",
"is",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/tinylog-impl/src/main/java/org/tinylog/writers/LogcatWriter.java#L159-L166 |
xm-online/xm-commons | xm-commons-permission/src/main/java/com/icthh/xm/commons/permission/repository/PermittedRepository.java | PermittedRepository.findByCondition | public <T> List<T> findByCondition(String whereCondition,
Map<String, Object> conditionParams,
Class<T> entityClass,
String privilegeKey) {
"""
Find permitted entities by parameters.
@param whereCo... | java | public <T> List<T> findByCondition(String whereCondition,
Map<String, Object> conditionParams,
Class<T> entityClass,
String privilegeKey) {
return findByCondition(whereCondition, conditionParams,... | [
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"findByCondition",
"(",
"String",
"whereCondition",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"conditionParams",
",",
"Class",
"<",
"T",
">",
"entityClass",
",",
"String",
"privilegeKey",
")",
"{",
"re... | Find permitted entities by parameters.
@param whereCondition the parameters condition
@param conditionParams the parameters map
@param entityClass the entity class to get
@param privilegeKey the privilege key for permission lookup
@param <T> the type of entity
@return list of permitted entities | [
"Find",
"permitted",
"entities",
"by",
"parameters",
"."
] | train | https://github.com/xm-online/xm-commons/blob/43eb2273adb96f40830d7b905ee3a767b8715caf/xm-commons-permission/src/main/java/com/icthh/xm/commons/permission/repository/PermittedRepository.java#L96-L101 |
febit/wit | wit-core/src/main/java/org/febit/wit/InternalContext.java | InternalContext.setBeanProperty | public <T> void setBeanProperty(final T bean, final Object property, final Object value) {
"""
Set a bean's property.
@param bean bean
@param property property
@param value value
"""
if (bean != null) {
@SuppressWarnings("unchecked")
SetResolver<T> resolver = this.se... | java | public <T> void setBeanProperty(final T bean, final Object property, final Object value) {
if (bean != null) {
@SuppressWarnings("unchecked")
SetResolver<T> resolver = this.setters.unsafeGet(bean.getClass());
if (resolver != null) {
resolver.set(bean, property... | [
"public",
"<",
"T",
">",
"void",
"setBeanProperty",
"(",
"final",
"T",
"bean",
",",
"final",
"Object",
"property",
",",
"final",
"Object",
"value",
")",
"{",
"if",
"(",
"bean",
"!=",
"null",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
... | Set a bean's property.
@param bean bean
@param property property
@param value value | [
"Set",
"a",
"bean",
"s",
"property",
"."
] | train | https://github.com/febit/wit/blob/89ee29efbc5633b79c30c3c7b953c9f4130575af/wit-core/src/main/java/org/febit/wit/InternalContext.java#L273-L283 |
landawn/AbacusUtil | src/com/landawn/abacus/util/stream/EntryStream.java | EntryStream.iterator | @SequentialOnly
public BiIterator<K, V> iterator() {
"""
Remember to close this Stream after the iteration is done, if required.
@return
"""
final ObjIterator<Entry<K, V>> iter = s.iterator();
final BooleanSupplier hasNext = new BooleanSupplier() {
@Override
... | java | @SequentialOnly
public BiIterator<K, V> iterator() {
final ObjIterator<Entry<K, V>> iter = s.iterator();
final BooleanSupplier hasNext = new BooleanSupplier() {
@Override
public boolean getAsBoolean() {
return iter.hasNext();
}
};... | [
"@",
"SequentialOnly",
"public",
"BiIterator",
"<",
"K",
",",
"V",
">",
"iterator",
"(",
")",
"{",
"final",
"ObjIterator",
"<",
"Entry",
"<",
"K",
",",
"V",
">",
">",
"iter",
"=",
"s",
".",
"iterator",
"(",
")",
";",
"final",
"BooleanSupplier",
"hasN... | Remember to close this Stream after the iteration is done, if required.
@return | [
"Remember",
"to",
"close",
"this",
"Stream",
"after",
"the",
"iteration",
"is",
"done",
"if",
"required",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/EntryStream.java#L968-L990 |
apereo/person-directory | person-directory-impl/src/main/java/org/apereo/services/persondir/support/web/RequestAttributeSourceFilter.java | RequestAttributeSourceFilter.addRequestProperties | protected void addRequestProperties(final HttpServletRequest httpServletRequest, final Map<String, List<Object>> attributes) {
"""
Add other properties from the request to the attributes map.
@param httpServletRequest Http Servlet Request
@param attributes Map of attributes to add additional attributes to from... | java | protected void addRequestProperties(final HttpServletRequest httpServletRequest, final Map<String, List<Object>> attributes) {
if (this.remoteUserAttribute != null) {
final String remoteUser = httpServletRequest.getRemoteUser();
attributes.put(this.remoteUserAttribute, list(remoteUser));... | [
"protected",
"void",
"addRequestProperties",
"(",
"final",
"HttpServletRequest",
"httpServletRequest",
",",
"final",
"Map",
"<",
"String",
",",
"List",
"<",
"Object",
">",
">",
"attributes",
")",
"{",
"if",
"(",
"this",
".",
"remoteUserAttribute",
"!=",
"null",
... | Add other properties from the request to the attributes map.
@param httpServletRequest Http Servlet Request
@param attributes Map of attributes to add additional attributes to from the Http Request | [
"Add",
"other",
"properties",
"from",
"the",
"request",
"to",
"the",
"attributes",
"map",
"."
] | train | https://github.com/apereo/person-directory/blob/331200c0878aec202b8aff12a732402d6ba7681f/person-directory-impl/src/main/java/org/apereo/services/persondir/support/web/RequestAttributeSourceFilter.java#L407-L428 |
landawn/AbacusUtil | src/com/landawn/abacus/util/ClassUtil.java | ClassUtil.setPropValue | public static void setPropValue(final Object entity, final String propName, final Object propValue) {
"""
Refer to setPropValue(Method, Object, Object).
@param entity
@param propName
is case insensitive
@param propValue
"""
setPropValue(entity, propName, propValue, false);
} | java | public static void setPropValue(final Object entity, final String propName, final Object propValue) {
setPropValue(entity, propName, propValue, false);
} | [
"public",
"static",
"void",
"setPropValue",
"(",
"final",
"Object",
"entity",
",",
"final",
"String",
"propName",
",",
"final",
"Object",
"propValue",
")",
"{",
"setPropValue",
"(",
"entity",
",",
"propName",
",",
"propValue",
",",
"false",
")",
";",
"}"
] | Refer to setPropValue(Method, Object, Object).
@param entity
@param propName
is case insensitive
@param propValue | [
"Refer",
"to",
"setPropValue",
"(",
"Method",
"Object",
"Object",
")",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/ClassUtil.java#L1913-L1915 |
paypal/SeLion | server/src/main/java/com/paypal/selion/pojos/BrowserInformationCache.java | BrowserInformationCache.getTotalBrowserCapacity | public synchronized int getTotalBrowserCapacity(String browserName, GridRegistry registry) {
"""
Returns the total instances of a particular browser, available through all nodes. This methods takes an instance
of {@link GridRegistry} to clean the cache before returning the results.
@param browserName
Browser ... | java | public synchronized int getTotalBrowserCapacity(String browserName, GridRegistry registry) {
logger.entering(new Object[] { browserName, registry });
cleanCacheUsingRegistry(registry);
int totalBrowserCounts = 0;
for (Map.Entry<URL, TestSlotInformation> entry : nodeMap.entrySet()) {
... | [
"public",
"synchronized",
"int",
"getTotalBrowserCapacity",
"(",
"String",
"browserName",
",",
"GridRegistry",
"registry",
")",
"{",
"logger",
".",
"entering",
"(",
"new",
"Object",
"[",
"]",
"{",
"browserName",
",",
"registry",
"}",
")",
";",
"cleanCacheUsingRe... | Returns the total instances of a particular browser, available through all nodes. This methods takes an instance
of {@link GridRegistry} to clean the cache before returning the results.
@param browserName
Browser name as {@link String}
@param registry
{@link GridRegistry} instance.
@return Total instances of a particu... | [
"Returns",
"the",
"total",
"instances",
"of",
"a",
"particular",
"browser",
"available",
"through",
"all",
"nodes",
".",
"This",
"methods",
"takes",
"an",
"instance",
"of",
"{",
"@link",
"GridRegistry",
"}",
"to",
"clean",
"the",
"cache",
"before",
"returning"... | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/pojos/BrowserInformationCache.java#L113-L123 |
apache/incubator-gobblin | gobblin-config-management/gobblin-config-core/src/main/java/org/apache/gobblin/config/common/impl/InMemoryTopology.java | InMemoryTopology.getImportedByRecursively | @Override
public Collection<ConfigKeyPath> getImportedByRecursively(ConfigKeyPath configKey) {
"""
{@inheritDoc}.
<p>
If the result is already in cache, return the result.
Otherwise, delegate the functionality to the fallback object.
If the fallback did not support this operation, will build the entire t... | java | @Override
public Collection<ConfigKeyPath> getImportedByRecursively(ConfigKeyPath configKey) {
return getImportedByRecursively(configKey, Optional.<Config>absent());
} | [
"@",
"Override",
"public",
"Collection",
"<",
"ConfigKeyPath",
">",
"getImportedByRecursively",
"(",
"ConfigKeyPath",
"configKey",
")",
"{",
"return",
"getImportedByRecursively",
"(",
"configKey",
",",
"Optional",
".",
"<",
"Config",
">",
"absent",
"(",
")",
")",
... | {@inheritDoc}.
<p>
If the result is already in cache, return the result.
Otherwise, delegate the functionality to the fallback object.
If the fallback did not support this operation, will build the entire topology of the {@link org.apache.gobblin.config.store.api.ConfigStore}
using default breath first search.
</p> | [
"{",
"@inheritDoc",
"}",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-config-management/gobblin-config-core/src/main/java/org/apache/gobblin/config/common/impl/InMemoryTopology.java#L215-L218 |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java | FileBasedAtomHandler.postMedia | @Override
public Entry postMedia(final AtomRequest areq, final Entry entry) throws AtomException {
"""
Store media data in collection specified by pathInfo, create an Atom media-link entry to
store metadata for the new media file and return that entry to the caller.
@param areq Details of HTTP request
@pa... | java | @Override
public Entry postMedia(final AtomRequest areq, final Entry entry) throws AtomException {
// get incoming slug from HTTP header
final String slug = areq.getHeader("Slug");
if (LOG.isDebugEnabled()) {
LOG.debug("postMedia - title: " + entry.getTitle() + " slug:" + slug)... | [
"@",
"Override",
"public",
"Entry",
"postMedia",
"(",
"final",
"AtomRequest",
"areq",
",",
"final",
"Entry",
"entry",
")",
"throws",
"AtomException",
"{",
"// get incoming slug from HTTP header",
"final",
"String",
"slug",
"=",
"areq",
".",
"getHeader",
"(",
"\"Sl... | Store media data in collection specified by pathInfo, create an Atom media-link entry to
store metadata for the new media file and return that entry to the caller.
@param areq Details of HTTP request
@param entry New entry initialzied with only title and content type
@return Location URL of new media entry | [
"Store",
"media",
"data",
"in",
"collection",
"specified",
"by",
"pathInfo",
"create",
"an",
"Atom",
"media",
"-",
"link",
"entry",
"to",
"store",
"metadata",
"for",
"the",
"new",
"media",
"file",
"and",
"return",
"that",
"entry",
"to",
"the",
"caller",
".... | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/impl/FileBasedAtomHandler.java#L274-L308 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/Widgets.java | Widgets.initTextBox | public static TextBox initTextBox (TextBox box, String text, int maxLength, int visibleLength) {
"""
Configures a text box with all of the configuration that you're bound to want to do. This is
useful for configuring a PasswordTextBox.
"""
if (text != null) {
box.setText(text);
}
... | java | public static TextBox initTextBox (TextBox box, String text, int maxLength, int visibleLength)
{
if (text != null) {
box.setText(text);
}
box.setMaxLength(maxLength > 0 ? maxLength : 255);
if (visibleLength > 0) {
box.setVisibleLength(visibleLength);
}... | [
"public",
"static",
"TextBox",
"initTextBox",
"(",
"TextBox",
"box",
",",
"String",
"text",
",",
"int",
"maxLength",
",",
"int",
"visibleLength",
")",
"{",
"if",
"(",
"text",
"!=",
"null",
")",
"{",
"box",
".",
"setText",
"(",
"text",
")",
";",
"}",
... | Configures a text box with all of the configuration that you're bound to want to do. This is
useful for configuring a PasswordTextBox. | [
"Configures",
"a",
"text",
"box",
"with",
"all",
"of",
"the",
"configuration",
"that",
"you",
"re",
"bound",
"to",
"want",
"to",
"do",
".",
"This",
"is",
"useful",
"for",
"configuring",
"a",
"PasswordTextBox",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L356-L366 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/message/app/ThickMessageManager.java | ThickMessageManager.init | public void init(App application, String strParams, Map<String, Object> properties) {
"""
Constructor.
@param application The parent application.
@param strParams The task properties.
"""
super.init(application, strParams, properties);
} | java | public void init(App application, String strParams, Map<String, Object> properties)
{
super.init(application, strParams, properties);
} | [
"public",
"void",
"init",
"(",
"App",
"application",
",",
"String",
"strParams",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"super",
".",
"init",
"(",
"application",
",",
"strParams",
",",
"properties",
")",
";",
"}"
] | Constructor.
@param application The parent application.
@param strParams The task properties. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/message/app/ThickMessageManager.java#L45-L48 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MessageFormat.java | MessageFormat.setFormatByArgumentIndex | public void setFormatByArgumentIndex(int argumentIndex, Format newFormat) {
"""
Sets the Format object to use for the format elements within the
previously set pattern string that use the given argument
index.
The argument index is part of the format element definition and
represents an index into the <code>ar... | java | public void setFormatByArgumentIndex(int argumentIndex, Format newFormat) {
if (msgPattern.hasNamedArguments()) {
throw new IllegalArgumentException(
"This method is not available in MessageFormat objects " +
"that use alphanumeric argument names.");
}... | [
"public",
"void",
"setFormatByArgumentIndex",
"(",
"int",
"argumentIndex",
",",
"Format",
"newFormat",
")",
"{",
"if",
"(",
"msgPattern",
".",
"hasNamedArguments",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"This method is not available in ... | Sets the Format object to use for the format elements within the
previously set pattern string that use the given argument
index.
The argument index is part of the format element definition and
represents an index into the <code>arguments</code> array passed
to the <code>format</code> methods or the result array return... | [
"Sets",
"the",
"Format",
"object",
"to",
"use",
"for",
"the",
"format",
"elements",
"within",
"the",
"previously",
"set",
"pattern",
"string",
"that",
"use",
"the",
"given",
"argument",
"index",
".",
"The",
"argument",
"index",
"is",
"part",
"of",
"the",
"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/MessageFormat.java#L676-L687 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/query/QueryImpl.java | QueryImpl.populateEmbeddedIdUsingLucene | private List<Object> populateEmbeddedIdUsingLucene(EntityMetadata m, Client client, List<Object> result,
Map<String, Object> searchFilter, MetamodelImpl metaModel) {
"""
Populate using lucene for embeddeId.
@param m
the m
@param client
the client
@param result
the result
@param searchFilter
t... | java | private List<Object> populateEmbeddedIdUsingLucene(EntityMetadata m, Client client, List<Object> result,
Map<String, Object> searchFilter, MetamodelImpl metaModel)
{
List<Object> compositeIds = new ArrayList<Object>();
for (String compositeIdName : searchFilter.keySet())
{
... | [
"private",
"List",
"<",
"Object",
">",
"populateEmbeddedIdUsingLucene",
"(",
"EntityMetadata",
"m",
",",
"Client",
"client",
",",
"List",
"<",
"Object",
">",
"result",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"searchFilter",
",",
"MetamodelImpl",
"metaMo... | Populate using lucene for embeddeId.
@param m
the m
@param client
the client
@param result
the result
@param searchFilter
the search filter
@param metaModel
the meta model
@return the list | [
"Populate",
"using",
"lucene",
"for",
"embeddeId",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/query/QueryImpl.java#L293-L308 |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ReportUtil.java | ReportUtil.getDynamicReportLayout | public static ReportLayout getDynamicReportLayout(Connection con, ReportLayout layout, ParametersBean pBean) throws Exception {
"""
Get dynamic report layout
Report layout is dynamically modified in some situations like:
1. FOR Report Band Element
2. Functions in Header or Group Header
@param con database co... | java | public static ReportLayout getDynamicReportLayout(Connection con, ReportLayout layout, ParametersBean pBean) throws Exception {
ReportLayout convertedLayout = ReportUtil.getReportLayoutForHeaderFunctions(layout);
// IMPORTANT: must take for report layout at the end because we save some transient data ... | [
"public",
"static",
"ReportLayout",
"getDynamicReportLayout",
"(",
"Connection",
"con",
",",
"ReportLayout",
"layout",
",",
"ParametersBean",
"pBean",
")",
"throws",
"Exception",
"{",
"ReportLayout",
"convertedLayout",
"=",
"ReportUtil",
".",
"getReportLayoutForHeaderFunc... | Get dynamic report layout
Report layout is dynamically modified in some situations like:
1. FOR Report Band Element
2. Functions in Header or Group Header
@param con database connection
@param layout report layout
@param pBean parameters bean
@return dynamic report layout
@throws Exception | [
"Get",
"dynamic",
"report",
"layout",
"Report",
"layout",
"is",
"dynamically",
"modified",
"in",
"some",
"situations",
"like",
":",
"1",
".",
"FOR",
"Report",
"Band",
"Element",
"2",
".",
"Functions",
"in",
"Header",
"or",
"Group",
"Header"
] | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ReportUtil.java#L980-L986 |
navnorth/LRJavaLib | src/com/navnorth/learningregistry/LREnvelope.java | LREnvelope.addSigningData | public void addSigningData(String signingMethod, String publicKeyLocation, String clearSignedMessage) {
"""
Adds signing data to the envelope
@param signingMethod method used for signing this envelope
@param publicKeyLocation location of the public key for the signature on this envelope
@param clearSignedMess... | java | public void addSigningData(String signingMethod, String publicKeyLocation, String clearSignedMessage)
{
this.signingMethod = signingMethod;
this.publicKeyLocation = publicKeyLocation;
this.clearSignedMessage = clearSignedMessage;
this.signed = true;
} | [
"public",
"void",
"addSigningData",
"(",
"String",
"signingMethod",
",",
"String",
"publicKeyLocation",
",",
"String",
"clearSignedMessage",
")",
"{",
"this",
".",
"signingMethod",
"=",
"signingMethod",
";",
"this",
".",
"publicKeyLocation",
"=",
"publicKeyLocation",
... | Adds signing data to the envelope
@param signingMethod method used for signing this envelope
@param publicKeyLocation location of the public key for the signature on this envelope
@param clearSignedMessage clear signed message created for signing this envelope | [
"Adds",
"signing",
"data",
"to",
"the",
"envelope"
] | train | https://github.com/navnorth/LRJavaLib/blob/27af28b9f80d772273592414e7d0dccffaac09e1/src/com/navnorth/learningregistry/LREnvelope.java#L183-L189 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/CollectionUtils.java | CollectionUtils.addAll | public static <T> void addAll(Collection<T> collection, Iterable<? extends T> items) {
"""
Add all the items from an iterable to a collection.
@param <T>
The type of items in the iterable and the collection
@param collection
The collection to which the items should be added.
@param items
The items to add t... | java | public static <T> void addAll(Collection<T> collection, Iterable<? extends T> items) {
for (T item : items) {
collection.add(item);
}
} | [
"public",
"static",
"<",
"T",
">",
"void",
"addAll",
"(",
"Collection",
"<",
"T",
">",
"collection",
",",
"Iterable",
"<",
"?",
"extends",
"T",
">",
"items",
")",
"{",
"for",
"(",
"T",
"item",
":",
"items",
")",
"{",
"collection",
".",
"add",
"(",
... | Add all the items from an iterable to a collection.
@param <T>
The type of items in the iterable and the collection
@param collection
The collection to which the items should be added.
@param items
The items to add to the collection. | [
"Add",
"all",
"the",
"items",
"from",
"an",
"iterable",
"to",
"a",
"collection",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/CollectionUtils.java#L541-L545 |
liferay/com-liferay-commerce | commerce-currency-service/src/main/java/com/liferay/commerce/currency/service/persistence/impl/CommerceCurrencyPersistenceImpl.java | CommerceCurrencyPersistenceImpl.findAll | @Override
public List<CommerceCurrency> findAll() {
"""
Returns all the commerce currencies.
@return the commerce currencies
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceCurrency> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceCurrency",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce currencies.
@return the commerce currencies | [
"Returns",
"all",
"the",
"commerce",
"currencies",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-currency-service/src/main/java/com/liferay/commerce/currency/service/persistence/impl/CommerceCurrencyPersistenceImpl.java#L4674-L4677 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/AbstractPathElement3D.java | AbstractPathElement3D.newInstance | @Pure
public static AbstractPathElement3D newInstance(PathElementType type, double lastX, double lastY, double lastZ, double[] coords) {
"""
Create an instance of path element.
@param type is the type of the new element.
@param lastX is the coordinate of the last point.
@param lastY is the coordinate of the ... | java | @Pure
public static AbstractPathElement3D newInstance(PathElementType type, double lastX, double lastY, double lastZ, double[] coords) {
switch(type) {
case MOVE_TO:
return new MovePathElement3d(coords[0], coords[1], coords[2]);
case LINE_TO:
return new LinePathElement3d(lastX, lastY, lastZ, coords[0], coo... | [
"@",
"Pure",
"public",
"static",
"AbstractPathElement3D",
"newInstance",
"(",
"PathElementType",
"type",
",",
"double",
"lastX",
",",
"double",
"lastY",
",",
"double",
"lastZ",
",",
"double",
"[",
"]",
"coords",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"... | Create an instance of path element.
@param type is the type of the new element.
@param lastX is the coordinate of the last point.
@param lastY is the coordinate of the last point.
@param lastZ is the coordinate of the last point.
@param coords are the coordinates.
@return the instance of path element. | [
"Create",
"an",
"instance",
"of",
"path",
"element",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/AbstractPathElement3D.java#L49-L65 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/Path.java | Path.curveTo | public void curveTo(float x, float y, float cx1, float cy1, float cx2, float cy2) {
"""
Add a curve to the specified location (using the default segments 10)
@param x The destination x coordinate
@param y The destination y coordiante
@param cx1 The x coordiante of the first control point
@param cy1 The y coo... | java | public void curveTo(float x, float y, float cx1, float cy1, float cx2, float cy2) {
curveTo(x,y,cx1,cy1,cx2,cy2,10);
} | [
"public",
"void",
"curveTo",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"cx1",
",",
"float",
"cy1",
",",
"float",
"cx2",
",",
"float",
"cy2",
")",
"{",
"curveTo",
"(",
"x",
",",
"y",
",",
"cx1",
",",
"cy1",
",",
"cx2",
",",
"cy2",
",",... | Add a curve to the specified location (using the default segments 10)
@param x The destination x coordinate
@param y The destination y coordiante
@param cx1 The x coordiante of the first control point
@param cy1 The y coordiante of the first control point
@param cx2 The x coordinate of the second control point
@param ... | [
"Add",
"a",
"curve",
"to",
"the",
"specified",
"location",
"(",
"using",
"the",
"default",
"segments",
"10",
")"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/Path.java#L84-L86 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsPropertyAdvanced.java | CmsPropertyAdvanced.actionDeleteResource | public void actionDeleteResource() throws JspException {
"""
Deletes the current resource if the dialog is in wizard mode.<p>
If the dialog is not in wizard mode, the resource is not deleted.<p>
@throws JspException if including the error page fails
"""
if ((getParamDialogmode() != null) && getP... | java | public void actionDeleteResource() throws JspException {
if ((getParamDialogmode() != null) && getParamDialogmode().startsWith(MODE_WIZARD)) {
// only delete resource if dialog mode is a wizard mode
try {
getCms().deleteResource(getParamResource(), CmsResource.DELETE_PRE... | [
"public",
"void",
"actionDeleteResource",
"(",
")",
"throws",
"JspException",
"{",
"if",
"(",
"(",
"getParamDialogmode",
"(",
")",
"!=",
"null",
")",
"&&",
"getParamDialogmode",
"(",
")",
".",
"startsWith",
"(",
"MODE_WIZARD",
")",
")",
"{",
"// only delete re... | Deletes the current resource if the dialog is in wizard mode.<p>
If the dialog is not in wizard mode, the resource is not deleted.<p>
@throws JspException if including the error page fails | [
"Deletes",
"the",
"current",
"resource",
"if",
"the",
"dialog",
"is",
"in",
"wizard",
"mode",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsPropertyAdvanced.java#L354-L365 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.rotateZYX | public Matrix4f rotateZYX(float angleZ, float angleY, float angleX) {
"""
Apply rotation of <code>angleZ</code> radians about the Z axis, followed by a rotation of <code>angleY</code> radians about the Y axis and
followed by a rotation of <code>angleX</code> radians about the X axis.
<p>
When used with a right-... | java | public Matrix4f rotateZYX(float angleZ, float angleY, float angleX) {
return rotateZYX(angleZ, angleY, angleX, thisOrNew());
} | [
"public",
"Matrix4f",
"rotateZYX",
"(",
"float",
"angleZ",
",",
"float",
"angleY",
",",
"float",
"angleX",
")",
"{",
"return",
"rotateZYX",
"(",
"angleZ",
",",
"angleY",
",",
"angleX",
",",
"thisOrNew",
"(",
")",
")",
";",
"}"
] | Apply rotation of <code>angleZ</code> radians about the Z axis, followed by a rotation of <code>angleY</code> radians about the Y axis and
followed by a rotation of <code>angleX</code> radians about the X axis.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter-clock... | [
"Apply",
"rotation",
"of",
"<code",
">",
"angleZ<",
"/",
"code",
">",
"radians",
"about",
"the",
"Z",
"axis",
"followed",
"by",
"a",
"rotation",
"of",
"<code",
">",
"angleY<",
"/",
"code",
">",
"radians",
"about",
"the",
"Y",
"axis",
"and",
"followed",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L5496-L5498 |
blackdoor/blackdoor | src/main/java/black/door/struct/GenericMap.java | GenericMap.put | public <T> Object put(String key, T value) {
"""
Associates the specified value with the specified key in this map. If the
map previously contained a mapping for the key, the old value is replaced
by the specified value. (A map m is said to contain a mapping for a key k
if and only if m.containsKey(k) would ret... | java | public <T> Object put(String key, T value) {
Object last = null;
int index = keys.indexOf(key);
if (index >= 0) {
last = grab(key);
values.remove(index);
values.add(index, new GenericEntry<T>(value));
} else {
keys.addSorted(key);
index = keys.indexOf(key);
values.add(index, new GenericEntry<T... | [
"public",
"<",
"T",
">",
"Object",
"put",
"(",
"String",
"key",
",",
"T",
"value",
")",
"{",
"Object",
"last",
"=",
"null",
";",
"int",
"index",
"=",
"keys",
".",
"indexOf",
"(",
"key",
")",
";",
"if",
"(",
"index",
">=",
"0",
")",
"{",
"last",... | Associates the specified value with the specified key in this map. If the
map previously contained a mapping for the key, the old value is replaced
by the specified value. (A map m is said to contain a mapping for a key k
if and only if m.containsKey(k) would return true.)
@param key
@param value
@return the value pre... | [
"Associates",
"the",
"specified",
"value",
"with",
"the",
"specified",
"key",
"in",
"this",
"map",
".",
"If",
"the",
"map",
"previously",
"contained",
"a",
"mapping",
"for",
"the",
"key",
"the",
"old",
"value",
"is",
"replaced",
"by",
"the",
"specified",
"... | train | https://github.com/blackdoor/blackdoor/blob/060c7a71dfafb85e10e8717736e6d3160262e96b/src/main/java/black/door/struct/GenericMap.java#L117-L132 |
dita-ot/dita-ot | src/main/java/org/dita/dost/writer/HTMLIndexWriter.java | HTMLIndexWriter.outputIndexTerm | private void outputIndexTerm(final IndexTerm term, final XMLSerializer serializer) throws SAXException {
"""
Output the given indexterm into the XML writer.
@param term term to serializer
@param serializer XML output to write to
"""
List<IndexTermTarget> targets = term.getTargetList();
fina... | java | private void outputIndexTerm(final IndexTerm term, final XMLSerializer serializer) throws SAXException {
List<IndexTermTarget> targets = term.getTargetList();
final List<IndexTerm> subTerms = term.getSubTerms();
serializer.writeStartElement("li");
//if term doesn't have target to link ... | [
"private",
"void",
"outputIndexTerm",
"(",
"final",
"IndexTerm",
"term",
",",
"final",
"XMLSerializer",
"serializer",
")",
"throws",
"SAXException",
"{",
"List",
"<",
"IndexTermTarget",
">",
"targets",
"=",
"term",
".",
"getTargetList",
"(",
")",
";",
"final",
... | Output the given indexterm into the XML writer.
@param term term to serializer
@param serializer XML output to write to | [
"Output",
"the",
"given",
"indexterm",
"into",
"the",
"XML",
"writer",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/writer/HTMLIndexWriter.java#L100-L130 |
twitter/scrooge | scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java | AbstractMavenScroogeMojo.getRecursiveThriftFiles | List<File> getRecursiveThriftFiles(MavenProject project, String outputDirectory, List<File> files) throws IOException {
"""
Walk project references recursively, adding thrift files to the provided list.
"""
HashFunction hashFun = Hashing.md5();
File dir = new File(new File(project.getFile().getParent()... | java | List<File> getRecursiveThriftFiles(MavenProject project, String outputDirectory, List<File> files) throws IOException {
HashFunction hashFun = Hashing.md5();
File dir = new File(new File(project.getFile().getParent(), "target"), outputDirectory);
if (dir.exists()) {
URI baseDir = getFileURI(dir);
... | [
"List",
"<",
"File",
">",
"getRecursiveThriftFiles",
"(",
"MavenProject",
"project",
",",
"String",
"outputDirectory",
",",
"List",
"<",
"File",
">",
"files",
")",
"throws",
"IOException",
"{",
"HashFunction",
"hashFun",
"=",
"Hashing",
".",
"md5",
"(",
")",
... | Walk project references recursively, adding thrift files to the provided list. | [
"Walk",
"project",
"references",
"recursively",
"adding",
"thrift",
"files",
"to",
"the",
"provided",
"list",
"."
] | train | https://github.com/twitter/scrooge/blob/2aec9b19a610e12be9609cd97925d0b1284d48bc/scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java#L495-L518 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/GroupsPoolsApi.java | GroupsPoolsApi.getPhotos | public Photos getPhotos(String groupId, List<String> tags, String userId, EnumSet<JinxConstants.PhotoExtras> extras, int perPage, int page, boolean sign) throws JinxException {
"""
Returns a list of pool photos for a given group, based on the permissions of the group and the user logged in (if any).
<br>
This me... | java | public Photos getPhotos(String groupId, List<String> tags, String userId, EnumSet<JinxConstants.PhotoExtras> extras, int perPage, int page, boolean sign) throws JinxException {
JinxUtils.validateParams(groupId);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.groups.pools.getPhoto... | [
"public",
"Photos",
"getPhotos",
"(",
"String",
"groupId",
",",
"List",
"<",
"String",
">",
"tags",
",",
"String",
"userId",
",",
"EnumSet",
"<",
"JinxConstants",
".",
"PhotoExtras",
">",
"extras",
",",
"int",
"perPage",
",",
"int",
"page",
",",
"boolean",... | Returns a list of pool photos for a given group, based on the permissions of the group and the user logged in (if any).
<br>
This method does not require authentication. Unsigned requests may not be able to retrieve photos from some groups.
@param groupId (Required) The id of the group who's pool you which to get the ... | [
"Returns",
"a",
"list",
"of",
"pool",
"photos",
"for",
"a",
"given",
"group",
"based",
"on",
"the",
"permissions",
"of",
"the",
"group",
"and",
"the",
"user",
"logged",
"in",
"(",
"if",
"any",
")",
".",
"<br",
">",
"This",
"method",
"does",
"not",
"r... | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/GroupsPoolsApi.java#L127-L148 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImagesImpl.java | ListManagementImagesImpl.deleteImage | public String deleteImage(String listId, String imageId) {
"""
Deletes an image from the list with list Id and image Id passed.
@param listId List Id of the image list.
@param imageId Id of the image.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws APIErrorException thrown i... | java | public String deleteImage(String listId, String imageId) {
return deleteImageWithServiceResponseAsync(listId, imageId).toBlocking().single().body();
} | [
"public",
"String",
"deleteImage",
"(",
"String",
"listId",
",",
"String",
"imageId",
")",
"{",
"return",
"deleteImageWithServiceResponseAsync",
"(",
"listId",
",",
"imageId",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
".",
"body",
"(",
")",
... | Deletes an image from the list with list Id and image Id passed.
@param listId List Id of the image list.
@param imageId Id of the image.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws APIErrorException thrown if the request is rejected by server
@throws RuntimeException all other wr... | [
"Deletes",
"an",
"image",
"from",
"the",
"list",
"with",
"list",
"Id",
"and",
"image",
"Id",
"passed",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ListManagementImagesImpl.java#L418-L420 |
RestComm/media-core | control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/command/CreateConnectionCommand.java | CreateConnectionCommand.createRemoteConnection | private MgcpConnection createRemoteConnection(int callId, ConnectionMode mode, MgcpEndpoint endpoint, CrcxContext context) throws MgcpConnectionException {
"""
Creates a new Remote Connection.
<p>
The connection will be half-open and a Local Connection Description is generated.
</p>
@param callId The call ... | java | private MgcpConnection createRemoteConnection(int callId, ConnectionMode mode, MgcpEndpoint endpoint, CrcxContext context) throws MgcpConnectionException {
// Create connection
MgcpConnection connection = endpoint.createConnection(callId, false);
// TODO set call agent
String localDescri... | [
"private",
"MgcpConnection",
"createRemoteConnection",
"(",
"int",
"callId",
",",
"ConnectionMode",
"mode",
",",
"MgcpEndpoint",
"endpoint",
",",
"CrcxContext",
"context",
")",
"throws",
"MgcpConnectionException",
"{",
"// Create connection",
"MgcpConnection",
"connection",... | Creates a new Remote Connection.
<p>
The connection will be half-open and a Local Connection Description is generated.
</p>
@param callId The call identifies which indicates to which session the connection belongs to.
@param mode The connection mode.
@param endpoint The endpoint where the connection will be registere... | [
"Creates",
"a",
"new",
"Remote",
"Connection",
"."
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/command/CreateConnectionCommand.java#L167-L175 |
Impetus/Kundera | src/kundera-ethereum/src/main/java/com/impetus/kundera/blockchain/ethereum/KunderaWeb3jClient.java | KunderaWeb3jClient.getFirstBlock | public EthBlock getFirstBlock(boolean includeTransactions) {
"""
Gets the first block.
@param includeTransactions
the include transactions
@return the first block
"""
try
{
return web3j.ethGetBlockByNumber(DefaultBlockParameterName.EARLIEST, includeTransactions).send();
... | java | public EthBlock getFirstBlock(boolean includeTransactions)
{
try
{
return web3j.ethGetBlockByNumber(DefaultBlockParameterName.EARLIEST, includeTransactions).send();
}
catch (IOException ex)
{
LOGGER.error("Not able to find the EARLIEST block. ", ex);
... | [
"public",
"EthBlock",
"getFirstBlock",
"(",
"boolean",
"includeTransactions",
")",
"{",
"try",
"{",
"return",
"web3j",
".",
"ethGetBlockByNumber",
"(",
"DefaultBlockParameterName",
".",
"EARLIEST",
",",
"includeTransactions",
")",
".",
"send",
"(",
")",
";",
"}",
... | Gets the first block.
@param includeTransactions
the include transactions
@return the first block | [
"Gets",
"the",
"first",
"block",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-ethereum/src/main/java/com/impetus/kundera/blockchain/ethereum/KunderaWeb3jClient.java#L217-L229 |
mijecu25/dsa | src/main/java/com/mijecu25/dsa/algorithms/search/linear/LinearSearch.java | LinearSearch.searchLast | public static int searchLast(float[] floatArray, float value, int occurrence) {
"""
Search for the value in the float array and return the index of the first occurrence from the
end of the array.
@param floatArray array that we are searching in.
@param value value that is being searched in the array.
@param ... | java | public static int searchLast(float[] floatArray, float value, int occurrence) {
if(occurrence <= 0 || occurrence > floatArray.length) {
throw new IllegalArgumentException("Occurrence must be greater or equal to 1 and less than "
+ "the array length: " + occurrence);
}
... | [
"public",
"static",
"int",
"searchLast",
"(",
"float",
"[",
"]",
"floatArray",
",",
"float",
"value",
",",
"int",
"occurrence",
")",
"{",
"if",
"(",
"occurrence",
"<=",
"0",
"||",
"occurrence",
">",
"floatArray",
".",
"length",
")",
"{",
"throw",
"new",
... | Search for the value in the float array and return the index of the first occurrence from the
end of the array.
@param floatArray array that we are searching in.
@param value value that is being searched in the array.
@param occurrence number of times we have seen the value before returning the index.
@return the ind... | [
"Search",
"for",
"the",
"value",
"in",
"the",
"float",
"array",
"and",
"return",
"the",
"index",
"of",
"the",
"first",
"occurrence",
"from",
"the",
"end",
"of",
"the",
"array",
"."
] | train | https://github.com/mijecu25/dsa/blob/a22971b746833e78a3939ae4de65e8f6bf2e3fd4/src/main/java/com/mijecu25/dsa/algorithms/search/linear/LinearSearch.java#L1680-L1699 |
kiswanij/jk-util | src/main/java/com/jk/util/context/JKAbstractContext.java | JKAbstractContext.setApplicationMap | public void setApplicationMap(final Map<String, Object> applicationMap) {
"""
Sets the application map.
@param applicationMap the application map
"""
JKThreadLocal.setValue(JKContextConstants.APPLICATION_MAP, applicationMap);
} | java | public void setApplicationMap(final Map<String, Object> applicationMap) {
JKThreadLocal.setValue(JKContextConstants.APPLICATION_MAP, applicationMap);
} | [
"public",
"void",
"setApplicationMap",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"applicationMap",
")",
"{",
"JKThreadLocal",
".",
"setValue",
"(",
"JKContextConstants",
".",
"APPLICATION_MAP",
",",
"applicationMap",
")",
";",
"}"
] | Sets the application map.
@param applicationMap the application map | [
"Sets",
"the",
"application",
"map",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/context/JKAbstractContext.java#L145-L147 |
upwork/java-upwork | src/com/Upwork/api/Routers/Reports/Finance/Billings.java | Billings.getByBuyersCompany | public JSONObject getByBuyersCompany(String buyerCompanyReference, HashMap<String, String> params) throws JSONException {
"""
Generate Billing Reports for a Specific Buyer's Company
@param buyerCompanyReference Buyer company reference
@param params Parameters
@throws JSONException If error occurred
@retu... | java | public JSONObject getByBuyersCompany(String buyerCompanyReference, HashMap<String, String> params) throws JSONException {
return oClient.get("/finreports/v2/buyer_companies/" + buyerCompanyReference + "/billings", params);
} | [
"public",
"JSONObject",
"getByBuyersCompany",
"(",
"String",
"buyerCompanyReference",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"JSONException",
"{",
"return",
"oClient",
".",
"get",
"(",
"\"/finreports/v2/buyer_companies/\"",
"+",
... | Generate Billing Reports for a Specific Buyer's Company
@param buyerCompanyReference Buyer company reference
@param params Parameters
@throws JSONException If error occurred
@return {@link JSONObject} | [
"Generate",
"Billing",
"Reports",
"for",
"a",
"Specific",
"Buyer",
"s",
"Company"
] | train | https://github.com/upwork/java-upwork/blob/342297161503a74e9e0bddbd381ab5eebf4dc454/src/com/Upwork/api/Routers/Reports/Finance/Billings.java#L102-L104 |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.getFeatureLicense | public Set<InstallLicense> getFeatureLicense(Collection<String> featureNames, Locale locale, String userId, String password) throws InstallException {
"""
Gets the licenses for the specified feature names
@param featureNames a collection of the feature names
@param locale Locale for the licenses
@param userId... | java | public Set<InstallLicense> getFeatureLicense(Collection<String> featureNames, Locale locale, String userId, String password) throws InstallException {
Set<InstallLicense> licenses = new HashSet<InstallLicense>();
if (featureNames == null || featureNames.isEmpty())
return licenses;
M... | [
"public",
"Set",
"<",
"InstallLicense",
">",
"getFeatureLicense",
"(",
"Collection",
"<",
"String",
">",
"featureNames",
",",
"Locale",
"locale",
",",
"String",
"userId",
",",
"String",
"password",
")",
"throws",
"InstallException",
"{",
"Set",
"<",
"InstallLice... | Gets the licenses for the specified feature names
@param featureNames a collection of the feature names
@param locale Locale for the licenses
@param userId userId for the repository
@param password password for the repository
@return A set of installLicenses for the featuresNames
@throws InstallException | [
"Gets",
"the",
"licenses",
"for",
"the",
"specified",
"feature",
"names"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L639-L651 |
defei/codelogger-utils | src/main/java/org/codelogger/utils/MethodUtils.java | MethodUtils.findMethod | public static Method findMethod(Class<?> clazz, String methodName, Class<?>[] parameterTypes) {
"""
Returns a Method object that reflects the specified declared method of
the class or interface represented by given class.<br>
Returns null if not find.
@param clazz
the method belong to.
@param methodName
th... | java | public static Method findMethod(Class<?> clazz, String methodName, Class<?>[] parameterTypes) {
try {
return clazz.getDeclaredMethod(methodName, parameterTypes);
} catch (Exception e) {
Class<?> superclass = clazz.getSuperclass();
if (superclass != null) {
... | [
"public",
"static",
"Method",
"findMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
")",
"{",
"try",
"{",
"return",
"clazz",
".",
"getDeclaredMethod",
"(",
"methodName",
... | Returns a Method object that reflects the specified declared method of
the class or interface represented by given class.<br>
Returns null if not find.
@param clazz
the method belong to.
@param methodName
the name of the method which you want to get.
@param parameterTypes
the parameter types of the method which you wa... | [
"Returns",
"a",
"Method",
"object",
"that",
"reflects",
"the",
"specified",
"declared",
"method",
"of",
"the",
"class",
"or",
"interface",
"represented",
"by",
"given",
"class",
".",
"<br",
">",
"Returns",
"null",
"if",
"not",
"find",
"."
] | train | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/MethodUtils.java#L68-L79 |
eurekaclinical/eurekaclinical-common | src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java | EurekaClinicalClient.doPost | protected void doPost(String path) throws ClientException {
"""
Makes a POST call to the specified path.
@param path the path to call.
@throws ClientException if a status code other than 200 (OK) and 204 (No
Content) is returned.
"""
this.readLock.lock();
try {
ClientResponse r... | java | protected void doPost(String path) throws ClientException {
this.readLock.lock();
try {
ClientResponse response = getResourceWrapper().rewritten(path, HttpMethod.POST)
.post(ClientResponse.class);
errorIfStatusNotEqualTo(response, ClientResponse.Status.OK, Cli... | [
"protected",
"void",
"doPost",
"(",
"String",
"path",
")",
"throws",
"ClientException",
"{",
"this",
".",
"readLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"ClientResponse",
"response",
"=",
"getResourceWrapper",
"(",
")",
".",
"rewritten",
"(",
"path",
... | Makes a POST call to the specified path.
@param path the path to call.
@throws ClientException if a status code other than 200 (OK) and 204 (No
Content) is returned. | [
"Makes",
"a",
"POST",
"call",
"to",
"the",
"specified",
"path",
"."
] | train | https://github.com/eurekaclinical/eurekaclinical-common/blob/1867102ff43fe94e519f76a074d5f5923e9be61c/src/main/java/org/eurekaclinical/common/comm/clients/EurekaClinicalClient.java#L527-L539 |
prestodb/presto | presto-main/src/main/java/com/facebook/presto/execution/StateMachine.java | StateMachine.setIf | public boolean setIf(T newState, Predicate<T> predicate) {
"""
Sets the state if the current state satisfies the specified predicate.
If the new state does not {@code .equals()} the current state, listeners and waiters will be notified.
@return true if the state is set
"""
checkState(!Thread.holdsL... | java | public boolean setIf(T newState, Predicate<T> predicate)
{
checkState(!Thread.holdsLock(lock), "Can not set state while holding the lock");
requireNonNull(newState, "newState is null");
while (true) {
// check if the current state passes the predicate
T currentState ... | [
"public",
"boolean",
"setIf",
"(",
"T",
"newState",
",",
"Predicate",
"<",
"T",
">",
"predicate",
")",
"{",
"checkState",
"(",
"!",
"Thread",
".",
"holdsLock",
"(",
"lock",
")",
",",
"\"Can not set state while holding the lock\"",
")",
";",
"requireNonNull",
"... | Sets the state if the current state satisfies the specified predicate.
If the new state does not {@code .equals()} the current state, listeners and waiters will be notified.
@return true if the state is set | [
"Sets",
"the",
"state",
"if",
"the",
"current",
"state",
"satisfies",
"the",
"specified",
"predicate",
".",
"If",
"the",
"new",
"state",
"does",
"not",
"{",
"@code",
".",
"equals",
"()",
"}",
"the",
"current",
"state",
"listeners",
"and",
"waiters",
"will"... | train | https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-main/src/main/java/com/facebook/presto/execution/StateMachine.java#L139-L163 |
jbibtex/jbibtex | src/main/java/org/jbibtex/KeyMap.java | KeyMap.putIfMissing | boolean putIfMissing(Key key, V value) {
"""
@return <code>true</code> If the {@link #keySet() key set} of the map was modified, <code>false</code> otherwise.
@see #removeIfPresent(Key)
"""
if(containsKey(key)){
return false;
}
put(key, value);
return true;
} | java | boolean putIfMissing(Key key, V value){
if(containsKey(key)){
return false;
}
put(key, value);
return true;
} | [
"boolean",
"putIfMissing",
"(",
"Key",
"key",
",",
"V",
"value",
")",
"{",
"if",
"(",
"containsKey",
"(",
"key",
")",
")",
"{",
"return",
"false",
";",
"}",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"true",
";",
"}"
] | @return <code>true</code> If the {@link #keySet() key set} of the map was modified, <code>false</code> otherwise.
@see #removeIfPresent(Key) | [
"@return",
"<code",
">",
"true<",
"/",
"code",
">",
"If",
"the",
"{",
"@link",
"#keySet",
"()",
"key",
"set",
"}",
"of",
"the",
"map",
"was",
"modified",
"<code",
">",
"false<",
"/",
"code",
">",
"otherwise",
"."
] | train | https://github.com/jbibtex/jbibtex/blob/459c719861c5e92617b91b10ac6888a7b7e5716b/src/main/java/org/jbibtex/KeyMap.java#L15-L24 |
stevespringett/Alpine | alpine/src/main/java/alpine/filters/BlacklistUrlFilter.java | BlacklistUrlFilter.doFilter | public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)
throws IOException, ServletException {
"""
Check for denied or ignored URLs being requested.
@param request The request object.
@param response The response object.
@param chain Refers to th... | java | public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)
throws IOException, ServletException {
final HttpServletRequest req = (HttpServletRequest) request;
final HttpServletResponse res = (HttpServletResponse) response;
final Stri... | [
"public",
"void",
"doFilter",
"(",
"final",
"ServletRequest",
"request",
",",
"final",
"ServletResponse",
"response",
",",
"final",
"FilterChain",
"chain",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"final",
"HttpServletRequest",
"req",
"=",
"(",
... | Check for denied or ignored URLs being requested.
@param request The request object.
@param response The response object.
@param chain Refers to the {@code FilterChain} object to pass control to the next {@code Filter}.
@throws IOException a IOException
@throws ServletException a ServletException | [
"Check",
"for",
"denied",
"or",
"ignored",
"URLs",
"being",
"requested",
"."
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/filters/BlacklistUrlFilter.java#L100-L122 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.writeByteArray | protected void writeByteArray(ObjectOutput output, byte[] data) throws IOException {
"""
Write information for the input data to the output stream. If the input
data is null or empty, this will write a -1 length marker.
@param output
@param data
@throws IOException
"""
if (null == data || 0 == da... | java | protected void writeByteArray(ObjectOutput output, byte[] data) throws IOException {
if (null == data || 0 == data.length) {
output.writeInt(-1);
} else {
output.writeInt(data.length);
output.write(data);
}
} | [
"protected",
"void",
"writeByteArray",
"(",
"ObjectOutput",
"output",
",",
"byte",
"[",
"]",
"data",
")",
"throws",
"IOException",
"{",
"if",
"(",
"null",
"==",
"data",
"||",
"0",
"==",
"data",
".",
"length",
")",
"{",
"output",
".",
"writeInt",
"(",
"... | Write information for the input data to the output stream. If the input
data is null or empty, this will write a -1 length marker.
@param output
@param data
@throws IOException | [
"Write",
"information",
"for",
"the",
"input",
"data",
"to",
"the",
"output",
"stream",
".",
"If",
"the",
"input",
"data",
"is",
"null",
"or",
"empty",
"this",
"will",
"write",
"a",
"-",
"1",
"length",
"marker",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L713-L720 |
google/closure-templates | java/src/com/google/template/soy/soytree/SoyTreeUtils.java | SoyTreeUtils.getNodeAsHtmlTagNode | public static HtmlTagNode getNodeAsHtmlTagNode(SoyNode node, boolean openTag) {
"""
Returns the node as an HTML tag node, if one can be extracted from it (e.g. wrapped in a
MsgPlaceholderNode). Otherwise, returns null.
"""
SoyNode.Kind tagKind =
openTag ? SoyNode.Kind.HTML_OPEN_TAG_NODE : SoyNode.... | java | public static HtmlTagNode getNodeAsHtmlTagNode(SoyNode node, boolean openTag) {
SoyNode.Kind tagKind =
openTag ? SoyNode.Kind.HTML_OPEN_TAG_NODE : SoyNode.Kind.HTML_CLOSE_TAG_NODE;
if (node.getKind() == tagKind) {
return (HtmlTagNode) node;
}
// In a msg tag it will be a placeholder, wrapp... | [
"public",
"static",
"HtmlTagNode",
"getNodeAsHtmlTagNode",
"(",
"SoyNode",
"node",
",",
"boolean",
"openTag",
")",
"{",
"SoyNode",
".",
"Kind",
"tagKind",
"=",
"openTag",
"?",
"SoyNode",
".",
"Kind",
".",
"HTML_OPEN_TAG_NODE",
":",
"SoyNode",
".",
"Kind",
".",... | Returns the node as an HTML tag node, if one can be extracted from it (e.g. wrapped in a
MsgPlaceholderNode). Otherwise, returns null. | [
"Returns",
"the",
"node",
"as",
"an",
"HTML",
"tag",
"node",
"if",
"one",
"can",
"be",
"extracted",
"from",
"it",
"(",
"e",
".",
"g",
".",
"wrapped",
"in",
"a",
"MsgPlaceholderNode",
")",
".",
"Otherwise",
"returns",
"null",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/soytree/SoyTreeUtils.java#L423-L441 |
googleads/googleads-java-lib | modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/utils/v201902/DateTimes.java | DateTimes.toDateTime | public static DateTime toDateTime(Instant instant, String timeZoneId) {
"""
Converts an {@code Instant} object to an API date time in the time zone supplied.
"""
return dateTimesHelper.toDateTime(instant, timeZoneId);
} | java | public static DateTime toDateTime(Instant instant, String timeZoneId) {
return dateTimesHelper.toDateTime(instant, timeZoneId);
} | [
"public",
"static",
"DateTime",
"toDateTime",
"(",
"Instant",
"instant",
",",
"String",
"timeZoneId",
")",
"{",
"return",
"dateTimesHelper",
".",
"toDateTime",
"(",
"instant",
",",
"timeZoneId",
")",
";",
"}"
] | Converts an {@code Instant} object to an API date time in the time zone supplied. | [
"Converts",
"an",
"{"
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/dfp_axis/src/main/java/com/google/api/ads/admanager/axis/utils/v201902/DateTimes.java#L39-L41 |
openbase/jul | extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/MetaConfigProcessor.java | MetaConfigProcessor.getValue | public static String getValue(final MetaConfig metaConfig, final String key) throws NotAvailableException {
"""
Resolves the key to the value entry of the given meta config.
@param metaConfig key value set
@param key the key to resolve
@return the related value of the given key.
@throws org.openbase.jul.exce... | java | public static String getValue(final MetaConfig metaConfig, final String key) throws NotAvailableException {
for (EntryType.Entry entry : metaConfig.getEntryList()) {
if (entry.getKey().equals(key)) {
if (!entry.getValue().isEmpty()) {
return entry.getValue();
... | [
"public",
"static",
"String",
"getValue",
"(",
"final",
"MetaConfig",
"metaConfig",
",",
"final",
"String",
"key",
")",
"throws",
"NotAvailableException",
"{",
"for",
"(",
"EntryType",
".",
"Entry",
"entry",
":",
"metaConfig",
".",
"getEntryList",
"(",
")",
")... | Resolves the key to the value entry of the given meta config.
@param metaConfig key value set
@param key the key to resolve
@return the related value of the given key.
@throws org.openbase.jul.exception.NotAvailableException si thrown if not value for the given key could be resolved. | [
"Resolves",
"the",
"key",
"to",
"the",
"value",
"entry",
"of",
"the",
"given",
"meta",
"config",
"."
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/MetaConfigProcessor.java#L46-L55 |
apiman/apiman | manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java | EsMarshalling.unmarshallOrganization | public static OrganizationBean unmarshallOrganization(Map<String, Object> source) {
"""
Unmarshals the given map source into a bean.
@param source the source
@return the organization
"""
if (source == null) {
return null;
}
OrganizationBean bean = new OrganizationBean();
... | java | public static OrganizationBean unmarshallOrganization(Map<String, Object> source) {
if (source == null) {
return null;
}
OrganizationBean bean = new OrganizationBean();
bean.setId(asString(source.get("id")));
bean.setName(asString(source.get("name")));
bean.se... | [
"public",
"static",
"OrganizationBean",
"unmarshallOrganization",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"source",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"OrganizationBean",
"bean",
"=",
"new",
"Organizatio... | Unmarshals the given map source into a bean.
@param source the source
@return the organization | [
"Unmarshals",
"the",
"given",
"map",
"source",
"into",
"a",
"bean",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/es/src/main/java/io/apiman/manager/api/es/EsMarshalling.java#L1152-L1166 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cdn_dedicated_serviceName_cacheRule_GET | public ArrayList<String> cdn_dedicated_serviceName_cacheRule_GET(String serviceName, OvhOrderCacheRuleEnum cacheRule) throws IOException {
"""
Get allowed durations for 'cacheRule' option
REST: GET /order/cdn/dedicated/{serviceName}/cacheRule
@param cacheRule [required] cache rule upgrade option to 100 or 1000... | java | public ArrayList<String> cdn_dedicated_serviceName_cacheRule_GET(String serviceName, OvhOrderCacheRuleEnum cacheRule) throws IOException {
String qPath = "/order/cdn/dedicated/{serviceName}/cacheRule";
StringBuilder sb = path(qPath, serviceName);
query(sb, "cacheRule", cacheRule);
String resp = exec(qPath, "GET... | [
"public",
"ArrayList",
"<",
"String",
">",
"cdn_dedicated_serviceName_cacheRule_GET",
"(",
"String",
"serviceName",
",",
"OvhOrderCacheRuleEnum",
"cacheRule",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cdn/dedicated/{serviceName}/cacheRule\"",
";",
... | Get allowed durations for 'cacheRule' option
REST: GET /order/cdn/dedicated/{serviceName}/cacheRule
@param cacheRule [required] cache rule upgrade option to 100 or 1000
@param serviceName [required] The internal name of your CDN offer | [
"Get",
"allowed",
"durations",
"for",
"cacheRule",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L5309-L5315 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/ssh/JschUtil.java | JschUtil.openAndBindPortToLocal | public static int openAndBindPortToLocal(Connector sshConn, String remoteHost, int remotePort) throws JschRuntimeException {
"""
打开SSH会话,并绑定远程端口到本地的一个随机端口
@param sshConn SSH连接信息对象
@param remoteHost 远程主机
@param remotePort 远程端口
@return 映射后的本地端口
@throws JschRuntimeException 连接异常
"""
final Session sessio... | java | public static int openAndBindPortToLocal(Connector sshConn, String remoteHost, int remotePort) throws JschRuntimeException {
final Session session = openSession(sshConn.getHost(), sshConn.getPort(), sshConn.getUser(), sshConn.getPassword());
if (session == null) {
throw new JschRuntimeException("Error to crea... | [
"public",
"static",
"int",
"openAndBindPortToLocal",
"(",
"Connector",
"sshConn",
",",
"String",
"remoteHost",
",",
"int",
"remotePort",
")",
"throws",
"JschRuntimeException",
"{",
"final",
"Session",
"session",
"=",
"openSession",
"(",
"sshConn",
".",
"getHost",
... | 打开SSH会话,并绑定远程端口到本地的一个随机端口
@param sshConn SSH连接信息对象
@param remoteHost 远程主机
@param remotePort 远程端口
@return 映射后的本地端口
@throws JschRuntimeException 连接异常 | [
"打开SSH会话,并绑定远程端口到本地的一个随机端口"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/ssh/JschUtil.java#L153-L161 |
eurekaclinical/javautil | src/main/java/org/arp/javautil/collections/Collections.java | Collections.putList | public static <K, V> void putList(Map<K, List<V>> map, K key, V valueElt) {
"""
Puts a value into a map of key -> list of values. If the specified key
is new, it creates an {@link ArrayList} as its value.
@param map a {@link Map}.
@param key a key.
@param valueElt a value.
"""
if (map.containsKey(k... | java | public static <K, V> void putList(Map<K, List<V>> map, K key, V valueElt) {
if (map.containsKey(key)) {
List<V> l = map.get(key);
l.add(valueElt);
} else {
List<V> l = new ArrayList<>();
l.add(valueElt);
map.put(key, l);
}
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"void",
"putList",
"(",
"Map",
"<",
"K",
",",
"List",
"<",
"V",
">",
">",
"map",
",",
"K",
"key",
",",
"V",
"valueElt",
")",
"{",
"if",
"(",
"map",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
... | Puts a value into a map of key -> list of values. If the specified key
is new, it creates an {@link ArrayList} as its value.
@param map a {@link Map}.
@param key a key.
@param valueElt a value. | [
"Puts",
"a",
"value",
"into",
"a",
"map",
"of",
"key",
"-",
">",
"list",
"of",
"values",
".",
"If",
"the",
"specified",
"key",
"is",
"new",
"it",
"creates",
"an",
"{"
] | train | https://github.com/eurekaclinical/javautil/blob/779bbc5bf096c75f8eed4f99ca45b99c1d44df43/src/main/java/org/arp/javautil/collections/Collections.java#L49-L58 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ManagedClustersInner.java | ManagedClustersInner.listClusterAdminCredentials | public CredentialResultsInner listClusterAdminCredentials(String resourceGroupName, String resourceName) {
"""
Gets cluster admin credential of a managed cluster.
Gets cluster admin credential of the managed cluster with a specified resource group and name.
@param resourceGroupName The name of the resource gro... | java | public CredentialResultsInner listClusterAdminCredentials(String resourceGroupName, String resourceName) {
return listClusterAdminCredentialsWithServiceResponseAsync(resourceGroupName, resourceName).toBlocking().single().body();
} | [
"public",
"CredentialResultsInner",
"listClusterAdminCredentials",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"listClusterAdminCredentialsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
")",
".",
"toBlocking"... | Gets cluster admin credential of a managed cluster.
Gets cluster admin credential of the managed cluster with a specified resource group and name.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the managed cluster resource.
@throws IllegalArgumentException thrown if parameters... | [
"Gets",
"cluster",
"admin",
"credential",
"of",
"a",
"managed",
"cluster",
".",
"Gets",
"cluster",
"admin",
"credential",
"of",
"the",
"managed",
"cluster",
"with",
"a",
"specified",
"resource",
"group",
"and",
"name",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ManagedClustersInner.java#L573-L575 |
mongodb/stitch-android-sdk | server/services/mongodb-remote/src/main/java/com/mongodb/stitch/server/services/mongodb/remote/internal/RemoteMongoCollectionImpl.java | RemoteMongoCollectionImpl.updateMany | public RemoteUpdateResult updateMany(final Bson filter, final Bson update) {
"""
Update all documents in the collection according to the specified arguments.
@param filter a document describing the query filter, which may not be null.
@param update a document describing the update, which may not be null. The u... | java | public RemoteUpdateResult updateMany(final Bson filter, final Bson update) {
return proxy.updateMany(filter, update);
} | [
"public",
"RemoteUpdateResult",
"updateMany",
"(",
"final",
"Bson",
"filter",
",",
"final",
"Bson",
"update",
")",
"{",
"return",
"proxy",
".",
"updateMany",
"(",
"filter",
",",
"update",
")",
";",
"}"
] | Update all documents in the collection according to the specified arguments.
@param filter a document describing the query filter, which may not be null.
@param update a document describing the update, which may not be null. The update to apply
must include only update operators.
@return the result of the update many ... | [
"Update",
"all",
"documents",
"in",
"the",
"collection",
"according",
"to",
"the",
"specified",
"arguments",
"."
] | train | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/server/services/mongodb-remote/src/main/java/com/mongodb/stitch/server/services/mongodb/remote/internal/RemoteMongoCollectionImpl.java#L340-L342 |
facebookarchive/hadoop-20 | src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java | FairScheduler.updateFairShares | private void updateFairShares(double totalSlots, final TaskType type) {
"""
Update fairshare for each JobInfo based on the weight, neededTasks and
minTasks and the size of the pool. We compute the share by finding the
ratio of (# of slots / weight) using binary search.
"""
// Find the proper ratio of (# ... | java | private void updateFairShares(double totalSlots, final TaskType type) {
// Find the proper ratio of (# of slots share / weight) by bineary search
BinarySearcher searcher = new BinarySearcher() {
@Override
double targetFunction(double x) {
return slotsUsedWithWeightToSlotRatio(x, type);
... | [
"private",
"void",
"updateFairShares",
"(",
"double",
"totalSlots",
",",
"final",
"TaskType",
"type",
")",
"{",
"// Find the proper ratio of (# of slots share / weight) by bineary search",
"BinarySearcher",
"searcher",
"=",
"new",
"BinarySearcher",
"(",
")",
"{",
"@",
"Ov... | Update fairshare for each JobInfo based on the weight, neededTasks and
minTasks and the size of the pool. We compute the share by finding the
ratio of (# of slots / weight) using binary search. | [
"Update",
"fairshare",
"for",
"each",
"JobInfo",
"based",
"on",
"the",
"weight",
"neededTasks",
"and",
"minTasks",
"and",
"the",
"size",
"of",
"the",
"pool",
".",
"We",
"compute",
"the",
"share",
"by",
"finding",
"the",
"ratio",
"of",
"(",
"#",
"of",
"sl... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/FairScheduler.java#L1939-L1958 |
kmi/iserve | iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/Util.java | Util.getUrlValueFromRow | private static URL getUrlValueFromRow(QuerySolution resultRow, String variableName) {
"""
Given a query result from a SPARQL query, obtain the given variable value
as a URL
@param resultRow the result from a SPARQL query
@param variableName the name of the variable to obtain
@return the value or null if i... | java | private static URL getUrlValueFromRow(QuerySolution resultRow, String variableName) {
// Check the input and exit immediately if null
if (resultRow == null) {
return null;
}
URL result = null;
Resource res = resultRow.getResource(variableName);
// Ignore and... | [
"private",
"static",
"URL",
"getUrlValueFromRow",
"(",
"QuerySolution",
"resultRow",
",",
"String",
"variableName",
")",
"{",
"// Check the input and exit immediately if null",
"if",
"(",
"resultRow",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"URL",
"resul... | Given a query result from a SPARQL query, obtain the given variable value
as a URL
@param resultRow the result from a SPARQL query
@param variableName the name of the variable to obtain
@return the value or null if it could not be obtained | [
"Given",
"a",
"query",
"result",
"from",
"a",
"SPARQL",
"query",
"obtain",
"the",
"given",
"variable",
"value",
"as",
"a",
"URL"
] | train | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-semantic-discovery/src/main/java/uk/ac/open/kmi/iserve/discovery/disco/Util.java#L131-L154 |
Viascom/groundwork | foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/builder/FoxHttpClientBuilder.java | FoxHttpClientBuilder.addFoxHttpAuthorization | public FoxHttpClientBuilder addFoxHttpAuthorization(FoxHttpAuthorizationScope foxHttpAuthorizationScope, FoxHttpAuthorization foxHttpAuthorization) {
"""
Add a Authorization to the AuthorizationStrategy
@param foxHttpAuthorizationScope Scope of the authorization
@param foxHttpAuthorization Authorization i... | java | public FoxHttpClientBuilder addFoxHttpAuthorization(FoxHttpAuthorizationScope foxHttpAuthorizationScope, FoxHttpAuthorization foxHttpAuthorization) {
foxHttpClient.getFoxHttpAuthorizationStrategy().addAuthorization(foxHttpAuthorizationScope, foxHttpAuthorization);
return this;
} | [
"public",
"FoxHttpClientBuilder",
"addFoxHttpAuthorization",
"(",
"FoxHttpAuthorizationScope",
"foxHttpAuthorizationScope",
",",
"FoxHttpAuthorization",
"foxHttpAuthorization",
")",
"{",
"foxHttpClient",
".",
"getFoxHttpAuthorizationStrategy",
"(",
")",
".",
"addAuthorization",
"... | Add a Authorization to the AuthorizationStrategy
@param foxHttpAuthorizationScope Scope of the authorization
@param foxHttpAuthorization Authorization itself
@return FoxHttpClientBuilder (this) | [
"Add",
"a",
"Authorization",
"to",
"the",
"AuthorizationStrategy"
] | train | https://github.com/Viascom/groundwork/blob/d3f7d0df65e2e75861fc7db938090683f2cdf919/foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/builder/FoxHttpClientBuilder.java#L213-L216 |
h2oai/h2o-3 | h2o-genmodel/src/main/java/hex/genmodel/utils/GenmodelBitSet.java | GenmodelBitSet.fill_1 | public void fill_1(byte[] v, int byteoff, int nbits, int bitoff) {
"""
/* SET IN STONE FOR MOJO VERSION "1.10" AND OLDER - DO NOT CHANGE
"""
if (nbits < 0) throw new NegativeArraySizeException("nbits < 0: " + nbits);
if (byteoff < 0) throw new IndexOutOfBoundsException("byteoff < 0: "+ byteoff);
... | java | public void fill_1(byte[] v, int byteoff, int nbits, int bitoff) {
if (nbits < 0) throw new NegativeArraySizeException("nbits < 0: " + nbits);
if (byteoff < 0) throw new IndexOutOfBoundsException("byteoff < 0: "+ byteoff);
if (bitoff < 0) throw new IndexOutOfBoundsException("bitoff < 0: " + bitoff);
... | [
"public",
"void",
"fill_1",
"(",
"byte",
"[",
"]",
"v",
",",
"int",
"byteoff",
",",
"int",
"nbits",
",",
"int",
"bitoff",
")",
"{",
"if",
"(",
"nbits",
"<",
"0",
")",
"throw",
"new",
"NegativeArraySizeException",
"(",
"\"nbits < 0: \"",
"+",
"nbits",
"... | /* SET IN STONE FOR MOJO VERSION "1.10" AND OLDER - DO NOT CHANGE | [
"/",
"*",
"SET",
"IN",
"STONE",
"FOR",
"MOJO",
"VERSION",
"1",
".",
"10",
"AND",
"OLDER",
"-",
"DO",
"NOT",
"CHANGE"
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/utils/GenmodelBitSet.java#L86-L95 |
stripe/stripe-java | src/main/java/com/stripe/model/Account.java | Account.persons | public PersonCollection persons(Map<String, Object> params, RequestOptions options)
throws StripeException {
"""
Returns a list of people associated with the account’s legal entity. The people are returned
sorted by creation date, with the most recent people appearing first.
"""
String url =
... | java | public PersonCollection persons(Map<String, Object> params, RequestOptions options)
throws StripeException {
String url =
String.format(
"%s%s",
Stripe.getApiBase(),
String.format("/v1/accounts/%s/persons", ApiResource.urlEncodeId(this.getId())));
return request... | [
"public",
"PersonCollection",
"persons",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
",",
"RequestOptions",
"options",
")",
"throws",
"StripeException",
"{",
"String",
"url",
"=",
"String",
".",
"format",
"(",
"\"%s%s\"",
",",
"Stripe",
".",
"ge... | Returns a list of people associated with the account’s legal entity. The people are returned
sorted by creation date, with the most recent people appearing first. | [
"Returns",
"a",
"list",
"of",
"people",
"associated",
"with",
"the",
"account’s",
"legal",
"entity",
".",
"The",
"people",
"are",
"returned",
"sorted",
"by",
"creation",
"date",
"with",
"the",
"most",
"recent",
"people",
"appearing",
"first",
"."
] | train | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Account.java#L467-L475 |
Netflix/spectator | spectator-ext-ipc/src/jmh/java/com/netflix/spectator/ipc/SeqServerGroup.java | SeqServerGroup.isSequence | private static boolean isSequence(String asg, int dN) {
"""
Check if the last portion of the server group name is a version sequence (v\d+).
"""
int length = asg.length();
if (length - dN < 3 || asg.charAt(dN + 1) != 'v') {
return false;
}
for (int i = dN + 2; i < length; ++i) {
if ... | java | private static boolean isSequence(String asg, int dN) {
int length = asg.length();
if (length - dN < 3 || asg.charAt(dN + 1) != 'v') {
return false;
}
for (int i = dN + 2; i < length; ++i) {
if (!Character.isDigit(asg.charAt(i))) {
return false;
}
}
return true;
} | [
"private",
"static",
"boolean",
"isSequence",
"(",
"String",
"asg",
",",
"int",
"dN",
")",
"{",
"int",
"length",
"=",
"asg",
".",
"length",
"(",
")",
";",
"if",
"(",
"length",
"-",
"dN",
"<",
"3",
"||",
"asg",
".",
"charAt",
"(",
"dN",
"+",
"1",
... | Check if the last portion of the server group name is a version sequence (v\d+). | [
"Check",
"if",
"the",
"last",
"portion",
"of",
"the",
"server",
"group",
"name",
"is",
"a",
"version",
"sequence",
"(",
"v",
"\\",
"d",
"+",
")",
"."
] | train | https://github.com/Netflix/spectator/blob/259318252770de3bad581b85adff187d8f2c6537/spectator-ext-ipc/src/jmh/java/com/netflix/spectator/ipc/SeqServerGroup.java#L47-L58 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/dispatcher/DataContextUtils.java | DataContextUtils.replaceDataReferencesInArray | public static String[] replaceDataReferencesInArray(final String[] args, final Map<String, Map<String, String>> data) {
"""
Replace the embedded properties of the form '${key.name}' in the input Strings with the value from the data
context
@param args argument string array
@param data data context
@return... | java | public static String[] replaceDataReferencesInArray(final String[] args, final Map<String, Map<String, String>> data) {
return replaceDataReferencesInArray(args, data, null, false);
} | [
"public",
"static",
"String",
"[",
"]",
"replaceDataReferencesInArray",
"(",
"final",
"String",
"[",
"]",
"args",
",",
"final",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"String",
">",
">",
"data",
")",
"{",
"return",
"replaceDataReferencesInArra... | Replace the embedded properties of the form '${key.name}' in the input Strings with the value from the data
context
@param args argument string array
@param data data context
@return string array with replaced embedded properties | [
"Replace",
"the",
"embedded",
"properties",
"of",
"the",
"form",
"$",
"{",
"key",
".",
"name",
"}",
"in",
"the",
"input",
"Strings",
"with",
"the",
"value",
"from",
"the",
"data",
"context"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/dispatcher/DataContextUtils.java#L379-L381 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getPvPAmuletInfo | public void getPvPAmuletInfo(int[] ids, Callback<List<PvPAmulet>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on pvp amulets API go <a href="https://wiki.guildwars2.com/wiki/API:2/pvp/amulets">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and ... | java | public void getPvPAmuletInfo(int[] ids, Callback<List<PvPAmulet>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getPvPAmuletInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback);
} | [
"public",
"void",
"getPvPAmuletInfo",
"(",
"int",
"[",
"]",
"ids",
",",
"Callback",
"<",
"List",
"<",
"PvPAmulet",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"i... | For more info on pvp amulets API go <a href="https://wiki.guildwars2.com/wiki/API:2/pvp/amulets">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param ids list of amulet id
@param callback callback t... | [
"For",
"more",
"info",
"on",
"pvp",
"amulets",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"pvp",
"/",
"amulets",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L2021-L2024 |
opencb/biodata | biodata-tools/src/main/java/org/opencb/biodata/tools/alignment/BamManager.java | BamManager.query | public List<SAMRecord> query(AlignmentFilters<SAMRecord> filters) throws IOException {
"""
/*
These methods aim to provide a very simple, safe and quick way of accessing to a small fragment of the BAM/CRAM file.
This must not be used in production for reading big data files. It returns a maximum of 50,000 SAM re... | java | public List<SAMRecord> query(AlignmentFilters<SAMRecord> filters) throws IOException {
return query(null, filters, null, SAMRecord.class);
} | [
"public",
"List",
"<",
"SAMRecord",
">",
"query",
"(",
"AlignmentFilters",
"<",
"SAMRecord",
">",
"filters",
")",
"throws",
"IOException",
"{",
"return",
"query",
"(",
"null",
",",
"filters",
",",
"null",
",",
"SAMRecord",
".",
"class",
")",
";",
"}"
] | /*
These methods aim to provide a very simple, safe and quick way of accessing to a small fragment of the BAM/CRAM file.
This must not be used in production for reading big data files. It returns a maximum of 50,000 SAM records,
you can use iterator methods for reading more reads. | [
"/",
"*",
"These",
"methods",
"aim",
"to",
"provide",
"a",
"very",
"simple",
"safe",
"and",
"quick",
"way",
"of",
"accessing",
"to",
"a",
"small",
"fragment",
"of",
"the",
"BAM",
"/",
"CRAM",
"file",
".",
"This",
"must",
"not",
"be",
"used",
"in",
"p... | train | https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/alignment/BamManager.java#L172-L174 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java | MultiIndex.doUpdateOffline | private void doUpdateOffline(final Collection<String> remove, final Collection<Document> add) throws IOException {
"""
Performs indexing while re-indexing is in progress
@param remove
@param add
@throws IOException
"""
SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object... | java | private void doUpdateOffline(final Collection<String> remove, final Collection<Document> add) throws IOException
{
SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
for (Iterator<String> it = remove.... | [
"private",
"void",
"doUpdateOffline",
"(",
"final",
"Collection",
"<",
"String",
">",
"remove",
",",
"final",
"Collection",
"<",
"Document",
">",
"add",
")",
"throws",
"IOException",
"{",
"SecurityHelper",
".",
"doPrivilegedIOExceptionAction",
"(",
"new",
"Privile... | Performs indexing while re-indexing is in progress
@param remove
@param add
@throws IOException | [
"Performs",
"indexing",
"while",
"re",
"-",
"indexing",
"is",
"in",
"progress"
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java#L1017-L1045 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/TransformerFactoryImpl.java | TransformerFactoryImpl.getAttribute | public Object getAttribute(String name) throws IllegalArgumentException {
"""
Allows the user to retrieve specific attributes on the underlying
implementation.
@param name The name of the attribute.
@return value The value of the attribute.
@throws IllegalArgumentException thrown if the underlying
impleme... | java | public Object getAttribute(String name) throws IllegalArgumentException
{
if (name.equals(FEATURE_INCREMENTAL))
{
return new Boolean(m_incremental);
}
else if (name.equals(FEATURE_OPTIMIZE))
{
return new Boolean(m_optimize);
}
else if (name.equals(FEATURE_SOURCE_LOC... | [
"public",
"Object",
"getAttribute",
"(",
"String",
"name",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"name",
".",
"equals",
"(",
"FEATURE_INCREMENTAL",
")",
")",
"{",
"return",
"new",
"Boolean",
"(",
"m_incremental",
")",
";",
"}",
"else",
"... | Allows the user to retrieve specific attributes on the underlying
implementation.
@param name The name of the attribute.
@return value The value of the attribute.
@throws IllegalArgumentException thrown if the underlying
implementation doesn't recognize the attribute. | [
"Allows",
"the",
"user",
"to",
"retrieve",
"specific",
"attributes",
"on",
"the",
"underlying",
"implementation",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/TransformerFactoryImpl.java#L594-L610 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.mp.jwt_fat/fat/src/com/ibm/ws/security/mp/jwt/fat/CommonMpJwtFat.java | CommonMpJwtFat.buildAppUrl | public String buildAppUrl(LibertyServer theServer, String root, String app) throws Exception {
"""
Build the http app url
@param theServer - The server where the app is running (used to get the port)
@param root - the root context of the app
@param app - the specific app to run
@return - returns the full url... | java | public String buildAppUrl(LibertyServer theServer, String root, String app) throws Exception {
return SecurityFatHttpUtils.getServerUrlBase(theServer) + root + "/rest/" + app + "/" + MpJwtFatConstants.MPJWT_GENERIC_APP_NAME;
} | [
"public",
"String",
"buildAppUrl",
"(",
"LibertyServer",
"theServer",
",",
"String",
"root",
",",
"String",
"app",
")",
"throws",
"Exception",
"{",
"return",
"SecurityFatHttpUtils",
".",
"getServerUrlBase",
"(",
"theServer",
")",
"+",
"root",
"+",
"\"/rest/\"",
... | Build the http app url
@param theServer - The server where the app is running (used to get the port)
@param root - the root context of the app
@param app - the specific app to run
@return - returns the full url to invoke
@throws Exception | [
"Build",
"the",
"http",
"app",
"url"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.mp.jwt_fat/fat/src/com/ibm/ws/security/mp/jwt/fat/CommonMpJwtFat.java#L129-L133 |
threerings/narya | core/src/main/java/com/threerings/presents/dobj/DObject.java | DObject.requestEntryRemove | protected <T extends DSet.Entry> void requestEntryRemove (
String name, DSet<T> set, Comparable<?> key) {
"""
Calls by derived instances when a set remover method was called.
"""
// if we're on the authoritative server, we update the set immediately
T oldEntry = null;
if (isAuth... | java | protected <T extends DSet.Entry> void requestEntryRemove (
String name, DSet<T> set, Comparable<?> key)
{
// if we're on the authoritative server, we update the set immediately
T oldEntry = null;
if (isAuthoritative()) {
oldEntry = set.removeKey(key);
if (oldE... | [
"protected",
"<",
"T",
"extends",
"DSet",
".",
"Entry",
">",
"void",
"requestEntryRemove",
"(",
"String",
"name",
",",
"DSet",
"<",
"T",
">",
"set",
",",
"Comparable",
"<",
"?",
">",
"key",
")",
"{",
"// if we're on the authoritative server, we update the set im... | Calls by derived instances when a set remover method was called. | [
"Calls",
"by",
"derived",
"instances",
"when",
"a",
"set",
"remover",
"method",
"was",
"called",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L904-L918 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/IntCounter.java | IntCounter.incrementCount | public int incrementCount(E key, int count) {
"""
Adds the given count to the current count for the given key. If the key
hasn't been seen before, it is assumed to have count 0, and thus this
method will set its count to the given amount. Negative increments are
equivalent to calling <tt>decrementCount</tt>.
<... | java | public int incrementCount(E key, int count) {
if (tempMInteger == null) {
tempMInteger = new MutableInteger();
}
MutableInteger oldMInteger = map.put(key, tempMInteger);
totalCount += count;
if (oldMInteger != null) {
count += oldMInteger.intValue();
}
tempMInteger.set... | [
"public",
"int",
"incrementCount",
"(",
"E",
"key",
",",
"int",
"count",
")",
"{",
"if",
"(",
"tempMInteger",
"==",
"null",
")",
"{",
"tempMInteger",
"=",
"new",
"MutableInteger",
"(",
")",
";",
"}",
"MutableInteger",
"oldMInteger",
"=",
"map",
".",
"put... | Adds the given count to the current count for the given key. If the key
hasn't been seen before, it is assumed to have count 0, and thus this
method will set its count to the given amount. Negative increments are
equivalent to calling <tt>decrementCount</tt>.
<p/>
To more conveniently increment the count by 1, use
{@li... | [
"Adds",
"the",
"given",
"count",
"to",
"the",
"current",
"count",
"for",
"the",
"given",
"key",
".",
"If",
"the",
"key",
"hasn",
"t",
"been",
"seen",
"before",
"it",
"is",
"assumed",
"to",
"have",
"count",
"0",
"and",
"thus",
"this",
"method",
"will",
... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/IntCounter.java#L236-L250 |
samskivert/samskivert | src/main/java/com/samskivert/servlet/util/ParameterUtil.java | ParameterUtil.parameterEquals | public static boolean parameterEquals (HttpServletRequest req, String name, String value) {
"""
Returns true if the specified parameter is equal to the supplied value. If the parameter is
not set in the request, false is returned.
@param name The parameter whose value should be compared with the supplied value... | java | public static boolean parameterEquals (HttpServletRequest req, String name, String value)
{
return value.equals(getParameter(req, name, false));
} | [
"public",
"static",
"boolean",
"parameterEquals",
"(",
"HttpServletRequest",
"req",
",",
"String",
"name",
",",
"String",
"value",
")",
"{",
"return",
"value",
".",
"equals",
"(",
"getParameter",
"(",
"req",
",",
"name",
",",
"false",
")",
")",
";",
"}"
] | Returns true if the specified parameter is equal to the supplied value. If the parameter is
not set in the request, false is returned.
@param name The parameter whose value should be compared with the supplied value.
@param value The value to which the parameter may be equal. This should not be null.
@return true if ... | [
"Returns",
"true",
"if",
"the",
"specified",
"parameter",
"is",
"equal",
"to",
"the",
"supplied",
"value",
".",
"If",
"the",
"parameter",
"is",
"not",
"set",
"in",
"the",
"request",
"false",
"is",
"returned",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/util/ParameterUtil.java#L315-L318 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java | ComputationGraph.scoreExamples | public INDArray scoreExamples(MultiDataSet dataSet, boolean addRegularizationTerms) {
"""
Calculate the score for each example in a DataSet individually. Unlike {@link #score(MultiDataSet)} and {@link #score(MultiDataSet, boolean)}
this method does not average/sum over examples. This method allows for examples to... | java | public INDArray scoreExamples(MultiDataSet dataSet, boolean addRegularizationTerms) {
try{
return scoreExamplesHelper(dataSet, addRegularizationTerms);
} catch (OutOfMemoryError e){
CrashReportingUtil.writeMemoryCrashDump(this, e);
throw e;
}
} | [
"public",
"INDArray",
"scoreExamples",
"(",
"MultiDataSet",
"dataSet",
",",
"boolean",
"addRegularizationTerms",
")",
"{",
"try",
"{",
"return",
"scoreExamplesHelper",
"(",
"dataSet",
",",
"addRegularizationTerms",
")",
";",
"}",
"catch",
"(",
"OutOfMemoryError",
"e... | Calculate the score for each example in a DataSet individually. Unlike {@link #score(MultiDataSet)} and {@link #score(MultiDataSet, boolean)}
this method does not average/sum over examples. This method allows for examples to be scored individually (at test time only), which
may be useful for example for autoencoder arc... | [
"Calculate",
"the",
"score",
"for",
"each",
"example",
"in",
"a",
"DataSet",
"individually",
".",
"Unlike",
"{",
"@link",
"#score",
"(",
"MultiDataSet",
")",
"}",
"and",
"{",
"@link",
"#score",
"(",
"MultiDataSet",
"boolean",
")",
"}",
"this",
"method",
"d... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java#L3054-L3061 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_TriangleDirection.java | ST_TriangleDirection.computeDirection | public static LineString computeDirection(Geometry geometry) throws IllegalArgumentException {
"""
Compute the main slope direction
@param geometry
@return
@throws IllegalArgumentException
"""
if(geometry == null){
return null;
}
// Convert geometry into triangle
... | java | public static LineString computeDirection(Geometry geometry) throws IllegalArgumentException {
if(geometry == null){
return null;
}
// Convert geometry into triangle
Triangle triangle = TINFeatureFactory.createTriangle(geometry);
// Compute slope vector
Vector... | [
"public",
"static",
"LineString",
"computeDirection",
"(",
"Geometry",
"geometry",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// Convert geometry into triangle",
"Triangle",
"triangle",
... | Compute the main slope direction
@param geometry
@return
@throws IllegalArgumentException | [
"Compute",
"the",
"main",
"slope",
"direction"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/topography/ST_TriangleDirection.java#L55-L87 |
DDTH/ddth-kafka | src/main/java/com/github/ddth/kafka/internal/KafkaMsgConsumer.java | KafkaMsgConsumer._getWorker | private KafkaMsgConsumerWorker _getWorker(String topic, boolean autoCommitOffsets) {
"""
Prepares a worker to consume messages from a Kafka topic.
@param topic
@param autoCommitOffsets
@return
"""
KafkaMsgConsumerWorker worker = topicWorkers.get(topic);
if (worker == null) {
Co... | java | private KafkaMsgConsumerWorker _getWorker(String topic, boolean autoCommitOffsets) {
KafkaMsgConsumerWorker worker = topicWorkers.get(topic);
if (worker == null) {
Collection<IKafkaMessageListener> msgListeners = topicMsgListeners.get(topic);
worker = new KafkaMsgConsumerWorker(t... | [
"private",
"KafkaMsgConsumerWorker",
"_getWorker",
"(",
"String",
"topic",
",",
"boolean",
"autoCommitOffsets",
")",
"{",
"KafkaMsgConsumerWorker",
"worker",
"=",
"topicWorkers",
".",
"get",
"(",
"topic",
")",
";",
"if",
"(",
"worker",
"==",
"null",
")",
"{",
... | Prepares a worker to consume messages from a Kafka topic.
@param topic
@param autoCommitOffsets
@return | [
"Prepares",
"a",
"worker",
"to",
"consume",
"messages",
"from",
"a",
"Kafka",
"topic",
"."
] | train | https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/internal/KafkaMsgConsumer.java#L482-L495 |
mgormley/prim | src/main/java_generated/edu/jhu/prim/arrays/ShortArrays.java | ShortArrays.countCommon | public static short countCommon(short[] indices1, short[] indices2) {
"""
Counts the number of indices that appear in both arrays.
@param indices1 Sorted array of indices.
@param indices2 Sorted array of indices.
"""
short numCommonIndices = 0;
int i = 0;
int j = 0;
while (i... | java | public static short countCommon(short[] indices1, short[] indices2) {
short numCommonIndices = 0;
int i = 0;
int j = 0;
while (i < indices1.length && j < indices2.length) {
if (indices1[i] < indices2[j]) {
i++;
} else if (indices2[j] < indices1[i])... | [
"public",
"static",
"short",
"countCommon",
"(",
"short",
"[",
"]",
"indices1",
",",
"short",
"[",
"]",
"indices2",
")",
"{",
"short",
"numCommonIndices",
"=",
"0",
";",
"int",
"i",
"=",
"0",
";",
"int",
"j",
"=",
"0",
";",
"while",
"(",
"i",
"<",
... | Counts the number of indices that appear in both arrays.
@param indices1 Sorted array of indices.
@param indices2 Sorted array of indices. | [
"Counts",
"the",
"number",
"of",
"indices",
"that",
"appear",
"in",
"both",
"arrays",
"."
] | train | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java_generated/edu/jhu/prim/arrays/ShortArrays.java#L215-L238 |
alkacon/opencms-core | src/org/opencms/ui/apps/cacheadmin/CmsImageCacheHolder.java | CmsImageCacheHolder.visitImage | private void visitImage(CmsObject cms, File f) {
"""
Visits a single image.<p>
@param cms CmsObject
@param f a File to be read out
"""
f.length();
String oName = f.getAbsolutePath().substring(CmsImageLoader.getImageRepositoryPath().length());
oName = getVFSName(cms, oName);
... | java | private void visitImage(CmsObject cms, File f) {
f.length();
String oName = f.getAbsolutePath().substring(CmsImageLoader.getImageRepositoryPath().length());
oName = getVFSName(cms, oName);
List files = (List)m_filePaths.get(oName);
if (files == null) {
files = new A... | [
"private",
"void",
"visitImage",
"(",
"CmsObject",
"cms",
",",
"File",
"f",
")",
"{",
"f",
".",
"length",
"(",
")",
";",
"String",
"oName",
"=",
"f",
".",
"getAbsolutePath",
"(",
")",
".",
"substring",
"(",
"CmsImageLoader",
".",
"getImageRepositoryPath",
... | Visits a single image.<p>
@param cms CmsObject
@param f a File to be read out | [
"Visits",
"a",
"single",
"image",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/cacheadmin/CmsImageCacheHolder.java#L252-L274 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/webhook/WebhookMessageBuilder.java | WebhookMessageBuilder.addFile | public WebhookMessageBuilder addFile(String name, InputStream data) {
"""
Adds the provided file to the resulting message.
@param name
The name to use for this file
@param data
The file data to add
@throws IllegalArgumentException
If the provided name or data is null
@throws IllegalStateException
If ... | java | public WebhookMessageBuilder addFile(String name, InputStream data)
{
Checks.notNull(data, "InputStream");
Checks.notBlank(name, "Name");
if (fileIndex >= MAX_FILES)
throw new IllegalStateException("Cannot add more than " + MAX_FILES + " attachments to a message");
try
... | [
"public",
"WebhookMessageBuilder",
"addFile",
"(",
"String",
"name",
",",
"InputStream",
"data",
")",
"{",
"Checks",
".",
"notNull",
"(",
"data",
",",
"\"InputStream\"",
")",
";",
"Checks",
".",
"notBlank",
"(",
"name",
",",
"\"Name\"",
")",
";",
"if",
"("... | Adds the provided file to the resulting message.
@param name
The name to use for this file
@param data
The file data to add
@throws IllegalArgumentException
If the provided name or data is null
@throws IllegalStateException
If the file limit has already been reached
@return The current WebhookMessageBuilder for ch... | [
"Adds",
"the",
"provided",
"file",
"to",
"the",
"resulting",
"message",
"."
] | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/webhook/WebhookMessageBuilder.java#L372-L389 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/clause/UpdateForClause.java | UpdateForClause.forIn | public static UpdateForClause forIn(String variable, String path) {
"""
Creates an updateFor clause that starts with <code>FOR variable IN path</code>.
@param variable the first variable in the clause.
@param path the first path in the clause, an IN path.
@return the clause, for chaining. See {@link #when(Expre... | java | public static UpdateForClause forIn(String variable, String path) {
UpdateForClause clause = new UpdateForClause();
return clause.in(variable, path);
} | [
"public",
"static",
"UpdateForClause",
"forIn",
"(",
"String",
"variable",
",",
"String",
"path",
")",
"{",
"UpdateForClause",
"clause",
"=",
"new",
"UpdateForClause",
"(",
")",
";",
"return",
"clause",
".",
"in",
"(",
"variable",
",",
"path",
")",
";",
"}... | Creates an updateFor clause that starts with <code>FOR variable IN path</code>.
@param variable the first variable in the clause.
@param path the first path in the clause, an IN path.
@return the clause, for chaining. See {@link #when(Expression)} and {@link #end()} to complete the clause. | [
"Creates",
"an",
"updateFor",
"clause",
"that",
"starts",
"with",
"<code",
">",
"FOR",
"variable",
"IN",
"path<",
"/",
"code",
">",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/clause/UpdateForClause.java#L47-L50 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java | GeometryUtil.translate2DCentreOfMassTo | public static void translate2DCentreOfMassTo(IAtomContainer atomCon, Point2d p) {
"""
Translates a molecule from the origin to a new point denoted by a vector. See comment for
center(IAtomContainer atomCon, Dimension areaDim, HashMap renderingCoordinates) for details
on coordinate sets
@param atomCon molecule... | java | public static void translate2DCentreOfMassTo(IAtomContainer atomCon, Point2d p) {
Point2d com = get2DCentreOfMass(atomCon);
Vector2d translation = new Vector2d(p.x - com.x, p.y - com.y);
for (IAtom atom : atomCon.atoms()) {
if (atom.getPoint2d() != null) {
atom.getPoi... | [
"public",
"static",
"void",
"translate2DCentreOfMassTo",
"(",
"IAtomContainer",
"atomCon",
",",
"Point2d",
"p",
")",
"{",
"Point2d",
"com",
"=",
"get2DCentreOfMass",
"(",
"atomCon",
")",
";",
"Vector2d",
"translation",
"=",
"new",
"Vector2d",
"(",
"p",
".",
"x... | Translates a molecule from the origin to a new point denoted by a vector. See comment for
center(IAtomContainer atomCon, Dimension areaDim, HashMap renderingCoordinates) for details
on coordinate sets
@param atomCon molecule to be translated
@param p Description of the Parameter | [
"Translates",
"a",
"molecule",
"from",
"the",
"origin",
"to",
"a",
"new",
"point",
"denoted",
"by",
"a",
"vector",
".",
"See",
"comment",
"for",
"center",
"(",
"IAtomContainer",
"atomCon",
"Dimension",
"areaDim",
"HashMap",
"renderingCoordinates",
")",
"for",
... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java#L387-L395 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/search/aggregate/DBEntitySequenceFactory.java | DBEntitySequenceFactory.collectUninitializedEntities | private List<DBEntity> collectUninitializedEntities(DBEntity entity, final String category,
final TableDefinition tableDef, final List<String> fields, final String link, final Map<ObjectID, LinkList> cache, final Set<ObjectID> keys,
final DBEntitySequenceOptions options) {
"""
Collects the entities to be i... | java | private List<DBEntity> collectUninitializedEntities(DBEntity entity, final String category,
final TableDefinition tableDef, final List<String> fields, final String link, final Map<ObjectID, LinkList> cache, final Set<ObjectID> keys,
final DBEntitySequenceOptions options) {
DBEntityCollector collector = new... | [
"private",
"List",
"<",
"DBEntity",
">",
"collectUninitializedEntities",
"(",
"DBEntity",
"entity",
",",
"final",
"String",
"category",
",",
"final",
"TableDefinition",
"tableDef",
",",
"final",
"List",
"<",
"String",
">",
"fields",
",",
"final",
"String",
"link... | Collects the entities to be initialized with the initial list of links using the link list bulk fetch.
Visits all the entities buffered by the iterators of the same category.
@param entity next entity to be returned by the iterator (must be initialized first)
@param category the iterator category that will return th... | [
"Collects",
"the",
"entities",
"to",
"be",
"initialized",
"with",
"the",
"initial",
"list",
"of",
"links",
"using",
"the",
"link",
"list",
"bulk",
"fetch",
".",
"Visits",
"all",
"the",
"entities",
"buffered",
"by",
"the",
"iterators",
"of",
"the",
"same",
... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/search/aggregate/DBEntitySequenceFactory.java#L315-L338 |
deeplearning4j/deeplearning4j | datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java | ArrowConverter.writeRecordBatchTo | public static void writeRecordBatchTo(List<List<Writable>> recordBatch, Schema inputSchema,OutputStream outputStream) {
"""
Write the records to the given output stream
@param recordBatch the record batch to write
@param inputSchema the input schema
@param outputStream the output stream to write to
"""
... | java | public static void writeRecordBatchTo(List<List<Writable>> recordBatch, Schema inputSchema,OutputStream outputStream) {
BufferAllocator bufferAllocator = new RootAllocator(Long.MAX_VALUE);
writeRecordBatchTo(bufferAllocator,recordBatch,inputSchema,outputStream);
} | [
"public",
"static",
"void",
"writeRecordBatchTo",
"(",
"List",
"<",
"List",
"<",
"Writable",
">",
">",
"recordBatch",
",",
"Schema",
"inputSchema",
",",
"OutputStream",
"outputStream",
")",
"{",
"BufferAllocator",
"bufferAllocator",
"=",
"new",
"RootAllocator",
"(... | Write the records to the given output stream
@param recordBatch the record batch to write
@param inputSchema the input schema
@param outputStream the output stream to write to | [
"Write",
"the",
"records",
"to",
"the",
"given",
"output",
"stream"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java#L265-L268 |
RoaringBitmap/RoaringBitmap | roaringbitmap/src/main/java/org/roaringbitmap/buffer/BufferUtil.java | BufferUtil.resetBitmapRange | public static void resetBitmapRange(LongBuffer bitmap, int start, int end) {
"""
clear bits at start, start+1,..., end-1
@param bitmap array of words to be modified
@param start first index to be modified (inclusive)
@param end last index to be modified (exclusive)
"""
if (isBackedBySimpleArray(bitmap... | java | public static void resetBitmapRange(LongBuffer bitmap, int start, int end) {
if (isBackedBySimpleArray(bitmap)) {
Util.resetBitmapRange(bitmap.array(), start, end);
return;
}
if (start == end) {
return;
}
int firstword = start / 64;
int endword = (end - 1) / 64;
if (firstwo... | [
"public",
"static",
"void",
"resetBitmapRange",
"(",
"LongBuffer",
"bitmap",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"if",
"(",
"isBackedBySimpleArray",
"(",
"bitmap",
")",
")",
"{",
"Util",
".",
"resetBitmapRange",
"(",
"bitmap",
".",
"array",
"... | clear bits at start, start+1,..., end-1
@param bitmap array of words to be modified
@param start first index to be modified (inclusive)
@param end last index to be modified (exclusive) | [
"clear",
"bits",
"at",
"start",
"start",
"+",
"1",
"...",
"end",
"-",
"1"
] | train | https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/buffer/BufferUtil.java#L552-L571 |
cdk/cdk | tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java | InChITautomerGenerator.findAtomByPosition | private IAtom findAtomByPosition(IAtomContainer container, int position) {
"""
Helper method that locates an atom based on its InChI atom table
position, which has been set as ID.
@param container input container
@param position InChI atom table position
@return atom on the position
"""
String pos ... | java | private IAtom findAtomByPosition(IAtomContainer container, int position) {
String pos = String.valueOf(position);
for (IAtom atom : container.atoms()) {
if (atom.getID().equals(pos)) return atom;
}
return null;
} | [
"private",
"IAtom",
"findAtomByPosition",
"(",
"IAtomContainer",
"container",
",",
"int",
"position",
")",
"{",
"String",
"pos",
"=",
"String",
".",
"valueOf",
"(",
"position",
")",
";",
"for",
"(",
"IAtom",
"atom",
":",
"container",
".",
"atoms",
"(",
")"... | Helper method that locates an atom based on its InChI atom table
position, which has been set as ID.
@param container input container
@param position InChI atom table position
@return atom on the position | [
"Helper",
"method",
"that",
"locates",
"an",
"atom",
"based",
"on",
"its",
"InChI",
"atom",
"table",
"position",
"which",
"has",
"been",
"set",
"as",
"ID",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java#L631-L637 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java | ResourcesInner.getAsync | public Observable<GenericResourceInner> getAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) {
"""
Gets a resource.
@param resourceGroupName The name of the resource group containing the resource to get. The ... | java | public Observable<GenericResourceInner> getAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) {
return getWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType... | [
"public",
"Observable",
"<",
"GenericResourceInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceProviderNamespace",
",",
"String",
"parentResourcePath",
",",
"String",
"resourceType",
",",
"String",
"resourceName",
",",
"String",
"apiVe... | Gets a resource.
@param resourceGroupName The name of the resource group containing the resource to get. The name is case insensitive.
@param resourceProviderNamespace The namespace of the resource provider.
@param parentResourcePath The parent resource identity.
@param resourceType The resource type of the resource.
... | [
"Gets",
"a",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java#L1771-L1778 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/shipping/admin/CarrierConfigurationUrl.java | CarrierConfigurationUrl.getConfigurationUrl | public static MozuUrl getConfigurationUrl(String carrierId, String responseFields) {
"""
Get Resource Url for GetConfiguration
@param carrierId The unique identifier of the carrier.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON ob... | java | public static MozuUrl getConfigurationUrl(String carrierId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/shipping/admin/carriers/{carrierId}?responseFields={responseFields}");
formatter.formatUrl("carrierId", carrierId);
formatter.formatUrl("responseFields", responseField... | [
"public",
"static",
"MozuUrl",
"getConfigurationUrl",
"(",
"String",
"carrierId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/shipping/admin/carriers/{carrierId}?responseFields={responseFields}\"",
")... | Get Resource Url for GetConfiguration
@param carrierId The unique identifier of the carrier.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this ... | [
"Get",
"Resource",
"Url",
"for",
"GetConfiguration"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/shipping/admin/CarrierConfigurationUrl.java#L42-L48 |
lessthanoptimal/ejml | examples/src/org/ejml/example/PrincipalComponentAnalysis.java | PrincipalComponentAnalysis.setup | public void setup( int numSamples , int sampleSize ) {
"""
Must be called before any other functions. Declares and sets up internal data structures.
@param numSamples Number of samples that will be processed.
@param sampleSize Number of elements in each sample.
"""
mean = new double[ sampleSize ];
... | java | public void setup( int numSamples , int sampleSize ) {
mean = new double[ sampleSize ];
A.reshape(numSamples,sampleSize,false);
sampleIndex = 0;
numComponents = -1;
} | [
"public",
"void",
"setup",
"(",
"int",
"numSamples",
",",
"int",
"sampleSize",
")",
"{",
"mean",
"=",
"new",
"double",
"[",
"sampleSize",
"]",
";",
"A",
".",
"reshape",
"(",
"numSamples",
",",
"sampleSize",
",",
"false",
")",
";",
"sampleIndex",
"=",
"... | Must be called before any other functions. Declares and sets up internal data structures.
@param numSamples Number of samples that will be processed.
@param sampleSize Number of elements in each sample. | [
"Must",
"be",
"called",
"before",
"any",
"other",
"functions",
".",
"Declares",
"and",
"sets",
"up",
"internal",
"data",
"structures",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/examples/src/org/ejml/example/PrincipalComponentAnalysis.java#L80-L85 |
alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/security/auth/DefaultHttpCredentialsPlugin.java | DefaultHttpCredentialsPlugin.populateContext | @Override
public ReqContext populateContext(ReqContext context, HttpServletRequest req) {
"""
Populates a given context with a new Subject derived from the credentials in a servlet request.
@param context the context to be populated
@param req the servlet request
@return the context
"""
String... | java | @Override
public ReqContext populateContext(ReqContext context, HttpServletRequest req) {
String userName = getUserName(req);
String doAsUser = req.getHeader("doAsUser");
if (doAsUser == null) {
doAsUser = req.getParameter("doAsUser");
}
if (doAsUser != null) {
... | [
"@",
"Override",
"public",
"ReqContext",
"populateContext",
"(",
"ReqContext",
"context",
",",
"HttpServletRequest",
"req",
")",
"{",
"String",
"userName",
"=",
"getUserName",
"(",
"req",
")",
";",
"String",
"doAsUser",
"=",
"req",
".",
"getHeader",
"(",
"\"do... | Populates a given context with a new Subject derived from the credentials in a servlet request.
@param context the context to be populated
@param req the servlet request
@return the context | [
"Populates",
"a",
"given",
"context",
"with",
"a",
"new",
"Subject",
"derived",
"from",
"the",
"credentials",
"in",
"a",
"servlet",
"request",
"."
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/security/auth/DefaultHttpCredentialsPlugin.java#L72-L95 |
real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/Generators.java | Generators.forEachField | public static void forEachField(final List<Token> tokens, final BiConsumer<Token, Token> consumer) {
"""
For each field found in a list of field {@link Token}s take the field token and following type token to
a {@link BiConsumer}.
@param tokens to be iterated over.
@param consumer to for the field and encod... | java | public static void forEachField(final List<Token> tokens, final BiConsumer<Token, Token> consumer)
{
for (int i = 0, size = tokens.size(); i < size;)
{
final Token fieldToken = tokens.get(i);
if (fieldToken.signal() == Signal.BEGIN_FIELD)
{
final T... | [
"public",
"static",
"void",
"forEachField",
"(",
"final",
"List",
"<",
"Token",
">",
"tokens",
",",
"final",
"BiConsumer",
"<",
"Token",
",",
"Token",
">",
"consumer",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"size",
"=",
"tokens",
".",
"size... | For each field found in a list of field {@link Token}s take the field token and following type token to
a {@link BiConsumer}.
@param tokens to be iterated over.
@param consumer to for the field and encoding token pair. | [
"For",
"each",
"field",
"found",
"in",
"a",
"list",
"of",
"field",
"{",
"@link",
"Token",
"}",
"s",
"take",
"the",
"field",
"token",
"and",
"following",
"type",
"token",
"to",
"a",
"{",
"@link",
"BiConsumer",
"}",
"."
] | train | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/Generators.java#L33-L49 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java | ComputerVisionImpl.describeImage | public ImageDescription describeImage(String url, DescribeImageOptionalParameter describeImageOptionalParameter) {
"""
This operation generates a description of an image in human readable language with complete sentences. The description is based on a collection of content tags, which are also returned by the ope... | java | public ImageDescription describeImage(String url, DescribeImageOptionalParameter describeImageOptionalParameter) {
return describeImageWithServiceResponseAsync(url, describeImageOptionalParameter).toBlocking().single().body();
} | [
"public",
"ImageDescription",
"describeImage",
"(",
"String",
"url",
",",
"DescribeImageOptionalParameter",
"describeImageOptionalParameter",
")",
"{",
"return",
"describeImageWithServiceResponseAsync",
"(",
"url",
",",
"describeImageOptionalParameter",
")",
".",
"toBlocking",
... | This operation generates a description of an image in human readable language with complete sentences. The description is based on a collection of content tags, which are also returned by the operation. More than one description can be generated for each image. Descriptions are ordered by their confidence score. All ... | [
"This",
"operation",
"generates",
"a",
"description",
"of",
"an",
"image",
"in",
"human",
"readable",
"language",
"with",
"complete",
"sentences",
".",
"The",
"description",
"is",
"based",
"on",
"a",
"collection",
"of",
"content",
"tags",
"which",
"are",
"also... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L1737-L1739 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/preprocessor/AbstractMultiDataSetNormalizer.java | AbstractMultiDataSetNormalizer.revertFeatures | public void revertFeatures(@NonNull INDArray features, INDArray mask, int input) {
"""
Undo (revert) the normalization applied by this normalizer to a specific features array.
If labels normalization is disabled (i.e., {@link #isFitLabel()} == false) then this is a no-op.
Can also be used to undo normalization f... | java | public void revertFeatures(@NonNull INDArray features, INDArray mask, int input) {
strategy.revert(features, mask, getFeatureStats(input));
} | [
"public",
"void",
"revertFeatures",
"(",
"@",
"NonNull",
"INDArray",
"features",
",",
"INDArray",
"mask",
",",
"int",
"input",
")",
"{",
"strategy",
".",
"revert",
"(",
"features",
",",
"mask",
",",
"getFeatureStats",
"(",
"input",
")",
")",
";",
"}"
] | Undo (revert) the normalization applied by this normalizer to a specific features array.
If labels normalization is disabled (i.e., {@link #isFitLabel()} == false) then this is a no-op.
Can also be used to undo normalization for network output arrays, in the case of regression.
@param features features arrays to rever... | [
"Undo",
"(",
"revert",
")",
"the",
"normalization",
"applied",
"by",
"this",
"normalizer",
"to",
"a",
"specific",
"features",
"array",
".",
"If",
"labels",
"normalization",
"is",
"disabled",
"(",
"i",
".",
"e",
".",
"{",
"@link",
"#isFitLabel",
"()",
"}",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/preprocessor/AbstractMultiDataSetNormalizer.java#L235-L237 |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassInfo.java | ClassInfo.getAllStandardClasses | static ClassInfoList getAllStandardClasses(final Collection<ClassInfo> classes, final ScanSpec scanSpec) {
"""
Get all standard classes found during the scan.
@param classes
the classes
@param scanSpec
the scan spec
@return A list of all standard classes found during the scan, or the empty list if none.
... | java | static ClassInfoList getAllStandardClasses(final Collection<ClassInfo> classes, final ScanSpec scanSpec) {
return new ClassInfoList(ClassInfo.filterClassInfo(classes, scanSpec, /* strictWhitelist = */ true,
ClassType.STANDARD_CLASS), /* sortByName = */ true);
} | [
"static",
"ClassInfoList",
"getAllStandardClasses",
"(",
"final",
"Collection",
"<",
"ClassInfo",
">",
"classes",
",",
"final",
"ScanSpec",
"scanSpec",
")",
"{",
"return",
"new",
"ClassInfoList",
"(",
"ClassInfo",
".",
"filterClassInfo",
"(",
"classes",
",",
"scan... | Get all standard classes found during the scan.
@param classes
the classes
@param scanSpec
the scan spec
@return A list of all standard classes found during the scan, or the empty list if none. | [
"Get",
"all",
"standard",
"classes",
"found",
"during",
"the",
"scan",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassInfo.java#L840-L843 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java | StyleUtil.setBorder | public static CellStyle setBorder(CellStyle cellStyle, BorderStyle borderSize, IndexedColors colorIndex) {
"""
设置cell的四个边框粗细和颜色
@param cellStyle {@link CellStyle}
@param borderSize 边框粗细{@link BorderStyle}枚举
@param colorIndex 颜色的short值
@return {@link CellStyle}
"""
cellStyle.setBorderBottom(borderSize)... | java | public static CellStyle setBorder(CellStyle cellStyle, BorderStyle borderSize, IndexedColors colorIndex) {
cellStyle.setBorderBottom(borderSize);
cellStyle.setBottomBorderColor(colorIndex.index);
cellStyle.setBorderLeft(borderSize);
cellStyle.setLeftBorderColor(colorIndex.index);
cellStyle.setBorderR... | [
"public",
"static",
"CellStyle",
"setBorder",
"(",
"CellStyle",
"cellStyle",
",",
"BorderStyle",
"borderSize",
",",
"IndexedColors",
"colorIndex",
")",
"{",
"cellStyle",
".",
"setBorderBottom",
"(",
"borderSize",
")",
";",
"cellStyle",
".",
"setBottomBorderColor",
"... | 设置cell的四个边框粗细和颜色
@param cellStyle {@link CellStyle}
@param borderSize 边框粗细{@link BorderStyle}枚举
@param colorIndex 颜色的short值
@return {@link CellStyle} | [
"设置cell的四个边框粗细和颜色"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java#L69-L83 |
fuinorg/utils4swing | src/main/java/org/fuin/utils4swing/common/Utils4Swing.java | Utils4Swing.showGlassPane | public static GlassPaneState showGlassPane(final Component source) {
"""
Makes the glass pane visible and focused and stores the saves the current
state.
@param source
Component to use when looking for the root pane container.
@return State of the UI before the glasspane was visible.
"""
final... | java | public static GlassPaneState showGlassPane(final Component source) {
final Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager()
.getFocusOwner();
final RootPaneContainer rootPaneContainer = findRootPaneContainer(source);
final Component glassPane = roo... | [
"public",
"static",
"GlassPaneState",
"showGlassPane",
"(",
"final",
"Component",
"source",
")",
"{",
"final",
"Component",
"focusOwner",
"=",
"KeyboardFocusManager",
".",
"getCurrentKeyboardFocusManager",
"(",
")",
".",
"getFocusOwner",
"(",
")",
";",
"final",
"Roo... | Makes the glass pane visible and focused and stores the saves the current
state.
@param source
Component to use when looking for the root pane container.
@return State of the UI before the glasspane was visible. | [
"Makes",
"the",
"glass",
"pane",
"visible",
"and",
"focused",
"and",
"stores",
"the",
"saves",
"the",
"current",
"state",
"."
] | train | https://github.com/fuinorg/utils4swing/blob/560fb69eac182e3473de9679c3c15433e524ef6b/src/main/java/org/fuin/utils4swing/common/Utils4Swing.java#L207-L220 |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/ResourceLoader.java | ResourceLoader.getResourceAsProperties | public static Properties getResourceAsProperties(Class<?> requestingClass, String resource)
throws ResourceMissingException, IOException {
"""
Get the contents of a URL as a java.util.Properties object
@param requestingClass the java.lang.Class object of the class that is attempting to load the
res... | java | public static Properties getResourceAsProperties(Class<?> requestingClass, String resource)
throws ResourceMissingException, IOException {
InputStream inputStream = null;
Properties props = null;
try {
inputStream = getResourceAsStream(requestingClass, resource);
... | [
"public",
"static",
"Properties",
"getResourceAsProperties",
"(",
"Class",
"<",
"?",
">",
"requestingClass",
",",
"String",
"resource",
")",
"throws",
"ResourceMissingException",
",",
"IOException",
"{",
"InputStream",
"inputStream",
"=",
"null",
";",
"Properties",
... | Get the contents of a URL as a java.util.Properties object
@param requestingClass the java.lang.Class object of the class that is attempting to load the
resource
@param resource a String describing the full or partial URL of the resource whose contents to
load
@return the actual contents of the resource as a Propertie... | [
"Get",
"the",
"contents",
"of",
"a",
"URL",
"as",
"a",
"java",
".",
"util",
".",
"Properties",
"object"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/ResourceLoader.java#L312-L324 |
ChannelFinder/javaCFClient | src/main/java/gov/bnl/channelfinder/api/ChannelUtil.java | ChannelUtil.getProperty | @Deprecated
public static Property getProperty(Channel channel, String propertyName) {
"""
deprecated - use the channel.getProperty instead
Return the property object with the name <tt>propertyName</tt> if it
exists on the channel <tt>channel</tt> else return null
@param channel - channel
@param propertyN... | java | @Deprecated
public static Property getProperty(Channel channel, String propertyName) {
Collection<Property> property = Collections2.filter(
channel.getProperties(),
new PropertyNamePredicate(propertyName));
if (property.size() == 1)
return property.iterator().next();
else
return null;
} | [
"@",
"Deprecated",
"public",
"static",
"Property",
"getProperty",
"(",
"Channel",
"channel",
",",
"String",
"propertyName",
")",
"{",
"Collection",
"<",
"Property",
">",
"property",
"=",
"Collections2",
".",
"filter",
"(",
"channel",
".",
"getProperties",
"(",
... | deprecated - use the channel.getProperty instead
Return the property object with the name <tt>propertyName</tt> if it
exists on the channel <tt>channel</tt> else return null
@param channel - channel
@param propertyName - property name
@return Property - property object found on channel | [
"deprecated",
"-",
"use",
"the",
"channel",
".",
"getProperty",
"instead"
] | train | https://github.com/ChannelFinder/javaCFClient/blob/000fce53ad2b8f8c38ef24fec5b5ec65e383ac9d/src/main/java/gov/bnl/channelfinder/api/ChannelUtil.java#L122-L131 |
structurizr/java | structurizr-core/src/com/structurizr/documentation/AutomaticDocumentationTemplate.java | AutomaticDocumentationTemplate.addSections | public List<Section> addSections(SoftwareSystem softwareSystem, File directory) throws IOException {
"""
Adds all files in the specified directory, each in its own section, related to a software system.
@param directory the directory to scan
@param softwareSystem the SoftwareSystem to associate the ... | java | public List<Section> addSections(SoftwareSystem softwareSystem, File directory) throws IOException {
if (softwareSystem == null) {
throw new IllegalArgumentException("A software system must be specified.");
}
return add(softwareSystem, directory);
} | [
"public",
"List",
"<",
"Section",
">",
"addSections",
"(",
"SoftwareSystem",
"softwareSystem",
",",
"File",
"directory",
")",
"throws",
"IOException",
"{",
"if",
"(",
"softwareSystem",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"A... | Adds all files in the specified directory, each in its own section, related to a software system.
@param directory the directory to scan
@param softwareSystem the SoftwareSystem to associate the documentation with
@return a List of Section objects
@throws IOException if there is an err... | [
"Adds",
"all",
"files",
"in",
"the",
"specified",
"directory",
"each",
"in",
"its",
"own",
"section",
"related",
"to",
"a",
"software",
"system",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/documentation/AutomaticDocumentationTemplate.java#L45-L51 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_database_GET | public ArrayList<String> serviceName_database_GET(String serviceName, OvhModeEnum mode, String name, String server, OvhDatabaseTypeEnum type, String user) throws IOException {
"""
Databases linked to your hosting
REST: GET /hosting/web/{serviceName}/database
@param type [required] Filter the value of type prop... | java | public ArrayList<String> serviceName_database_GET(String serviceName, OvhModeEnum mode, String name, String server, OvhDatabaseTypeEnum type, String user) throws IOException {
String qPath = "/hosting/web/{serviceName}/database";
StringBuilder sb = path(qPath, serviceName);
query(sb, "mode", mode);
query(sb, "n... | [
"public",
"ArrayList",
"<",
"String",
">",
"serviceName_database_GET",
"(",
"String",
"serviceName",
",",
"OvhModeEnum",
"mode",
",",
"String",
"name",
",",
"String",
"server",
",",
"OvhDatabaseTypeEnum",
"type",
",",
"String",
"user",
")",
"throws",
"IOException"... | Databases linked to your hosting
REST: GET /hosting/web/{serviceName}/database
@param type [required] Filter the value of type property (=)
@param name [required] Filter the value of name property (like)
@param server [required] Filter the value of server property (like)
@param mode [required] Filter the value of mode... | [
"Databases",
"linked",
"to",
"your",
"hosting"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L1086-L1096 |
google/gson | gson/src/main/java/com/google/gson/internal/bind/util/ISO8601Utils.java | ISO8601Utils.checkOffset | private static boolean checkOffset(String value, int offset, char expected) {
"""
Check if the expected character exist at the given offset in the value.
@param value the string to check at the specified offset
@param offset the offset to look for the expected character
@param expected the expected character
... | java | private static boolean checkOffset(String value, int offset, char expected) {
return (offset < value.length()) && (value.charAt(offset) == expected);
} | [
"private",
"static",
"boolean",
"checkOffset",
"(",
"String",
"value",
",",
"int",
"offset",
",",
"char",
"expected",
")",
"{",
"return",
"(",
"offset",
"<",
"value",
".",
"length",
"(",
")",
")",
"&&",
"(",
"value",
".",
"charAt",
"(",
"offset",
")",
... | Check if the expected character exist at the given offset in the value.
@param value the string to check at the specified offset
@param offset the offset to look for the expected character
@param expected the expected character
@return true if the expected character exist at the given offset | [
"Check",
"if",
"the",
"expected",
"character",
"exist",
"at",
"the",
"given",
"offset",
"in",
"the",
"value",
"."
] | train | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/internal/bind/util/ISO8601Utils.java#L287-L289 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.count | public static <T> int count(Iterable<T> iterable, Matcher<T> matcher) {
"""
集合中匹配规则的数量
@param <T> 集合元素类型
@param iterable {@link Iterable}
@param matcher 匹配器,为空则全部匹配
@return 匹配数量
"""
int count = 0;
if (null != iterable) {
for (T t : iterable) {
if (null == matcher || matcher.match(t)) {
... | java | public static <T> int count(Iterable<T> iterable, Matcher<T> matcher) {
int count = 0;
if (null != iterable) {
for (T t : iterable) {
if (null == matcher || matcher.match(t)) {
count++;
}
}
}
return count;
} | [
"public",
"static",
"<",
"T",
">",
"int",
"count",
"(",
"Iterable",
"<",
"T",
">",
"iterable",
",",
"Matcher",
"<",
"T",
">",
"matcher",
")",
"{",
"int",
"count",
"=",
"0",
";",
"if",
"(",
"null",
"!=",
"iterable",
")",
"{",
"for",
"(",
"T",
"t... | 集合中匹配规则的数量
@param <T> 集合元素类型
@param iterable {@link Iterable}
@param matcher 匹配器,为空则全部匹配
@return 匹配数量 | [
"集合中匹配规则的数量"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L1301-L1311 |
SimplicityApks/ReminderDatePicker | lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/ReminderDatePicker.java | ReminderDatePicker.setSelectedDate | public void setSelectedDate(int year, int month, int day) {
"""
Sets the Spinners' date selection as integers considering only day.
"""
dateSpinner.setSelectedDate(new GregorianCalendar(year, month, day));
// a custom selection has been set, don't select the default date:
shouldSelectDe... | java | public void setSelectedDate(int year, int month, int day) {
dateSpinner.setSelectedDate(new GregorianCalendar(year, month, day));
// a custom selection has been set, don't select the default date:
shouldSelectDefault = false;
} | [
"public",
"void",
"setSelectedDate",
"(",
"int",
"year",
",",
"int",
"month",
",",
"int",
"day",
")",
"{",
"dateSpinner",
".",
"setSelectedDate",
"(",
"new",
"GregorianCalendar",
"(",
"year",
",",
"month",
",",
"day",
")",
")",
";",
"// a custom selection ha... | Sets the Spinners' date selection as integers considering only day. | [
"Sets",
"the",
"Spinners",
"date",
"selection",
"as",
"integers",
"considering",
"only",
"day",
"."
] | train | https://github.com/SimplicityApks/ReminderDatePicker/blob/7596fbac77a5d26f687fec11758935a2b7db156f/lib/src/main/java/com/simplicityapks/reminderdatepicker/lib/ReminderDatePicker.java#L259-L263 |
lucee/Lucee | core/src/main/java/lucee/commons/lang/StringUtil.java | StringUtil.endsWith | public static boolean endsWith(String str, char suffix) {
"""
Tests if this string ends with the specified suffix.
@param str string to check first char
@param suffix the suffix.
@return is last of given type
"""
return str != null && str.length() > 0 && str.charAt(str.length() - 1) == suffix;
} | java | public static boolean endsWith(String str, char suffix) {
return str != null && str.length() > 0 && str.charAt(str.length() - 1) == suffix;
} | [
"public",
"static",
"boolean",
"endsWith",
"(",
"String",
"str",
",",
"char",
"suffix",
")",
"{",
"return",
"str",
"!=",
"null",
"&&",
"str",
".",
"length",
"(",
")",
">",
"0",
"&&",
"str",
".",
"charAt",
"(",
"str",
".",
"length",
"(",
")",
"-",
... | Tests if this string ends with the specified suffix.
@param str string to check first char
@param suffix the suffix.
@return is last of given type | [
"Tests",
"if",
"this",
"string",
"ends",
"with",
"the",
"specified",
"suffix",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/lang/StringUtil.java#L866-L868 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/KunderaPersistenceProviderUtil.java | KunderaPersistenceProviderUtil.isLoadedWithoutReference | @Override
public LoadState isLoadedWithoutReference(Object paramObject, String paramString) {
"""
If the provider determines that the entity has been provided by itself
and that the state of the specified attribute has been loaded, this
method returns LoadState.LOADED. If the provider determines that the
en... | java | @Override
public LoadState isLoadedWithoutReference(Object paramObject, String paramString)
{
return PersistenceUtilHelper.isLoadedWithoutReference(paramObject, paramString, provider.getCache());
} | [
"@",
"Override",
"public",
"LoadState",
"isLoadedWithoutReference",
"(",
"Object",
"paramObject",
",",
"String",
"paramString",
")",
"{",
"return",
"PersistenceUtilHelper",
".",
"isLoadedWithoutReference",
"(",
"paramObject",
",",
"paramString",
",",
"provider",
".",
... | If the provider determines that the entity has been provided by itself
and that the state of the specified attribute has been loaded, this
method returns LoadState.LOADED. If the provider determines that the
entity has been provided by itself and that either entity attributes with
FetchType EAGER have not been loaded o... | [
"If",
"the",
"provider",
"determines",
"that",
"the",
"entity",
"has",
"been",
"provided",
"by",
"itself",
"and",
"that",
"the",
"state",
"of",
"the",
"specified",
"attribute",
"has",
"been",
"loaded",
"this",
"method",
"returns",
"LoadState",
".",
"LOADED",
... | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/KunderaPersistenceProviderUtil.java#L53-L57 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WImageRenderer.java | WImageRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
"""
Paints the given {@link WImage}.
@param component the WImage to paint.
@param renderContext the RenderContext to paint to.
"""
WImage imageComponent = (WImage) component;
XmlStringBuilder xml = re... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WImage imageComponent = (WImage) component;
XmlStringBuilder xml = renderContext.getWriter();
// No image set
if (imageComponent.getImage() == null && imageComponent.getImageUrl() == null) {
return;
}
... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WImage",
"imageComponent",
"=",
"(",
"WImage",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
"renderCo... | Paints the given {@link WImage}.
@param component the WImage to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"{",
"@link",
"WImage",
"}",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WImageRenderer.java#L65-L77 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.