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 |
|---|---|---|---|---|---|---|---|---|---|---|
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java | ViterbiBuilder.isLatticeBrokenBefore | private boolean isLatticeBrokenBefore(int nodeIndex, ViterbiLattice lattice) {
"""
Checks whether there exists any node in the lattice that connects to the newly inserted entry on the left side
(before the new entry).
@param nodeIndex
@param lattice
@return whether the lattice has a node that ends at nodeInd... | java | private boolean isLatticeBrokenBefore(int nodeIndex, ViterbiLattice lattice) {
ViterbiNode[][] nodeEndIndices = lattice.getEndIndexArr();
return nodeEndIndices[nodeIndex] == null;
} | [
"private",
"boolean",
"isLatticeBrokenBefore",
"(",
"int",
"nodeIndex",
",",
"ViterbiLattice",
"lattice",
")",
"{",
"ViterbiNode",
"[",
"]",
"[",
"]",
"nodeEndIndices",
"=",
"lattice",
".",
"getEndIndexArr",
"(",
")",
";",
"return",
"nodeEndIndices",
"[",
"nodeI... | Checks whether there exists any node in the lattice that connects to the newly inserted entry on the left side
(before the new entry).
@param nodeIndex
@param lattice
@return whether the lattice has a node that ends at nodeIndex | [
"Checks",
"whether",
"there",
"exists",
"any",
"node",
"in",
"the",
"lattice",
"that",
"connects",
"to",
"the",
"newly",
"inserted",
"entry",
"on",
"the",
"left",
"side",
"(",
"before",
"the",
"new",
"entry",
")",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java#L210-L214 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/storage/types/DigitalObjectUtil.java | DigitalObjectUtil.updateLegacyDatastreams | @SuppressWarnings("deprecation")
public static void updateLegacyDatastreams(DigitalObject obj) {
"""
Upgrades a legacy (pre-Fedora-3.0) object by setting the correct MIME
type and Format URI for all "reserved" datastreams.
@param obj the object to update.
"""
final String xml = "text/xml";
... | java | @SuppressWarnings("deprecation")
public static void updateLegacyDatastreams(DigitalObject obj) {
final String xml = "text/xml";
final String rdf = "application/rdf+xml";
updateLegacyDatastream(obj, "DC", xml, OAI_DC2_0.uri);
updateLegacyDatastream(obj, "RELS-EXT", rdf, RELS_EXT1_0.ur... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"static",
"void",
"updateLegacyDatastreams",
"(",
"DigitalObject",
"obj",
")",
"{",
"final",
"String",
"xml",
"=",
"\"text/xml\"",
";",
"final",
"String",
"rdf",
"=",
"\"application/rdf+xml\"",
";",
"... | Upgrades a legacy (pre-Fedora-3.0) object by setting the correct MIME
type and Format URI for all "reserved" datastreams.
@param obj the object to update. | [
"Upgrades",
"a",
"legacy",
"(",
"pre",
"-",
"Fedora",
"-",
"3",
".",
"0",
")",
"object",
"by",
"setting",
"the",
"correct",
"MIME",
"type",
"and",
"Format",
"URI",
"for",
"all",
"reserved",
"datastreams",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/storage/types/DigitalObjectUtil.java#L23-L51 |
zxing/zxing | core/src/main/java/com/google/zxing/datamatrix/encoder/HighLevelEncoder.java | HighLevelEncoder.determineConsecutiveDigitCount | public static int determineConsecutiveDigitCount(CharSequence msg, int startpos) {
"""
Determines the number of consecutive characters that are encodable using numeric compaction.
@param msg the message
@param startpos the start position within the message
@return the requested character count
"""
... | java | public static int determineConsecutiveDigitCount(CharSequence msg, int startpos) {
int count = 0;
int len = msg.length();
int idx = startpos;
if (idx < len) {
char ch = msg.charAt(idx);
while (isDigit(ch) && idx < len) {
count++;
idx++;
if (idx < len) {
ch =... | [
"public",
"static",
"int",
"determineConsecutiveDigitCount",
"(",
"CharSequence",
"msg",
",",
"int",
"startpos",
")",
"{",
"int",
"count",
"=",
"0",
";",
"int",
"len",
"=",
"msg",
".",
"length",
"(",
")",
";",
"int",
"idx",
"=",
"startpos",
";",
"if",
... | Determines the number of consecutive characters that are encodable using numeric compaction.
@param msg the message
@param startpos the start position within the message
@return the requested character count | [
"Determines",
"the",
"number",
"of",
"consecutive",
"characters",
"that",
"are",
"encodable",
"using",
"numeric",
"compaction",
"."
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/datamatrix/encoder/HighLevelEncoder.java#L426-L441 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.addInlineComment | public void addInlineComment(Doc doc, Tag tag, Content htmltree) {
"""
Add the inline comment.
@param doc the doc for which the inline comment will be added
@param tag the inline tag to be added
@param htmltree the content tree to which the comment will be added
"""
addCommentTags(doc, tag, tag.in... | java | public void addInlineComment(Doc doc, Tag tag, Content htmltree) {
addCommentTags(doc, tag, tag.inlineTags(), false, false, htmltree);
} | [
"public",
"void",
"addInlineComment",
"(",
"Doc",
"doc",
",",
"Tag",
"tag",
",",
"Content",
"htmltree",
")",
"{",
"addCommentTags",
"(",
"doc",
",",
"tag",
",",
"tag",
".",
"inlineTags",
"(",
")",
",",
"false",
",",
"false",
",",
"htmltree",
")",
";",
... | Add the inline comment.
@param doc the doc for which the inline comment will be added
@param tag the inline tag to be added
@param htmltree the content tree to which the comment will be added | [
"Add",
"the",
"inline",
"comment",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java#L1419-L1421 |
HolmesNL/kafka-spout | src/main/java/nl/minvenj/nfi/storm/kafka/util/ConfigUtils.java | ConfigUtils.getTopic | public static String getTopic(final Map<String, Object> stormConfig) {
"""
Retrieves the topic to be consumed from storm's configuration map, or the {@link #DEFAULT_TOPIC} if no
(non-empty) value was found using {@link #CONFIG_TOPIC}.
@param stormConfig Storm's configuration map.
@return The topic to be consu... | java | public static String getTopic(final Map<String, Object> stormConfig) {
if (stormConfig.containsKey(CONFIG_TOPIC)) {
// get configured topic from config as string, removing whitespace from both ends
final String topic = String.valueOf(stormConfig.get(CONFIG_TOPIC)).trim();
if ... | [
"public",
"static",
"String",
"getTopic",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"stormConfig",
")",
"{",
"if",
"(",
"stormConfig",
".",
"containsKey",
"(",
"CONFIG_TOPIC",
")",
")",
"{",
"// get configured topic from config as string, removing whit... | Retrieves the topic to be consumed from storm's configuration map, or the {@link #DEFAULT_TOPIC} if no
(non-empty) value was found using {@link #CONFIG_TOPIC}.
@param stormConfig Storm's configuration map.
@return The topic to be consumed. | [
"Retrieves",
"the",
"topic",
"to",
"be",
"consumed",
"from",
"storm",
"s",
"configuration",
"map",
"or",
"the",
"{",
"@link",
"#DEFAULT_TOPIC",
"}",
"if",
"no",
"(",
"non",
"-",
"empty",
")",
"value",
"was",
"found",
"using",
"{",
"@link",
"#CONFIG_TOPIC",... | train | https://github.com/HolmesNL/kafka-spout/blob/bef626b9fab6946a7e0d3c85979ec36ae0870233/src/main/java/nl/minvenj/nfi/storm/kafka/util/ConfigUtils.java#L287-L303 |
haifengl/smile | plot/src/main/java/smile/plot/Graphics.java | Graphics.drawTextBaseRatio | public void drawTextBaseRatio(String label, double horizontalReference, double verticalReference, double[] coord) {
"""
Draw a string with given reference point. (0.5, 0.5) is center, (0, 0) is
lower left, (0, 1) is upper left, etc. The logical coordinates are
proportional to the base coordinates.
"""
... | java | public void drawTextBaseRatio(String label, double horizontalReference, double verticalReference, double[] coord) {
drawTextBaseRatio(label, horizontalReference, verticalReference, 0.0, coord);
} | [
"public",
"void",
"drawTextBaseRatio",
"(",
"String",
"label",
",",
"double",
"horizontalReference",
",",
"double",
"verticalReference",
",",
"double",
"[",
"]",
"coord",
")",
"{",
"drawTextBaseRatio",
"(",
"label",
",",
"horizontalReference",
",",
"verticalReferenc... | Draw a string with given reference point. (0.5, 0.5) is center, (0, 0) is
lower left, (0, 1) is upper left, etc. The logical coordinates are
proportional to the base coordinates. | [
"Draw",
"a",
"string",
"with",
"given",
"reference",
"point",
".",
"(",
"0",
".",
"5",
"0",
".",
"5",
")",
"is",
"center",
"(",
"0",
"0",
")",
"is",
"lower",
"left",
"(",
"0",
"1",
")",
"is",
"upper",
"left",
"etc",
".",
"The",
"logical",
"coor... | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/plot/src/main/java/smile/plot/Graphics.java#L264-L266 |
lucee/Lucee | core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java | ResourceUtil.toResourceNotExisting | public static Resource toResourceNotExisting(PageContext pc, String destination) {
"""
cast a String (argument destination) to a File Object, if destination is not a absolute, file
object will be relative to current position (get from PageContext) existing file is preferred but
dont must exist
@param pc Page ... | java | public static Resource toResourceNotExisting(PageContext pc, String destination) {
return toResourceNotExisting(pc, destination, pc.getConfig().allowRealPath(), false);
} | [
"public",
"static",
"Resource",
"toResourceNotExisting",
"(",
"PageContext",
"pc",
",",
"String",
"destination",
")",
"{",
"return",
"toResourceNotExisting",
"(",
"pc",
",",
"destination",
",",
"pc",
".",
"getConfig",
"(",
")",
".",
"allowRealPath",
"(",
")",
... | cast a String (argument destination) to a File Object, if destination is not a absolute, file
object will be relative to current position (get from PageContext) existing file is preferred but
dont must exist
@param pc Page Context to the current position in filesystem
@param destination relative or absolute path for f... | [
"cast",
"a",
"String",
"(",
"argument",
"destination",
")",
"to",
"a",
"File",
"Object",
"if",
"destination",
"is",
"not",
"a",
"absolute",
"file",
"object",
"will",
"be",
"relative",
"to",
"current",
"position",
"(",
"get",
"from",
"PageContext",
")",
"ex... | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java#L313-L315 |
alkacon/opencms-core | src/org/opencms/ade/containerpage/CmsElementUtil.java | CmsElementUtil.getContentByContainer | public String getContentByContainer(CmsFile elementFile, String elementId, CmsContainer container) {
"""
Returns the HTML content for the given resource and container.<p>
@param elementFile the element resource file
@param elementId the element id
@param container the container
@return the HTML content
... | java | public String getContentByContainer(CmsFile elementFile, String elementId, CmsContainer container) {
CmsContainerElementBean element = CmsADESessionCache.getCache(m_req, m_cms).getCacheContainerElement(elementId);
element = element.clone();
element.setTemporaryFile(elementFile);
CmsForm... | [
"public",
"String",
"getContentByContainer",
"(",
"CmsFile",
"elementFile",
",",
"String",
"elementId",
",",
"CmsContainer",
"container",
")",
"{",
"CmsContainerElementBean",
"element",
"=",
"CmsADESessionCache",
".",
"getCache",
"(",
"m_req",
",",
"m_cms",
")",
"."... | Returns the HTML content for the given resource and container.<p>
@param elementFile the element resource file
@param elementId the element id
@param container the container
@return the HTML content | [
"Returns",
"the",
"HTML",
"content",
"for",
"the",
"given",
"resource",
"and",
"container",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/containerpage/CmsElementUtil.java#L419-L426 |
OpenLiberty/open-liberty | dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileContainer.java | ZipFileContainer.createEntry | @Trivial
protected ZipFileEntry createEntry(String entryName, String a_entryPath) {
"""
Answer the zip entry for the zip file entry at the specified path.
The zip file entry may be virtual.
@param entryName The simple name of the entry.
@param a_entryPath The absolute path of the entry.
@return The zip... | java | @Trivial
protected ZipFileEntry createEntry(String entryName, String a_entryPath) {
ZipEntryData[] useZipEntries = getZipEntryData();
if ( useZipEntries.length == 0 ) {
return null;
}
String r_entryPath = a_entryPath.substring(1);
int location = locatePath(r_entr... | [
"@",
"Trivial",
"protected",
"ZipFileEntry",
"createEntry",
"(",
"String",
"entryName",
",",
"String",
"a_entryPath",
")",
"{",
"ZipEntryData",
"[",
"]",
"useZipEntries",
"=",
"getZipEntryData",
"(",
")",
";",
"if",
"(",
"useZipEntries",
".",
"length",
"==",
"... | Answer the zip entry for the zip file entry at the specified path.
The zip file entry may be virtual.
@param entryName The simple name of the entry.
@param a_entryPath The absolute path of the entry.
@return The zip entry for the zip file entry at the specified path. | [
"Answer",
"the",
"zip",
"entry",
"for",
"the",
"zip",
"file",
"entry",
"at",
"the",
"specified",
"path",
".",
"The",
"zip",
"file",
"entry",
"may",
"be",
"virtual",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileContainer.java#L1106-L1128 |
apereo/cas | core/cas-server-core-web-api/src/main/java/org/apereo/cas/services/web/view/AbstractCasView.java | AbstractCasView.putIntoModel | protected void putIntoModel(final Map<String, Object> model, final String key, final Object value) {
"""
Put into model.
@param model the model
@param key the key
@param value the value
"""
LOGGER.trace("Adding attribute [{}] into the view model for [{}] with value [{}]", key, getClass().getSimp... | java | protected void putIntoModel(final Map<String, Object> model, final String key, final Object value) {
LOGGER.trace("Adding attribute [{}] into the view model for [{}] with value [{}]", key, getClass().getSimpleName(), value);
model.put(key, value);
} | [
"protected",
"void",
"putIntoModel",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"model",
",",
"final",
"String",
"key",
",",
"final",
"Object",
"value",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"\"Adding attribute [{}] into the view model for [{}] with ... | Put into model.
@param model the model
@param key the key
@param value the value | [
"Put",
"into",
"model",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-web-api/src/main/java/org/apereo/cas/services/web/view/AbstractCasView.java#L193-L196 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/database/CmsDatabaseExportDialog.java | CmsDatabaseExportDialog.getComboExportFiles | protected List getComboExportFiles() {
"""
Returns the present export files on the server to show in the combo box.<p>
The result list elements are of type <code>{@link org.opencms.widgets.CmsSelectWidgetOption}</code>.<p>
@return the present export files on the server to show in the combo box
"""
... | java | protected List getComboExportFiles() {
List result = new ArrayList(8);
Iterator i = CmsDatabaseImportFromServer.getFileListFromServer(true).iterator();
while (i.hasNext()) {
String fileName = (String)i.next();
String helpText = key(Messages.GUI_EDITOR_HELP_EXPORTFILE_1, ... | [
"protected",
"List",
"getComboExportFiles",
"(",
")",
"{",
"List",
"result",
"=",
"new",
"ArrayList",
"(",
"8",
")",
";",
"Iterator",
"i",
"=",
"CmsDatabaseImportFromServer",
".",
"getFileListFromServer",
"(",
"true",
")",
".",
"iterator",
"(",
")",
";",
"wh... | Returns the present export files on the server to show in the combo box.<p>
The result list elements are of type <code>{@link org.opencms.widgets.CmsSelectWidgetOption}</code>.<p>
@return the present export files on the server to show in the combo box | [
"Returns",
"the",
"present",
"export",
"files",
"on",
"the",
"server",
"to",
"show",
"in",
"the",
"combo",
"box",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/database/CmsDatabaseExportDialog.java#L218-L228 |
apache/flink | flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcBatchReader.java | OrcBatchReader.fillColumnWithRepeatingValue | private static void fillColumnWithRepeatingValue(Object[] vals, int fieldIdx, Object repeatingValue, int childCount) {
"""
Sets a repeating value to all objects or row fields of the passed vals array.
@param vals The array of objects or Rows.
@param fieldIdx If the objs array is an array of Row, the index of t... | java | private static void fillColumnWithRepeatingValue(Object[] vals, int fieldIdx, Object repeatingValue, int childCount) {
if (fieldIdx == -1) {
// set value as an object
Arrays.fill(vals, 0, childCount, repeatingValue);
} else {
// set value as a field of Row
Row[] rows = (Row[]) vals;
for (int i = 0; ... | [
"private",
"static",
"void",
"fillColumnWithRepeatingValue",
"(",
"Object",
"[",
"]",
"vals",
",",
"int",
"fieldIdx",
",",
"Object",
"repeatingValue",
",",
"int",
"childCount",
")",
"{",
"if",
"(",
"fieldIdx",
"==",
"-",
"1",
")",
"{",
"// set value as an obje... | Sets a repeating value to all objects or row fields of the passed vals array.
@param vals The array of objects or Rows.
@param fieldIdx If the objs array is an array of Row, the index of the field that needs to be filled.
Otherwise a -1 must be passed and the data is directly filled into the array.
@param repeatingVal... | [
"Sets",
"a",
"repeating",
"value",
"to",
"all",
"objects",
"or",
"row",
"fields",
"of",
"the",
"passed",
"vals",
"array",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-orc/src/main/java/org/apache/flink/orc/OrcBatchReader.java#L1122-L1134 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.newUploadPhotoRequest | public static Request newUploadPhotoRequest(Session session, File file,
Callback callback) throws FileNotFoundException {
"""
Creates a new Request configured to upload a photo to the user's default photo album. The photo
will be read from the specified stream.
@param session the Session to use, o... | java | public static Request newUploadPhotoRequest(Session session, File file,
Callback callback) throws FileNotFoundException {
ParcelFileDescriptor descriptor = ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);
Bundle parameters = new Bundle(1);
parameters.putParcelabl... | [
"public",
"static",
"Request",
"newUploadPhotoRequest",
"(",
"Session",
"session",
",",
"File",
"file",
",",
"Callback",
"callback",
")",
"throws",
"FileNotFoundException",
"{",
"ParcelFileDescriptor",
"descriptor",
"=",
"ParcelFileDescriptor",
".",
"open",
"(",
"file... | Creates a new Request configured to upload a photo to the user's default photo album. The photo
will be read from the specified stream.
@param session the Session to use, or null; if non-null, the session must be in an opened state
@param file the file containing the photo to upload
@param callback a callback tha... | [
"Creates",
"a",
"new",
"Request",
"configured",
"to",
"upload",
"a",
"photo",
"to",
"the",
"user",
"s",
"default",
"photo",
"album",
".",
"The",
"photo",
"will",
"be",
"read",
"from",
"the",
"specified",
"stream",
"."
] | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L335-L342 |
apereo/cas | support/cas-server-support-saml-idp-core/src/main/java/org/apereo/cas/support/saml/idp/metadata/generator/BaseSamlIdPMetadataGenerator.java | BaseSamlIdPMetadataGenerator.buildMetadataGeneratorParameters | @SneakyThrows
private String buildMetadataGeneratorParameters(final Pair<String, String> signing, final Pair<String, String> encryption) {
"""
Build metadata generator parameters by passing the encryption,
signing and back-channel certs to the parameter generator.
@param signing the signing
@param encr... | java | @SneakyThrows
private String buildMetadataGeneratorParameters(final Pair<String, String> signing, final Pair<String, String> encryption) {
val template = samlIdPMetadataGeneratorConfigurationContext.getResourceLoader().getResource("classpath:/template-idp-metadata.xml");
var signingCert = signing.g... | [
"@",
"SneakyThrows",
"private",
"String",
"buildMetadataGeneratorParameters",
"(",
"final",
"Pair",
"<",
"String",
",",
"String",
">",
"signing",
",",
"final",
"Pair",
"<",
"String",
",",
"String",
">",
"encryption",
")",
"{",
"val",
"template",
"=",
"samlIdPM... | Build metadata generator parameters by passing the encryption,
signing and back-channel certs to the parameter generator.
@param signing the signing
@param encryption the encryption
@return the metadata | [
"Build",
"metadata",
"generator",
"parameters",
"by",
"passing",
"the",
"encryption",
"signing",
"and",
"back",
"-",
"channel",
"certs",
"to",
"the",
"parameter",
"generator",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-idp-core/src/main/java/org/apereo/cas/support/saml/idp/metadata/generator/BaseSamlIdPMetadataGenerator.java#L96-L120 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.registry/src/com/ibm/ws/security/registry/internal/UserRegistryServiceImpl.java | UserRegistryServiceImpl.getUserRegistryFromConfiguration | private UserRegistry getUserRegistryFromConfiguration() throws RegistryException {
"""
When a configuration element is defined, use it to resolve the effective
UserRegistry configuration.
@return
@throws RegistryException
"""
String[] refIds = this.refId;
if (refIds == null || refIds.lengt... | java | private UserRegistry getUserRegistryFromConfiguration() throws RegistryException {
String[] refIds = this.refId;
if (refIds == null || refIds.length == 0) {
// Can look for config.source = file
// If thats set, and we're missing this, we can error.
// If its not set, ... | [
"private",
"UserRegistry",
"getUserRegistryFromConfiguration",
"(",
")",
"throws",
"RegistryException",
"{",
"String",
"[",
"]",
"refIds",
"=",
"this",
".",
"refId",
";",
"if",
"(",
"refIds",
"==",
"null",
"||",
"refIds",
".",
"length",
"==",
"0",
")",
"{",
... | When a configuration element is defined, use it to resolve the effective
UserRegistry configuration.
@return
@throws RegistryException | [
"When",
"a",
"configuration",
"element",
"is",
"defined",
"use",
"it",
"to",
"resolve",
"the",
"effective",
"UserRegistry",
"configuration",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.registry/src/com/ibm/ws/security/registry/internal/UserRegistryServiceImpl.java#L447-L471 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeElement.java | TreeElement.updateName | protected void updateName(TreeElement parentNode, int index) {
"""
This method will update the name of this node and all of the children node. The name
of a node reflects it's position in the tree.
@param parentNode The parent node of this node.
@param index the index position of this node within the pare... | java | protected void updateName(TreeElement parentNode, int index)
{
setName(getNodeName(parentNode, index));
TreeElement[] children = getChildren();
for (int i = 0; i < children.length; i++) {
children[i].updateName(this, i);
}
} | [
"protected",
"void",
"updateName",
"(",
"TreeElement",
"parentNode",
",",
"int",
"index",
")",
"{",
"setName",
"(",
"getNodeName",
"(",
"parentNode",
",",
"index",
")",
")",
";",
"TreeElement",
"[",
"]",
"children",
"=",
"getChildren",
"(",
")",
";",
"for"... | This method will update the name of this node and all of the children node. The name
of a node reflects it's position in the tree.
@param parentNode The parent node of this node.
@param index the index position of this node within the parent node. | [
"This",
"method",
"will",
"update",
"the",
"name",
"of",
"this",
"node",
"and",
"all",
"of",
"the",
"children",
"node",
".",
"The",
"name",
"of",
"a",
"node",
"reflects",
"it",
"s",
"position",
"in",
"the",
"tree",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeElement.java#L731-L738 |
DiUS/pact-jvm | pact-jvm-consumer-java8/src/main/java/io/pactfoundation/consumer/dsl/LambdaDslJsonArray.java | LambdaDslJsonArray.minArrayLike | public LambdaDslJsonArray minArrayLike(Integer size, Consumer<LambdaDslJsonBody> nestedObject) {
"""
Element that is an array with a minimum size where each item must match the following example
@param size minimum size of the array
"""
final PactDslJsonBody arrayLike = pactArray.minArrayLike(size);... | java | public LambdaDslJsonArray minArrayLike(Integer size, Consumer<LambdaDslJsonBody> nestedObject) {
final PactDslJsonBody arrayLike = pactArray.minArrayLike(size);
final LambdaDslJsonBody dslBody = new LambdaDslJsonBody(arrayLike);
nestedObject.accept(dslBody);
arrayLike.closeArray();
... | [
"public",
"LambdaDslJsonArray",
"minArrayLike",
"(",
"Integer",
"size",
",",
"Consumer",
"<",
"LambdaDslJsonBody",
">",
"nestedObject",
")",
"{",
"final",
"PactDslJsonBody",
"arrayLike",
"=",
"pactArray",
".",
"minArrayLike",
"(",
"size",
")",
";",
"final",
"Lambd... | Element that is an array with a minimum size where each item must match the following example
@param size minimum size of the array | [
"Element",
"that",
"is",
"an",
"array",
"with",
"a",
"minimum",
"size",
"where",
"each",
"item",
"must",
"match",
"the",
"following",
"example"
] | train | https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer-java8/src/main/java/io/pactfoundation/consumer/dsl/LambdaDslJsonArray.java#L313-L319 |
anotheria/moskito | moskito-webui/src/main/java/net/anotheria/moskito/webui/journey/action/BaseJourneyAction.java | BaseJourneyAction.fillGraphDataMap | protected Map<String, GraphDataBean> fillGraphDataMap(Map<String, GraphDataBean> graphData, AnalyzedProducerCallsMapAO analyzedProducerCallsMap) {
"""
Converts values from {@link AnalyzedProducerCallsMapAO} to {@link GraphDataBean}s.
@param graphData Map containing graph data
@param analyzedProducerCallsMap {@li... | java | protected Map<String, GraphDataBean> fillGraphDataMap(Map<String, GraphDataBean> graphData, AnalyzedProducerCallsMapAO analyzedProducerCallsMap) {
if (graphData == null) {
graphData = new HashMap<>();
}
for (AnalyzedProducerCallsAO producerCallsBean : analyzedProducerCallsMap.getProducerCallsBeans()) {
// ... | [
"protected",
"Map",
"<",
"String",
",",
"GraphDataBean",
">",
"fillGraphDataMap",
"(",
"Map",
"<",
"String",
",",
"GraphDataBean",
">",
"graphData",
",",
"AnalyzedProducerCallsMapAO",
"analyzedProducerCallsMap",
")",
"{",
"if",
"(",
"graphData",
"==",
"null",
")",... | Converts values from {@link AnalyzedProducerCallsMapAO} to {@link GraphDataBean}s.
@param graphData Map containing graph data
@param analyzedProducerCallsMap {@link AnalyzedProducerCallsMapAO}
@return Map with graph data | [
"Converts",
"values",
"from",
"{"
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-webui/src/main/java/net/anotheria/moskito/webui/journey/action/BaseJourneyAction.java#L46-L78 |
jenkinsci/jenkins | core/src/main/java/jenkins/util/SystemProperties.java | SystemProperties.getLong | public static Long getLong(String name, Long def, Level logLevel) {
"""
Determines the integer value of the system property with the
specified name, or a default value.
This behaves just like <code>Long.getLong(String,Long)</code>, except that it
also consults the <code>ServletContext</code>'s "init" paramete... | java | public static Long getLong(String name, Long def, Level logLevel) {
String v = getString(name);
if (v != null) {
try {
return Long.decode(v);
} catch (NumberFormatException e) {
// Ignore, fallback to default
if (LOGGER.isLo... | [
"public",
"static",
"Long",
"getLong",
"(",
"String",
"name",
",",
"Long",
"def",
",",
"Level",
"logLevel",
")",
"{",
"String",
"v",
"=",
"getString",
"(",
"name",
")",
";",
"if",
"(",
"v",
"!=",
"null",
")",
"{",
"try",
"{",
"return",
"Long",
".",... | Determines the integer value of the system property with the
specified name, or a default value.
This behaves just like <code>Long.getLong(String,Long)</code>, except that it
also consults the <code>ServletContext</code>'s "init" parameters. If neither exist,
return the default value.
@param name property name.
@pa... | [
"Determines",
"the",
"integer",
"value",
"of",
"the",
"system",
"property",
"with",
"the",
"specified",
"name",
"or",
"a",
"default",
"value",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/SystemProperties.java#L430-L444 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCapturesInner.java | PacketCapturesInner.beginDelete | public void beginDelete(String resourceGroupName, String networkWatcherName, String packetCaptureName) {
"""
Deletes the specified packet capture session.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param packetCaptureName The name of th... | java | public void beginDelete(String resourceGroupName, String networkWatcherName, String packetCaptureName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"String",
"packetCaptureName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"networkWatcherName",
",",
"packetCaptureName",
")",... | Deletes the specified packet capture session.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param packetCaptureName The name of the packet capture session.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorRespo... | [
"Deletes",
"the",
"specified",
"packet",
"capture",
"session",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCapturesInner.java#L461-L463 |
glyptodon/guacamole-client | guacamole/src/main/java/org/apache/guacamole/resource/WebApplicationResource.java | WebApplicationResource.getMimeType | private static String getMimeType(ServletContext context, String path) {
"""
Derives a mimetype from the filename within the given path using the
given ServletContext, if possible.
@param context
The ServletContext to use to derive the mimetype.
@param path
The path to derive the mimetype from.
@return... | java | private static String getMimeType(ServletContext context, String path) {
// If mimetype is known, use defined mimetype
String mimetype = context.getMimeType(path);
if (mimetype != null)
return mimetype;
// Otherwise, default to application/octet-stream
return "appli... | [
"private",
"static",
"String",
"getMimeType",
"(",
"ServletContext",
"context",
",",
"String",
"path",
")",
"{",
"// If mimetype is known, use defined mimetype",
"String",
"mimetype",
"=",
"context",
".",
"getMimeType",
"(",
"path",
")",
";",
"if",
"(",
"mimetype",
... | Derives a mimetype from the filename within the given path using the
given ServletContext, if possible.
@param context
The ServletContext to use to derive the mimetype.
@param path
The path to derive the mimetype from.
@return
An appropriate mimetype based on the name of the file in the path,
or "application/octet-s... | [
"Derives",
"a",
"mimetype",
"from",
"the",
"filename",
"within",
"the",
"given",
"path",
"using",
"the",
"given",
"ServletContext",
"if",
"possible",
"."
] | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole/src/main/java/org/apache/guacamole/resource/WebApplicationResource.java#L56-L66 |
jeremylong/DependencyCheck | utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java | Settings.getFloat | public float getFloat(@NotNull final String key, float defaultValue) {
"""
Returns a float value from the properties file. If the value was
specified as a system property or passed in via the
<code>-Dprop=value</code> argument this method will return the value from
the system properties before the values in the... | java | public float getFloat(@NotNull final String key, float defaultValue) {
float retValue = defaultValue;
try {
retValue = Float.parseFloat(getString(key));
} catch (Throwable ignore) {
LOGGER.trace("ignore", ignore);
}
return retValue;
} | [
"public",
"float",
"getFloat",
"(",
"@",
"NotNull",
"final",
"String",
"key",
",",
"float",
"defaultValue",
")",
"{",
"float",
"retValue",
"=",
"defaultValue",
";",
"try",
"{",
"retValue",
"=",
"Float",
".",
"parseFloat",
"(",
"getString",
"(",
"key",
")",... | Returns a float value from the properties file. If the value was
specified as a system property or passed in via the
<code>-Dprop=value</code> argument this method will return the value from
the system properties before the values in the contained configuration
file.
@param key the key to lookup within the properties ... | [
"Returns",
"a",
"float",
"value",
"from",
"the",
"properties",
"file",
".",
"If",
"the",
"value",
"was",
"specified",
"as",
"a",
"system",
"property",
"or",
"passed",
"in",
"via",
"the",
"<code",
">",
"-",
"Dprop",
"=",
"value<",
"/",
"code",
">",
"arg... | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java#L1072-L1080 |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/struct/PackedSetsPoint2D_I32.java | PackedSetsPoint2D_I32.getSet | public void getSet(int which , FastQueue<Point2D_I32> list ) {
"""
Copies all the points in the set into the specified list
@param which (Input) which point set
@param list (Output) Storage for points
"""
list.reset();
BlockIndexLength set = sets.get(which);
for (int i = 0; i < set.length; i++) {
... | java | public void getSet(int which , FastQueue<Point2D_I32> list ) {
list.reset();
BlockIndexLength set = sets.get(which);
for (int i = 0; i < set.length; i++) {
int index = set.start + i*2;
int blockIndex = set.block + index/blockLength;
index %= blockLength;
int block[] = blocks.get( blockIndex );
l... | [
"public",
"void",
"getSet",
"(",
"int",
"which",
",",
"FastQueue",
"<",
"Point2D_I32",
">",
"list",
")",
"{",
"list",
".",
"reset",
"(",
")",
";",
"BlockIndexLength",
"set",
"=",
"sets",
".",
"get",
"(",
"which",
")",
";",
"for",
"(",
"int",
"i",
"... | Copies all the points in the set into the specified list
@param which (Input) which point set
@param list (Output) Storage for points | [
"Copies",
"all",
"the",
"points",
"in",
"the",
"set",
"into",
"the",
"specified",
"list"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/struct/PackedSetsPoint2D_I32.java#L160-L173 |
apache/reef | lang/java/reef-runtime-azbatch/src/main/java/org/apache/reef/runtime/azbatch/util/storage/SharedAccessSignatureCloudBlobClientProvider.java | SharedAccessSignatureCloudBlobClientProvider.generateSharedAccessSignature | @Override
public URI generateSharedAccessSignature(final CloudBlob cloudBlob, final SharedAccessBlobPolicy policy)
throws IOException {
"""
Generates a Shared Access Key URI for the given {@link CloudBlob}.
@param cloudBlob cloud blob to create a Shared Access Key URI for.
@param policy an instanc... | java | @Override
public URI generateSharedAccessSignature(final CloudBlob cloudBlob, final SharedAccessBlobPolicy policy)
throws IOException {
try {
final URI uri = cloudBlob.getStorageUri().getPrimaryUri();
Map<String, String[]> queryString = PathUtility.parseQueryString(this.azureStorageContainerSAS... | [
"@",
"Override",
"public",
"URI",
"generateSharedAccessSignature",
"(",
"final",
"CloudBlob",
"cloudBlob",
",",
"final",
"SharedAccessBlobPolicy",
"policy",
")",
"throws",
"IOException",
"{",
"try",
"{",
"final",
"URI",
"uri",
"=",
"cloudBlob",
".",
"getStorageUri",... | Generates a Shared Access Key URI for the given {@link CloudBlob}.
@param cloudBlob cloud blob to create a Shared Access Key URI for.
@param policy an instance of {@link SharedAccessBlobPolicy} that specifies permissions and signature's
validity time period.
@return a Shared Access Key URI for the giv... | [
"Generates",
"a",
"Shared",
"Access",
"Key",
"URI",
"for",
"the",
"given",
"{"
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-azbatch/src/main/java/org/apache/reef/runtime/azbatch/util/storage/SharedAccessSignatureCloudBlobClientProvider.java#L87-L109 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.addSubList | public int addSubList(UUID appId, String versionId, UUID clEntityId, WordListObject wordListCreateObject) {
"""
Adds a list to an existing closed list.
@param appId The application ID.
@param versionId The version ID.
@param clEntityId The closed list entity extractor ID.
@param wordListCreateObject Words li... | java | public int addSubList(UUID appId, String versionId, UUID clEntityId, WordListObject wordListCreateObject) {
return addSubListWithServiceResponseAsync(appId, versionId, clEntityId, wordListCreateObject).toBlocking().single().body();
} | [
"public",
"int",
"addSubList",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"clEntityId",
",",
"WordListObject",
"wordListCreateObject",
")",
"{",
"return",
"addSubListWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"clEntityId",
",... | Adds a list to an existing closed list.
@param appId The application ID.
@param versionId The version ID.
@param clEntityId The closed list entity extractor ID.
@param wordListCreateObject Words list.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the... | [
"Adds",
"a",
"list",
"to",
"an",
"existing",
"closed",
"list",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L5444-L5446 |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/io/Closeables.java | Closeables.closeableFrom | public static Closeable closeableFrom(@WillNotClose @Nullable final Statement statement) {
"""
Provides {@link Closeable} interface for {@link Statement}
@param statement the statement to decorate
@return a closeable decorated statement
"""
return closeableFrom(statement, Statement::close);
} | java | public static Closeable closeableFrom(@WillNotClose @Nullable final Statement statement) {
return closeableFrom(statement, Statement::close);
} | [
"public",
"static",
"Closeable",
"closeableFrom",
"(",
"@",
"WillNotClose",
"@",
"Nullable",
"final",
"Statement",
"statement",
")",
"{",
"return",
"closeableFrom",
"(",
"statement",
",",
"Statement",
"::",
"close",
")",
";",
"}"
] | Provides {@link Closeable} interface for {@link Statement}
@param statement the statement to decorate
@return a closeable decorated statement | [
"Provides",
"{",
"@link",
"Closeable",
"}",
"interface",
"for",
"{",
"@link",
"Statement",
"}"
] | train | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/io/Closeables.java#L48-L50 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/hostchooser/GlobalHostStatusTracker.java | GlobalHostStatusTracker.reportHostStatus | public static void reportHostStatus(HostSpec hostSpec, HostStatus hostStatus) {
"""
Store the actual observed host status.
@param hostSpec The host whose status is known.
@param hostStatus Latest known status for the host.
"""
long now = currentTimeMillis();
synchronized (hostStatusMap) {
Hos... | java | public static void reportHostStatus(HostSpec hostSpec, HostStatus hostStatus) {
long now = currentTimeMillis();
synchronized (hostStatusMap) {
HostSpecStatus hostSpecStatus = hostStatusMap.get(hostSpec);
if (hostSpecStatus == null) {
hostSpecStatus = new HostSpecStatus(hostSpec);
hos... | [
"public",
"static",
"void",
"reportHostStatus",
"(",
"HostSpec",
"hostSpec",
",",
"HostStatus",
"hostStatus",
")",
"{",
"long",
"now",
"=",
"currentTimeMillis",
"(",
")",
";",
"synchronized",
"(",
"hostStatusMap",
")",
"{",
"HostSpecStatus",
"hostSpecStatus",
"=",... | Store the actual observed host status.
@param hostSpec The host whose status is known.
@param hostStatus Latest known status for the host. | [
"Store",
"the",
"actual",
"observed",
"host",
"status",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/hostchooser/GlobalHostStatusTracker.java#L30-L41 |
undertow-io/undertow | core/src/main/java/io/undertow/websockets/core/WebSockets.java | WebSockets.sendCloseBlocking | public static void sendCloseBlocking(final int code, String reason, final WebSocketChannel wsChannel) throws IOException {
"""
Sends a complete close message, invoking the callback when complete
@param code
@param wsChannel The web socket channel
"""
sendCloseBlocking(new CloseMessage(code, reason)... | java | public static void sendCloseBlocking(final int code, String reason, final WebSocketChannel wsChannel) throws IOException {
sendCloseBlocking(new CloseMessage(code, reason), wsChannel);
} | [
"public",
"static",
"void",
"sendCloseBlocking",
"(",
"final",
"int",
"code",
",",
"String",
"reason",
",",
"final",
"WebSocketChannel",
"wsChannel",
")",
"throws",
"IOException",
"{",
"sendCloseBlocking",
"(",
"new",
"CloseMessage",
"(",
"code",
",",
"reason",
... | Sends a complete close message, invoking the callback when complete
@param code
@param wsChannel The web socket channel | [
"Sends",
"a",
"complete",
"close",
"message",
"invoking",
"the",
"callback",
"when",
"complete"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L876-L878 |
hawkular/hawkular-agent | hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/JBossASClient.java | JBossASClient.createReadAttributeRequest | public static ModelNode createReadAttributeRequest(boolean runtime, String attributeName, Address address) {
"""
Convienence method that allows you to create request that reads a single attribute
value to a resource.
@param runtime if <code>true</code>, the attribute is a runtime attribute
@param attributeNam... | java | public static ModelNode createReadAttributeRequest(boolean runtime, String attributeName, Address address) {
final ModelNode op = createRequest(READ_ATTRIBUTE, address);
op.get("include-runtime").set(runtime);
op.get(NAME).set(attributeName);
return op;
} | [
"public",
"static",
"ModelNode",
"createReadAttributeRequest",
"(",
"boolean",
"runtime",
",",
"String",
"attributeName",
",",
"Address",
"address",
")",
"{",
"final",
"ModelNode",
"op",
"=",
"createRequest",
"(",
"READ_ATTRIBUTE",
",",
"address",
")",
";",
"op",
... | Convienence method that allows you to create request that reads a single attribute
value to a resource.
@param runtime if <code>true</code>, the attribute is a runtime attribute
@param attributeName the name of the attribute whose value is to be read
@param address identifies the resource
@return the request | [
"Convienence",
"method",
"that",
"allows",
"you",
"to",
"create",
"request",
"that",
"reads",
"a",
"single",
"attribute",
"value",
"to",
"a",
"resource",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/JBossASClient.java#L95-L100 |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java | ClientEntry.setContent | public void setContent(final String contentString, final String type) {
"""
Set content of entry.
@param contentString content string.
@param type Must be "text" for plain text, "html" for escaped HTML, "xhtml" for XHTML or a
valid MIME content-type.
"""
final Content newContent = new Content();
... | java | public void setContent(final String contentString, final String type) {
final Content newContent = new Content();
newContent.setType(type == null ? Content.HTML : type);
newContent.setValue(contentString);
final ArrayList<Content> contents = new ArrayList<Content>();
contents.add... | [
"public",
"void",
"setContent",
"(",
"final",
"String",
"contentString",
",",
"final",
"String",
"type",
")",
"{",
"final",
"Content",
"newContent",
"=",
"new",
"Content",
"(",
")",
";",
"newContent",
".",
"setType",
"(",
"type",
"==",
"null",
"?",
"Conten... | Set content of entry.
@param contentString content string.
@param type Must be "text" for plain text, "html" for escaped HTML, "xhtml" for XHTML or a
valid MIME content-type. | [
"Set",
"content",
"of",
"entry",
"."
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/client/ClientEntry.java#L87-L94 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/YearQuarter.java | YearQuarter.plusQuarters | public YearQuarter plusQuarters(long quartersToAdd) {
"""
Returns a copy of this year-quarter with the specified period in quarters added.
<p>
This instance is immutable and unaffected by this method call.
@param quartersToAdd the quarters to add, may be negative
@return a {@code YearQuarter} based on this ... | java | public YearQuarter plusQuarters(long quartersToAdd) {
if (quartersToAdd == 0) {
return this;
}
long quarterCount = year * 4L + (quarter.getValue() - 1);
long calcQuarters = quarterCount + quartersToAdd; // safe overflow
int newYear = YEAR.checkValidIntValue(Math.floo... | [
"public",
"YearQuarter",
"plusQuarters",
"(",
"long",
"quartersToAdd",
")",
"{",
"if",
"(",
"quartersToAdd",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"long",
"quarterCount",
"=",
"year",
"*",
"4L",
"+",
"(",
"quarter",
".",
"getValue",
"(",
")",
... | Returns a copy of this year-quarter with the specified period in quarters added.
<p>
This instance is immutable and unaffected by this method call.
@param quartersToAdd the quarters to add, may be negative
@return a {@code YearQuarter} based on this year-quarter with the quarters added, not null
@throws DateTimeExcep... | [
"Returns",
"a",
"copy",
"of",
"this",
"year",
"-",
"quarter",
"with",
"the",
"specified",
"period",
"in",
"quarters",
"added",
".",
"<p",
">",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/YearQuarter.java#L865-L874 |
groundupworks/wings | wings-facebook/src/main/java/com/groundupworks/wings/facebook/FacebookEndpoint.java | FacebookEndpoint.finishSettingsRequest | private FacebookSettings finishSettingsRequest(int requestCode, int resultCode, Intent data) {
"""
Finishes a {@link com.groundupworks.wings.facebook.FacebookEndpoint#startSettingsRequest(android.app.Activity, android.support.v4.app.Fragment)}.
@param requestCode the integer request code originally supplied to ... | java | private FacebookSettings finishSettingsRequest(int requestCode, int resultCode, Intent data) {
FacebookSettings settings = null;
if (requestCode == SETTINGS_REQUEST_CODE && resultCode == Activity.RESULT_OK && data != null) {
// Construct settings from the extras bundle.
settings... | [
"private",
"FacebookSettings",
"finishSettingsRequest",
"(",
"int",
"requestCode",
",",
"int",
"resultCode",
",",
"Intent",
"data",
")",
"{",
"FacebookSettings",
"settings",
"=",
"null",
";",
"if",
"(",
"requestCode",
"==",
"SETTINGS_REQUEST_CODE",
"&&",
"resultCode... | Finishes a {@link com.groundupworks.wings.facebook.FacebookEndpoint#startSettingsRequest(android.app.Activity, android.support.v4.app.Fragment)}.
@param requestCode the integer request code originally supplied to startActivityForResult(), allowing you to identify who
this result came from.
@param resultCode the integ... | [
"Finishes",
"a",
"{",
"@link",
"com",
".",
"groundupworks",
".",
"wings",
".",
"facebook",
".",
"FacebookEndpoint#startSettingsRequest",
"(",
"android",
".",
"app",
".",
"Activity",
"android",
".",
"support",
".",
"v4",
".",
"app",
".",
"Fragment",
")",
"}",... | train | https://github.com/groundupworks/wings/blob/03d2827c30ef55f2db4e23f7500e016c7771fa39/wings-facebook/src/main/java/com/groundupworks/wings/facebook/FacebookEndpoint.java#L481-L489 |
zxing/zxing | core/src/main/java/com/google/zxing/qrcode/encoder/MaskUtil.java | MaskUtil.getDataMaskBit | static boolean getDataMaskBit(int maskPattern, int x, int y) {
"""
Return the mask bit for "getMaskPattern" at "x" and "y". See 8.8 of JISX0510:2004 for mask
pattern conditions.
"""
int intermediate;
int temp;
switch (maskPattern) {
case 0:
intermediate = (y + x) & 0x1;
break... | java | static boolean getDataMaskBit(int maskPattern, int x, int y) {
int intermediate;
int temp;
switch (maskPattern) {
case 0:
intermediate = (y + x) & 0x1;
break;
case 1:
intermediate = y & 0x1;
break;
case 2:
intermediate = x % 3;
break;
c... | [
"static",
"boolean",
"getDataMaskBit",
"(",
"int",
"maskPattern",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"int",
"intermediate",
";",
"int",
"temp",
";",
"switch",
"(",
"maskPattern",
")",
"{",
"case",
"0",
":",
"intermediate",
"=",
"(",
"y",
"+",
... | Return the mask bit for "getMaskPattern" at "x" and "y". See 8.8 of JISX0510:2004 for mask
pattern conditions. | [
"Return",
"the",
"mask",
"bit",
"for",
"getMaskPattern",
"at",
"x",
"and",
"y",
".",
"See",
"8",
".",
"8",
"of",
"JISX0510",
":",
"2004",
"for",
"mask",
"pattern",
"conditions",
"."
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/qrcode/encoder/MaskUtil.java#L154-L189 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/internal/util/VelocityParser.java | VelocityParser.getKeyWord | public int getKeyWord(char[] array, int currentIndex, StringBuffer velocityBlock, VelocityParserContext context)
throws InvalidVelocityException {
"""
Get any valid Velocity block starting with a sharp character (#if, #somemaccro(), ##comment etc.).
@param array the source to parse
@param currentIndex ... | java | public int getKeyWord(char[] array, int currentIndex, StringBuffer velocityBlock, VelocityParserContext context)
throws InvalidVelocityException
{
int i = currentIndex;
if (i + 1 >= array.length) {
throw new InvalidVelocityException();
}
if (array[i + 1] == '#')... | [
"public",
"int",
"getKeyWord",
"(",
"char",
"[",
"]",
"array",
",",
"int",
"currentIndex",
",",
"StringBuffer",
"velocityBlock",
",",
"VelocityParserContext",
"context",
")",
"throws",
"InvalidVelocityException",
"{",
"int",
"i",
"=",
"currentIndex",
";",
"if",
... | Get any valid Velocity block starting with a sharp character (#if, #somemaccro(), ##comment etc.).
@param array the source to parse
@param currentIndex the current index in the <code>array</code>
@param velocityBlock the buffer where to append matched velocity block
@param context the parser context to put some inform... | [
"Get",
"any",
"valid",
"Velocity",
"block",
"starting",
"with",
"a",
"sharp",
"character",
"(",
"#if",
"#somemaccro",
"()",
"##comment",
"etc",
".",
")",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/internal/util/VelocityParser.java#L99-L122 |
alipay/sofa-rpc | core/api/src/main/java/com/alipay/sofa/rpc/config/AbstractInterfaceConfig.java | AbstractInterfaceConfig.setParameters | public S setParameters(Map<String, String> parameters) {
"""
Sets parameters.
@param parameters the parameters
@return the parameters
"""
if (this.parameters == null) {
this.parameters = new ConcurrentHashMap<String, String>();
}
this.parameters.putAll(parameters);
... | java | public S setParameters(Map<String, String> parameters) {
if (this.parameters == null) {
this.parameters = new ConcurrentHashMap<String, String>();
}
this.parameters.putAll(parameters);
return castThis();
} | [
"public",
"S",
"setParameters",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"if",
"(",
"this",
".",
"parameters",
"==",
"null",
")",
"{",
"this",
".",
"parameters",
"=",
"new",
"ConcurrentHashMap",
"<",
"String",
",",
"String",... | Sets parameters.
@param parameters the parameters
@return the parameters | [
"Sets",
"parameters",
"."
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/config/AbstractInterfaceConfig.java#L553-L559 |
alibaba/otter | shared/common/src/main/java/com/alibaba/otter/shared/common/utils/zookeeper/ZkClientx.java | ZkClientx.createPersistentSequential | public String createPersistentSequential(String path, Object data) throws ZkInterruptedException,
IllegalArgumentException, ZkException,
RuntimeException {
"""
Create a persis... | java | public String createPersistentSequential(String path, Object data) throws ZkInterruptedException,
IllegalArgumentException, ZkException,
RuntimeException {
return create(pa... | [
"public",
"String",
"createPersistentSequential",
"(",
"String",
"path",
",",
"Object",
"data",
")",
"throws",
"ZkInterruptedException",
",",
"IllegalArgumentException",
",",
"ZkException",
",",
"RuntimeException",
"{",
"return",
"create",
"(",
"path",
",",
"data",
... | Create a persistent, sequental node.
@param path
@param data
@return create node's path
@throws ZkInterruptedException if operation was interrupted, or a required reconnection got interrupted
@throws IllegalArgumentException if called from anything except the ZooKeeper event thread
@throws ZkException if any ZooKeeper... | [
"Create",
"a",
"persistent",
"sequental",
"node",
"."
] | train | https://github.com/alibaba/otter/blob/c7b5f94a0dd162e01ddffaf3a63cade7d23fca55/shared/common/src/main/java/com/alibaba/otter/shared/common/utils/zookeeper/ZkClientx.java#L364-L368 |
TheHortonMachine/hortonmachine | dbs/src/main/java/jsqlite/Database.java | Database.open_blob | public Blob open_blob( String db, String table, String column, long row, boolean rw ) throws jsqlite.Exception {
"""
Open an SQLite3 blob. Only available in SQLite 3.4.0 and above.
@param db database name
@param table table name
@param column column name
@param row row identifier
@param rw if true, open for r... | java | public Blob open_blob( String db, String table, String column, long row, boolean rw ) throws jsqlite.Exception {
synchronized (this) {
Blob blob = new Blob();
_open_blob(db, table, column, row, rw, blob);
return blob;
}
} | [
"public",
"Blob",
"open_blob",
"(",
"String",
"db",
",",
"String",
"table",
",",
"String",
"column",
",",
"long",
"row",
",",
"boolean",
"rw",
")",
"throws",
"jsqlite",
".",
"Exception",
"{",
"synchronized",
"(",
"this",
")",
"{",
"Blob",
"blob",
"=",
... | Open an SQLite3 blob. Only available in SQLite 3.4.0 and above.
@param db database name
@param table table name
@param column column name
@param row row identifier
@param rw if true, open for read-write, else read-only
@return a Blob object | [
"Open",
"an",
"SQLite3",
"blob",
".",
"Only",
"available",
"in",
"SQLite",
"3",
".",
"4",
".",
"0",
"and",
"above",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/jsqlite/Database.java#L730-L736 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemovePoints.java | ST_RemovePoints.removePoint | public static Geometry removePoint(Geometry geometry, Polygon polygon) throws SQLException {
"""
Remove all vertices that are located within a polygon
@param geometry
@param polygon
@return
@throws SQLException
"""
if(geometry == null){
return null;
}
GeometryEditor lo... | java | public static Geometry removePoint(Geometry geometry, Polygon polygon) throws SQLException {
if(geometry == null){
return null;
}
GeometryEditor localGeometryEditor = new GeometryEditor();
PolygonDeleteVertexOperation localBoxDeleteVertexOperation = new PolygonDeleteVertexOpe... | [
"public",
"static",
"Geometry",
"removePoint",
"(",
"Geometry",
"geometry",
",",
"Polygon",
"polygon",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"GeometryEditor",
"localGeometryEditor",
"=",
... | Remove all vertices that are located within a polygon
@param geometry
@param polygon
@return
@throws SQLException | [
"Remove",
"all",
"vertices",
"that",
"are",
"located",
"within",
"a",
"polygon"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/ST_RemovePoints.java#L54-L65 |
tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/server/UTCDateTimeUtils.java | UTCDateTimeUtils.getDateValue | public static final Date getDateValue(TimeZone zone, Long dateBoxValue, Long timeBoxValue) {
"""
Returns the {@link Date} for the values of the UTCDateBox and
UTCTimeBox which were edited in the specified {@link TimeZone}.
@param zone
The {@link TimeZone} in which the Date was edited.
@param dateBoxValue
Th... | java | public static final Date getDateValue(TimeZone zone, Long dateBoxValue, Long timeBoxValue) {
if (dateBoxValue == null) return null;
Calendar gmt = GregorianCalendar.getInstance(TimeZone.getTimeZone("GMT"));
gmt.setTimeInMillis(dateBoxValue.longValue());
Calendar cal = GregorianCalenda... | [
"public",
"static",
"final",
"Date",
"getDateValue",
"(",
"TimeZone",
"zone",
",",
"Long",
"dateBoxValue",
",",
"Long",
"timeBoxValue",
")",
"{",
"if",
"(",
"dateBoxValue",
"==",
"null",
")",
"return",
"null",
";",
"Calendar",
"gmt",
"=",
"GregorianCalendar",
... | Returns the {@link Date} for the values of the UTCDateBox and
UTCTimeBox which were edited in the specified {@link TimeZone}.
@param zone
The {@link TimeZone} in which the Date was edited.
@param dateBoxValue
The value of the {@link UTCDateBox} control.
@param timeBoxValue
The value of the {@link UTCTimeBox} control.
... | [
"Returns",
"the",
"{",
"@link",
"Date",
"}",
"for",
"the",
"values",
"of",
"the",
"UTCDateBox",
"and",
"UTCTimeBox",
"which",
"were",
"edited",
"in",
"the",
"specified",
"{",
"@link",
"TimeZone",
"}",
"."
] | train | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/server/UTCDateTimeUtils.java#L118-L163 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java | SynchronousRequest.getExchangeInfo | public Exchange getExchangeInfo(Exchange.Type currency, long quantity) throws GuildWars2Exception {
"""
For more info on exchange coins API go <a href="https://wiki.guildwars2.com/wiki/API:2/commerce/exchange/coins">here</a><br/>
@param currency exchange currency type
@param quantity The amount to exchange
@r... | java | public Exchange getExchangeInfo(Exchange.Type currency, long quantity) throws GuildWars2Exception {
isValueValid(quantity);
try {
Response<Exchange> response = gw2API.getExchangeInfo(currency.name(), Long.toString(quantity)).execute();
if (!response.isSuccessful()) throwError(response.code(), response.errorBo... | [
"public",
"Exchange",
"getExchangeInfo",
"(",
"Exchange",
".",
"Type",
"currency",
",",
"long",
"quantity",
")",
"throws",
"GuildWars2Exception",
"{",
"isValueValid",
"(",
"quantity",
")",
";",
"try",
"{",
"Response",
"<",
"Exchange",
">",
"response",
"=",
"gw... | For more info on exchange coins API go <a href="https://wiki.guildwars2.com/wiki/API:2/commerce/exchange/coins">here</a><br/>
@param currency exchange currency type
@param quantity The amount to exchange
@return the current coins to gems exchange rate
@throws GuildWars2Exception see {@link ErrorCode} for detail
@see E... | [
"For",
"more",
"info",
"on",
"exchange",
"coins",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"commerce",
"/",
"exchange",
"/",
"coins",
">",
"here<",
"/",
"a",
... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/SynchronousRequest.java#L1234-L1243 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDLoss.java | SDLoss.sigmoidCrossEntropy | public SDVariable sigmoidCrossEntropy(String name, @NonNull SDVariable label, @NonNull SDVariable predictions) {
"""
See {@link #sigmoidCrossEntropy(String, SDVariable, SDVariable, SDVariable, LossReduce, double)}.
"""
return sigmoidCrossEntropy(name, label, predictions, null, LossReduce.MEAN_BY_NONZER... | java | public SDVariable sigmoidCrossEntropy(String name, @NonNull SDVariable label, @NonNull SDVariable predictions) {
return sigmoidCrossEntropy(name, label, predictions, null, LossReduce.MEAN_BY_NONZERO_WEIGHT_COUNT, SigmoidCrossEntropyLoss.DEFAULT_LABEL_SMOOTHING);
} | [
"public",
"SDVariable",
"sigmoidCrossEntropy",
"(",
"String",
"name",
",",
"@",
"NonNull",
"SDVariable",
"label",
",",
"@",
"NonNull",
"SDVariable",
"predictions",
")",
"{",
"return",
"sigmoidCrossEntropy",
"(",
"name",
",",
"label",
",",
"predictions",
",",
"nu... | See {@link #sigmoidCrossEntropy(String, SDVariable, SDVariable, SDVariable, LossReduce, double)}. | [
"See",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDLoss.java#L393-L395 |
VueGWT/vue-gwt | processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentInjectedDependenciesBuilder.java | ComponentInjectedDependenciesBuilder.addInjectedVariable | private void addInjectedVariable(VariableElement element, String fieldName) {
"""
Add an injected variable to our component
@param element The {@link VariableElement} that was injected
@param fieldName The name of the field
"""
TypeName typeName = resolveVariableTypeName(element, messager);
// Cre... | java | private void addInjectedVariable(VariableElement element, String fieldName) {
TypeName typeName = resolveVariableTypeName(element, messager);
// Create field
FieldSpec.Builder fieldBuilder = FieldSpec.builder(typeName, fieldName, Modifier.PUBLIC);
// Copy field annotations
element
.getAnno... | [
"private",
"void",
"addInjectedVariable",
"(",
"VariableElement",
"element",
",",
"String",
"fieldName",
")",
"{",
"TypeName",
"typeName",
"=",
"resolveVariableTypeName",
"(",
"element",
",",
"messager",
")",
";",
"// Create field",
"FieldSpec",
".",
"Builder",
"fie... | Add an injected variable to our component
@param element The {@link VariableElement} that was injected
@param fieldName The name of the field | [
"Add",
"an",
"injected",
"variable",
"to",
"our",
"component"
] | train | https://github.com/VueGWT/vue-gwt/blob/961cd83aed6fe8e2dd80c279847f1b3f62918a1f/processors/src/main/java/com/axellience/vuegwt/processors/component/ComponentInjectedDependenciesBuilder.java#L176-L196 |
SpartaTech/sparta-spring-web-utils | src/main/java/org/sparta/springwebutils/property/PropertiesLoaderBuilder.java | PropertiesLoaderBuilder.loadPropertiesByPrefix | public PropertiesLoaderBuilder loadPropertiesByPrefix(String prefix, boolean removePrefix) {
"""
Loads all properties found for a given prefix.
@param prefix prefix to find the properties
@param removePrefix if true - removes the prefix from the destination prop, false - copy with the same name
@return Proper... | java | public PropertiesLoaderBuilder loadPropertiesByPrefix(String prefix, boolean removePrefix) {
for (PropertySource<?> propertySource : env.getPropertySources()) {
if (propertySource instanceof MapPropertySource) {
MapPropertySource mapPropSource = (MapPropertySource) propertySource;
... | [
"public",
"PropertiesLoaderBuilder",
"loadPropertiesByPrefix",
"(",
"String",
"prefix",
",",
"boolean",
"removePrefix",
")",
"{",
"for",
"(",
"PropertySource",
"<",
"?",
">",
"propertySource",
":",
"env",
".",
"getPropertySources",
"(",
")",
")",
"{",
"if",
"(",... | Loads all properties found for a given prefix.
@param prefix prefix to find the properties
@param removePrefix if true - removes the prefix from the destination prop, false - copy with the same name
@return PropertyLoaderBuilder to continue the builder chain | [
"Loads",
"all",
"properties",
"found",
"for",
"a",
"given",
"prefix",
"."
] | train | https://github.com/SpartaTech/sparta-spring-web-utils/blob/f5382474d46a6048d58707fc64e7936277e8b2ce/src/main/java/org/sparta/springwebutils/property/PropertiesLoaderBuilder.java#L80-L96 |
eclipse/hawkbit | hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/RepositoryApplicationConfiguration.java | RepositoryApplicationConfiguration.rolloutScheduler | @Bean
@ConditionalOnMissingBean
@Profile("!test")
@ConditionalOnProperty(prefix = "hawkbit.rollout.scheduler", name = "enabled", matchIfMissing = true)
RolloutScheduler rolloutScheduler(final TenantAware tenantAware, final SystemManagement systemManagement,
final RolloutManagement rolloutMan... | java | @Bean
@ConditionalOnMissingBean
@Profile("!test")
@ConditionalOnProperty(prefix = "hawkbit.rollout.scheduler", name = "enabled", matchIfMissing = true)
RolloutScheduler rolloutScheduler(final TenantAware tenantAware, final SystemManagement systemManagement,
final RolloutManagement rolloutMan... | [
"@",
"Bean",
"@",
"ConditionalOnMissingBean",
"@",
"Profile",
"(",
"\"!test\"",
")",
"@",
"ConditionalOnProperty",
"(",
"prefix",
"=",
"\"hawkbit.rollout.scheduler\"",
",",
"name",
"=",
"\"enabled\"",
",",
"matchIfMissing",
"=",
"true",
")",
"RolloutScheduler",
"rol... | {@link RolloutScheduler} bean.
Note: does not activate in test profile, otherwise it is hard to test the
rollout handling functionality.
@param systemManagement
to find all tenants
@param rolloutManagement
to run the rollout handler
@param systemSecurityContext
to run as system
@return a new {@link RolloutScheduler} ... | [
"{",
"@link",
"RolloutScheduler",
"}",
"bean",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/RepositoryApplicationConfiguration.java#L849-L856 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java | TypeExtractionUtils.hasSuperclass | public static boolean hasSuperclass(Class<?> clazz, String superClassName) {
"""
Returns true if the given class has a superclass of given name.
@param clazz class to be analyzed
@param superClassName class name of the super class
"""
List<Type> hierarchy = new ArrayList<>();
getTypeHierarchy(hierarchy... | java | public static boolean hasSuperclass(Class<?> clazz, String superClassName) {
List<Type> hierarchy = new ArrayList<>();
getTypeHierarchy(hierarchy, clazz, Object.class);
for (Type t : hierarchy) {
if (isClassType(t) && typeToClass(t).getName().equals(superClassName)) {
return true;
}
}
return false;
... | [
"public",
"static",
"boolean",
"hasSuperclass",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"superClassName",
")",
"{",
"List",
"<",
"Type",
">",
"hierarchy",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"getTypeHierarchy",
"(",
"hierarchy",
",",... | Returns true if the given class has a superclass of given name.
@param clazz class to be analyzed
@param superClassName class name of the super class | [
"Returns",
"true",
"if",
"the",
"given",
"class",
"has",
"a",
"superclass",
"of",
"given",
"name",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java#L311-L320 |
Azure/azure-sdk-for-java | postgresql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/postgresql/v2017_12_01/implementation/ServerSecurityAlertPoliciesInner.java | ServerSecurityAlertPoliciesInner.beginCreateOrUpdateAsync | public Observable<ServerSecurityAlertPolicyInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, ServerSecurityAlertPolicyInner parameters) {
"""
Creates or updates a threat detection policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtai... | java | public Observable<ServerSecurityAlertPolicyInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, ServerSecurityAlertPolicyInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ServerSecurityAlertPoli... | [
"public",
"Observable",
"<",
"ServerSecurityAlertPolicyInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"ServerSecurityAlertPolicyInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",... | Creates or updates a threat detection policy.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param parameters The server security alert policy.
@throws IllegalArg... | [
"Creates",
"or",
"updates",
"a",
"threat",
"detection",
"policy",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/postgresql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/postgresql/v2017_12_01/implementation/ServerSecurityAlertPoliciesInner.java#L274-L281 |
jsonld-java/jsonld-java | core/src/main/java/com/github/jsonldjava/utils/JsonUtils.java | JsonUtils.fromInputStream | public static Object fromInputStream(InputStream input) throws IOException {
"""
Parses a JSON-LD document from the given {@link InputStream} to an object
that can be used as input for the {@link JsonLdApi} and
{@link JsonLdProcessor} methods.<br>
Uses UTF-8 as the character encoding when decoding the InputStre... | java | public static Object fromInputStream(InputStream input) throws IOException {
// filter BOMs from InputStream
try (final BOMInputStream bOMInputStream = new BOMInputStream(input, false,
ByteOrderMark.UTF_8, ByteOrderMark.UTF_16BE, ByteOrderMark.UTF_16LE,
ByteOrderMark.UTF_... | [
"public",
"static",
"Object",
"fromInputStream",
"(",
"InputStream",
"input",
")",
"throws",
"IOException",
"{",
"// filter BOMs from InputStream",
"try",
"(",
"final",
"BOMInputStream",
"bOMInputStream",
"=",
"new",
"BOMInputStream",
"(",
"input",
",",
"false",
",",
... | Parses a JSON-LD document from the given {@link InputStream} to an object
that can be used as input for the {@link JsonLdApi} and
{@link JsonLdProcessor} methods.<br>
Uses UTF-8 as the character encoding when decoding the InputStream.
@param input
The JSON-LD document in an InputStream.
@return A JSON Object.
@throws ... | [
"Parses",
"a",
"JSON",
"-",
"LD",
"document",
"from",
"the",
"given",
"{",
"@link",
"InputStream",
"}",
"to",
"an",
"object",
"that",
"can",
"be",
"used",
"as",
"input",
"for",
"the",
"{",
"@link",
"JsonLdApi",
"}",
"and",
"{",
"@link",
"JsonLdProcessor"... | train | https://github.com/jsonld-java/jsonld-java/blob/efeef6ee96029a0011649633457035fa6be42da1/core/src/main/java/com/github/jsonldjava/utils/JsonUtils.java#L95-L113 |
alipay/sofa-rpc | extension-impl/registry-sofa/src/main/java/com/alipay/sofa/rpc/registry/sofa/SofaRegistrySubscribeCallback.java | SofaRegistrySubscribeCallback.handleDataToListener | void handleDataToListener(String dataId, ConsumerConfig config, ProviderInfoListener listener) {
"""
单独通知某个Listener
@param dataId 订阅关键字
@param config 服务端订阅者配置
@param listener 服务列表监听器
"""
if (!canNotify()) {
return;
}
if (lastUserData != null) {
ComposeUs... | java | void handleDataToListener(String dataId, ConsumerConfig config, ProviderInfoListener listener) {
if (!canNotify()) {
return;
}
if (lastUserData != null) {
ComposeUserData composeUserData = composeUserAndConfigData(lastUserData, lastConfigData);
notifyToListene... | [
"void",
"handleDataToListener",
"(",
"String",
"dataId",
",",
"ConsumerConfig",
"config",
",",
"ProviderInfoListener",
"listener",
")",
"{",
"if",
"(",
"!",
"canNotify",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"lastUserData",
"!=",
"null",
")",
... | 单独通知某个Listener
@param dataId 订阅关键字
@param config 服务端订阅者配置
@param listener 服务列表监听器 | [
"单独通知某个Listener"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/registry-sofa/src/main/java/com/alipay/sofa/rpc/registry/sofa/SofaRegistrySubscribeCallback.java#L129-L137 |
akberc/ceylon-maven-plugin | src/main/java/com/dgwave/car/maven/CeylonInstallJar.java | CeylonInstallJar.readModel | private Model readModel(final InputStream pomStream) throws MojoExecutionException {
"""
Parses a POM.
@param pomStream The path of the POM file to parse, must not be <code>null</code>.
@return The model from the POM file, never <code>null</code>.
@throws MojoExecutionException If the POM could not be parsed.... | java | private Model readModel(final InputStream pomStream) throws MojoExecutionException {
Reader reader = null;
try {
reader = ReaderFactory.newXmlReader(pomStream);
return new MavenXpp3Reader().read(reader);
} catch (FileNotFoundException e) {
throw new Mojo... | [
"private",
"Model",
"readModel",
"(",
"final",
"InputStream",
"pomStream",
")",
"throws",
"MojoExecutionException",
"{",
"Reader",
"reader",
"=",
"null",
";",
"try",
"{",
"reader",
"=",
"ReaderFactory",
".",
"newXmlReader",
"(",
"pomStream",
")",
";",
"return",
... | Parses a POM.
@param pomStream The path of the POM file to parse, must not be <code>null</code>.
@return The model from the POM file, never <code>null</code>.
@throws MojoExecutionException If the POM could not be parsed. | [
"Parses",
"a",
"POM",
"."
] | train | https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/maven/CeylonInstallJar.java#L298-L312 |
trellis-ldp-archive/trellis-http | src/main/java/org/trellisldp/http/impl/RdfUtils.java | RdfUtils.getDefaultProfile | public static IRI getDefaultProfile(final RDFSyntax syntax, final IRI identifier) {
"""
Get a default profile IRI from the syntax and/or identifier
@param syntax the RDF syntax
@param identifier the resource identifier
@return a profile IRI usable by the output streamer
"""
return RDFA_HTML.equals(s... | java | public static IRI getDefaultProfile(final RDFSyntax syntax, final IRI identifier) {
return RDFA_HTML.equals(syntax) ? identifier : expanded;
} | [
"public",
"static",
"IRI",
"getDefaultProfile",
"(",
"final",
"RDFSyntax",
"syntax",
",",
"final",
"IRI",
"identifier",
")",
"{",
"return",
"RDFA_HTML",
".",
"equals",
"(",
"syntax",
")",
"?",
"identifier",
":",
"expanded",
";",
"}"
] | Get a default profile IRI from the syntax and/or identifier
@param syntax the RDF syntax
@param identifier the resource identifier
@return a profile IRI usable by the output streamer | [
"Get",
"a",
"default",
"profile",
"IRI",
"from",
"the",
"syntax",
"and",
"/",
"or",
"identifier"
] | train | https://github.com/trellis-ldp-archive/trellis-http/blob/bc762f88602c49c2b137a7adf68d576666e55fff/src/main/java/org/trellisldp/http/impl/RdfUtils.java#L249-L251 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/feature/detdesc/FactoryDetectDescribe.java | FactoryDetectDescribe.surfColorFast | public static <T extends ImageGray<T>, II extends ImageGray<II>>
DetectDescribePoint<T,BrightFeature> surfColorFast( @Nullable ConfigFastHessian configDetector ,
@Nullable ConfigSurfDescribe.Speed configDesc,
@Nullable ConfigAverageIntegral configOrientation,
ImageType<T> imag... | java | public static <T extends ImageGray<T>, II extends ImageGray<II>>
DetectDescribePoint<T,BrightFeature> surfColorFast( @Nullable ConfigFastHessian configDetector ,
@Nullable ConfigSurfDescribe.Speed configDesc,
@Nullable ConfigAverageIntegral configOrientation,
ImageType<T> imag... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"II",
"extends",
"ImageGray",
"<",
"II",
">",
">",
"DetectDescribePoint",
"<",
"T",
",",
"BrightFeature",
">",
"surfColorFast",
"(",
"@",
"Nullable",
"ConfigFastHessian",
"configDetector... | <p>
Color version of SURF stable. Features are detected in a gray scale image, but the descriptors are
computed using a color image. Each band in the page adds to the descriptor length. See
{@link DetectDescribeSurfPlanar} for details.
</p>
@see FastHessianFeatureDetector
@see DescribePointSurf
@see DescribePointSu... | [
"<p",
">",
"Color",
"version",
"of",
"SURF",
"stable",
".",
"Features",
"are",
"detected",
"in",
"a",
"gray",
"scale",
"image",
"but",
"the",
"descriptors",
"are",
"computed",
"using",
"a",
"color",
"image",
".",
"Each",
"band",
"in",
"the",
"page",
"add... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/feature/detdesc/FactoryDetectDescribe.java#L153-L176 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/SmartGrid.java | SmartGrid.setWidget | public void setWidget (int row, int column, Widget widget, String style) {
"""
Sets the widget in the specified cell, with the specified style and column span.
"""
setWidget(row, column, widget);
if (style != null) {
getCellFormatter().setStyleName(row, column, style);
}
... | java | public void setWidget (int row, int column, Widget widget, String style)
{
setWidget(row, column, widget);
if (style != null) {
getCellFormatter().setStyleName(row, column, style);
}
} | [
"public",
"void",
"setWidget",
"(",
"int",
"row",
",",
"int",
"column",
",",
"Widget",
"widget",
",",
"String",
"style",
")",
"{",
"setWidget",
"(",
"row",
",",
"column",
",",
"widget",
")",
";",
"if",
"(",
"style",
"!=",
"null",
")",
"{",
"getCellFo... | Sets the widget in the specified cell, with the specified style and column span. | [
"Sets",
"the",
"widget",
"in",
"the",
"specified",
"cell",
"with",
"the",
"specified",
"style",
"and",
"column",
"span",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/SmartGrid.java#L68-L74 |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.centerOnTile | public void centerOnTile (int tx, int ty) {
"""
Moves the scene such that the specified tile is in the center.
"""
Rectangle trect = MisoUtil.getTilePolygon(_metrics, tx, ty).getBounds();
int nx = trect.x + trect.width/2 - _vbounds.width/2;
int ny = trect.y + trect.height/2 - _vbounds.h... | java | public void centerOnTile (int tx, int ty)
{
Rectangle trect = MisoUtil.getTilePolygon(_metrics, tx, ty).getBounds();
int nx = trect.x + trect.width/2 - _vbounds.width/2;
int ny = trect.y + trect.height/2 - _vbounds.height/2;
// Log.info("Centering on t:" + StringUtil.coordsToString(t... | [
"public",
"void",
"centerOnTile",
"(",
"int",
"tx",
",",
"int",
"ty",
")",
"{",
"Rectangle",
"trect",
"=",
"MisoUtil",
".",
"getTilePolygon",
"(",
"_metrics",
",",
"tx",
",",
"ty",
")",
".",
"getBounds",
"(",
")",
";",
"int",
"nx",
"=",
"trect",
".",... | Moves the scene such that the specified tile is in the center. | [
"Moves",
"the",
"scene",
"such",
"that",
"the",
"specified",
"tile",
"is",
"in",
"the",
"center",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L169-L179 |
AlmogBaku/IntlPhoneInput | intlphoneinput/src/main/java/net/rimoto/intlphoneinput/CountriesFetcher.java | CountriesFetcher.getJsonFromRaw | private static String getJsonFromRaw(Context context, int resource) {
"""
Fetch JSON from RAW resource
@param context Context
@param resource Resource int of the RAW file
@return JSON
"""
String json;
try {
InputStream inputStream = context.getResources().openRawResource(resou... | java | private static String getJsonFromRaw(Context context, int resource) {
String json;
try {
InputStream inputStream = context.getResources().openRawResource(resource);
int size = inputStream.available();
byte[] buffer = new byte[size];
inputStream.read(buffer... | [
"private",
"static",
"String",
"getJsonFromRaw",
"(",
"Context",
"context",
",",
"int",
"resource",
")",
"{",
"String",
"json",
";",
"try",
"{",
"InputStream",
"inputStream",
"=",
"context",
".",
"getResources",
"(",
")",
".",
"openRawResource",
"(",
"resource... | Fetch JSON from RAW resource
@param context Context
@param resource Resource int of the RAW file
@return JSON | [
"Fetch",
"JSON",
"from",
"RAW",
"resource"
] | train | https://github.com/AlmogBaku/IntlPhoneInput/blob/ac7313a2d1683feb4d535d5dbee6676b53879059/intlphoneinput/src/main/java/net/rimoto/intlphoneinput/CountriesFetcher.java#L24-L38 |
cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAromaticTypeMapping.java | MmffAromaticTypeMapping.indexOfHetro | static int indexOfHetro(int[] cycle, int[] contribution) {
"""
Find the index of a hetroatom in a cycle. A hetroatom in MMFF is the unique atom that
contributes a pi-lone-pair to the aromatic system.
@param cycle aromatic cycle, |C| = 5
@param contribution vector of p electron contributions from each v... | java | static int indexOfHetro(int[] cycle, int[] contribution) {
int index = -1;
for (int i = 0; i < cycle.length - 1; i++) {
if (contribution[cycle[i]] == 2) index = index == -1 ? i : -2;
}
return index;
} | [
"static",
"int",
"indexOfHetro",
"(",
"int",
"[",
"]",
"cycle",
",",
"int",
"[",
"]",
"contribution",
")",
"{",
"int",
"index",
"=",
"-",
"1",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"cycle",
".",
"length",
"-",
"1",
";",
"i",
"... | Find the index of a hetroatom in a cycle. A hetroatom in MMFF is the unique atom that
contributes a pi-lone-pair to the aromatic system.
@param cycle aromatic cycle, |C| = 5
@param contribution vector of p electron contributions from each vertex
@return index of hetroatom, if none found index is < 0. | [
"Find",
"the",
"index",
"of",
"a",
"hetroatom",
"in",
"a",
"cycle",
".",
"A",
"hetroatom",
"in",
"MMFF",
"is",
"the",
"unique",
"atom",
"that",
"contributes",
"a",
"pi",
"-",
"lone",
"-",
"pair",
"to",
"the",
"aromatic",
"system",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAromaticTypeMapping.java#L323-L329 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/adapter/urbridge/utils/URBridgeEntity.java | URBridgeEntity.getUniqueId | public String getUniqueId(boolean setAttr) throws Exception {
"""
Returns the uniqueId of a user or a group.
@param setAttr a boolean indicating whether to actually set the attribute
in the entity or just perform a lookup.
@return the user or group's uniqueId.
@throws Exception identifier values are missing ... | java | public String getUniqueId(boolean setAttr) throws Exception {
String uniqueName = null;
String uniqueId = null;
if (entity.getIdentifier().isSet(uniqueIdProp)) {
uniqueId = (String) entity.getIdentifier().get(uniqueIdProp);
return uniqueId;
}
uniqueName = ... | [
"public",
"String",
"getUniqueId",
"(",
"boolean",
"setAttr",
")",
"throws",
"Exception",
"{",
"String",
"uniqueName",
"=",
"null",
";",
"String",
"uniqueId",
"=",
"null",
";",
"if",
"(",
"entity",
".",
"getIdentifier",
"(",
")",
".",
"isSet",
"(",
"unique... | Returns the uniqueId of a user or a group.
@param setAttr a boolean indicating whether to actually set the attribute
in the entity or just perform a lookup.
@return the user or group's uniqueId.
@throws Exception identifier values are missing or the underlying
registry threw an error. | [
"Returns",
"the",
"uniqueId",
"of",
"a",
"user",
"or",
"a",
"group",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.core/src/com/ibm/ws/security/wim/adapter/urbridge/utils/URBridgeEntity.java#L206-L229 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedceph/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedceph.java | ApiOvhDedicatedceph.serviceName_acl_POST | public String serviceName_acl_POST(String serviceName, String[] aclList) throws IOException {
"""
Create one or more new IP ACLs
REST: POST /dedicated/ceph/{serviceName}/acl
@param serviceName [required] ID of cluster
@param aclList [required] List of new ACLs
API beta
"""
String qPath = "/dedicated/... | java | public String serviceName_acl_POST(String serviceName, String[] aclList) throws IOException {
String qPath = "/dedicated/ceph/{serviceName}/acl";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "aclList", aclList);
String resp = exec(qPath, "PO... | [
"public",
"String",
"serviceName_acl_POST",
"(",
"String",
"serviceName",
",",
"String",
"[",
"]",
"aclList",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/ceph/{serviceName}/acl\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
... | Create one or more new IP ACLs
REST: POST /dedicated/ceph/{serviceName}/acl
@param serviceName [required] ID of cluster
@param aclList [required] List of new ACLs
API beta | [
"Create",
"one",
"or",
"more",
"new",
"IP",
"ACLs"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedceph/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedceph.java#L467-L474 |
asciidoctor/asciidoclet | src/main/java/org/asciidoctor/asciidoclet/AsciidoctorRenderer.java | AsciidoctorRenderer.renderTag | private void renderTag(Tag tag, StringBuilder buffer) {
"""
Renders a document tag in the standard way.
@param tag input
@param buffer output buffer
"""
buffer.append(tag.name()).append(' ');
// Special handling for @param <T> tags
// See http://docs.oracle.com/javase/1.5.0/docs/too... | java | private void renderTag(Tag tag, StringBuilder buffer) {
buffer.append(tag.name()).append(' ');
// Special handling for @param <T> tags
// See http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#@param
if ((tag instanceof ParamTag) && ((ParamTag) tag).isTypeParameter())... | [
"private",
"void",
"renderTag",
"(",
"Tag",
"tag",
",",
"StringBuilder",
"buffer",
")",
"{",
"buffer",
".",
"append",
"(",
"tag",
".",
"name",
"(",
")",
")",
".",
"append",
"(",
"'",
"'",
")",
";",
"// Special handling for @param <T> tags",
"// See http://do... | Renders a document tag in the standard way.
@param tag input
@param buffer output buffer | [
"Renders",
"a",
"document",
"tag",
"in",
"the",
"standard",
"way",
"."
] | train | https://github.com/asciidoctor/asciidoclet/blob/6c43ce214e48797d2b5e8d59c31b65304279717b/src/main/java/org/asciidoctor/asciidoclet/AsciidoctorRenderer.java#L129-L143 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/activerecord/DbPro.java | DbPro.batchUpdate | public int[] batchUpdate(String tableName, String primaryKey, List<Record> recordList, int batchSize) {
"""
Batch update records using the columns names of the first record in recordList.
Ensure all the records can use the same sql as the first record.
@param tableName the table name
@param primaryKey the prima... | java | public int[] batchUpdate(String tableName, String primaryKey, List<Record> recordList, int batchSize) {
if (recordList == null || recordList.size() == 0)
return new int[0];
String[] pKeys = primaryKey.split(",");
config.dialect.trimPrimaryKeys(pKeys);
Record record = recordL... | [
"public",
"int",
"[",
"]",
"batchUpdate",
"(",
"String",
"tableName",
",",
"String",
"primaryKey",
",",
"List",
"<",
"Record",
">",
"recordList",
",",
"int",
"batchSize",
")",
"{",
"if",
"(",
"recordList",
"==",
"null",
"||",
"recordList",
".",
"size",
"... | Batch update records using the columns names of the first record in recordList.
Ensure all the records can use the same sql as the first record.
@param tableName the table name
@param primaryKey the primary key of the table, composite primary key is separated by comma character: "," | [
"Batch",
"update",
"records",
"using",
"the",
"columns",
"names",
"of",
"the",
"first",
"record",
"in",
"recordList",
".",
"Ensure",
"all",
"the",
"records",
"can",
"use",
"the",
"same",
"sql",
"as",
"the",
"first",
"record",
"."
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/DbPro.java#L1225-L1250 |
igniterealtime/Smack | smack-core/src/main/java/org/jivesoftware/smack/packet/DefaultExtensionElement.java | DefaultExtensionElement.setValue | public synchronized void setValue(String name, String value) {
"""
Sets a stanza extension value using the given name.
@param name the name.
@param value the value.
"""
if (map == null) {
map = new HashMap<String,String>();
}
map.put(name, value);
} | java | public synchronized void setValue(String name, String value) {
if (map == null) {
map = new HashMap<String,String>();
}
map.put(name, value);
} | [
"public",
"synchronized",
"void",
"setValue",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"map",
"==",
"null",
")",
"{",
"map",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"}",
"map",
".",
"put",... | Sets a stanza extension value using the given name.
@param name the name.
@param value the value. | [
"Sets",
"a",
"stanza",
"extension",
"value",
"using",
"the",
"given",
"name",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/packet/DefaultExtensionElement.java#L132-L137 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java | GVRSceneObject.forAllComponents | public void forAllComponents(ComponentVisitor visitor, long componentType) {
"""
Visits all the components of the specified type attached to
the descendants of this scene object.
The ComponentVisitor.visit function is called for every
eligible component of each descendant until it returns false.
This allows yo... | java | public void forAllComponents(ComponentVisitor visitor, long componentType) {
synchronized (mComponents)
{
GVRComponent comp = getComponent(componentType);
if ((comp != null) && !visitor.visit(comp))
{
return;
}
}
synchronize... | [
"public",
"void",
"forAllComponents",
"(",
"ComponentVisitor",
"visitor",
",",
"long",
"componentType",
")",
"{",
"synchronized",
"(",
"mComponents",
")",
"{",
"GVRComponent",
"comp",
"=",
"getComponent",
"(",
"componentType",
")",
";",
"if",
"(",
"(",
"comp",
... | Visits all the components of the specified type attached to
the descendants of this scene object.
The ComponentVisitor.visit function is called for every
eligible component of each descendant until it returns false.
This allows you to traverse the scene graph safely without copying it.
This method gives much better per... | [
"Visits",
"all",
"the",
"components",
"of",
"the",
"specified",
"type",
"attached",
"to",
"the",
"descendants",
"of",
"this",
"scene",
"object",
".",
"The",
"ComponentVisitor",
".",
"visit",
"function",
"is",
"called",
"for",
"every",
"eligible",
"component",
... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRSceneObject.java#L872-L889 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java | StringIterate.allSatisfy | @Deprecated
public static boolean allSatisfy(String string, CharPredicate predicate) {
"""
@return true if all of the characters in the {@code string} answer true for the specified {@code predicate}.
@deprecated since 7.0. Use {@link #allSatisfyChar(String, CharPredicate)} instead.
"""
return St... | java | @Deprecated
public static boolean allSatisfy(String string, CharPredicate predicate)
{
return StringIterate.allSatisfyChar(string, predicate);
} | [
"@",
"Deprecated",
"public",
"static",
"boolean",
"allSatisfy",
"(",
"String",
"string",
",",
"CharPredicate",
"predicate",
")",
"{",
"return",
"StringIterate",
".",
"allSatisfyChar",
"(",
"string",
",",
"predicate",
")",
";",
"}"
] | @return true if all of the characters in the {@code string} answer true for the specified {@code predicate}.
@deprecated since 7.0. Use {@link #allSatisfyChar(String, CharPredicate)} instead. | [
"@return",
"true",
"if",
"all",
"of",
"the",
"characters",
"in",
"the",
"{",
"@code",
"string",
"}",
"answer",
"true",
"for",
"the",
"specified",
"{",
"@code",
"predicate",
"}",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java#L850-L854 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java | ComputerVisionImpl.tagImageWithServiceResponseAsync | public Observable<ServiceResponse<TagResult>> tagImageWithServiceResponseAsync(String url, TagImageOptionalParameter tagImageOptionalParameter) {
"""
This operation generates a list of words, or tags, that are relevant to the content of the supplied image. The Computer Vision API can return tags based on objects, ... | java | public Observable<ServiceResponse<TagResult>> tagImageWithServiceResponseAsync(String url, TagImageOptionalParameter tagImageOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");
}
... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"TagResult",
">",
">",
"tagImageWithServiceResponseAsync",
"(",
"String",
"url",
",",
"TagImageOptionalParameter",
"tagImageOptionalParameter",
")",
"{",
"if",
"(",
"this",
".",
"client",
".",
"endpoint",
"(",
")"... | This operation generates a list of words, or tags, that are relevant to the content of the supplied image. The Computer Vision API can return tags based on objects, living beings, scenery or actions found in images. Unlike categories, tags are not organized according to a hierarchical classification system, but corresp... | [
"This",
"operation",
"generates",
"a",
"list",
"of",
"words",
"or",
"tags",
"that",
"are",
"relevant",
"to",
"the",
"content",
"of",
"the",
"supplied",
"image",
".",
"The",
"Computer",
"Vision",
"API",
"can",
"return",
"tags",
"based",
"on",
"objects",
"li... | 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#L1626-L1636 |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/ReadableLogRecord.java | ReadableLogRecord.read | private static ReadableLogRecord read(ByteBuffer viewBuffer, long expectedSequenceNumber, ByteBuffer sourceBuffer) {
"""
careful with trace in this method as it is called many times from doByteByByteScanning
"""
ReadableLogRecord logRecord = null;
int absolutePosition = sourceBuffer.position() + viewBu... | java | private static ReadableLogRecord read(ByteBuffer viewBuffer, long expectedSequenceNumber, ByteBuffer sourceBuffer)
{
ReadableLogRecord logRecord = null;
int absolutePosition = sourceBuffer.position() + viewBuffer.position();
// Read the record magic number field.
final byte[] magicNumberBuffer = ... | [
"private",
"static",
"ReadableLogRecord",
"read",
"(",
"ByteBuffer",
"viewBuffer",
",",
"long",
"expectedSequenceNumber",
",",
"ByteBuffer",
"sourceBuffer",
")",
"{",
"ReadableLogRecord",
"logRecord",
"=",
"null",
";",
"int",
"absolutePosition",
"=",
"sourceBuffer",
"... | careful with trace in this method as it is called many times from doByteByByteScanning | [
"careful",
"with",
"trace",
"in",
"this",
"method",
"as",
"it",
"is",
"called",
"many",
"times",
"from",
"doByteByByteScanning"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/ReadableLogRecord.java#L87-L141 |
MKLab-ITI/multimedia-indexing | src/main/java/gr/iti/mklab/visual/dimreduction/PCALearningExample.java | PCALearningExample.main | public static void main(String[] args) throws Exception {
"""
This method can be used to learn a PCA projection matrix.
@param args
[0] full path to the location of the BDB store which contains the training vectors (use
backslashes)
@param args
[1] number of vectors to use for learning (the first vectors wi... | java | public static void main(String[] args) throws Exception {
String indexLocation = args[0];
int numTrainVectors = Integer.parseInt(args[1]);
int vectorLength = Integer.parseInt(args[2]);
int numPrincipalComponents = Integer.parseInt(args[3]);
boolean whitening = true;
boolean compact = false;
PCA... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"String",
"indexLocation",
"=",
"args",
"[",
"0",
"]",
";",
"int",
"numTrainVectors",
"=",
"Integer",
".",
"parseInt",
"(",
"args",
"[",
"1",
"]",
")"... | This method can be used to learn a PCA projection matrix.
@param args
[0] full path to the location of the BDB store which contains the training vectors (use
backslashes)
@param args
[1] number of vectors to use for learning (the first vectors will be used), e.g. 10000
@param args
[2] length of the supplied vectors, e... | [
"This",
"method",
"can",
"be",
"used",
"to",
"learn",
"a",
"PCA",
"projection",
"matrix",
"."
] | train | https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/dimreduction/PCALearningExample.java#L27-L56 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsManagedConnectionFactoryImpl.java | JmsManagedConnectionFactoryImpl.instantiateConnection | JmsConnectionImpl instantiateConnection(JmsJcaConnection jcaConnection, Map<String, String> _passThruProps) throws JMSException {
"""
This method is used to create a JMS Connection object.<p>
This method is overriden by subclasses so that the appropriate connection
type is returned whenever this method is call... | java | JmsConnectionImpl instantiateConnection(JmsJcaConnection jcaConnection, Map<String, String> _passThruProps) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "instantiateConnection", jcaConnection);
JmsConnectionImpl jmsConnection = ... | [
"JmsConnectionImpl",
"instantiateConnection",
"(",
"JmsJcaConnection",
"jcaConnection",
",",
"Map",
"<",
"String",
",",
"String",
">",
"_passThruProps",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc"... | This method is used to create a JMS Connection object.<p>
This method is overriden by subclasses so that the appropriate connection
type is returned whenever this method is called
(e.g. from within createConnection()). | [
"This",
"method",
"is",
"used",
"to",
"create",
"a",
"JMS",
"Connection",
"object",
".",
"<p",
">"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsManagedConnectionFactoryImpl.java#L346-L353 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.javaeesec.cdi/src/com/ibm/ws/security/javaeesec/cdi/beans/hash/Pbkdf2PasswordHashImpl.java | Pbkdf2PasswordHashImpl.parseParams | protected void parseParams(Map<String, String> params) {
"""
Parse the parameters. If the value is not set, set the default, if the value is invalid, throw InvalidArgumentException
"""
generateAlgorithm = indexOf(PARAM_ALGORITHM, DEFAULT_ALGORITHM, SUPPORTED_ALGORITHMS, params.get(PARAM_ALGORITHM));
... | java | protected void parseParams(Map<String, String> params) {
generateAlgorithm = indexOf(PARAM_ALGORITHM, DEFAULT_ALGORITHM, SUPPORTED_ALGORITHMS, params.get(PARAM_ALGORITHM));
generateIterations = parseInt(PARAM_ITERATIONS, params.get(PARAM_ITERATIONS), DEFAULT_ITERATIONS, MINIMUM_ITERATIONS);
gene... | [
"protected",
"void",
"parseParams",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"{",
"generateAlgorithm",
"=",
"indexOf",
"(",
"PARAM_ALGORITHM",
",",
"DEFAULT_ALGORITHM",
",",
"SUPPORTED_ALGORITHMS",
",",
"params",
".",
"get",
"(",
"PARAM_ALGO... | Parse the parameters. If the value is not set, set the default, if the value is invalid, throw InvalidArgumentException | [
"Parse",
"the",
"parameters",
".",
"If",
"the",
"value",
"is",
"not",
"set",
"set",
"the",
"default",
"if",
"the",
"value",
"is",
"invalid",
"throw",
"InvalidArgumentException"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.javaeesec.cdi/src/com/ibm/ws/security/javaeesec/cdi/beans/hash/Pbkdf2PasswordHashImpl.java#L151-L156 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncAgentsInner.java | SyncAgentsInner.listLinkedDatabasesWithServiceResponseAsync | public Observable<ServiceResponse<Page<SyncAgentLinkedDatabaseInner>>> listLinkedDatabasesWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String syncAgentName) {
"""
Lists databases linked to a sync agent.
@param resourceGroupName The name of the resource group that conta... | java | public Observable<ServiceResponse<Page<SyncAgentLinkedDatabaseInner>>> listLinkedDatabasesWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String syncAgentName) {
return listLinkedDatabasesSinglePageAsync(resourceGroupName, serverName, syncAgentName)
.concatMap... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"SyncAgentLinkedDatabaseInner",
">",
">",
">",
"listLinkedDatabasesWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"serverName",
",",
"final",
"String",
"sy... | Lists databases linked to a sync agent.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server on which the sync agent is hosted.
@param syncAgentName The name of the sync ... | [
"Lists",
"databases",
"linked",
"to",
"a",
"sync",
"agent",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncAgentsInner.java#L1005-L1017 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpd/MPDUtility.java | MPDUtility.hexdump | public static final String hexdump(byte[] buffer, int offset, int length, boolean ascii) {
"""
This method generates a formatted version of the data contained
in a byte array. The data is written both in hex, and as ASCII
characters.
@param buffer data to be displayed
@param offset offset of start of data to... | java | public static final String hexdump(byte[] buffer, int offset, int length, boolean ascii)
{
StringBuilder sb = new StringBuilder();
if (buffer != null)
{
char c;
int loop;
int count = offset + length;
for (loop = offset; loop < count; loop++)
{
... | [
"public",
"static",
"final",
"String",
"hexdump",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
",",
"boolean",
"ascii",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"buffer",
"!... | This method generates a formatted version of the data contained
in a byte array. The data is written both in hex, and as ASCII
characters.
@param buffer data to be displayed
@param offset offset of start of data to be displayed
@param length length of data to be displayed
@param ascii flag indicating whether ASCII equ... | [
"This",
"method",
"generates",
"a",
"formatted",
"version",
"of",
"the",
"data",
"contained",
"in",
"a",
"byte",
"array",
".",
"The",
"data",
"is",
"written",
"both",
"in",
"hex",
"and",
"as",
"ASCII",
"characters",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPDUtility.java#L361-L397 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionRendererModel.java | MapTileCollisionRendererModel.renderX | private static void renderX(Graphic g, CollisionFunction function, CollisionRange range, int th, int y) {
"""
Render horizontal collision from current vector.
@param g The graphic buffer.
@param function The collision function.
@param range The collision range.
@param th The tile height.
@param y The curren... | java | private static void renderX(Graphic g, CollisionFunction function, CollisionRange range, int th, int y)
{
if (UtilMath.isBetween(y, range.getMinY(), range.getMaxY()))
{
g.drawRect(function.getRenderX(y), th - y - 1, 0, 0, false);
}
} | [
"private",
"static",
"void",
"renderX",
"(",
"Graphic",
"g",
",",
"CollisionFunction",
"function",
",",
"CollisionRange",
"range",
",",
"int",
"th",
",",
"int",
"y",
")",
"{",
"if",
"(",
"UtilMath",
".",
"isBetween",
"(",
"y",
",",
"range",
".",
"getMinY... | Render horizontal collision from current vector.
@param g The graphic buffer.
@param function The collision function.
@param range The collision range.
@param th The tile height.
@param y The current vertical location. | [
"Render",
"horizontal",
"collision",
"from",
"current",
"vector",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionRendererModel.java#L114-L120 |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/collections/sort/RedBlackTreeLong.java | RedBlackTreeLong.get | public Node<T> get(long value) {
"""
Returns the node associated to the given key, or null if no such key exists.
"""
if (root == null) return null;
if (value == first.value) return first;
if (value == last.value) return last;
if (value < first.value) return null;
if (value > last... | java | public Node<T> get(long value) {
if (root == null) return null;
if (value == first.value) return first;
if (value == last.value) return last;
if (value < first.value) return null;
if (value > last.value) return null;
return get(root, value);
} | [
"public",
"Node",
"<",
"T",
">",
"get",
"(",
"long",
"value",
")",
"{",
"if",
"(",
"root",
"==",
"null",
")",
"return",
"null",
";",
"if",
"(",
"value",
"==",
"first",
".",
"value",
")",
"return",
"first",
";",
"if",
"(",
"value",
"==",
"last",
... | Returns the node associated to the given key, or null if no such key exists. | [
"Returns",
"the",
"node",
"associated",
"to",
"the",
"given",
"key",
"or",
"null",
"if",
"no",
"such",
"key",
"exists",
"."
] | train | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/collections/sort/RedBlackTreeLong.java#L67-L74 |
VoltDB/voltdb | src/frontend/org/voltdb/sysprocs/AdHocBase.java | AdHocBase.adHocSQLStringFromPlannedStatement | public static String adHocSQLStringFromPlannedStatement(AdHocPlannedStatement statement, Object[] userparams) {
"""
Get a string containing a SQL statement and any parameters for a given
AdHocPlannedStatement. Used for debugging and logging.
"""
final int MAX_PARAM_LINE_CHARS = 120;
StringBui... | java | public static String adHocSQLStringFromPlannedStatement(AdHocPlannedStatement statement, Object[] userparams) {
final int MAX_PARAM_LINE_CHARS = 120;
StringBuilder sb = new StringBuilder();
String sql = new String(statement.sql, Charsets.UTF_8);
sb.append(sql);
Object[] params ... | [
"public",
"static",
"String",
"adHocSQLStringFromPlannedStatement",
"(",
"AdHocPlannedStatement",
"statement",
",",
"Object",
"[",
"]",
"userparams",
")",
"{",
"final",
"int",
"MAX_PARAM_LINE_CHARS",
"=",
"120",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",... | Get a string containing a SQL statement and any parameters for a given
AdHocPlannedStatement. Used for debugging and logging. | [
"Get",
"a",
"string",
"containing",
"a",
"SQL",
"statement",
"and",
"any",
"parameters",
"for",
"a",
"given",
"AdHocPlannedStatement",
".",
"Used",
"for",
"debugging",
"and",
"logging",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/sysprocs/AdHocBase.java#L104-L127 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/StringUtils.java | StringUtils.parseIntRange | public static int[] parseIntRange(final String aIntRange) {
"""
Parses strings with an integer range (e.g., 2-5) and returns an expanded integer array {2, 3, 4, 5} with those
values.
@param aIntRange A string representation of a range of integers
@return An int array with the expanded values of the string rep... | java | public static int[] parseIntRange(final String aIntRange) {
final String[] range = aIntRange.split(RANGE_DELIMETER);
final int[] ints;
if (range.length == 1) {
ints = new int[range.length];
ints[0] = Integer.parseInt(aIntRange);
} else {
final int sta... | [
"public",
"static",
"int",
"[",
"]",
"parseIntRange",
"(",
"final",
"String",
"aIntRange",
")",
"{",
"final",
"String",
"[",
"]",
"range",
"=",
"aIntRange",
".",
"split",
"(",
"RANGE_DELIMETER",
")",
";",
"final",
"int",
"[",
"]",
"ints",
";",
"if",
"(... | Parses strings with an integer range (e.g., 2-5) and returns an expanded integer array {2, 3, 4, 5} with those
values.
@param aIntRange A string representation of a range of integers
@return An int array with the expanded values of the string representation | [
"Parses",
"strings",
"with",
"an",
"integer",
"range",
"(",
"e",
".",
"g",
".",
"2",
"-",
"5",
")",
"and",
"returns",
"an",
"expanded",
"integer",
"array",
"{",
"2",
"3",
"4",
"5",
"}",
"with",
"those",
"values",
"."
] | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/StringUtils.java#L502-L527 |
NordicSemiconductor/Android-DFU-Library | dfu/src/main/java/no/nordicsemi/android/dfu/LegacyDfuImpl.java | LegacyDfuImpl.writeImageSize | private void writeImageSize(@NonNull final BluetoothGattCharacteristic characteristic, final int imageSize)
throws DeviceDisconnectedException, DfuException,
UploadAbortedException {
"""
Writes the image size to the characteristic. This method is SYNCHRONOUS and wait until the
{@link android.bluetooth.Bluet... | java | private void writeImageSize(@NonNull final BluetoothGattCharacteristic characteristic, final int imageSize)
throws DeviceDisconnectedException, DfuException,
UploadAbortedException {
mReceivedData = null;
mError = 0;
mImageSizeInProgress = true;
characteristic.setWriteType(BluetoothGattCharacteristic.WRI... | [
"private",
"void",
"writeImageSize",
"(",
"@",
"NonNull",
"final",
"BluetoothGattCharacteristic",
"characteristic",
",",
"final",
"int",
"imageSize",
")",
"throws",
"DeviceDisconnectedException",
",",
"DfuException",
",",
"UploadAbortedException",
"{",
"mReceivedData",
"=... | Writes the image size to the characteristic. This method is SYNCHRONOUS and wait until the
{@link android.bluetooth.BluetoothGattCallback#onCharacteristicWrite(android.bluetooth.BluetoothGatt, android.bluetooth.BluetoothGattCharacteristic, int)}
will be called or the device gets disconnected. If connection state will c... | [
"Writes",
"the",
"image",
"size",
"to",
"the",
"characteristic",
".",
"This",
"method",
"is",
"SYNCHRONOUS",
"and",
"wait",
"until",
"the",
"{",
"@link",
"android",
".",
"bluetooth",
".",
"BluetoothGattCallback#onCharacteristicWrite",
"(",
"android",
".",
"bluetoo... | train | https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/LegacyDfuImpl.java#L625-L654 |
aws/aws-sdk-java | aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/WeeklyAutoScalingSchedule.java | WeeklyAutoScalingSchedule.withMonday | public WeeklyAutoScalingSchedule withMonday(java.util.Map<String, String> monday) {
"""
<p>
The schedule for Monday.
</p>
@param monday
The schedule for Monday.
@return Returns a reference to this object so that method calls can be chained together.
"""
setMonday(monday);
return this;
... | java | public WeeklyAutoScalingSchedule withMonday(java.util.Map<String, String> monday) {
setMonday(monday);
return this;
} | [
"public",
"WeeklyAutoScalingSchedule",
"withMonday",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"monday",
")",
"{",
"setMonday",
"(",
"monday",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The schedule for Monday.
</p>
@param monday
The schedule for Monday.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"schedule",
"for",
"Monday",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/WeeklyAutoScalingSchedule.java#L137-L140 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/parameters/Parameters.java | Parameters.getPositiveIntegerList | public List<Integer> getPositiveIntegerList(final String param) {
"""
Gets a parameter whose value is a (possibly empty) list of positive integers.
"""
return getList(param, new StringToInteger(),
new IsPositive<Integer>(), "positive integer");
} | java | public List<Integer> getPositiveIntegerList(final String param) {
return getList(param, new StringToInteger(),
new IsPositive<Integer>(), "positive integer");
} | [
"public",
"List",
"<",
"Integer",
">",
"getPositiveIntegerList",
"(",
"final",
"String",
"param",
")",
"{",
"return",
"getList",
"(",
"param",
",",
"new",
"StringToInteger",
"(",
")",
",",
"new",
"IsPositive",
"<",
"Integer",
">",
"(",
")",
",",
"\"positiv... | Gets a parameter whose value is a (possibly empty) list of positive integers. | [
"Gets",
"a",
"parameter",
"whose",
"value",
"is",
"a",
"(",
"possibly",
"empty",
")",
"list",
"of",
"positive",
"integers",
"."
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/parameters/Parameters.java#L678-L681 |
EdwardRaff/JSAT | JSAT/src/jsat/utils/concurrent/AtomicDoubleArray.java | AtomicDoubleArray.compareAndSet | public boolean compareAndSet(int i, double expected, double update) {
"""
Atomically sets the element at position {@code i} to the given
updated value if the current value {@code ==} the expected value.
@param i the index
@param expected the expected value
@param update the new value
@return true if success... | java | public boolean compareAndSet(int i, double expected, double update)
{
long expectedL = Double.doubleToRawLongBits(expected);
long updateL = Double.doubleToRawLongBits(update);
return larray.compareAndSet(i, expectedL, updateL);
} | [
"public",
"boolean",
"compareAndSet",
"(",
"int",
"i",
",",
"double",
"expected",
",",
"double",
"update",
")",
"{",
"long",
"expectedL",
"=",
"Double",
".",
"doubleToRawLongBits",
"(",
"expected",
")",
";",
"long",
"updateL",
"=",
"Double",
".",
"doubleToRa... | Atomically sets the element at position {@code i} to the given
updated value if the current value {@code ==} the expected value.
@param i the index
@param expected the expected value
@param update the new value
@return true if successful. False return indicates that
the actual value was not equal to the expected value... | [
"Atomically",
"sets",
"the",
"element",
"at",
"position",
"{",
"@code",
"i",
"}",
"to",
"the",
"given",
"updated",
"value",
"if",
"the",
"current",
"value",
"{",
"@code",
"==",
"}",
"the",
"expected",
"value",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/utils/concurrent/AtomicDoubleArray.java#L151-L156 |
ManfredTremmel/gwt-bean-validators | gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/java/text/Normalizer.java | Normalizer.isNormalized | public static boolean isNormalized(final CharSequence src, final Form form) {
"""
Determines if the given sequence of char values is normalized.
@param src The sequence of char values to be checked.
@param form The normalization form; one of {@link java.text.Normalizer.Form#NFC},
{@link java.text.Normalizer.F... | java | public static boolean isNormalized(final CharSequence src, final Form form) {
return StringUtils.equals(src.toString(), normalize(src.toString(), form));
} | [
"public",
"static",
"boolean",
"isNormalized",
"(",
"final",
"CharSequence",
"src",
",",
"final",
"Form",
"form",
")",
"{",
"return",
"StringUtils",
".",
"equals",
"(",
"src",
".",
"toString",
"(",
")",
",",
"normalize",
"(",
"src",
".",
"toString",
"(",
... | Determines if the given sequence of char values is normalized.
@param src The sequence of char values to be checked.
@param form The normalization form; one of {@link java.text.Normalizer.Form#NFC},
{@link java.text.Normalizer.Form#NFD}, {@link java.text.Normalizer.Form#NFKC},
{@link java.text.Normalizer.Form#NFKD}
@r... | [
"Determines",
"if",
"the",
"given",
"sequence",
"of",
"char",
"values",
"is",
"normalized",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwt-bean-validators/src/main/super/de/knightsoftnet/validators/supersource/java/text/Normalizer.java#L192-L194 |
facebook/fresco | fbcore/src/main/java/com/facebook/datasource/SimpleDataSource.java | SimpleDataSource.setResult | @Override
public boolean setResult(T value, boolean isLast) {
"""
Sets the result to {@code value}.
<p> This method will return {@code true} if the value was successfully set, or
{@code false} if the data source has already been set, failed or closed.
<p> If the value was successfully set and {@code isLas... | java | @Override
public boolean setResult(T value, boolean isLast) {
return super.setResult(Preconditions.checkNotNull(value), isLast);
} | [
"@",
"Override",
"public",
"boolean",
"setResult",
"(",
"T",
"value",
",",
"boolean",
"isLast",
")",
"{",
"return",
"super",
".",
"setResult",
"(",
"Preconditions",
".",
"checkNotNull",
"(",
"value",
")",
",",
"isLast",
")",
";",
"}"
] | Sets the result to {@code value}.
<p> This method will return {@code true} if the value was successfully set, or
{@code false} if the data source has already been set, failed or closed.
<p> If the value was successfully set and {@code isLast} is {@code true}, state of the
data source will be set to {@link AbstractDat... | [
"Sets",
"the",
"result",
"to",
"{",
"@code",
"value",
"}",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/fbcore/src/main/java/com/facebook/datasource/SimpleDataSource.java#L42-L45 |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplateUserSegmentRelPersistenceImpl.java | CommerceNotificationTemplateUserSegmentRelPersistenceImpl.findAll | @Override
public List<CommerceNotificationTemplateUserSegmentRel> findAll() {
"""
Returns all the commerce notification template user segment rels.
@return the commerce notification template user segment rels
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceNotificationTemplateUserSegmentRel> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceNotificationTemplateUserSegmentRel",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce notification template user segment rels.
@return the commerce notification template user segment rels | [
"Returns",
"all",
"the",
"commerce",
"notification",
"template",
"user",
"segment",
"rels",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationTemplateUserSegmentRelPersistenceImpl.java#L2044-L2047 |
dbracewell/mango | src/main/java/com/davidbracewell/conversion/Val.java | Val.asClass | @SuppressWarnings("unchecked")
public <T> Class<T> asClass(Class<T> defaultValue) {
"""
As class.
@param <T> the type parameter
@param defaultValue the default value
@return The object as a class
"""
return as(Class.class, defaultValue);
} | java | @SuppressWarnings("unchecked")
public <T> Class<T> asClass(Class<T> defaultValue) {
return as(Class.class, defaultValue);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"Class",
"<",
"T",
">",
"asClass",
"(",
"Class",
"<",
"T",
">",
"defaultValue",
")",
"{",
"return",
"as",
"(",
"Class",
".",
"class",
",",
"defaultValue",
")",
";",
"}"
] | As class.
@param <T> the type parameter
@param defaultValue the default value
@return The object as a class | [
"As",
"class",
"."
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/conversion/Val.java#L382-L385 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/edge/HysteresisEdgeTracePoints.java | HysteresisEdgeTracePoints.process | public void process(GrayF32 intensity , GrayS8 direction , float lower , float upper ) {
"""
Performs hysteresis thresholding using the provided lower and upper thresholds.
@param intensity Intensity image after edge non-maximum suppression has been applied. Modified.
@param direction 4-direction image. Not ... | java | public void process(GrayF32 intensity , GrayS8 direction , float lower , float upper ) {
if( lower < 0 )
throw new IllegalArgumentException("Lower must be >= 0!");
InputSanityCheck.checkSameShape(intensity, direction);
// set up internal data structures
this.intensity = intensity;
this.direction = directi... | [
"public",
"void",
"process",
"(",
"GrayF32",
"intensity",
",",
"GrayS8",
"direction",
",",
"float",
"lower",
",",
"float",
"upper",
")",
"{",
"if",
"(",
"lower",
"<",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Lower must be >= 0!\"",
")",
... | Performs hysteresis thresholding using the provided lower and upper thresholds.
@param intensity Intensity image after edge non-maximum suppression has been applied. Modified.
@param direction 4-direction image. Not modified.
@param lower Lower threshold.
@param upper Upper threshold. | [
"Performs",
"hysteresis",
"thresholding",
"using",
"the",
"provided",
"lower",
"and",
"upper",
"thresholds",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/edge/HysteresisEdgeTracePoints.java#L76-L99 |
Terradue/jcatalogue-client | apis/src/main/java/com/terradue/jcatalogue/repository/Proxy.java | Proxy.setPort | public Proxy setPort( int port ) {
"""
Sets the port number for the proxy.
@param port The port number for the proxy.
@return The new proxy, never {@code null}.
"""
if ( this.port == port )
{
return this;
}
return new Proxy( type, host, port, auth );
} | java | public Proxy setPort( int port )
{
if ( this.port == port )
{
return this;
}
return new Proxy( type, host, port, auth );
} | [
"public",
"Proxy",
"setPort",
"(",
"int",
"port",
")",
"{",
"if",
"(",
"this",
".",
"port",
"==",
"port",
")",
"{",
"return",
"this",
";",
"}",
"return",
"new",
"Proxy",
"(",
"type",
",",
"host",
",",
"port",
",",
"auth",
")",
";",
"}"
] | Sets the port number for the proxy.
@param port The port number for the proxy.
@return The new proxy, never {@code null}. | [
"Sets",
"the",
"port",
"number",
"for",
"the",
"proxy",
"."
] | train | https://github.com/Terradue/jcatalogue-client/blob/1f24c4da952d8ad2373c4fa97eed48b0b8a88d21/apis/src/main/java/com/terradue/jcatalogue/repository/Proxy.java#L129-L136 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_datacenter_datacenterId_vm_vmId_backupJob_GET | public OvhBackupJob serviceName_datacenter_datacenterId_vm_vmId_backupJob_GET(String serviceName, Long datacenterId, Long vmId) throws IOException {
"""
Get this object properties
REST: GET /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/backupJob
@param serviceName [required] Domain of the s... | java | public OvhBackupJob serviceName_datacenter_datacenterId_vm_vmId_backupJob_GET(String serviceName, Long datacenterId, Long vmId) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/backupJob";
StringBuilder sb = path(qPath, serviceName, datacenterId, vmId);
String... | [
"public",
"OvhBackupJob",
"serviceName_datacenter_datacenterId_vm_vmId_backupJob_GET",
"(",
"String",
"serviceName",
",",
"Long",
"datacenterId",
",",
"Long",
"vmId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicatedCloud/{serviceName}/datacenter/{datacen... | Get this object properties
REST: GET /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/vm/{vmId}/backupJob
@param serviceName [required] Domain of the service
@param datacenterId [required]
@param vmId [required] Id of the virtual machine.
@deprecated | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L2006-L2011 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java | SDBaseOps.neq | public SDVariable neq(SDVariable x, SDVariable y) {
"""
Not equal to operation: elementwise x != y<br>
If x and y arrays have equal shape, the output shape is the same as these inputs.<br>
Note: supports broadcasting if x and y have different shapes and are broadcastable.<br>
Returns an array with values 1 wher... | java | public SDVariable neq(SDVariable x, SDVariable y) {
return neq(null, x, y);
} | [
"public",
"SDVariable",
"neq",
"(",
"SDVariable",
"x",
",",
"SDVariable",
"y",
")",
"{",
"return",
"neq",
"(",
"null",
",",
"x",
",",
"y",
")",
";",
"}"
] | Not equal to operation: elementwise x != y<br>
If x and y arrays have equal shape, the output shape is the same as these inputs.<br>
Note: supports broadcasting if x and y have different shapes and are broadcastable.<br>
Returns an array with values 1 where condition is satisfied, or value 0 otherwise.
@param x Input ... | [
"Not",
"equal",
"to",
"operation",
":",
"elementwise",
"x",
"!",
"=",
"y<br",
">",
"If",
"x",
"and",
"y",
"arrays",
"have",
"equal",
"shape",
"the",
"output",
"shape",
"is",
"the",
"same",
"as",
"these",
"inputs",
".",
"<br",
">",
"Note",
":",
"suppo... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L1323-L1325 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/BaseField.java | BaseField.setupTablePopup | public ScreenComponent setupTablePopup(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Rec record, int iQueryKeySeq, int iDisplayFieldSeq, boolean bIncludeBlankOption, boolean bIncludeFormButton) {
"""
Add a popup for the table tied to this field.
Key must be the fir... | java | public ScreenComponent setupTablePopup(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Rec record, int iQueryKeySeq, int iDisplayFieldSeq, boolean bIncludeBlankOption, boolean bIncludeFormButton)
{
String keyAreaName = null;
if (iQueryKeySeq != -1)
... | [
"public",
"ScreenComponent",
"setupTablePopup",
"(",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"Convert",
"converter",
",",
"int",
"iDisplayFieldDesc",
",",
"Rec",
"record",
",",
"int",
"iQueryKeySeq",
",",
"int",
"iDisplayFieldSeq",
","... | Add a popup for the table tied to this field.
Key must be the first and primary and only key.
@param record Record to display in a popup
@param iQueryKeySeq Order to display the record (-1 = Primary field)
@param iDisplayFieldSeq Description field for the popup (-1 = second field)
@param bIncludeBlankOption Include a b... | [
"Add",
"a",
"popup",
"for",
"the",
"table",
"tied",
"to",
"this",
"field",
".",
"Key",
"must",
"be",
"the",
"first",
"and",
"primary",
"and",
"only",
"key",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/BaseField.java#L1206-L1216 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/cluster/RedisAdvancedClusterAsyncCommandsImpl.java | RedisAdvancedClusterAsyncCommandsImpl.executeOnMasters | protected <T> Map<String, CompletableFuture<T>> executeOnMasters(
Function<RedisClusterAsyncCommands<K, V>, RedisFuture<T>> function) {
"""
Run a command on all available masters,
@param function function producing the command
@param <T> result type
@return map of a key (counter) and commands.
... | java | protected <T> Map<String, CompletableFuture<T>> executeOnMasters(
Function<RedisClusterAsyncCommands<K, V>, RedisFuture<T>> function) {
return executeOnNodes(function, redisClusterNode -> redisClusterNode.is(MASTER));
} | [
"protected",
"<",
"T",
">",
"Map",
"<",
"String",
",",
"CompletableFuture",
"<",
"T",
">",
">",
"executeOnMasters",
"(",
"Function",
"<",
"RedisClusterAsyncCommands",
"<",
"K",
",",
"V",
">",
",",
"RedisFuture",
"<",
"T",
">",
">",
"function",
")",
"{",
... | Run a command on all available masters,
@param function function producing the command
@param <T> result type
@return map of a key (counter) and commands. | [
"Run",
"a",
"command",
"on",
"all",
"available",
"masters"
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/cluster/RedisAdvancedClusterAsyncCommandsImpl.java#L601-L604 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/TimedDirContext.java | TimedDirContext.traceJndiThrow | private void traceJndiThrow(String methodname, long duration, NamingException ne) {
"""
Trace a message with "JNDI_CALL' that includes the resulting exception from that JNDI call.
@param methodname The name of the method that is requesting the trace.
@param duration The duration of the call in milliseconds.
@... | java | private void traceJndiThrow(String methodname, long duration, NamingException ne) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, JNDI_CALL + methodname + " [" + duration + " ms] " + ne.getMessage(), ne);
}
} | [
"private",
"void",
"traceJndiThrow",
"(",
"String",
"methodname",
",",
"long",
"duration",
",",
"NamingException",
"ne",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",... | Trace a message with "JNDI_CALL' that includes the resulting exception from that JNDI call.
@param methodname The name of the method that is requesting the trace.
@param duration The duration of the call in milliseconds.
@param ne The {@link NamingException}. | [
"Trace",
"a",
"message",
"with",
"JNDI_CALL",
"that",
"includes",
"the",
"resulting",
"exception",
"from",
"that",
"JNDI",
"call",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/TimedDirContext.java#L542-L546 |
before/quality-check | modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java | ConditionalCheck.noNullElements | @ArgumentsChecked
@Throws( {
"""
Ensures that an iterable reference is neither {@code null} nor contains any elements that are {@code null}.
<p>
We recommend to use the overloaded method {@link Check#noNullElements(Iterable, String)} and pass as second
argument the name of the parameter to enhance the except... | java | @ArgumentsChecked
@Throws({ IllegalNullArgumentException.class, IllegalNullElementsException.class })
public static <T extends Iterable<?>> void noNullElements(final boolean condition, @Nonnull final T iterable) {
if (condition) {
Check.noNullElements(iterable);
}
} | [
"@",
"ArgumentsChecked",
"@",
"Throws",
"(",
"{",
"IllegalNullArgumentException",
".",
"class",
",",
"IllegalNullElementsException",
".",
"class",
"}",
")",
"public",
"static",
"<",
"T",
"extends",
"Iterable",
"<",
"?",
">",
">",
"void",
"noNullElements",
"(",
... | Ensures that an iterable reference is neither {@code null} nor contains any elements that are {@code null}.
<p>
We recommend to use the overloaded method {@link Check#noNullElements(Iterable, String)} and pass as second
argument the name of the parameter to enhance the exception message.
@param condition
condition mu... | [
"Ensures",
"that",
"an",
"iterable",
"reference",
"is",
"neither",
"{",
"@code",
"null",
"}",
"nor",
"contains",
"any",
"elements",
"that",
"are",
"{",
"@code",
"null",
"}",
"."
] | train | https://github.com/before/quality-check/blob/a75c32c39434ddb1f89bece57acae0536724c15a/modules/quality-check/src/main/java/net/sf/qualitycheck/ConditionalCheck.java#L1068-L1074 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDLoss.java | SDLoss.huberLoss | public SDVariable huberLoss(String name, @NonNull SDVariable label, @NonNull SDVariable predictions, double delta) {
"""
See {@link #huberLoss(String, SDVariable, SDVariable, SDVariable, LossReduce, double)}.
"""
return huberLoss(name, label, predictions, null, LossReduce.MEAN_BY_NONZERO_WEIGHT_COUNT, ... | java | public SDVariable huberLoss(String name, @NonNull SDVariable label, @NonNull SDVariable predictions, double delta) {
return huberLoss(name, label, predictions, null, LossReduce.MEAN_BY_NONZERO_WEIGHT_COUNT, delta);
} | [
"public",
"SDVariable",
"huberLoss",
"(",
"String",
"name",
",",
"@",
"NonNull",
"SDVariable",
"label",
",",
"@",
"NonNull",
"SDVariable",
"predictions",
",",
"double",
"delta",
")",
"{",
"return",
"huberLoss",
"(",
"name",
",",
"label",
",",
"predictions",
... | See {@link #huberLoss(String, SDVariable, SDVariable, SDVariable, LossReduce, double)}. | [
"See",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDLoss.java#L144-L146 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/zip/Zipper.java | Zipper.zipFiles | private void zipFiles(final File file, ZipOutputStream zos) throws IOException {
"""
Zip files.
@param file
the file
@throws IOException
Signals that an I/O exception has occurred.
"""
if (file.isDirectory())
{
File[] fList;
List<File> foundedFiles;
if (null != this.fileFilter)
{
fina... | java | private void zipFiles(final File file, ZipOutputStream zos) throws IOException
{
if (file.isDirectory())
{
File[] fList;
List<File> foundedFiles;
if (null != this.fileFilter)
{
final File[] tmpfList = file.listFiles(this.fileFilter);
final List<File> foundedDirs = FileSearchExtensions.listDirs(... | [
"private",
"void",
"zipFiles",
"(",
"final",
"File",
"file",
",",
"ZipOutputStream",
"zos",
")",
"throws",
"IOException",
"{",
"if",
"(",
"file",
".",
"isDirectory",
"(",
")",
")",
"{",
"File",
"[",
"]",
"fList",
";",
"List",
"<",
"File",
">",
"founded... | Zip files.
@param file
the file
@throws IOException
Signals that an I/O exception has occurred. | [
"Zip",
"files",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/zip/Zipper.java#L193-L243 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/ProbabilityWeightedMoments.java | ProbabilityWeightedMoments.normalizeLMR | private static void normalizeLMR(double[] sum, int nmom) {
"""
Normalize the moments
@param sum Sums
@param nmom Number of moments
"""
for(int k = nmom - 1; k >= 1; --k) {
double p = ((k & 1) == 0) ? +1 : -1;
double temp = p * sum[0];
for(int i = 0; i < k; i++) {
double ai = i... | java | private static void normalizeLMR(double[] sum, int nmom) {
for(int k = nmom - 1; k >= 1; --k) {
double p = ((k & 1) == 0) ? +1 : -1;
double temp = p * sum[0];
for(int i = 0; i < k; i++) {
double ai = i + 1.;
p *= -(k + ai) * (k - i) / (ai * ai);
temp += p * sum[i + 1];
... | [
"private",
"static",
"void",
"normalizeLMR",
"(",
"double",
"[",
"]",
"sum",
",",
"int",
"nmom",
")",
"{",
"for",
"(",
"int",
"k",
"=",
"nmom",
"-",
"1",
";",
"k",
">=",
"1",
";",
"--",
"k",
")",
"{",
"double",
"p",
"=",
"(",
"(",
"k",
"&",
... | Normalize the moments
@param sum Sums
@param nmom Number of moments | [
"Normalize",
"the",
"moments"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/ProbabilityWeightedMoments.java#L191-L202 |
respoke/respoke-sdk-android | respokeSDK/src/main/java/com/digium/respokesdk/RespokeEndpoint.java | RespokeEndpoint.startDirectConnection | public RespokeDirectConnection startDirectConnection() {
"""
Create a new DirectConnection. This method creates a new Call as well, attaching this DirectConnection to
it for the purposes of creating a peer-to-peer link for sending data such as messages to the other endpoint.
Information sent through a DirectCon... | java | public RespokeDirectConnection startDirectConnection() {
// The constructor will call the setDirectConnection method on this endpoint instance with a reference to the new RespokeDirectConnection object
RespokeCall call = new RespokeCall(signalingChannel, this, true);
call.startCall(null, null, f... | [
"public",
"RespokeDirectConnection",
"startDirectConnection",
"(",
")",
"{",
"// The constructor will call the setDirectConnection method on this endpoint instance with a reference to the new RespokeDirectConnection object",
"RespokeCall",
"call",
"=",
"new",
"RespokeCall",
"(",
"signaling... | Create a new DirectConnection. This method creates a new Call as well, attaching this DirectConnection to
it for the purposes of creating a peer-to-peer link for sending data such as messages to the other endpoint.
Information sent through a DirectConnection is not handled by the cloud infrastructure.
@return The Dir... | [
"Create",
"a",
"new",
"DirectConnection",
".",
"This",
"method",
"creates",
"a",
"new",
"Call",
"as",
"well",
"attaching",
"this",
"DirectConnection",
"to",
"it",
"for",
"the",
"purposes",
"of",
"creating",
"a",
"peer",
"-",
"to",
"-",
"peer",
"link",
"for... | train | https://github.com/respoke/respoke-sdk-android/blob/34a15f0558d29b1f1bc8481bbc5c505e855e05ef/respokeSDK/src/main/java/com/digium/respokesdk/RespokeEndpoint.java#L357-L363 |
landawn/AbacusUtil | src/com/landawn/abacus/util/JdbcUtil.java | JdbcUtil.importData | public static int importData(final DataSet dataset, final int offset, final int count, final PreparedStatement stmt,
final Try.BiConsumer<? super PreparedStatement, ? super Object[], SQLException> stmtSetter) throws UncheckedSQLException {
"""
Imports the data from <code>DataSet</code> to database.
... | java | public static int importData(final DataSet dataset, final int offset, final int count, final PreparedStatement stmt,
final Try.BiConsumer<? super PreparedStatement, ? super Object[], SQLException> stmtSetter) throws UncheckedSQLException {
return importData(dataset, offset, count, stmt, 200, 0, st... | [
"public",
"static",
"int",
"importData",
"(",
"final",
"DataSet",
"dataset",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"count",
",",
"final",
"PreparedStatement",
"stmt",
",",
"final",
"Try",
".",
"BiConsumer",
"<",
"?",
"super",
"PreparedStatement",... | Imports the data from <code>DataSet</code> to database.
@param dataset
@param offset
@param count
@param stmt the column order in the sql must be consistent with the column order in the DataSet.
@return
@throws UncheckedSQLException | [
"Imports",
"the",
"data",
"from",
"<code",
">",
"DataSet<",
"/",
"code",
">",
"to",
"database",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/JdbcUtil.java#L2408-L2411 |
finmath/finmath-lib | src/main/java/net/finmath/marketdata/model/bond/Bond.java | Bond.getSpread | public double getSpread(double bondPrice, Curve referenceCurve, AnalyticModel model) {
"""
Returns the spread value such that the sum of cash flows of the bond discounted with a given reference curve
with the additional spread coincides with a given price.
@param bondPrice The target price as double.
@param r... | java | public double getSpread(double bondPrice, Curve referenceCurve, AnalyticModel model) {
GoldenSectionSearch search = new GoldenSectionSearch(-2.0, 2.0);
while(search.getAccuracy() > 1E-11 && !search.isDone()) {
double x = search.getNextPoint();
double fx=getValueWithGivenSpreadOverCurve(0.0,referenceCurve,x,mo... | [
"public",
"double",
"getSpread",
"(",
"double",
"bondPrice",
",",
"Curve",
"referenceCurve",
",",
"AnalyticModel",
"model",
")",
"{",
"GoldenSectionSearch",
"search",
"=",
"new",
"GoldenSectionSearch",
"(",
"-",
"2.0",
",",
"2.0",
")",
";",
"while",
"(",
"sear... | Returns the spread value such that the sum of cash flows of the bond discounted with a given reference curve
with the additional spread coincides with a given price.
@param bondPrice The target price as double.
@param referenceCurve The reference curve used for discounting the coupon payments.
@param model The model u... | [
"Returns",
"the",
"spread",
"value",
"such",
"that",
"the",
"sum",
"of",
"cash",
"flows",
"of",
"the",
"bond",
"discounted",
"with",
"a",
"given",
"reference",
"curve",
"with",
"the",
"additional",
"spread",
"coincides",
"with",
"a",
"given",
"price",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/marketdata/model/bond/Bond.java#L270-L280 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/GrailsHibernateQueryUtils.java | GrailsHibernateQueryUtils.addOrderPossiblyNested | private static void addOrderPossiblyNested(Criteria c, PersistentEntity entity, String sort, String order, boolean ignoreCase) {
"""
Add order to criteria, creating necessary subCriteria if nested sort property (ie. sort:'nested.property').
"""
int firstDotPos = sort.indexOf(".");
if (firstDotP... | java | private static void addOrderPossiblyNested(Criteria c, PersistentEntity entity, String sort, String order, boolean ignoreCase) {
int firstDotPos = sort.indexOf(".");
if (firstDotPos == -1) {
addOrder(c, sort, order, ignoreCase);
} else { // nested property
String sortHead... | [
"private",
"static",
"void",
"addOrderPossiblyNested",
"(",
"Criteria",
"c",
",",
"PersistentEntity",
"entity",
",",
"String",
"sort",
",",
"String",
"order",
",",
"boolean",
"ignoreCase",
")",
"{",
"int",
"firstDotPos",
"=",
"sort",
".",
"indexOf",
"(",
"\".\... | Add order to criteria, creating necessary subCriteria if nested sort property (ie. sort:'nested.property'). | [
"Add",
"order",
"to",
"criteria",
"creating",
"necessary",
"subCriteria",
"if",
"nested",
"sort",
"property",
"(",
"ie",
".",
"sort",
":",
"nested",
".",
"property",
")",
"."
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/GrailsHibernateQueryUtils.java#L242-L262 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java | ZoneMeta.openOlsonResource | public static UResourceBundle openOlsonResource(UResourceBundle top, String id) {
"""
Given an ID and the top-level resource of the zoneinfo resource,
open the appropriate resource for the given time zone.
Dereference links if necessary.
@param top the top level resource of the zoneinfo resource or null.
@para... | java | public static UResourceBundle openOlsonResource(UResourceBundle top, String id)
{
UResourceBundle res = null;
int zoneIdx = getZoneIndex(id);
if (zoneIdx >= 0) {
try {
if (top == null) {
top = UResourceBundle.getBundleInstance(
... | [
"public",
"static",
"UResourceBundle",
"openOlsonResource",
"(",
"UResourceBundle",
"top",
",",
"String",
"id",
")",
"{",
"UResourceBundle",
"res",
"=",
"null",
";",
"int",
"zoneIdx",
"=",
"getZoneIndex",
"(",
"id",
")",
";",
"if",
"(",
"zoneIdx",
">=",
"0",... | Given an ID and the top-level resource of the zoneinfo resource,
open the appropriate resource for the given time zone.
Dereference links if necessary.
@param top the top level resource of the zoneinfo resource or null.
@param id zone id
@return the corresponding zone resource or null if not found | [
"Given",
"an",
"ID",
"and",
"the",
"top",
"-",
"level",
"resource",
"of",
"the",
"zoneinfo",
"resource",
"open",
"the",
"appropriate",
"resource",
"for",
"the",
"given",
"time",
"zone",
".",
"Dereference",
"links",
"if",
"necessary",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/ZoneMeta.java#L520-L542 |
fcrepo3/fcrepo | fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/util/ContextUtil.java | ContextUtil.makeResponseCtx | public ResponseCtx makeResponseCtx(String response)
throws MelcoeXacmlException {
"""
Converts a string based response to a ResponseCtx obejct.
@param response
the string response
@return the ResponseCtx object
@throws MelcoeXacmlException
"""
ResponseCtx resCtx = null;
try {
... | java | public ResponseCtx makeResponseCtx(String response)
throws MelcoeXacmlException {
ResponseCtx resCtx = null;
try {
ByteArrayInputStream is =
new ByteArrayInputStream(response.getBytes());
resCtx = ResponseCtx.getInstance(is);
} catch (Parsi... | [
"public",
"ResponseCtx",
"makeResponseCtx",
"(",
"String",
"response",
")",
"throws",
"MelcoeXacmlException",
"{",
"ResponseCtx",
"resCtx",
"=",
"null",
";",
"try",
"{",
"ByteArrayInputStream",
"is",
"=",
"new",
"ByteArrayInputStream",
"(",
"response",
".",
"getByte... | Converts a string based response to a ResponseCtx obejct.
@param response
the string response
@return the ResponseCtx object
@throws MelcoeXacmlException | [
"Converts",
"a",
"string",
"based",
"response",
"to",
"a",
"ResponseCtx",
"obejct",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/util/ContextUtil.java#L285-L296 |
googlegenomics/dataflow-java | src/main/java/com/google/cloud/genomics/dataflow/readers/bam/BAMShard.java | BAMShard.addBin | public void addBin(List<Chunk> chunksToAdd, long lastLocus) {
"""
Appends chunks from another bin to the list and moved the end position.
"""
assert chunks != null;
contig = new Contig(contig.referenceName, contig.start, lastLocus);
chunks.addAll(chunksToAdd);
updateSpan();
} | java | public void addBin(List<Chunk> chunksToAdd, long lastLocus) {
assert chunks != null;
contig = new Contig(contig.referenceName, contig.start, lastLocus);
chunks.addAll(chunksToAdd);
updateSpan();
} | [
"public",
"void",
"addBin",
"(",
"List",
"<",
"Chunk",
">",
"chunksToAdd",
",",
"long",
"lastLocus",
")",
"{",
"assert",
"chunks",
"!=",
"null",
";",
"contig",
"=",
"new",
"Contig",
"(",
"contig",
".",
"referenceName",
",",
"contig",
".",
"start",
",",
... | Appends chunks from another bin to the list and moved the end position. | [
"Appends",
"chunks",
"from",
"another",
"bin",
"to",
"the",
"list",
"and",
"moved",
"the",
"end",
"position",
"."
] | train | https://github.com/googlegenomics/dataflow-java/blob/ef2c56ed1a6397843c55102748b8c2b12aaa4772/src/main/java/com/google/cloud/genomics/dataflow/readers/bam/BAMShard.java#L71-L76 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentCurrentBillingFeaturesInner.java | ComponentCurrentBillingFeaturesInner.getAsync | public Observable<ApplicationInsightsComponentBillingFeaturesInner> getAsync(String resourceGroupName, String resourceName) {
"""
Returns current billing features for an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insi... | java | public Observable<ApplicationInsightsComponentBillingFeaturesInner> getAsync(String resourceGroupName, String resourceName) {
return getWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<ApplicationInsightsComponentBillingFeaturesInner>, ApplicationInsightsComponentBillingFe... | [
"public",
"Observable",
"<",
"ApplicationInsightsComponentBillingFeaturesInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
")",
".",
... | Returns current billing features for an Application Insights component.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Applicati... | [
"Returns",
"current",
"billing",
"features",
"for",
"an",
"Application",
"Insights",
"component",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ComponentCurrentBillingFeaturesInner.java#L102-L109 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.