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 |
|---|---|---|---|---|---|---|---|---|---|---|
nats-io/java-nats | src/main/java/io/nats/client/NKey.java | NKey.createOperator | public static NKey createOperator(SecureRandom random)
throws IOException, NoSuchProviderException, NoSuchAlgorithmException {
"""
Create an Operator NKey from the provided random number generator.
If no random is provided, SecureRandom.getInstance("SHA1PRNG", "SUN") will be used to creat eone.
T... | java | public static NKey createOperator(SecureRandom random)
throws IOException, NoSuchProviderException, NoSuchAlgorithmException {
return createPair(Type.OPERATOR, random);
} | [
"public",
"static",
"NKey",
"createOperator",
"(",
"SecureRandom",
"random",
")",
"throws",
"IOException",
",",
"NoSuchProviderException",
",",
"NoSuchAlgorithmException",
"{",
"return",
"createPair",
"(",
"Type",
".",
"OPERATOR",
",",
"random",
")",
";",
"}"
] | Create an Operator NKey from the provided random number generator.
If no random is provided, SecureRandom.getInstance("SHA1PRNG", "SUN") will be used to creat eone.
The new NKey contains the private seed, which should be saved in a secure location.
@param random A secure random provider
@return the new Nkey
@throws ... | [
"Create",
"an",
"Operator",
"NKey",
"from",
"the",
"provided",
"random",
"number",
"generator",
"."
] | train | https://github.com/nats-io/java-nats/blob/5f291048fd30192ba39b3fe2925ecd60aaad6b48/src/main/java/io/nats/client/NKey.java#L515-L518 |
codescape/bitvunit | bitvunit-core/src/main/java/de/codescape/bitvunit/util/html/HtmlPageUtil.java | HtmlPageUtil.toHtmlPage | public static HtmlPage toHtmlPage(Reader reader) {
"""
Creates a {@link HtmlPage} from a given {@link Reader} that reads the HTML code for that page.
@param reader {@link Reader} that reads the HTML code
@return {@link HtmlPage} for this {@link Reader}
"""
try {
return toHtmlPage(IOUtil... | java | public static HtmlPage toHtmlPage(Reader reader) {
try {
return toHtmlPage(IOUtils.toString(reader));
} catch (IOException e) {
throw new RuntimeException("Error creating HtmlPage from Reader.", e);
}
} | [
"public",
"static",
"HtmlPage",
"toHtmlPage",
"(",
"Reader",
"reader",
")",
"{",
"try",
"{",
"return",
"toHtmlPage",
"(",
"IOUtils",
".",
"toString",
"(",
"reader",
")",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new",
"RuntimeE... | Creates a {@link HtmlPage} from a given {@link Reader} that reads the HTML code for that page.
@param reader {@link Reader} that reads the HTML code
@return {@link HtmlPage} for this {@link Reader} | [
"Creates",
"a",
"{",
"@link",
"HtmlPage",
"}",
"from",
"a",
"given",
"{",
"@link",
"Reader",
"}",
"that",
"reads",
"the",
"HTML",
"code",
"for",
"that",
"page",
"."
] | train | https://github.com/codescape/bitvunit/blob/cef6d9af60d684e41294981c10b6d92c8f063a4e/bitvunit-core/src/main/java/de/codescape/bitvunit/util/html/HtmlPageUtil.java#L61-L67 |
google/j2objc | jre_emul/android/frameworks/base/core/java/android/util/Base64OutputStream.java | Base64OutputStream.internalWrite | private void internalWrite(byte[] b, int off, int len, boolean finish) throws IOException {
"""
Write the given bytes to the encoder/decoder.
@param finish true if this is the last batch of input, to cause
encoder/decoder state to be finalized.
"""
coder.output = embiggen(coder.output, coder.maxOut... | java | private void internalWrite(byte[] b, int off, int len, boolean finish) throws IOException {
coder.output = embiggen(coder.output, coder.maxOutputSize(len));
if (!coder.process(b, off, len, finish)) {
throw new Base64DataException("bad base-64");
}
out.write(coder.output, 0, c... | [
"private",
"void",
"internalWrite",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"off",
",",
"int",
"len",
",",
"boolean",
"finish",
")",
"throws",
"IOException",
"{",
"coder",
".",
"output",
"=",
"embiggen",
"(",
"coder",
".",
"output",
",",
"coder",
".",
... | Write the given bytes to the encoder/decoder.
@param finish true if this is the last batch of input, to cause
encoder/decoder state to be finalized. | [
"Write",
"the",
"given",
"bytes",
"to",
"the",
"encoder",
"/",
"decoder",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/frameworks/base/core/java/android/util/Base64OutputStream.java#L136-L142 |
fcrepo3/fcrepo | fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/pdp/data/XPathPolicyIndex.java | XPathPolicyIndex.getXpath | protected static String getXpath(Map<String, Collection<AttributeBean>> attributeMap) {
"""
Creates an XPath query from the attributes
@param attributeMap attributes from request
@return String
"""
StringBuilder sb = new StringBuilder();
getXpath(attributeMap, sb);
return sb.toString(... | java | protected static String getXpath(Map<String, Collection<AttributeBean>> attributeMap) {
StringBuilder sb = new StringBuilder();
getXpath(attributeMap, sb);
return sb.toString();
} | [
"protected",
"static",
"String",
"getXpath",
"(",
"Map",
"<",
"String",
",",
"Collection",
"<",
"AttributeBean",
">",
">",
"attributeMap",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"getXpath",
"(",
"attributeMap",
",",
"sb"... | Creates an XPath query from the attributes
@param attributeMap attributes from request
@return String | [
"Creates",
"an",
"XPath",
"query",
"from",
"the",
"attributes"
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-security/fcrepo-security-pdp/src/main/java/org/fcrepo/server/security/xacml/pdp/data/XPathPolicyIndex.java#L119-L123 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/util/PositionUtil.java | PositionUtil.toRangeAddress | public String toRangeAddress(final int row1, final int col1, final int row2, final int col2) {
"""
Return the Excel/OO/LO address of a range
@param row1 the first row
@param col1 the first col
@param row2 the last row
@param col2 the last col
@return the Excel/OO/LO address
"""
return this.toCe... | java | public String toRangeAddress(final int row1, final int col1, final int row2, final int col2) {
return this.toCellAddress(row1, col1) + ":" + this.toCellAddress(row2, col2);
} | [
"public",
"String",
"toRangeAddress",
"(",
"final",
"int",
"row1",
",",
"final",
"int",
"col1",
",",
"final",
"int",
"row2",
",",
"final",
"int",
"col2",
")",
"{",
"return",
"this",
".",
"toCellAddress",
"(",
"row1",
",",
"col1",
")",
"+",
"\":\"",
"+"... | Return the Excel/OO/LO address of a range
@param row1 the first row
@param col1 the first col
@param row2 the last row
@param col2 the last col
@return the Excel/OO/LO address | [
"Return",
"the",
"Excel",
"/",
"OO",
"/",
"LO",
"address",
"of",
"a",
"range"
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/util/PositionUtil.java#L260-L262 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java | ImageMiscOps.fillUniform | public static void fillUniform(GrayF32 img, Random rand , float min , float max) {
"""
Sets each value in the image to a value drawn from an uniform distribution that has a range of min ≤ X < max.
@param img Image which is to be filled. Modified,
@param rand Random number generator
@param min Minimum v... | java | public static void fillUniform(GrayF32 img, Random rand , float min , float max) {
float range = max-min;
float[] data = img.data;
for (int y = 0; y < img.height; y++) {
int index = img.getStartIndex() + y * img.getStride();
for (int x = 0; x < img.width; x++) {
data[index++] = rand.nextFloat()*range+... | [
"public",
"static",
"void",
"fillUniform",
"(",
"GrayF32",
"img",
",",
"Random",
"rand",
",",
"float",
"min",
",",
"float",
"max",
")",
"{",
"float",
"range",
"=",
"max",
"-",
"min",
";",
"float",
"[",
"]",
"data",
"=",
"img",
".",
"data",
";",
"fo... | Sets each value in the image to a value drawn from an uniform distribution that has a range of min ≤ X < max.
@param img Image which is to be filled. Modified,
@param rand Random number generator
@param min Minimum value of the distribution, inclusive
@param max Maximum value of the distribution, inclusive | [
"Sets",
"each",
"value",
"in",
"the",
"image",
"to",
"a",
"value",
"drawn",
"from",
"an",
"uniform",
"distribution",
"that",
"has",
"a",
"range",
"of",
"min",
"&le",
";",
"X",
"<",
";",
"max",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java#L2454-L2465 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/SocketGroovyMethods.java | SocketGroovyMethods.leftShift | public static OutputStream leftShift(Socket self, byte[] value) throws IOException {
"""
Overloads the left shift operator to provide an append mechanism
to add bytes to the output stream of a socket
@param self a Socket
@param value a value to append
@return an OutputStream
@throws IOException if an IOExc... | java | public static OutputStream leftShift(Socket self, byte[] value) throws IOException {
return IOGroovyMethods.leftShift(self.getOutputStream(), value);
} | [
"public",
"static",
"OutputStream",
"leftShift",
"(",
"Socket",
"self",
",",
"byte",
"[",
"]",
"value",
")",
"throws",
"IOException",
"{",
"return",
"IOGroovyMethods",
".",
"leftShift",
"(",
"self",
".",
"getOutputStream",
"(",
")",
",",
"value",
")",
";",
... | Overloads the left shift operator to provide an append mechanism
to add bytes to the output stream of a socket
@param self a Socket
@param value a value to append
@return an OutputStream
@throws IOException if an IOException occurs.
@since 1.0 | [
"Overloads",
"the",
"left",
"shift",
"operator",
"to",
"provide",
"an",
"append",
"mechanism",
"to",
"add",
"bytes",
"to",
"the",
"output",
"stream",
"of",
"a",
"socket"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/SocketGroovyMethods.java#L146-L148 |
alkacon/opencms-core | src/org/opencms/db/generic/CmsVfsDriver.java | CmsVfsDriver.internalIncrementCounter | protected void internalIncrementCounter(CmsDbContext dbc, String name) throws CmsDbSqlException {
"""
Increments a counter.<p>
@param dbc the current db context
@param name the name of the counter which should be incremented
@throws CmsDbSqlException if something goes wrong
"""
PreparedStatemen... | java | protected void internalIncrementCounter(CmsDbContext dbc, String name) throws CmsDbSqlException {
PreparedStatement stmt = null;
Connection conn = null;
ResultSet resultSet = null;
try {
conn = m_sqlManager.getConnection(dbc);
stmt = m_sqlManager.getPreparedState... | [
"protected",
"void",
"internalIncrementCounter",
"(",
"CmsDbContext",
"dbc",
",",
"String",
"name",
")",
"throws",
"CmsDbSqlException",
"{",
"PreparedStatement",
"stmt",
"=",
"null",
";",
"Connection",
"conn",
"=",
"null",
";",
"ResultSet",
"resultSet",
"=",
"null... | Increments a counter.<p>
@param dbc the current db context
@param name the name of the counter which should be incremented
@throws CmsDbSqlException if something goes wrong | [
"Increments",
"a",
"counter",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/generic/CmsVfsDriver.java#L3757-L3773 |
wuman/orientdb-android | core/src/main/java/com/orientechnologies/orient/core/index/OIndexFullText.java | OIndexFullText.put | @Override
public OIndexFullText put(final Object iKey, final OIdentifiable iSingleValue) {
"""
Indexes a value and save the index. Splits the value in single words and index each one. Save of the index is responsibility of
the caller.
"""
if (iKey == null)
return this;
modificationLock.r... | java | @Override
public OIndexFullText put(final Object iKey, final OIdentifiable iSingleValue) {
if (iKey == null)
return this;
modificationLock.requestModificationLock();
try {
final List<String> words = splitIntoWords(iKey.toString());
// FOREACH WORD CREATE THE LINK TO THE CURR... | [
"@",
"Override",
"public",
"OIndexFullText",
"put",
"(",
"final",
"Object",
"iKey",
",",
"final",
"OIdentifiable",
"iSingleValue",
")",
"{",
"if",
"(",
"iKey",
"==",
"null",
")",
"return",
"this",
";",
"modificationLock",
".",
"requestModificationLock",
"(",
"... | Indexes a value and save the index. Splits the value in single words and index each one. Save of the index is responsibility of
the caller. | [
"Indexes",
"a",
"value",
"and",
"save",
"the",
"index",
".",
"Splits",
"the",
"value",
"in",
"single",
"words",
"and",
"index",
"each",
"one",
".",
"Save",
"of",
"the",
"index",
"is",
"responsibility",
"of",
"the",
"caller",
"."
] | train | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/core/src/main/java/com/orientechnologies/orient/core/index/OIndexFullText.java#L91-L129 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/Sources.java | Sources.getDeepResource | public static URL getDeepResource(ClassLoader startLoader, String resourceName) {
"""
Search class loader tree for resource, current implementation
attempts up to 10 levels of nested class loaders.
@param startLoader class loader to start from
@param resourceName the resource name on class path
@return A {@... | java | public static URL getDeepResource(ClassLoader startLoader, String resourceName) {
ClassLoader currentLoader = checkNotNull(startLoader);
URL url = currentLoader.getResource(checkNotEmpty(resourceName));
int attempts = 0;
while (url == null && attempts < 10) { // search the class loader ... | [
"public",
"static",
"URL",
"getDeepResource",
"(",
"ClassLoader",
"startLoader",
",",
"String",
"resourceName",
")",
"{",
"ClassLoader",
"currentLoader",
"=",
"checkNotNull",
"(",
"startLoader",
")",
";",
"URL",
"url",
"=",
"currentLoader",
".",
"getResource",
"("... | Search class loader tree for resource, current implementation
attempts up to 10 levels of nested class loaders.
@param startLoader class loader to start from
@param resourceName the resource name on class path
@return A {@link URL} object for reading the resource
@throws java.lang.IllegalArgumentException if the reso... | [
"Search",
"class",
"loader",
"tree",
"for",
"resource",
"current",
"implementation",
"attempts",
"up",
"to",
"10",
"levels",
"of",
"nested",
"class",
"loaders",
"."
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/Sources.java#L146-L161 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/graph/invariant/Canon.java | Canon.primeProduct | private long primeProduct(int[] ws, long[] ranks, boolean[] hydrogens) {
"""
Compute the prime product of the values (ranks) for the given
adjacent neighbors (ws).
@param ws indices (adjacent neighbors)
@param ranks invariant ranks
@return the prime product
"""
long prod = 1;
for (int ... | java | private long primeProduct(int[] ws, long[] ranks, boolean[] hydrogens) {
long prod = 1;
for (int w : ws) {
if (!hydrogens[w]) {
prod *= PRIMES[(int) ranks[w]];
}
}
return prod;
} | [
"private",
"long",
"primeProduct",
"(",
"int",
"[",
"]",
"ws",
",",
"long",
"[",
"]",
"ranks",
",",
"boolean",
"[",
"]",
"hydrogens",
")",
"{",
"long",
"prod",
"=",
"1",
";",
"for",
"(",
"int",
"w",
":",
"ws",
")",
"{",
"if",
"(",
"!",
"hydroge... | Compute the prime product of the values (ranks) for the given
adjacent neighbors (ws).
@param ws indices (adjacent neighbors)
@param ranks invariant ranks
@return the prime product | [
"Compute",
"the",
"prime",
"product",
"of",
"the",
"values",
"(",
"ranks",
")",
"for",
"the",
"given",
"adjacent",
"neighbors",
"(",
"ws",
")",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/invariant/Canon.java#L294-L302 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Retryer.java | Retryer.timeout | public Retryer<R> timeout(long duration, TimeUnit timeUnit) {
"""
Timing out after the specified time limit
@param duration
@param timeUnit
@return
"""
return timeout(duration, timeUnit, null);
} | java | public Retryer<R> timeout(long duration, TimeUnit timeUnit) {
return timeout(duration, timeUnit, null);
} | [
"public",
"Retryer",
"<",
"R",
">",
"timeout",
"(",
"long",
"duration",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"return",
"timeout",
"(",
"duration",
",",
"timeUnit",
",",
"null",
")",
";",
"}"
] | Timing out after the specified time limit
@param duration
@param timeUnit
@return | [
"Timing",
"out",
"after",
"the",
"specified",
"time",
"limit"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Retryer.java#L76-L78 |
javabits/yar | yar-api/src/main/java/org/javabits/yar/TimeoutException.java | TimeoutException.newTimeoutException | public static TimeoutException newTimeoutException(long timeout, TimeUnit unit, java.util.concurrent.TimeoutException cause) {
"""
Constructs a <tt>TimeoutException</tt> with the specified detail
timeout value.
@param timeout the maximum time to wait.
@param unit the time unit of the timeout argument
@par... | java | public static TimeoutException newTimeoutException(long timeout, TimeUnit unit, java.util.concurrent.TimeoutException cause) {
return new TimeoutException(timeout, unit, cause);
} | [
"public",
"static",
"TimeoutException",
"newTimeoutException",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
",",
"java",
".",
"util",
".",
"concurrent",
".",
"TimeoutException",
"cause",
")",
"{",
"return",
"new",
"TimeoutException",
"(",
"timeout",
",",
"un... | Constructs a <tt>TimeoutException</tt> with the specified detail
timeout value.
@param timeout the maximum time to wait.
@param unit the time unit of the timeout argument
@param cause the original {@code TimeoutException} | [
"Constructs",
"a",
"<tt",
">",
"TimeoutException<",
"/",
"tt",
">",
"with",
"the",
"specified",
"detail",
"timeout",
"value",
"."
] | train | https://github.com/javabits/yar/blob/e146a86611ca4831e8334c9a98fd7086cee9c03e/yar-api/src/main/java/org/javabits/yar/TimeoutException.java#L103-L105 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java | HtmlTree.FRAMESET | public static HtmlTree FRAMESET(String cols, String rows, String title, String onload) {
"""
Generates a FRAMESET tag.
@param cols the size of columns in the frameset
@param rows the size of rows in the frameset
@param title the title for the frameset
@param onload the script to run when the document loads
... | java | public static HtmlTree FRAMESET(String cols, String rows, String title, String onload) {
HtmlTree htmltree = new HtmlTree(HtmlTag.FRAMESET);
if (cols != null)
htmltree.addAttr(HtmlAttr.COLS, cols);
if (rows != null)
htmltree.addAttr(HtmlAttr.ROWS, rows);
htmltree.... | [
"public",
"static",
"HtmlTree",
"FRAMESET",
"(",
"String",
"cols",
",",
"String",
"rows",
",",
"String",
"title",
",",
"String",
"onload",
")",
"{",
"HtmlTree",
"htmltree",
"=",
"new",
"HtmlTree",
"(",
"HtmlTag",
".",
"FRAMESET",
")",
";",
"if",
"(",
"co... | Generates a FRAMESET tag.
@param cols the size of columns in the frameset
@param rows the size of rows in the frameset
@param title the title for the frameset
@param onload the script to run when the document loads
@return an HtmlTree object for the FRAMESET tag | [
"Generates",
"a",
"FRAMESET",
"tag",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java#L370-L379 |
eclipse/hawkbit | hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/AbstractMetadataPopupLayout.java | AbstractMetadataPopupLayout.getWindow | public CommonDialogWindow getWindow(final E entity, final String metaDatakey) {
"""
Returns metadata popup.
@param entity
entity for which metadata data is displayed
@param metaDatakey
metadata key to be selected
@return {@link CommonDialogWindow}
"""
selectedEntity = entity;
metadataWi... | java | public CommonDialogWindow getWindow(final E entity, final String metaDatakey) {
selectedEntity = entity;
metadataWindow = new WindowBuilder(SPUIDefinitions.CREATE_UPDATE_WINDOW).caption(getMetadataCaption())
.content(this).cancelButtonClickListener(event -> onCancel())
.... | [
"public",
"CommonDialogWindow",
"getWindow",
"(",
"final",
"E",
"entity",
",",
"final",
"String",
"metaDatakey",
")",
"{",
"selectedEntity",
"=",
"entity",
";",
"metadataWindow",
"=",
"new",
"WindowBuilder",
"(",
"SPUIDefinitions",
".",
"CREATE_UPDATE_WINDOW",
")",
... | Returns metadata popup.
@param entity
entity for which metadata data is displayed
@param metaDatakey
metadata key to be selected
@return {@link CommonDialogWindow} | [
"Returns",
"metadata",
"popup",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/AbstractMetadataPopupLayout.java#L131-L145 |
Jasig/uPortal | uPortal-spring/src/main/java/org/springframework/web/portlet/HeaderHandlingDispatcherPortlet.java | HeaderHandlingDispatcherPortlet.doRenderService | @Override
protected void doRenderService(RenderRequest request, RenderResponse response)
throws Exception {
"""
Processes the actual dispatching to the handler for render requests.
<p>The handler will be obtained by applying the portlet's HandlerMappings in order. The
HandlerAdapter will be obt... | java | @Override
protected void doRenderService(RenderRequest request, RenderResponse response)
throws Exception {
super.doRenderService(request, response);
} | [
"@",
"Override",
"protected",
"void",
"doRenderService",
"(",
"RenderRequest",
"request",
",",
"RenderResponse",
"response",
")",
"throws",
"Exception",
"{",
"super",
".",
"doRenderService",
"(",
"request",
",",
"response",
")",
";",
"}"
] | Processes the actual dispatching to the handler for render requests.
<p>The handler will be obtained by applying the portlet's HandlerMappings in order. The
HandlerAdapter will be obtained by querying the portlet's installed HandlerAdapters to find
the first that supports the handler class.
<p>For two-phase render pr... | [
"Processes",
"the",
"actual",
"dispatching",
"to",
"the",
"handler",
"for",
"render",
"requests",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-spring/src/main/java/org/springframework/web/portlet/HeaderHandlingDispatcherPortlet.java#L86-L90 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/RemoteAllResults.java | RemoteAllResults.getLogLists | public Iterable<RemoteInstanceDetails> getLogLists() {
"""
returns list of server instances satisfying the request.
@return iterable over RemoteInstanceDetails objects
"""
ArrayList<RemoteInstanceDetails> result = new ArrayList<RemoteInstanceDetails>();
for (Date startTime: resultList) {
result.add(n... | java | public Iterable<RemoteInstanceDetails> getLogLists() {
ArrayList<RemoteInstanceDetails> result = new ArrayList<RemoteInstanceDetails>();
for (Date startTime: resultList) {
result.add(new RemoteInstanceDetails(query, startTime, new String[0]));
}
return result;
} | [
"public",
"Iterable",
"<",
"RemoteInstanceDetails",
">",
"getLogLists",
"(",
")",
"{",
"ArrayList",
"<",
"RemoteInstanceDetails",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"RemoteInstanceDetails",
">",
"(",
")",
";",
"for",
"(",
"Date",
"startTime",
":",
"r... | returns list of server instances satisfying the request.
@return iterable over RemoteInstanceDetails objects | [
"returns",
"list",
"of",
"server",
"instances",
"satisfying",
"the",
"request",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/RemoteAllResults.java#L56-L62 |
jamesagnew/hapi-fhir | hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/impl/BaseHttpClientInvocation.java | BaseHttpClientInvocation.createHttpRequest | protected IHttpRequest createHttpRequest(String theUrl, EncodingEnum theEncoding, RequestTypeEnum theRequestType) {
"""
Create an HTTP request for the given url, encoding and request-type
@param theUrl
The complete FHIR url to which the http request will be sent
@param theEncoding
The encoding to use for any... | java | protected IHttpRequest createHttpRequest(String theUrl, EncodingEnum theEncoding, RequestTypeEnum theRequestType) {
IHttpClient httpClient = getRestfulClientFactory().getHttpClient(new StringBuilder(theUrl), null, null, theRequestType, myHeaders);
return httpClient.createGetRequest(getContext(), theEncoding);
} | [
"protected",
"IHttpRequest",
"createHttpRequest",
"(",
"String",
"theUrl",
",",
"EncodingEnum",
"theEncoding",
",",
"RequestTypeEnum",
"theRequestType",
")",
"{",
"IHttpClient",
"httpClient",
"=",
"getRestfulClientFactory",
"(",
")",
".",
"getHttpClient",
"(",
"new",
... | Create an HTTP request for the given url, encoding and request-type
@param theUrl
The complete FHIR url to which the http request will be sent
@param theEncoding
The encoding to use for any serialized content sent to the
server
@param theRequestType
the type of HTTP request (GET, DELETE, ..) | [
"Create",
"an",
"HTTP",
"request",
"for",
"the",
"given",
"url",
"encoding",
"and",
"request",
"-",
"type"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/impl/BaseHttpClientInvocation.java#L75-L78 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java | SARLQuickfixProvider.getSpaceSize | public int getSpaceSize(IXtextDocument document, int offset) throws BadLocationException {
"""
Replies the size of a sequence of whitespaces.
@param document the document.
@param offset the offset of the first character of the sequence.
@return the number of whitespaces at the given offset.
@throws BadLocati... | java | public int getSpaceSize(IXtextDocument document, int offset) throws BadLocationException {
int size = 0;
char c = document.getChar(offset + size);
while (Character.isWhitespace(c)) {
size++;
c = document.getChar(offset + size);
}
return size;
} | [
"public",
"int",
"getSpaceSize",
"(",
"IXtextDocument",
"document",
",",
"int",
"offset",
")",
"throws",
"BadLocationException",
"{",
"int",
"size",
"=",
"0",
";",
"char",
"c",
"=",
"document",
".",
"getChar",
"(",
"offset",
"+",
"size",
")",
";",
"while",... | Replies the size of a sequence of whitespaces.
@param document the document.
@param offset the offset of the first character of the sequence.
@return the number of whitespaces at the given offset.
@throws BadLocationException if there is a problem with the location of the element. | [
"Replies",
"the",
"size",
"of",
"a",
"sequence",
"of",
"whitespaces",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L540-L548 |
haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/lang/BeanUtil.java | BeanUtil.setPropertyValue | public static void setPropertyValue(Object pObject, String pProperty, Object pValue)
throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
"""
Sets the property value to an object using reflection.
Supports setting values of properties that are properties of
properties (r... | java | public static void setPropertyValue(Object pObject, String pProperty, Object pValue)
throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
//
// TODO: Support set(Object, Object)/put(Object, Object) methods
// of Collections!
// ... | [
"public",
"static",
"void",
"setPropertyValue",
"(",
"Object",
"pObject",
",",
"String",
"pProperty",
",",
"Object",
"pValue",
")",
"throws",
"NoSuchMethodException",
",",
"InvocationTargetException",
",",
"IllegalAccessException",
"{",
"//\r",
"// TODO: Support set(Objec... | Sets the property value to an object using reflection.
Supports setting values of properties that are properties of
properties (recursive).
@param pObject The object to get a property from
@param pProperty The name of the property
@param pValue The property value
@throws NoSuchMethodException if there's no wr... | [
"Sets",
"the",
"property",
"value",
"to",
"an",
"object",
"using",
"reflection",
".",
"Supports",
"setting",
"values",
"of",
"properties",
"that",
"are",
"properties",
"of",
"properties",
"(",
"recursive",
")",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/lang/BeanUtil.java#L222-L252 |
apache/flink | flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/asm/translate/Translate.java | Translate.translateEdgeIds | public static <OLD, NEW, EV> DataSet<Edge<NEW, EV>> translateEdgeIds(DataSet<Edge<OLD, EV>> edges, TranslateFunction<OLD, NEW> translator) {
"""
Translate {@link Edge} IDs using the given {@link TranslateFunction}.
@param edges input edges
@param translator implements conversion from {@code OLD} to {@code NEW}... | java | public static <OLD, NEW, EV> DataSet<Edge<NEW, EV>> translateEdgeIds(DataSet<Edge<OLD, EV>> edges, TranslateFunction<OLD, NEW> translator) {
return translateEdgeIds(edges, translator, PARALLELISM_DEFAULT);
} | [
"public",
"static",
"<",
"OLD",
",",
"NEW",
",",
"EV",
">",
"DataSet",
"<",
"Edge",
"<",
"NEW",
",",
"EV",
">",
">",
"translateEdgeIds",
"(",
"DataSet",
"<",
"Edge",
"<",
"OLD",
",",
"EV",
">",
">",
"edges",
",",
"TranslateFunction",
"<",
"OLD",
",... | Translate {@link Edge} IDs using the given {@link TranslateFunction}.
@param edges input edges
@param translator implements conversion from {@code OLD} to {@code NEW}
@param <OLD> old edge ID type
@param <NEW> new edge ID type
@param <EV> edge value type
@return translated edges | [
"Translate",
"{",
"@link",
"Edge",
"}",
"IDs",
"using",
"the",
"given",
"{",
"@link",
"TranslateFunction",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-gelly/src/main/java/org/apache/flink/graph/asm/translate/Translate.java#L137-L139 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java | FacebookRestClient.feed_publishStoryToUser | public boolean feed_publishStoryToUser(CharSequence title, CharSequence body, Integer priority)
throws FacebookException, IOException {
"""
Publish a story to the logged-in user's newsfeed.
@param title the title of the feed story
@param body the body of the feed story
@param priority
@return whether the s... | java | public boolean feed_publishStoryToUser(CharSequence title, CharSequence body, Integer priority)
throws FacebookException, IOException {
return feed_publishStoryToUser(title, body, null, priority);
} | [
"public",
"boolean",
"feed_publishStoryToUser",
"(",
"CharSequence",
"title",
",",
"CharSequence",
"body",
",",
"Integer",
"priority",
")",
"throws",
"FacebookException",
",",
"IOException",
"{",
"return",
"feed_publishStoryToUser",
"(",
"title",
",",
"body",
",",
"... | Publish a story to the logged-in user's newsfeed.
@param title the title of the feed story
@param body the body of the feed story
@param priority
@return whether the story was successfully published; false in case of permission error
@see <a href="http://wiki.developers.facebook.com/index.php/Feed.publishStoryToUser">
... | [
"Publish",
"a",
"story",
"to",
"the",
"logged",
"-",
"in",
"user",
"s",
"newsfeed",
"."
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L350-L353 |
ops4j/org.ops4j.pax.exam2 | core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/reactors/ReactorManager.java | ReactorManager.prepareReactor | public synchronized ExamReactor prepareReactor(Class<?> _testClass, Object testClassInstance) {
"""
Prepares the unstaged reactor for the given test class instance. Any configurations from
{@code Configuration} methods of the class are added to the reactor.
@param _testClass
test class
@param testClassInstan... | java | public synchronized ExamReactor prepareReactor(Class<?> _testClass, Object testClassInstance) {
this.currentTestClass = _testClass;
this.reactor = createReactor(_testClass);
testClasses.add(_testClass);
try {
addConfigurationsToReactor(_testClass, testClassInstance);
... | [
"public",
"synchronized",
"ExamReactor",
"prepareReactor",
"(",
"Class",
"<",
"?",
">",
"_testClass",
",",
"Object",
"testClassInstance",
")",
"{",
"this",
".",
"currentTestClass",
"=",
"_testClass",
";",
"this",
".",
"reactor",
"=",
"createReactor",
"(",
"_test... | Prepares the unstaged reactor for the given test class instance. Any configurations from
{@code Configuration} methods of the class are added to the reactor.
@param _testClass
test class
@param testClassInstance
instance of test class
@return reactor | [
"Prepares",
"the",
"unstaged",
"reactor",
"for",
"the",
"given",
"test",
"class",
"instance",
".",
"Any",
"configurations",
"from",
"{",
"@code",
"Configuration",
"}",
"methods",
"of",
"the",
"class",
"are",
"added",
"to",
"the",
"reactor",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/core/pax-exam-spi/src/main/java/org/ops4j/pax/exam/spi/reactors/ReactorManager.java#L166-L186 |
jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/BaseApplet.java | BaseApplet.onChangePassword | public int onChangePassword() {
"""
Display the change password dialog and change the password.
@return
"""
String strDisplay = "Login required";
strDisplay = this.getTask().getString(strDisplay);
for (int i = 1; i < 3; i++)
{
String strUserName = this.getProperty(P... | java | public int onChangePassword()
{
String strDisplay = "Login required";
strDisplay = this.getTask().getString(strDisplay);
for (int i = 1; i < 3; i++)
{
String strUserName = this.getProperty(Params.USER_NAME);
Frame frame = ScreenUtil.getFrame(this);
... | [
"public",
"int",
"onChangePassword",
"(",
")",
"{",
"String",
"strDisplay",
"=",
"\"Login required\"",
";",
"strDisplay",
"=",
"this",
".",
"getTask",
"(",
")",
".",
"getString",
"(",
"strDisplay",
")",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
... | Display the change password dialog and change the password.
@return | [
"Display",
"the",
"change",
"password",
"dialog",
"and",
"change",
"the",
"password",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/BaseApplet.java#L478-L517 |
threerings/nenya | core/src/main/java/com/threerings/media/FrameManager.java | FrameManager.newInstance | public static FrameManager newInstance (ManagedRoot root, MediaTimer timer) {
"""
Constructs a frame manager that will do its rendering to the supplied root and use the
supplied media timer for timing information.
"""
FrameManager fmgr = (root instanceof ManagedJFrame && _useFlip.getValue()) ?
... | java | public static FrameManager newInstance (ManagedRoot root, MediaTimer timer)
{
FrameManager fmgr = (root instanceof ManagedJFrame && _useFlip.getValue()) ?
new FlipFrameManager() : new BackFrameManager();
fmgr.init(root, timer);
return fmgr;
} | [
"public",
"static",
"FrameManager",
"newInstance",
"(",
"ManagedRoot",
"root",
",",
"MediaTimer",
"timer",
")",
"{",
"FrameManager",
"fmgr",
"=",
"(",
"root",
"instanceof",
"ManagedJFrame",
"&&",
"_useFlip",
".",
"getValue",
"(",
")",
")",
"?",
"new",
"FlipFra... | Constructs a frame manager that will do its rendering to the supplied root and use the
supplied media timer for timing information. | [
"Constructs",
"a",
"frame",
"manager",
"that",
"will",
"do",
"its",
"rendering",
"to",
"the",
"supplied",
"root",
"and",
"use",
"the",
"supplied",
"media",
"timer",
"for",
"timing",
"information",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/FrameManager.java#L159-L165 |
infinispan/infinispan | lucene/lucene-directory/src/main/java/org/infinispan/lucene/readlocks/DistributedSegmentReadLocker.java | DistributedSegmentReadLocker.isMultiChunked | private boolean isMultiChunked(final String filename) {
"""
Evaluates if the file is potentially being stored as fragmented into multiple chunks;
when it's a single chunk we don't need to apply readlocks.
@param filename
@return true if it is definitely fragmented, or if it's possibly fragmented.
"""
... | java | private boolean isMultiChunked(final String filename) {
final FileCacheKey fileCacheKey = new FileCacheKey(indexName, filename, affinitySegmentId);
final FileMetadata fileMetadata = metadataCache.get(fileCacheKey);
if (fileMetadata==null) {
//This might happen under high load when the metadat... | [
"private",
"boolean",
"isMultiChunked",
"(",
"final",
"String",
"filename",
")",
"{",
"final",
"FileCacheKey",
"fileCacheKey",
"=",
"new",
"FileCacheKey",
"(",
"indexName",
",",
"filename",
",",
"affinitySegmentId",
")",
";",
"final",
"FileMetadata",
"fileMetadata",... | Evaluates if the file is potentially being stored as fragmented into multiple chunks;
when it's a single chunk we don't need to apply readlocks.
@param filename
@return true if it is definitely fragmented, or if it's possibly fragmented. | [
"Evaluates",
"if",
"the",
"file",
"is",
"potentially",
"being",
"stored",
"as",
"fragmented",
"into",
"multiple",
"chunks",
";",
"when",
"it",
"s",
"a",
"single",
"chunk",
"we",
"don",
"t",
"need",
"to",
"apply",
"readlocks",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/lucene/lucene-directory/src/main/java/org/infinispan/lucene/readlocks/DistributedSegmentReadLocker.java#L108-L121 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/StereoDisparityWtoNaive.java | StereoDisparityWtoNaive.computeScore | protected double computeScore( int leftX , int rightX , int centerY ) {
"""
Compute SAD (Sum of Absolute Difference) error.
@param leftX X-axis center left image
@param rightX X-axis center left image
@param centerY Y-axis center for both images
@return Fit score for both regions.
"""
double ret=0;
... | java | protected double computeScore( int leftX , int rightX , int centerY ) {
double ret=0;
for( int y = -radiusY; y <= radiusY; y++ ) {
for( int x = -radiusX; x <= radiusX; x++ ) {
double l = GeneralizedImageOps.get(imageLeft,leftX+x,centerY+y);
double r = GeneralizedImageOps.get(imageRight,rightX+x,centerY... | [
"protected",
"double",
"computeScore",
"(",
"int",
"leftX",
",",
"int",
"rightX",
",",
"int",
"centerY",
")",
"{",
"double",
"ret",
"=",
"0",
";",
"for",
"(",
"int",
"y",
"=",
"-",
"radiusY",
";",
"y",
"<=",
"radiusY",
";",
"y",
"++",
")",
"{",
"... | Compute SAD (Sum of Absolute Difference) error.
@param leftX X-axis center left image
@param rightX X-axis center left image
@param centerY Y-axis center for both images
@return Fit score for both regions. | [
"Compute",
"SAD",
"(",
"Sum",
"of",
"Absolute",
"Difference",
")",
"error",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/disparity/impl/StereoDisparityWtoNaive.java#L137-L151 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/record/meta/StructTypeID.java | StructTypeID.writeRest | void writeRest(RecordOutput rout, String tag) throws IOException {
"""
/*
Writes rest of the struct (excluding type value).
As an optimization, this method is directly called by RTI
for the top level record so that we don't write out the byte
indicating that this is a struct (since top level records are
alway... | java | void writeRest(RecordOutput rout, String tag) throws IOException {
rout.writeInt(typeInfos.size(), tag);
for (FieldTypeInfo ti : typeInfos) {
ti.write(rout, tag);
}
} | [
"void",
"writeRest",
"(",
"RecordOutput",
"rout",
",",
"String",
"tag",
")",
"throws",
"IOException",
"{",
"rout",
".",
"writeInt",
"(",
"typeInfos",
".",
"size",
"(",
")",
",",
"tag",
")",
";",
"for",
"(",
"FieldTypeInfo",
"ti",
":",
"typeInfos",
")",
... | /*
Writes rest of the struct (excluding type value).
As an optimization, this method is directly called by RTI
for the top level record so that we don't write out the byte
indicating that this is a struct (since top level records are
always structs). | [
"/",
"*",
"Writes",
"rest",
"of",
"the",
"struct",
"(",
"excluding",
"type",
"value",
")",
".",
"As",
"an",
"optimization",
"this",
"method",
"is",
"directly",
"called",
"by",
"RTI",
"for",
"the",
"top",
"level",
"record",
"so",
"that",
"we",
"don",
"t... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/record/meta/StructTypeID.java#L80-L85 |
TGIO/RNCryptorNative | rncryptor-native/src/main/java/tgio/rncryptor/RNCryptorNative.java | RNCryptorNative.encryptAsync | public static void encryptAsync(String raw, String password, RNCryptorNativeCallback RNCryptorNativeCallback) {
"""
Encrypts raw string and returns result via callback
@param raw just a raw string
@param password strong generated password
@param RNCryptorNativeCallback just a callback
"""
byte[] enc... | java | public static void encryptAsync(String raw, String password, RNCryptorNativeCallback RNCryptorNativeCallback) {
byte[] encrypted;
try {
encrypted = new RNCryptorNative().encrypt(raw, password);
RNCryptorNativeCallback.done(new String(encrypted, "UTF-8"), null);
} catch (E... | [
"public",
"static",
"void",
"encryptAsync",
"(",
"String",
"raw",
",",
"String",
"password",
",",
"RNCryptorNativeCallback",
"RNCryptorNativeCallback",
")",
"{",
"byte",
"[",
"]",
"encrypted",
";",
"try",
"{",
"encrypted",
"=",
"new",
"RNCryptorNative",
"(",
")"... | Encrypts raw string and returns result via callback
@param raw just a raw string
@param password strong generated password
@param RNCryptorNativeCallback just a callback | [
"Encrypts",
"raw",
"string",
"and",
"returns",
"result",
"via",
"callback"
] | train | https://github.com/TGIO/RNCryptorNative/blob/5209f10b988e4033c0b769a40b0d6cc99ea16af7/rncryptor-native/src/main/java/tgio/rncryptor/RNCryptorNative.java#L80-L89 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java | ImageModerationsImpl.evaluateFileInput | public Evaluate evaluateFileInput(byte[] imageStream, EvaluateFileInputOptionalParameter evaluateFileInputOptionalParameter) {
"""
Returns probabilities of the image containing racy or adult content.
@param imageStream The image file.
@param evaluateFileInputOptionalParameter the object representing the option... | java | public Evaluate evaluateFileInput(byte[] imageStream, EvaluateFileInputOptionalParameter evaluateFileInputOptionalParameter) {
return evaluateFileInputWithServiceResponseAsync(imageStream, evaluateFileInputOptionalParameter).toBlocking().single().body();
} | [
"public",
"Evaluate",
"evaluateFileInput",
"(",
"byte",
"[",
"]",
"imageStream",
",",
"EvaluateFileInputOptionalParameter",
"evaluateFileInputOptionalParameter",
")",
"{",
"return",
"evaluateFileInputWithServiceResponseAsync",
"(",
"imageStream",
",",
"evaluateFileInputOptionalPa... | Returns probabilities of the image containing racy or adult content.
@param imageStream The image file.
@param evaluateFileInputOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@throws APIErrorE... | [
"Returns",
"probabilities",
"of",
"the",
"image",
"containing",
"racy",
"or",
"adult",
"content",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java#L1426-L1428 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/config/jmx/JmxUtils.java | JmxUtils.getMBeanObjectName | public static ObjectName getMBeanObjectName(final ServletContext servletContext, final String resourceType,
final String mBeanPrefix) {
"""
Returns the object name for the Jawr configuration Manager MBean
@param servletContext
the servelt context
@param resourceType
the resource type
@param mBeanPrefix
... | java | public static ObjectName getMBeanObjectName(final ServletContext servletContext, final String resourceType,
final String mBeanPrefix) {
String contextPath = getContextPath(servletContext);
return getJawrConfigMBeanObjectName(contextPath, resourceType, mBeanPrefix);
} | [
"public",
"static",
"ObjectName",
"getMBeanObjectName",
"(",
"final",
"ServletContext",
"servletContext",
",",
"final",
"String",
"resourceType",
",",
"final",
"String",
"mBeanPrefix",
")",
"{",
"String",
"contextPath",
"=",
"getContextPath",
"(",
"servletContext",
")... | Returns the object name for the Jawr configuration Manager MBean
@param servletContext
the servelt context
@param resourceType
the resource type
@param mBeanPrefix
@return the object name for the Jawr configuration Manager MBean | [
"Returns",
"the",
"object",
"name",
"for",
"the",
"Jawr",
"configuration",
"Manager",
"MBean"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/config/jmx/JmxUtils.java#L166-L171 |
Jasig/uPortal | uPortal-persondir/src/main/java/org/apereo/portal/persondir/PortalRootPersonAttributeDao.java | PortalRootPersonAttributeDao.getPerson | @Override
public IPersonAttributes getPerson(String uid) {
"""
This method is for "filling" a specific individual.
@param uid The username (identity) of a known individual
@return A completely "filled" person, including overrides, or <code>null</code> if the person
is unknown
"""
final IPerso... | java | @Override
public IPersonAttributes getPerson(String uid) {
final IPersonAttributes rslt = delegatePersonAttributeDao.getPerson(uid);
if (rslt == null) {
// Nothing we can do with that
return null;
}
return postProcessPerson(rslt, uid);
} | [
"@",
"Override",
"public",
"IPersonAttributes",
"getPerson",
"(",
"String",
"uid",
")",
"{",
"final",
"IPersonAttributes",
"rslt",
"=",
"delegatePersonAttributeDao",
".",
"getPerson",
"(",
"uid",
")",
";",
"if",
"(",
"rslt",
"==",
"null",
")",
"{",
"// Nothing... | This method is for "filling" a specific individual.
@param uid The username (identity) of a known individual
@return A completely "filled" person, including overrides, or <code>null</code> if the person
is unknown | [
"This",
"method",
"is",
"for",
"filling",
"a",
"specific",
"individual",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-persondir/src/main/java/org/apereo/portal/persondir/PortalRootPersonAttributeDao.java#L110-L120 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/css/CSSClass.java | CSSClass.setStatement | public void setStatement(String key, String value) {
"""
Set a CSS statement.
@param key Statement key.
@param value Value or null (to unset)
"""
if (value != null && !checkCSSStatement(key, value)) {
throw new InvalidCSS("Invalid CSS statement.");
}
for (Pair<String, String> pair : state... | java | public void setStatement(String key, String value) {
if (value != null && !checkCSSStatement(key, value)) {
throw new InvalidCSS("Invalid CSS statement.");
}
for (Pair<String, String> pair : statements) {
if (pair.getFirst().equals(key)) {
if (value != null) {
pair.setSecond(va... | [
"public",
"void",
"setStatement",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
"&&",
"!",
"checkCSSStatement",
"(",
"key",
",",
"value",
")",
")",
"{",
"throw",
"new",
"InvalidCSS",
"(",
"\"Invalid CSS statement... | Set a CSS statement.
@param key Statement key.
@param value Value or null (to unset) | [
"Set",
"a",
"CSS",
"statement",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/css/CSSClass.java#L213-L230 |
morimekta/providence | providence-core/src/main/java/net/morimekta/providence/serializer/binary/BinaryFormatUtils.java | BinaryFormatUtils.writeMessage | public static <Message extends PMessage<Message, Field>, Field extends PField>
int writeMessage(BigEndianBinaryWriter writer, Message message)
throws IOException {
"""
Write message to writer.
@param writer The binary writer.
@param message The message to write.
@param <Message> The message ty... | java | public static <Message extends PMessage<Message, Field>, Field extends PField>
int writeMessage(BigEndianBinaryWriter writer, Message message)
throws IOException {
if (message instanceof BinaryWriter) {
return ((BinaryWriter) message).writeBinary(writer);
}
int len =... | [
"public",
"static",
"<",
"Message",
"extends",
"PMessage",
"<",
"Message",
",",
"Field",
">",
",",
"Field",
"extends",
"PField",
">",
"int",
"writeMessage",
"(",
"BigEndianBinaryWriter",
"writer",
",",
"Message",
"message",
")",
"throws",
"IOException",
"{",
"... | Write message to writer.
@param writer The binary writer.
@param message The message to write.
@param <Message> The message type.
@param <Field> The field type.
@return The number of bytes written.
@throws IOException If write failed. | [
"Write",
"message",
"to",
"writer",
"."
] | train | https://github.com/morimekta/providence/blob/7c17dc1c96b1a1d4b9ff942c2cfeb725278bd3aa/providence-core/src/main/java/net/morimekta/providence/serializer/binary/BinaryFormatUtils.java#L340-L368 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java | Whitebox.getMethod | public static Method getMethod(Class<?> type, String methodName, Class<?>... parameterTypes) {
"""
Convenience method to get a method from a class type without having to
catch the checked exceptions otherwise required. These exceptions are
wrapped as runtime exceptions.
<p>
The method will first try to look fo... | java | public static Method getMethod(Class<?> type, String methodName, Class<?>... parameterTypes) {
return WhiteboxImpl.getMethod(type, methodName, parameterTypes);
} | [
"public",
"static",
"Method",
"getMethod",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"...",
"parameterTypes",
")",
"{",
"return",
"WhiteboxImpl",
".",
"getMethod",
"(",
"type",
",",
"methodName",
",",
... | Convenience method to get a method from a class type without having to
catch the checked exceptions otherwise required. These exceptions are
wrapped as runtime exceptions.
<p>
The method will first try to look for a declared method in the same
class. If the method is not declared in this class it will look for the
meth... | [
"Convenience",
"method",
"to",
"get",
"a",
"method",
"from",
"a",
"class",
"type",
"without",
"having",
"to",
"catch",
"the",
"checked",
"exceptions",
"otherwise",
"required",
".",
"These",
"exceptions",
"are",
"wrapped",
"as",
"runtime",
"exceptions",
".",
"<... | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java#L93-L95 |
softindex/datakernel | boot/src/main/java/io/datakernel/service/ServiceGraphModule.java | ServiceGraphModule.registerForSpecificKey | public <T> ServiceGraphModule registerForSpecificKey(Key<T> key, ServiceAdapter<T> factory) {
"""
Puts the key and its factory to the keys
@param key key with which the specified factory is to be associated
@param factory value to be associated with the specified key
@param <T> type of service
@retur... | java | public <T> ServiceGraphModule registerForSpecificKey(Key<T> key, ServiceAdapter<T> factory) {
keys.put(key, factory);
return this;
} | [
"public",
"<",
"T",
">",
"ServiceGraphModule",
"registerForSpecificKey",
"(",
"Key",
"<",
"T",
">",
"key",
",",
"ServiceAdapter",
"<",
"T",
">",
"factory",
")",
"{",
"keys",
".",
"put",
"(",
"key",
",",
"factory",
")",
";",
"return",
"this",
";",
"}"
] | Puts the key and its factory to the keys
@param key key with which the specified factory is to be associated
@param factory value to be associated with the specified key
@param <T> type of service
@return ServiceGraphModule with change | [
"Puts",
"the",
"key",
"and",
"its",
"factory",
"to",
"the",
"keys"
] | train | https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/boot/src/main/java/io/datakernel/service/ServiceGraphModule.java#L156-L159 |
gresrun/jesque | src/main/java/net/greghaines/jesque/utils/JedisUtils.java | JedisUtils.isDelayedQueue | public static boolean isDelayedQueue(final Jedis jedis, final String key) {
"""
Determines if the queue identified by the given key is a delayed queue.
@param jedis
connection to Redis
@param key
the key that identifies a queue
@return true if the key identifies a delayed queue, false otherwise
"""
... | java | public static boolean isDelayedQueue(final Jedis jedis, final String key) {
return ZSET.equalsIgnoreCase(jedis.type(key));
} | [
"public",
"static",
"boolean",
"isDelayedQueue",
"(",
"final",
"Jedis",
"jedis",
",",
"final",
"String",
"key",
")",
"{",
"return",
"ZSET",
".",
"equalsIgnoreCase",
"(",
"jedis",
".",
"type",
"(",
"key",
")",
")",
";",
"}"
] | Determines if the queue identified by the given key is a delayed queue.
@param jedis
connection to Redis
@param key
the key that identifies a queue
@return true if the key identifies a delayed queue, false otherwise | [
"Determines",
"if",
"the",
"queue",
"identified",
"by",
"the",
"given",
"key",
"is",
"a",
"delayed",
"queue",
"."
] | train | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/JedisUtils.java#L132-L134 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/lib/RefCapablePropertyResourceBundle.java | RefCapablePropertyResourceBundle.getBundle | public static RefCapablePropertyResourceBundle
getBundle(String baseName, Locale locale, ClassLoader loader) {
"""
Use exactly like java.util.ResourceBundle.get(String, Locale, ClassLoader).
@see ResourceBundle#getBundle(String, Locale, ClassLoader)
"""
return getRef(baseName,
... | java | public static RefCapablePropertyResourceBundle
getBundle(String baseName, Locale locale, ClassLoader loader) {
return getRef(baseName,
ResourceBundle.getBundle(baseName, locale, loader), loader);
} | [
"public",
"static",
"RefCapablePropertyResourceBundle",
"getBundle",
"(",
"String",
"baseName",
",",
"Locale",
"locale",
",",
"ClassLoader",
"loader",
")",
"{",
"return",
"getRef",
"(",
"baseName",
",",
"ResourceBundle",
".",
"getBundle",
"(",
"baseName",
",",
"lo... | Use exactly like java.util.ResourceBundle.get(String, Locale, ClassLoader).
@see ResourceBundle#getBundle(String, Locale, ClassLoader) | [
"Use",
"exactly",
"like",
"java",
".",
"util",
".",
"ResourceBundle",
".",
"get",
"(",
"String",
"Locale",
"ClassLoader",
")",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/RefCapablePropertyResourceBundle.java#L354-L358 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java | PatternBox.controlsTransportOfChemical | public static Pattern controlsTransportOfChemical(Blacklist blacklist) {
"""
Pattern for a ProteinReference has a member PhysicalEntity that is controlling a reaction
that changes cellular location of a small molecule.
@param blacklist a skip-list of ubiquitous molecules
@return the pattern
"""
Pattern ... | java | public static Pattern controlsTransportOfChemical(Blacklist blacklist)
{
Pattern p = new Pattern(SequenceEntityReference.class, "controller ER");
p.add(linkedER(true), "controller ER", "controller generic ER");
p.add(erToPE(), "controller generic ER", "controller simple PE");
p.add(linkToComplex(), "controller... | [
"public",
"static",
"Pattern",
"controlsTransportOfChemical",
"(",
"Blacklist",
"blacklist",
")",
"{",
"Pattern",
"p",
"=",
"new",
"Pattern",
"(",
"SequenceEntityReference",
".",
"class",
",",
"\"controller ER\"",
")",
";",
"p",
".",
"add",
"(",
"linkedER",
"(",... | Pattern for a ProteinReference has a member PhysicalEntity that is controlling a reaction
that changes cellular location of a small molecule.
@param blacklist a skip-list of ubiquitous molecules
@return the pattern | [
"Pattern",
"for",
"a",
"ProteinReference",
"has",
"a",
"member",
"PhysicalEntity",
"that",
"is",
"controlling",
"a",
"reaction",
"that",
"changes",
"cellular",
"location",
"of",
"a",
"small",
"molecule",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/PatternBox.java#L79-L105 |
cdk/cdk | storage/ctab/src/main/java/org/openscience/cdk/io/RGroupQueryReader.java | RGroupQueryReader.checkLineBeginsWith | private void checkLineBeginsWith(String line, String expect, int lineCount) throws CDKException {
"""
Checks that a given line starts as expected, according to RGFile format.
@param line
@param expect
@param lineCount
@throws CDKException
"""
if (line == null) {
throw new CDKException("... | java | private void checkLineBeginsWith(String line, String expect, int lineCount) throws CDKException {
if (line == null) {
throw new CDKException("RGFile invalid, empty/null line at #" + lineCount);
}
if (!line.startsWith(expect)) {
throw new CDKException("RGFile invalid, line... | [
"private",
"void",
"checkLineBeginsWith",
"(",
"String",
"line",
",",
"String",
"expect",
",",
"int",
"lineCount",
")",
"throws",
"CDKException",
"{",
"if",
"(",
"line",
"==",
"null",
")",
"{",
"throw",
"new",
"CDKException",
"(",
"\"RGFile invalid, empty/null l... | Checks that a given line starts as expected, according to RGFile format.
@param line
@param expect
@param lineCount
@throws CDKException | [
"Checks",
"that",
"a",
"given",
"line",
"starts",
"as",
"expected",
"according",
"to",
"RGFile",
"format",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/ctab/src/main/java/org/openscience/cdk/io/RGroupQueryReader.java#L448-L455 |
jenetics/jenetics | jenetics.prog/src/main/java/io/jenetics/prog/op/Program.java | Program.check | public static void check(final Tree<? extends Op<?>, ?> program) {
"""
Validates the given program tree.
@param program the program to validate
@throws NullPointerException if the given {@code program} is {@code null}
@throws IllegalArgumentException if the given operation tree is invalid,
which means there ... | java | public static void check(final Tree<? extends Op<?>, ?> program) {
requireNonNull(program);
program.forEach(Program::checkArity);
} | [
"public",
"static",
"void",
"check",
"(",
"final",
"Tree",
"<",
"?",
"extends",
"Op",
"<",
"?",
">",
",",
"?",
">",
"program",
")",
"{",
"requireNonNull",
"(",
"program",
")",
";",
"program",
".",
"forEach",
"(",
"Program",
"::",
"checkArity",
")",
"... | Validates the given program tree.
@param program the program to validate
@throws NullPointerException if the given {@code program} is {@code null}
@throws IllegalArgumentException if the given operation tree is invalid,
which means there is at least one node where the operation arity
and the node child count differ. | [
"Validates",
"the",
"given",
"program",
"tree",
"."
] | train | https://github.com/jenetics/jenetics/blob/ee516770c65ef529b27deb283f071c85f344eff4/jenetics.prog/src/main/java/io/jenetics/prog/op/Program.java#L207-L210 |
azkaban/azkaban | az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopConfigurationInjector.java | HadoopConfigurationInjector.getPath | public static String getPath(Props props, String workingDir) {
"""
Gets the path to the directory in which the generated links and Hadoop
conf properties files are written.
@param props The Azkaban properties
@param workingDir The Azkaban job working directory
"""
return new File(workingDir, getDirNam... | java | public static String getPath(Props props, String workingDir) {
return new File(workingDir, getDirName(props)).toString();
} | [
"public",
"static",
"String",
"getPath",
"(",
"Props",
"props",
",",
"String",
"workingDir",
")",
"{",
"return",
"new",
"File",
"(",
"workingDir",
",",
"getDirName",
"(",
"props",
")",
")",
".",
"toString",
"(",
")",
";",
"}"
] | Gets the path to the directory in which the generated links and Hadoop
conf properties files are written.
@param props The Azkaban properties
@param workingDir The Azkaban job working directory | [
"Gets",
"the",
"path",
"to",
"the",
"directory",
"in",
"which",
"the",
"generated",
"links",
"and",
"Hadoop",
"conf",
"properties",
"files",
"are",
"written",
"."
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/az-hadoop-jobtype-plugin/src/main/java/azkaban/jobtype/HadoopConfigurationInjector.java#L188-L190 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/util/TableUtils.java | TableUtils.waitUntilActive | public static void waitUntilActive(final AmazonDynamoDB dynamo, final String tableName, final int timeout,
final int interval) throws InterruptedException, TableNeverTransitionedToStateException {
"""
Waits up to a specified amount of time for a specified DynamoDB table to
move into the <code>ACTIVE</code> sta... | java | public static void waitUntilActive(final AmazonDynamoDB dynamo, final String tableName, final int timeout,
final int interval) throws InterruptedException, TableNeverTransitionedToStateException {
TableDescription table = waitForTableDescription(dynamo, tableName, TableStatus.ACTIVE, timeout, interval);
if (tab... | [
"public",
"static",
"void",
"waitUntilActive",
"(",
"final",
"AmazonDynamoDB",
"dynamo",
",",
"final",
"String",
"tableName",
",",
"final",
"int",
"timeout",
",",
"final",
"int",
"interval",
")",
"throws",
"InterruptedException",
",",
"TableNeverTransitionedToStateExc... | Waits up to a specified amount of time for a specified DynamoDB table to
move into the <code>ACTIVE</code> state. If the table does not exist or
does not transition to the <code>ACTIVE</code> state after this time,
then a SdkClientException is thrown.
@param dynamo
The DynamoDB client to use to make requests.
@param t... | [
"Waits",
"up",
"to",
"a",
"specified",
"amount",
"of",
"time",
"for",
"a",
"specified",
"DynamoDB",
"table",
"to",
"move",
"into",
"the",
"<code",
">",
"ACTIVE<",
"/",
"code",
">",
"state",
".",
"If",
"the",
"table",
"does",
"not",
"exist",
"or",
"does... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/util/TableUtils.java#L165-L172 |
datacleaner/DataCleaner | desktop/ui/src/main/java/org/datacleaner/widgets/tabs/CloseableTabbedPaneUI.java | CloseableTabbedPaneUI.closeRectFor | public Rectangle closeRectFor(final int tabIndex) {
"""
Helper-method to get a rectangle definition for the close-icon
@param tabIndex
@return
"""
final Rectangle rect = rects[tabIndex];
final int x = rect.x + rect.width - CLOSE_ICON_WIDTH - CLOSE_ICON_RIGHT_MARGIN;
final int y = re... | java | public Rectangle closeRectFor(final int tabIndex) {
final Rectangle rect = rects[tabIndex];
final int x = rect.x + rect.width - CLOSE_ICON_WIDTH - CLOSE_ICON_RIGHT_MARGIN;
final int y = rect.y + (rect.height - CLOSE_ICON_WIDTH) / 2;
final int width = CLOSE_ICON_WIDTH;
return new ... | [
"public",
"Rectangle",
"closeRectFor",
"(",
"final",
"int",
"tabIndex",
")",
"{",
"final",
"Rectangle",
"rect",
"=",
"rects",
"[",
"tabIndex",
"]",
";",
"final",
"int",
"x",
"=",
"rect",
".",
"x",
"+",
"rect",
".",
"width",
"-",
"CLOSE_ICON_WIDTH",
"-",
... | Helper-method to get a rectangle definition for the close-icon
@param tabIndex
@return | [
"Helper",
"-",
"method",
"to",
"get",
"a",
"rectangle",
"definition",
"for",
"the",
"close",
"-",
"icon"
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/desktop/ui/src/main/java/org/datacleaner/widgets/tabs/CloseableTabbedPaneUI.java#L120-L126 |
bazaarvoice/emodb | auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/jersey/AuthenticationResourceFilter.java | AuthenticationResourceFilter.setJettyAuthentication | private void setJettyAuthentication(Subject subject) {
"""
Certain aspects of the container, such as logging, need the authentication information to behave properly.
This method updates the request with the necessary objects to recognize the authenticated user.
"""
// In unit test environments there m... | java | private void setJettyAuthentication(Subject subject) {
// In unit test environments there may not be a current connection. If any nulls are encountered
// then, by definition, there is no container to update.
HttpConnection connection = HttpConnection.getCurrentConnection();
if (connect... | [
"private",
"void",
"setJettyAuthentication",
"(",
"Subject",
"subject",
")",
"{",
"// In unit test environments there may not be a current connection. If any nulls are encountered",
"// then, by definition, there is no container to update.",
"HttpConnection",
"connection",
"=",
"HttpConne... | Certain aspects of the container, such as logging, need the authentication information to behave properly.
This method updates the request with the necessary objects to recognize the authenticated user. | [
"Certain",
"aspects",
"of",
"the",
"container",
"such",
"as",
"logging",
"need",
"the",
"authentication",
"information",
"to",
"behave",
"properly",
".",
"This",
"method",
"updates",
"the",
"request",
"with",
"the",
"necessary",
"objects",
"to",
"recognize",
"th... | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/jersey/AuthenticationResourceFilter.java#L79-L96 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbNetworks.java | TmdbNetworks.getNetworkInfo | public Network getNetworkInfo(int networkId) throws MovieDbException {
"""
This method is used to retrieve the basic information about a TV network.
<p>
You can use this ID to search for TV shows with the discover method.
@param networkId
@return
@throws MovieDbException
"""
TmdbParameters param... | java | public Network getNetworkInfo(int networkId) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, networkId);
URL url = new ApiUrl(apiKey, MethodBase.NETWORK).buildUrl(parameters);
String webpage = httpTools.getRequest(url);
try {... | [
"public",
"Network",
"getNetworkInfo",
"(",
"int",
"networkId",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"parameters",
".",
"add",
"(",
"Param",
".",
"ID",
",",
"networkId",
")",
";",
... | This method is used to retrieve the basic information about a TV network.
<p>
You can use this ID to search for TV shows with the discover method.
@param networkId
@return
@throws MovieDbException | [
"This",
"method",
"is",
"used",
"to",
"retrieve",
"the",
"basic",
"information",
"about",
"a",
"TV",
"network",
".",
"<p",
">",
"You",
"can",
"use",
"this",
"ID",
"to",
"search",
"for",
"TV",
"shows",
"with",
"the",
"discover",
"method",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbNetworks.java#L59-L71 |
apache/incubator-druid | core/src/main/java/org/apache/druid/guice/LifecycleModule.java | LifecycleModule.registerKey | public static void registerKey(Binder binder, Key<?> key) {
"""
Registers a key to instantiate eagerly. {@link Key}s mentioned here will be pulled out of
the injector with an injector.getInstance() call when the lifecycle is created.
Eagerly loaded classes will *not* be automatically added to the Lifecycle un... | java | public static void registerKey(Binder binder, Key<?> key)
{
getEagerBinder(binder).addBinding().toInstance(new KeyHolder<Object>(key));
} | [
"public",
"static",
"void",
"registerKey",
"(",
"Binder",
"binder",
",",
"Key",
"<",
"?",
">",
"key",
")",
"{",
"getEagerBinder",
"(",
"binder",
")",
".",
"addBinding",
"(",
")",
".",
"toInstance",
"(",
"new",
"KeyHolder",
"<",
"Object",
">",
"(",
"key... | Registers a key to instantiate eagerly. {@link Key}s mentioned here will be pulled out of
the injector with an injector.getInstance() call when the lifecycle is created.
Eagerly loaded classes will *not* be automatically added to the Lifecycle unless they are bound to the proper
scope. That is, they are generally ea... | [
"Registers",
"a",
"key",
"to",
"instantiate",
"eagerly",
".",
"{",
"@link",
"Key",
"}",
"s",
"mentioned",
"here",
"will",
"be",
"pulled",
"out",
"of",
"the",
"injector",
"with",
"an",
"injector",
".",
"getInstance",
"()",
"call",
"when",
"the",
"lifecycle"... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/guice/LifecycleModule.java#L105-L108 |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java | JSONArray.optLong | public long optLong(int index, long fallback) {
"""
Returns the value at {@code index} if it exists and is a long or can be coerced to
a long. Returns {@code fallback} otherwise.
@param index the index to get the value from
@param fallback the fallback value
@return the value at {@code index} of {@code fallbac... | java | public long optLong(int index, long fallback) {
Object object = opt(index);
Long result = JSON.toLong(object);
return result != null ? result : fallback;
} | [
"public",
"long",
"optLong",
"(",
"int",
"index",
",",
"long",
"fallback",
")",
"{",
"Object",
"object",
"=",
"opt",
"(",
"index",
")",
";",
"Long",
"result",
"=",
"JSON",
".",
"toLong",
"(",
"object",
")",
";",
"return",
"result",
"!=",
"null",
"?",... | Returns the value at {@code index} if it exists and is a long or can be coerced to
a long. Returns {@code fallback} otherwise.
@param index the index to get the value from
@param fallback the fallback value
@return the value at {@code index} of {@code fallback} | [
"Returns",
"the",
"value",
"at",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java#L477-L481 |
craigwblake/redline | src/main/java/org/redline_rpm/Builder.java | Builder.addURL | public void addURL( final String path, final URL source, final int mode, final int dirmode, final String username, final String group) throws NoSuchAlgorithmException, IOException {
"""
Add the specified file to the repository payload in order by URL.
The required header entries will automatically be generated
t... | java | public void addURL( final String path, final URL source, final int mode, final int dirmode, final String username, final String group) throws NoSuchAlgorithmException, IOException {
contents.addURL( path, source, mode, null, username, group, dirmode);
} | [
"public",
"void",
"addURL",
"(",
"final",
"String",
"path",
",",
"final",
"URL",
"source",
",",
"final",
"int",
"mode",
",",
"final",
"int",
"dirmode",
",",
"final",
"String",
"username",
",",
"final",
"String",
"group",
")",
"throws",
"NoSuchAlgorithmExcept... | Add the specified file to the repository payload in order by URL.
The required header entries will automatically be generated
to record the directory names and file names, as well as their
digests.
@param path the absolute path at which this file will be installed.
@param source the file content to include in this rpm... | [
"Add",
"the",
"specified",
"file",
"to",
"the",
"repository",
"payload",
"in",
"order",
"by",
"URL",
".",
"The",
"required",
"header",
"entries",
"will",
"automatically",
"be",
"generated",
"to",
"record",
"the",
"directory",
"names",
"and",
"file",
"names",
... | train | https://github.com/craigwblake/redline/blob/b2fee5eb6c8150e801a132a4478a643f9ec0df04/src/main/java/org/redline_rpm/Builder.java#L1048-L1050 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/Screen.java | Screen.getNextLocation | public ScreenLocation getNextLocation(short position, short setNewAnchor) {
"""
Code this position and Anchor to add it to the LayoutManager.
@param position The location constant (see ScreenConstants).
@param setNewAnchor The anchor constant.
@return The new screen location object.
"""
if (position... | java | public ScreenLocation getNextLocation(short position, short setNewAnchor)
{
if (position == ScreenConstants.ADD_VIEW_BUFFER)
position = ScreenConstants.ADD_SCREEN_VIEW_BUFFER;
if (position == ScreenConstants.FIRST_LOCATION)
position = ScreenConstants.FIRST_INPUT_LOCATION;
... | [
"public",
"ScreenLocation",
"getNextLocation",
"(",
"short",
"position",
",",
"short",
"setNewAnchor",
")",
"{",
"if",
"(",
"position",
"==",
"ScreenConstants",
".",
"ADD_VIEW_BUFFER",
")",
"position",
"=",
"ScreenConstants",
".",
"ADD_SCREEN_VIEW_BUFFER",
";",
"if"... | Code this position and Anchor to add it to the LayoutManager.
@param position The location constant (see ScreenConstants).
@param setNewAnchor The anchor constant.
@return The new screen location object. | [
"Code",
"this",
"position",
"and",
"Anchor",
"to",
"add",
"it",
"to",
"the",
"LayoutManager",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/Screen.java#L145-L152 |
synchronoss/cpo-api | cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java | CassandraCpoAdapter.newOrderBy | @Override
public CpoOrderBy newOrderBy(String attribute, boolean ascending) throws CpoException {
"""
newOrderBy allows you to dynamically change the order of the objects in the resulting collection. This allows you
to apply user input in determining the order of the collection
@param attribute The name of t... | java | @Override
public CpoOrderBy newOrderBy(String attribute, boolean ascending) throws CpoException {
return new BindableCpoOrderBy(attribute, ascending);
} | [
"@",
"Override",
"public",
"CpoOrderBy",
"newOrderBy",
"(",
"String",
"attribute",
",",
"boolean",
"ascending",
")",
"throws",
"CpoException",
"{",
"return",
"new",
"BindableCpoOrderBy",
"(",
"attribute",
",",
"ascending",
")",
";",
"}"
] | newOrderBy allows you to dynamically change the order of the objects in the resulting collection. This allows you
to apply user input in determining the order of the collection
@param attribute The name of the attribute from the pojo that will be sorted.
@param ascending If true, sort ascending. If false sort descendi... | [
"newOrderBy",
"allows",
"you",
"to",
"dynamically",
"change",
"the",
"order",
"of",
"the",
"objects",
"in",
"the",
"resulting",
"collection",
".",
"This",
"allows",
"you",
"to",
"apply",
"user",
"input",
"in",
"determining",
"the",
"order",
"of",
"the",
"col... | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java#L1045-L1048 |
JamesIry/jADT | jADT-core/src/main/java/com/pogofish/jadt/JADT.java | JADT.standardConfigDriver | public static JADT standardConfigDriver() {
"""
Convenient factory method to create a complete standard configuration
@return Driver configured with all the Standard bits
"""
logger.fine("Using standard configuration.");
final SourceFactory sourceFactory = new FileSourceFactory();
final... | java | public static JADT standardConfigDriver() {
logger.fine("Using standard configuration.");
final SourceFactory sourceFactory = new FileSourceFactory();
final ClassBodyEmitter classBodyEmitter = new StandardClassBodyEmitter();
final ConstructorEmitter constructorEmitter = new StandardConstruc... | [
"public",
"static",
"JADT",
"standardConfigDriver",
"(",
")",
"{",
"logger",
".",
"fine",
"(",
"\"Using standard configuration.\"",
")",
";",
"final",
"SourceFactory",
"sourceFactory",
"=",
"new",
"FileSourceFactory",
"(",
")",
";",
"final",
"ClassBodyEmitter",
"cla... | Convenient factory method to create a complete standard configuration
@return Driver configured with all the Standard bits | [
"Convenient",
"factory",
"method",
"to",
"create",
"a",
"complete",
"standard",
"configuration"
] | train | https://github.com/JamesIry/jADT/blob/92ee94b6624cd673851497d78c218837dcf02b8a/jADT-core/src/main/java/com/pogofish/jadt/JADT.java#L91-L103 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java | ServletUtil.checkResourceRequest | public static boolean checkResourceRequest(final HttpServletRequest request,
final HttpServletResponse response)
throws ServletException, IOException {
"""
Check if the request is for a resource (eg static, theme...).
@param request the http servlet request.
@param response the http servlet response.
@r... | java | public static boolean checkResourceRequest(final HttpServletRequest request,
final HttpServletResponse response)
throws ServletException, IOException {
// Static resource
if (isStaticResourceRequest(request)) {
handleStaticResourceRequest(request, response);
return false;
} else if (isThemeResourceReq... | [
"public",
"static",
"boolean",
"checkResourceRequest",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"HttpServletResponse",
"response",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"// Static resource",
"if",
"(",
"isStaticResourceRequest",
"... | Check if the request is for a resource (eg static, theme...).
@param request the http servlet request.
@param response the http servlet response.
@return true to continue processing
@throws ServletException a servlet exception
@throws IOException an IO Exception | [
"Check",
"if",
"the",
"request",
"is",
"for",
"a",
"resource",
"(",
"eg",
"static",
"theme",
"...",
")",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/servlet/ServletUtil.java#L138-L161 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/MainLogRepositoryBrowserImpl.java | MainLogRepositoryBrowserImpl.findNext | private LogRepositoryBrowser findNext(long cur, long timelimit) {
"""
Find instance with a smallest timestamp bigger than value of <code>cur</code>.
@param cur time stamp of the previous instance.
@param timelimit time limit after which we are not interested in the result.
@return LogFileBrowser instance or <... | java | private LogRepositoryBrowser findNext(long cur, long timelimit) {
File[] files = listFiles(instanceFilter);
if (files == null) {
return null;
}
File result = null;
long min = Long.MAX_VALUE;
for (File file : files) {
long time = parseTimeStamp(fil... | [
"private",
"LogRepositoryBrowser",
"findNext",
"(",
"long",
"cur",
",",
"long",
"timelimit",
")",
"{",
"File",
"[",
"]",
"files",
"=",
"listFiles",
"(",
"instanceFilter",
")",
";",
"if",
"(",
"files",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
... | Find instance with a smallest timestamp bigger than value of <code>cur</code>.
@param cur time stamp of the previous instance.
@param timelimit time limit after which we are not interested in the result.
@return LogFileBrowser instance or <code>null</code> if there's not such instance or
if its timestamp is bigger tha... | [
"Find",
"instance",
"with",
"a",
"smallest",
"timestamp",
"bigger",
"than",
"value",
"of",
"<code",
">",
"cur<",
"/",
"code",
">",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/MainLogRepositoryBrowserImpl.java#L152-L175 |
networknt/light-4j | metrics/src/main/java/io/dropwizard/metrics/InstrumentedExecutors.java | InstrumentedExecutors.newCachedThreadPool | public static InstrumentedExecutorService newCachedThreadPool(MetricRegistry registry, String name) {
"""
Creates an instrumented thread pool that creates new threads as needed, but
will reuse previously constructed threads when they are
available. These pools will typically improve the performance
of programs... | java | public static InstrumentedExecutorService newCachedThreadPool(MetricRegistry registry, String name) {
return new InstrumentedExecutorService(Executors.newCachedThreadPool(), registry, name);
} | [
"public",
"static",
"InstrumentedExecutorService",
"newCachedThreadPool",
"(",
"MetricRegistry",
"registry",
",",
"String",
"name",
")",
"{",
"return",
"new",
"InstrumentedExecutorService",
"(",
"Executors",
".",
"newCachedThreadPool",
"(",
")",
",",
"registry",
",",
... | Creates an instrumented thread pool that creates new threads as needed, but
will reuse previously constructed threads when they are
available. These pools will typically improve the performance
of programs that execute many short-lived asynchronous tasks.
Calls to {@code execute} will reuse previously constructed
thre... | [
"Creates",
"an",
"instrumented",
"thread",
"pool",
"that",
"creates",
"new",
"threads",
"as",
"needed",
"but",
"will",
"reuse",
"previously",
"constructed",
"threads",
"when",
"they",
"are",
"available",
".",
"These",
"pools",
"will",
"typically",
"improve",
"th... | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/metrics/src/main/java/io/dropwizard/metrics/InstrumentedExecutors.java#L235-L237 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRMesh.java | GVRMesh.createQuad | public void createQuad(float width, float height) {
"""
Sets the contents of this mesh to be a quad consisting of two triangles,
with the specified width and height. If the mesh descriptor allows for
normals and/or texture coordinates, they are added.
@param width
the quad's width
@param height
the quad's ... | java | public void createQuad(float width, float height)
{
String vertexDescriptor = getVertexBuffer().getDescriptor();
float[] vertices = { width * -0.5f, height * 0.5f, 0.0f, width * -0.5f,
height * -0.5f, 0.0f, width * 0.5f, height * 0.5f, 0.0f,
width * 0.5f, height * -0.... | [
"public",
"void",
"createQuad",
"(",
"float",
"width",
",",
"float",
"height",
")",
"{",
"String",
"vertexDescriptor",
"=",
"getVertexBuffer",
"(",
")",
".",
"getDescriptor",
"(",
")",
";",
"float",
"[",
"]",
"vertices",
"=",
"{",
"width",
"*",
"-",
"0.5... | Sets the contents of this mesh to be a quad consisting of two triangles,
with the specified width and height. If the mesh descriptor allows for
normals and/or texture coordinates, they are added.
@param width
the quad's width
@param height
the quad's height | [
"Sets",
"the",
"contents",
"of",
"this",
"mesh",
"to",
"be",
"a",
"quad",
"consisting",
"of",
"two",
"triangles",
"with",
"the",
"specified",
"width",
"and",
"height",
".",
"If",
"the",
"mesh",
"descriptor",
"allows",
"for",
"normals",
"and",
"/",
"or",
... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRMesh.java#L698-L720 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/upload/impl/CmsUploaderFileApi.java | CmsUploaderFileApi.onBrowserError | private void onBrowserError(I_CmsUploadDialog dialog, String errorCode) {
"""
Switches the error message depending on the given error code.<p>
The error codes are defined in the W3C file API.<p>
<a href="http://www.w3.org/TR/FileAPI/#dfn-fileerror">http://www.w3.org/TR/FileAPI/#dfn-fileerror</a>
@param di... | java | private void onBrowserError(I_CmsUploadDialog dialog, String errorCode) {
int code = new Integer(errorCode).intValue();
String errMsg = org.opencms.gwt.client.Messages.get().key(org.opencms.gwt.client.Messages.ERR_UPLOAD_BROWSER_0);
switch (code) {
case 1: // NOT_FOUND_ERR
... | [
"private",
"void",
"onBrowserError",
"(",
"I_CmsUploadDialog",
"dialog",
",",
"String",
"errorCode",
")",
"{",
"int",
"code",
"=",
"new",
"Integer",
"(",
"errorCode",
")",
".",
"intValue",
"(",
")",
";",
"String",
"errMsg",
"=",
"org",
".",
"opencms",
".",... | Switches the error message depending on the given error code.<p>
The error codes are defined in the W3C file API.<p>
<a href="http://www.w3.org/TR/FileAPI/#dfn-fileerror">http://www.w3.org/TR/FileAPI/#dfn-fileerror</a>
@param dialog the upload dialog
@param errorCode the error code as String | [
"Switches",
"the",
"error",
"message",
"depending",
"on",
"the",
"given",
"error",
"code",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/upload/impl/CmsUploaderFileApi.java#L167-L197 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/SuperPositionQCP.java | SuperPositionQCP.calcTransformation | private void calcTransformation() {
"""
Superposition coords2 onto coords1 -- in other words, coords2 is rotated,
coords1 is held fixed
"""
// transformation.set(rotmat,new Vector3d(0,0,0), 1);
transformation.set(rotmat);
// long t2 = System.nanoTime();
// System.out.println("create transformation: "... | java | private void calcTransformation() {
// transformation.set(rotmat,new Vector3d(0,0,0), 1);
transformation.set(rotmat);
// long t2 = System.nanoTime();
// System.out.println("create transformation: " + (t2-t1));
// System.out.println("m3d -> m4d");
// System.out.println(transformation);
// combine with x ... | [
"private",
"void",
"calcTransformation",
"(",
")",
"{",
"// transformation.set(rotmat,new Vector3d(0,0,0), 1);",
"transformation",
".",
"set",
"(",
"rotmat",
")",
";",
"// long t2 = System.nanoTime();",
"// System.out.println(\"create transformation: \" + (t2-t1));",
"// System.out.p... | Superposition coords2 onto coords1 -- in other words, coords2 is rotated,
coords1 is held fixed | [
"Superposition",
"coords2",
"onto",
"coords1",
"--",
"in",
"other",
"words",
"coords2",
"is",
"rotated",
"coords1",
"is",
"held",
"fixed"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/SuperPositionQCP.java#L282-L307 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTasksInner.java | BuildTasksInner.createAsync | public Observable<BuildTaskInner> createAsync(String resourceGroupName, String registryName, String buildTaskName, BuildTaskInner buildTaskCreateParameters) {
"""
Creates a build task for a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which the con... | java | public Observable<BuildTaskInner> createAsync(String resourceGroupName, String registryName, String buildTaskName, BuildTaskInner buildTaskCreateParameters) {
return createWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, buildTaskCreateParameters).map(new Func1<ServiceResponse<BuildTaskI... | [
"public",
"Observable",
"<",
"BuildTaskInner",
">",
"createAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"buildTaskName",
",",
"BuildTaskInner",
"buildTaskCreateParameters",
")",
"{",
"return",
"createWithServiceResponseAsync",
... | Creates a build task for a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param buildTaskName The name of the container registry build task.
@param buildTaskCreat... | [
"Creates",
"a",
"build",
"task",
"for",
"a",
"container",
"registry",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTasksInner.java#L488-L495 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java | CmsSitemapController.createSubEntry | public void createSubEntry(final CmsClientSitemapEntry parent, final CmsUUID structureId) {
"""
Creates a new sub-entry of an existing sitemap entry.<p>
@param parent the entry to which a new sub-entry should be added
@param structureId the structure id of the model page (if null, uses default model page)
... | java | public void createSubEntry(final CmsClientSitemapEntry parent, final CmsUUID structureId) {
CmsSitemapTreeItem item = CmsSitemapTreeItem.getItemById(parent.getId());
AsyncCallback<CmsClientSitemapEntry> callback = new AsyncCallback<CmsClientSitemapEntry>() {
public void onFailure(Throwable... | [
"public",
"void",
"createSubEntry",
"(",
"final",
"CmsClientSitemapEntry",
"parent",
",",
"final",
"CmsUUID",
"structureId",
")",
"{",
"CmsSitemapTreeItem",
"item",
"=",
"CmsSitemapTreeItem",
".",
"getItemById",
"(",
"parent",
".",
"getId",
"(",
")",
")",
";",
"... | Creates a new sub-entry of an existing sitemap entry.<p>
@param parent the entry to which a new sub-entry should be added
@param structureId the structure id of the model page (if null, uses default model page) | [
"Creates",
"a",
"new",
"sub",
"-",
"entry",
"of",
"an",
"existing",
"sitemap",
"entry",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java#L653-L682 |
ixa-ehu/ixa-pipe-tok | src/main/java/eus/ixa/ixa/pipe/tok/RuleBasedTokenizerServer.java | RuleBasedTokenizerServer.getAnnotations | private String getAnnotations(final Properties properties,
final String stringFromClient) throws IOException, JDOMException {
"""
Get tokens.
@param properties
the options
@param stringFromClient
the original string
@return the tokenized string
@throws IOException
if io problems
@throws JDOMExcepti... | java | private String getAnnotations(final Properties properties,
final String stringFromClient) throws IOException, JDOMException {
BufferedReader breader;
KAFDocument kaf;
String kafString = null;
String lang = properties.getProperty("language");
String outputFormat = properties.getProperty("outpu... | [
"private",
"String",
"getAnnotations",
"(",
"final",
"Properties",
"properties",
",",
"final",
"String",
"stringFromClient",
")",
"throws",
"IOException",
",",
"JDOMException",
"{",
"BufferedReader",
"breader",
";",
"KAFDocument",
"kaf",
";",
"String",
"kafString",
... | Get tokens.
@param properties
the options
@param stringFromClient
the original string
@return the tokenized string
@throws IOException
if io problems
@throws JDOMException
if NAF problems | [
"Get",
"tokens",
"."
] | train | https://github.com/ixa-ehu/ixa-pipe-tok/blob/be38651a1267be37764b08acce9ee12a87fb61e7/src/main/java/eus/ixa/ixa/pipe/tok/RuleBasedTokenizerServer.java#L175-L231 |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/security/BCrypt.java | BCrypt.ekskey | private void ekskey(final byte data[], final byte key[]) {
"""
Perform the "enhanced key schedule" step described by Provos and Mazieres
in "A Future-Adaptable Password Scheme"
http://www.openbsd.org/papers/bcrypt-paper.ps
@param data salt information
@param key password information
"""
int i;
... | java | private void ekskey(final byte data[], final byte key[]) {
int i;
final int koffp[] = {0}, doffp[] = {0};
final int lr[] = {0, 0};
final int plen = P.length, slen = S.length;
for (i = 0; i < plen; i++) {
P[i] = P[i] ^ streamtoword(key, koffp);
}
for ... | [
"private",
"void",
"ekskey",
"(",
"final",
"byte",
"data",
"[",
"]",
",",
"final",
"byte",
"key",
"[",
"]",
")",
"{",
"int",
"i",
";",
"final",
"int",
"koffp",
"[",
"]",
"=",
"{",
"0",
"}",
",",
"doffp",
"[",
"]",
"=",
"{",
"0",
"}",
";",
"... | Perform the "enhanced key schedule" step described by Provos and Mazieres
in "A Future-Adaptable Password Scheme"
http://www.openbsd.org/papers/bcrypt-paper.ps
@param data salt information
@param key password information | [
"Perform",
"the",
"enhanced",
"key",
"schedule",
"step",
"described",
"by",
"Provos",
"and",
"Mazieres",
"in",
"A",
"Future",
"-",
"Adaptable",
"Password",
"Scheme",
"http",
":",
"//",
"www",
".",
"openbsd",
".",
"org",
"/",
"papers",
"/",
"bcrypt",
"-",
... | train | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/security/BCrypt.java#L522-L547 |
petergeneric/stdlib | stdlib/src/main/java/com/peterphi/std/types/Timebase.java | Timebase.resample | public double resample(final double samples, final Timebase oldRate) {
"""
Convert a sample count from one timebase to another
@param samples
@param oldRate
@return
"""
if (samples == 0)
{
return 0;
}
else if (!this.equals(oldRate))
{
final double resampled = resample(samples, oldRate, t... | java | public double resample(final double samples, final Timebase oldRate)
{
if (samples == 0)
{
return 0;
}
else if (!this.equals(oldRate))
{
final double resampled = resample(samples, oldRate, this);
return resampled;
}
else
{
return samples;
}
} | [
"public",
"double",
"resample",
"(",
"final",
"double",
"samples",
",",
"final",
"Timebase",
"oldRate",
")",
"{",
"if",
"(",
"samples",
"==",
"0",
")",
"{",
"return",
"0",
";",
"}",
"else",
"if",
"(",
"!",
"this",
".",
"equals",
"(",
"oldRate",
")",
... | Convert a sample count from one timebase to another
@param samples
@param oldRate
@return | [
"Convert",
"a",
"sample",
"count",
"from",
"one",
"timebase",
"to",
"another"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/types/Timebase.java#L247-L263 |
elki-project/elki | elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/query/knn/LinearScanPrimitiveDistanceKNNQuery.java | LinearScanPrimitiveDistanceKNNQuery.linearScan | private KNNHeap linearScan(Relation<? extends O> relation, DBIDIter iter, final O obj, KNNHeap heap) {
"""
Main loop of the linear scan.
@param relation Data relation
@param iter ID iterator
@param obj Query object
@param heap Output heap
@return Heap
"""
final PrimitiveDistanceFunction<? super O> r... | java | private KNNHeap linearScan(Relation<? extends O> relation, DBIDIter iter, final O obj, KNNHeap heap) {
final PrimitiveDistanceFunction<? super O> rawdist = this.rawdist;
double max = Double.POSITIVE_INFINITY;
while(iter.valid()) {
final double dist = rawdist.distance(obj, relation.get(iter));
if... | [
"private",
"KNNHeap",
"linearScan",
"(",
"Relation",
"<",
"?",
"extends",
"O",
">",
"relation",
",",
"DBIDIter",
"iter",
",",
"final",
"O",
"obj",
",",
"KNNHeap",
"heap",
")",
"{",
"final",
"PrimitiveDistanceFunction",
"<",
"?",
"super",
"O",
">",
"rawdist... | Main loop of the linear scan.
@param relation Data relation
@param iter ID iterator
@param obj Query object
@param heap Output heap
@return Heap | [
"Main",
"loop",
"of",
"the",
"linear",
"scan",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/query/knn/LinearScanPrimitiveDistanceKNNQuery.java#L86-L97 |
apiman/apiman | manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java | OrganizationResourceImpl.validateTimeSeriesMetric | private void validateTimeSeriesMetric(DateTime from, DateTime to, HistogramIntervalType interval)
throws InvalidMetricCriteriaException {
"""
Ensures that a time series can be created for the given date range and
interval, and that the
"""
long millis = to.getMillis() - from.getMillis();
... | java | private void validateTimeSeriesMetric(DateTime from, DateTime to, HistogramIntervalType interval)
throws InvalidMetricCriteriaException {
long millis = to.getMillis() - from.getMillis();
long divBy = ONE_DAY_MILLIS;
switch (interval) {
case day:
divBy = ONE_DAY_MI... | [
"private",
"void",
"validateTimeSeriesMetric",
"(",
"DateTime",
"from",
",",
"DateTime",
"to",
",",
"HistogramIntervalType",
"interval",
")",
"throws",
"InvalidMetricCriteriaException",
"{",
"long",
"millis",
"=",
"to",
".",
"getMillis",
"(",
")",
"-",
"from",
"."... | Ensures that a time series can be created for the given date range and
interval, and that the | [
"Ensures",
"that",
"a",
"time",
"series",
"can",
"be",
"created",
"for",
"the",
"given",
"date",
"range",
"and",
"interval",
"and",
"that",
"the"
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/OrganizationResourceImpl.java#L3704-L3731 |
RobAustin/low-latency-primitive-concurrent-queues | src/main/java/uk/co/boundedbuffer/ConcurrentBlockingIntQueue.java | ConcurrentBlockingIntQueue.drainTo | int drainTo(int[] target, int maxElements) {
"""
Removes at most the given number of available elements from this queue and adds them to the given
collection. A failure encountered while attempting to add elements to collection <tt>c</tt> may result
in elements being in neither, either or both collections when ... | java | int drainTo(int[] target, int maxElements) {
// non volatile read ( which is quicker )
int readLocation = this.consumerReadLocation;
int i = 0;
// to reduce the number of volatile reads we are going to perform a kind of double check reading on the volatile write location
int ... | [
"int",
"drainTo",
"(",
"int",
"[",
"]",
"target",
",",
"int",
"maxElements",
")",
"{",
"// non volatile read ( which is quicker )",
"int",
"readLocation",
"=",
"this",
".",
"consumerReadLocation",
";",
"int",
"i",
"=",
"0",
";",
"// to reduce the number of volatile... | Removes at most the given number of available elements from this queue and adds them to the given
collection. A failure encountered while attempting to add elements to collection <tt>c</tt> may result
in elements being in neither, either or both collections when the associated exception is thrown.
Attempts to drain a ... | [
"Removes",
"at",
"most",
"the",
"given",
"number",
"of",
"available",
"elements",
"from",
"this",
"queue",
"and",
"adds",
"them",
"to",
"the",
"given",
"collection",
".",
"A",
"failure",
"encountered",
"while",
"attempting",
"to",
"add",
"elements",
"to",
"c... | train | https://github.com/RobAustin/low-latency-primitive-concurrent-queues/blob/ffcf95a8135750c0b23cd486346a1f68a4724b1c/src/main/java/uk/co/boundedbuffer/ConcurrentBlockingIntQueue.java#L386-L425 |
eobermuhlner/big-math | ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigComplex.java | BigComplex.valueOf | public static BigComplex valueOf(BigDecimal real, BigDecimal imaginary) {
"""
Returns a complex number with the specified real and imaginary {@link BigDecimal} parts.
@param real the real {@link BigDecimal} part
@param imaginary the imaginary {@link BigDecimal} part
@return the complex number
"""
if (re... | java | public static BigComplex valueOf(BigDecimal real, BigDecimal imaginary) {
if (real.signum() == 0) {
if (imaginary.signum() == 0) {
return ZERO;
}
if (imaginary.compareTo(BigDecimal.ONE) == 0) {
return I;
}
}
if (imaginary.signum() == 0 && real.compareTo(BigDecimal.ONE) == 0) {
return ONE;
... | [
"public",
"static",
"BigComplex",
"valueOf",
"(",
"BigDecimal",
"real",
",",
"BigDecimal",
"imaginary",
")",
"{",
"if",
"(",
"real",
".",
"signum",
"(",
")",
"==",
"0",
")",
"{",
"if",
"(",
"imaginary",
".",
"signum",
"(",
")",
"==",
"0",
")",
"{",
... | Returns a complex number with the specified real and imaginary {@link BigDecimal} parts.
@param real the real {@link BigDecimal} part
@param imaginary the imaginary {@link BigDecimal} part
@return the complex number | [
"Returns",
"a",
"complex",
"number",
"with",
"the",
"specified",
"real",
"and",
"imaginary",
"{",
"@link",
"BigDecimal",
"}",
"parts",
"."
] | train | https://github.com/eobermuhlner/big-math/blob/52c4fc334d0d722b295de740c1018ee400e3e8f2/ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigComplex.java#L519-L533 |
thorstenwagner/TraJ | src/main/java/de/biomedical_imaging/traJ/features/BoundednessFeature.java | BoundednessFeature.getRadiusToBoundedness | public static double getRadiusToBoundedness(double D, int N, double timelag, double B) {
"""
Calculates the radius to a given boundedness value
@param D Diffusion coefficient
@param N Number of steps
@param timelag Timelag
@param B Boundedeness
@return Confinement radius
"""
double cov_area = a(N)*D*tim... | java | public static double getRadiusToBoundedness(double D, int N, double timelag, double B){
double cov_area = a(N)*D*timelag;
double radius = Math.sqrt(cov_area/(4*B));
return radius;
} | [
"public",
"static",
"double",
"getRadiusToBoundedness",
"(",
"double",
"D",
",",
"int",
"N",
",",
"double",
"timelag",
",",
"double",
"B",
")",
"{",
"double",
"cov_area",
"=",
"a",
"(",
"N",
")",
"*",
"D",
"*",
"timelag",
";",
"double",
"radius",
"=",
... | Calculates the radius to a given boundedness value
@param D Diffusion coefficient
@param N Number of steps
@param timelag Timelag
@param B Boundedeness
@return Confinement radius | [
"Calculates",
"the",
"radius",
"to",
"a",
"given",
"boundedness",
"value"
] | train | https://github.com/thorstenwagner/TraJ/blob/505fafb1f2f77a2d67bb2a089a2fdebe2c9bc7cb/src/main/java/de/biomedical_imaging/traJ/features/BoundednessFeature.java#L51-L55 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/model/TorqueModelDef.java | TorqueModelDef.addIndex | private void addIndex(IndexDescriptorDef indexDescDef, TableDef tableDef) {
"""
Adds an index to the table for the given index descriptor.
@param indexDescDef The index descriptor
@param tableDef The table
"""
IndexDef indexDef = tableDef.getIndex(indexDescDef.getName());
if (indexD... | java | private void addIndex(IndexDescriptorDef indexDescDef, TableDef tableDef)
{
IndexDef indexDef = tableDef.getIndex(indexDescDef.getName());
if (indexDef == null)
{
indexDef = new IndexDef(indexDescDef.getName(),
indexDescDef.getBooleanPr... | [
"private",
"void",
"addIndex",
"(",
"IndexDescriptorDef",
"indexDescDef",
",",
"TableDef",
"tableDef",
")",
"{",
"IndexDef",
"indexDef",
"=",
"tableDef",
".",
"getIndex",
"(",
"indexDescDef",
".",
"getName",
"(",
")",
")",
";",
"if",
"(",
"indexDef",
"==",
"... | Adds an index to the table for the given index descriptor.
@param indexDescDef The index descriptor
@param tableDef The table | [
"Adds",
"an",
"index",
"to",
"the",
"table",
"for",
"the",
"given",
"index",
"descriptor",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/model/TorqueModelDef.java#L488-L515 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/sjavac/BuildState.java | BuildState.copyPackagesExcept | public void copyPackagesExcept(BuildState prev, Set<String> recompiled, Set<String> removed) {
"""
During an incremental compile we need to copy the old javac state
information about packages that were not recompiled.
"""
for (String pkg : prev.packages().keySet()) {
// Do not copy recompi... | java | public void copyPackagesExcept(BuildState prev, Set<String> recompiled, Set<String> removed) {
for (String pkg : prev.packages().keySet()) {
// Do not copy recompiled or removed packages.
if (recompiled.contains(pkg) || removed.contains(pkg))
continue;
Module... | [
"public",
"void",
"copyPackagesExcept",
"(",
"BuildState",
"prev",
",",
"Set",
"<",
"String",
">",
"recompiled",
",",
"Set",
"<",
"String",
">",
"removed",
")",
"{",
"for",
"(",
"String",
"pkg",
":",
"prev",
".",
"packages",
"(",
")",
".",
"keySet",
"(... | During an incremental compile we need to copy the old javac state
information about packages that were not recompiled. | [
"During",
"an",
"incremental",
"compile",
"we",
"need",
"to",
"copy",
"the",
"old",
"javac",
"state",
"information",
"about",
"packages",
"that",
"were",
"not",
"recompiled",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/sjavac/BuildState.java#L278-L298 |
GCRC/nunaliit | nunaliit2-couch-command/src/main/java/ca/carleton/gcrc/couch/command/impl/PathComputer.java | PathComputer.computeContentDir | static public File computeContentDir(File installDir) {
"""
Finds the "content" directory from the installation location
and returns it. If the command-line tool is packaged and
deployed, then the "content" directory is found at the
root of the installation. If the command-line tool is run
from the development... | java | static public File computeContentDir(File installDir) {
if( null != installDir ) {
// Command-line package
File contentDir = new File(installDir, "content");
if( contentDir.exists() && contentDir.isDirectory() ) {
return contentDir;
}
// Development environment
File nunaliit2Dir = computeNun... | [
"static",
"public",
"File",
"computeContentDir",
"(",
"File",
"installDir",
")",
"{",
"if",
"(",
"null",
"!=",
"installDir",
")",
"{",
"// Command-line package",
"File",
"contentDir",
"=",
"new",
"File",
"(",
"installDir",
",",
"\"content\"",
")",
";",
"if",
... | Finds the "content" directory from the installation location
and returns it. If the command-line tool is packaged and
deployed, then the "content" directory is found at the
root of the installation. If the command-line tool is run
from the development environment, then the "content" directory
is found in the SDK sub-pr... | [
"Finds",
"the",
"content",
"directory",
"from",
"the",
"installation",
"location",
"and",
"returns",
"it",
".",
"If",
"the",
"command",
"-",
"line",
"tool",
"is",
"packaged",
"and",
"deployed",
"then",
"the",
"content",
"directory",
"is",
"found",
"at",
"the... | train | https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-couch-command/src/main/java/ca/carleton/gcrc/couch/command/impl/PathComputer.java#L145-L162 |
lucee/Lucee | core/src/main/java/lucee/runtime/type/scope/client/ClientFile.java | ClientFile.getInstance | public static Client getInstance(String name, PageContext pc, Log log) {
"""
load new instance of the class
@param name
@param pc
@param log
@return
"""
Resource res = _loadResource(pc.getConfig(), SCOPE_CLIENT, name, pc.getCFID());
Struct data = _loadData(pc, res, log);
return new ClientFile(pc, res... | java | public static Client getInstance(String name, PageContext pc, Log log) {
Resource res = _loadResource(pc.getConfig(), SCOPE_CLIENT, name, pc.getCFID());
Struct data = _loadData(pc, res, log);
return new ClientFile(pc, res, data);
} | [
"public",
"static",
"Client",
"getInstance",
"(",
"String",
"name",
",",
"PageContext",
"pc",
",",
"Log",
"log",
")",
"{",
"Resource",
"res",
"=",
"_loadResource",
"(",
"pc",
".",
"getConfig",
"(",
")",
",",
"SCOPE_CLIENT",
",",
"name",
",",
"pc",
".",
... | load new instance of the class
@param name
@param pc
@param log
@return | [
"load",
"new",
"instance",
"of",
"the",
"class"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/client/ClientFile.java#L59-L64 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/jboss/logging/Logger.java | Logger.errorv | public void errorv(String format, Object param1) {
"""
Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting.
@param format the message format string
@param param1 the sole parameter
"""
if (isEnabled(Level.ERROR)) {
doLog(Level.ERROR, FQCN, fo... | java | public void errorv(String format, Object param1) {
if (isEnabled(Level.ERROR)) {
doLog(Level.ERROR, FQCN, format, new Object[] { param1 }, null);
}
} | [
"public",
"void",
"errorv",
"(",
"String",
"format",
",",
"Object",
"param1",
")",
"{",
"if",
"(",
"isEnabled",
"(",
"Level",
".",
"ERROR",
")",
")",
"{",
"doLog",
"(",
"Level",
".",
"ERROR",
",",
"FQCN",
",",
"format",
",",
"new",
"Object",
"[",
"... | Issue a log message with a level of ERROR using {@link java.text.MessageFormat}-style formatting.
@param format the message format string
@param param1 the sole parameter | [
"Issue",
"a",
"log",
"message",
"with",
"a",
"level",
"of",
"ERROR",
"using",
"{",
"@link",
"java",
".",
"text",
".",
"MessageFormat",
"}",
"-",
"style",
"formatting",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L1574-L1578 |
grails/grails-core | grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java | GroovyPagesUriSupport.getTemplateURI | public String getTemplateURI(String controllerName, String templateName) {
"""
Obtains the URI to a template using the controller name and template name
@param controllerName The controller name
@param templateName The template name
@return The template URI
"""
return getTemplateURI(controllerName, ... | java | public String getTemplateURI(String controllerName, String templateName) {
return getTemplateURI(controllerName, templateName, true);
} | [
"public",
"String",
"getTemplateURI",
"(",
"String",
"controllerName",
",",
"String",
"templateName",
")",
"{",
"return",
"getTemplateURI",
"(",
"controllerName",
",",
"templateName",
",",
"true",
")",
";",
"}"
] | Obtains the URI to a template using the controller name and template name
@param controllerName The controller name
@param templateName The template name
@return The template URI | [
"Obtains",
"the",
"URI",
"to",
"a",
"template",
"using",
"the",
"controller",
"name",
"and",
"template",
"name"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-web-common/src/main/groovy/org/grails/web/pages/GroovyPagesUriSupport.java#L106-L108 |
eclipse/hawkbit | hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/repository/RolloutStatusCache.java | RolloutStatusCache.getRolloutGroupStatus | public Map<Long, List<TotalTargetCountActionStatus>> getRolloutGroupStatus(final List<Long> rolloutGroups) {
"""
Retrieves cached list of {@link TotalTargetCountActionStatus} of
{@link RolloutGroup}s.
@param rolloutGroups
rolloutGroupsIds to retrieve cache entries for
@return map of cached entries
"""
... | java | public Map<Long, List<TotalTargetCountActionStatus>> getRolloutGroupStatus(final List<Long> rolloutGroups) {
final Cache cache = cacheManager.getCache(CACHE_GR_NAME);
return retrieveFromCache(rolloutGroups, cache);
} | [
"public",
"Map",
"<",
"Long",
",",
"List",
"<",
"TotalTargetCountActionStatus",
">",
">",
"getRolloutGroupStatus",
"(",
"final",
"List",
"<",
"Long",
">",
"rolloutGroups",
")",
"{",
"final",
"Cache",
"cache",
"=",
"cacheManager",
".",
"getCache",
"(",
"CACHE_G... | Retrieves cached list of {@link TotalTargetCountActionStatus} of
{@link RolloutGroup}s.
@param rolloutGroups
rolloutGroupsIds to retrieve cache entries for
@return map of cached entries | [
"Retrieves",
"cached",
"list",
"of",
"{",
"@link",
"TotalTargetCountActionStatus",
"}",
"of",
"{",
"@link",
"RolloutGroup",
"}",
"s",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-core/src/main/java/org/eclipse/hawkbit/repository/RolloutStatusCache.java#L103-L107 |
lucee/Lucee | core/src/main/java/lucee/runtime/tag/Admin.java | Admin.doUpdateMonitor | private void doUpdateMonitor() throws PageException {
"""
/*
private void doUpdateUpdateLogSettings() throws PageException { int
level=LogUtil.toIntType(getString("admin", "updateUpdateLogSettings", "level"), -1); String
source=getString("admin", "updateUpdateLogSettings", "path"); if(source.indexOf("{")==-1){
... | java | private void doUpdateMonitor() throws PageException {
ClassDefinition cd = new ClassDefinitionImpl(getString("admin", action, "class"), getString("bundleName", null), getString("bundleVersion", null),
config.getIdentification());
admin.updateMonitor(cd, getString("admin", "updateMonitor", "monitorType"), getString... | [
"private",
"void",
"doUpdateMonitor",
"(",
")",
"throws",
"PageException",
"{",
"ClassDefinition",
"cd",
"=",
"new",
"ClassDefinitionImpl",
"(",
"getString",
"(",
"\"admin\"",
",",
"action",
",",
"\"class\"",
")",
",",
"getString",
"(",
"\"bundleName\"",
",",
"n... | /*
private void doUpdateUpdateLogSettings() throws PageException { int
level=LogUtil.toIntType(getString("admin", "updateUpdateLogSettings", "level"), -1); String
source=getString("admin", "updateUpdateLogSettings", "path"); if(source.indexOf("{")==-1){
Resource res = ResourceUtil.toResourceNotExisting(pageContext, sou... | [
"/",
"*",
"private",
"void",
"doUpdateUpdateLogSettings",
"()",
"throws",
"PageException",
"{",
"int",
"level",
"=",
"LogUtil",
".",
"toIntType",
"(",
"getString",
"(",
"admin",
"updateUpdateLogSettings",
"level",
")",
"-",
"1",
")",
";",
"String",
"source",
"... | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Admin.java#L4146-L4153 |
Crab2died/Excel4J | src/main/java/com/github/crab2died/ExcelUtils.java | ExcelUtils.exportObjects2CSV | public void exportObjects2CSV(List<?> data, Class clazz, boolean isWriteHeader, String path)
throws Excel4JException {
"""
基于注解导出CSV文件
@param data 待导出
@param clazz {@link com.github.crab2died.annotation.ExcelField}映射对象Class
@param isWriteHeader 是否写入文件
@param path 导出文件路径
... | java | public void exportObjects2CSV(List<?> data, Class clazz, boolean isWriteHeader, String path)
throws Excel4JException {
try {
Writer writer = new FileWriter(path);
exportCSVByMapHandler(data, clazz, isWriteHeader, writer);
} catch (Excel4JException | IOException e) {
... | [
"public",
"void",
"exportObjects2CSV",
"(",
"List",
"<",
"?",
">",
"data",
",",
"Class",
"clazz",
",",
"boolean",
"isWriteHeader",
",",
"String",
"path",
")",
"throws",
"Excel4JException",
"{",
"try",
"{",
"Writer",
"writer",
"=",
"new",
"FileWriter",
"(",
... | 基于注解导出CSV文件
@param data 待导出
@param clazz {@link com.github.crab2died.annotation.ExcelField}映射对象Class
@param isWriteHeader 是否写入文件
@param path 导出文件路径
@throws Excel4JException exception | [
"基于注解导出CSV文件"
] | train | https://github.com/Crab2died/Excel4J/blob/2ab0a3b8226a69ff868c3ead6e724f3a774f5f77/src/main/java/com/github/crab2died/ExcelUtils.java#L1640-L1649 |
landawn/AbacusUtil | src/com/landawn/abacus/util/stream/Stream.java | Stream.lines | public static Stream<String> lines(final Reader reader) {
"""
It's user's responsibility to close the input <code>reader</code> after the stream is finished.
@param reader
@return
"""
N.checkArgNotNull(reader);
return of(createLazyLineIterator(null, null, Charsets.UTF_8, reader, false))... | java | public static Stream<String> lines(final Reader reader) {
N.checkArgNotNull(reader);
return of(createLazyLineIterator(null, null, Charsets.UTF_8, reader, false));
} | [
"public",
"static",
"Stream",
"<",
"String",
">",
"lines",
"(",
"final",
"Reader",
"reader",
")",
"{",
"N",
".",
"checkArgNotNull",
"(",
"reader",
")",
";",
"return",
"of",
"(",
"createLazyLineIterator",
"(",
"null",
",",
"null",
",",
"Charsets",
".",
"U... | It's user's responsibility to close the input <code>reader</code> after the stream is finished.
@param reader
@return | [
"It",
"s",
"user",
"s",
"responsibility",
"to",
"close",
"the",
"input",
"<code",
">",
"reader<",
"/",
"code",
">",
"after",
"the",
"stream",
"is",
"finished",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/Stream.java#L3674-L3678 |
HubSpot/Singularity | SingularityService/src/main/java/com/hubspot/singularity/mesos/SingularityMesosStatusUpdateHandler.java | SingularityMesosStatusUpdateHandler.isDuplicateOrIgnorableStatusUpdate | private boolean isDuplicateOrIgnorableStatusUpdate(Optional<SingularityTaskStatusHolder> previousTaskStatusHolder, final SingularityTaskStatusHolder newTaskStatusHolder) {
"""
1- we have a previous update, and this is a duplicate of it (ignore) 2- we don't have a
previous update, 2 cases: a - this task has alread... | java | private boolean isDuplicateOrIgnorableStatusUpdate(Optional<SingularityTaskStatusHolder> previousTaskStatusHolder, final SingularityTaskStatusHolder newTaskStatusHolder) {
if (!previousTaskStatusHolder.isPresent()) {
return true;
}
if (!previousTaskStatusHolder.get().getTaskStatus().isPresent()) { //... | [
"private",
"boolean",
"isDuplicateOrIgnorableStatusUpdate",
"(",
"Optional",
"<",
"SingularityTaskStatusHolder",
">",
"previousTaskStatusHolder",
",",
"final",
"SingularityTaskStatusHolder",
"newTaskStatusHolder",
")",
"{",
"if",
"(",
"!",
"previousTaskStatusHolder",
".",
"is... | 1- we have a previous update, and this is a duplicate of it (ignore) 2- we don't have a
previous update, 2 cases: a - this task has already been destroyed (we can ignore it then) b -
we've never heard of this task (very unlikely since we first write a status into zk before we
launch a task) | [
"1",
"-",
"we",
"have",
"a",
"previous",
"update",
"and",
"this",
"is",
"a",
"duplicate",
"of",
"it",
"(",
"ignore",
")",
"2",
"-",
"we",
"don",
"t",
"have",
"a",
"previous",
"update",
"2",
"cases",
":",
"a",
"-",
"this",
"task",
"has",
"already",
... | train | https://github.com/HubSpot/Singularity/blob/384a8c16a10aa076af5ca45c8dfcedab9e5122c8/SingularityService/src/main/java/com/hubspot/singularity/mesos/SingularityMesosStatusUpdateHandler.java#L132-L142 |
shrinkwrap/shrinkwrap | impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/exporter/AbstractStreamExporterImpl.java | AbstractStreamExporterImpl.getOutputStreamToFile | protected final OutputStream getOutputStreamToFile(final File target, final boolean overwrite)
throws FileExistsException {
"""
Obtains an {@link OutputStream} to the provided {@link File}.
@param target
@param overwrite
Whether we may overwrite an existing file
@return
@throws FileExistsException
... | java | protected final OutputStream getOutputStreamToFile(final File target, final boolean overwrite)
throws FileExistsException {
// Precondition checks
if (target == null) {
throw new IllegalArgumentException("Target file must be specified");
}
if (target.isDirectory()) {
... | [
"protected",
"final",
"OutputStream",
"getOutputStreamToFile",
"(",
"final",
"File",
"target",
",",
"final",
"boolean",
"overwrite",
")",
"throws",
"FileExistsException",
"{",
"// Precondition checks",
"if",
"(",
"target",
"==",
"null",
")",
"{",
"throw",
"new",
"... | Obtains an {@link OutputStream} to the provided {@link File}.
@param target
@param overwrite
Whether we may overwrite an existing file
@return
@throws FileExistsException
If the specified file exists and the overwrite flag is false
@throws IllegalArgumentException
If the file target is not specified | [
"Obtains",
"an",
"{",
"@link",
"OutputStream",
"}",
"to",
"the",
"provided",
"{",
"@link",
"File",
"}",
"."
] | train | https://github.com/shrinkwrap/shrinkwrap/blob/3f8a1a6d344651428c709a63ebb52d35343c5387/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/exporter/AbstractStreamExporterImpl.java#L74-L100 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/retention/policy/TimeBasedRetentionPolicy.java | TimeBasedRetentionPolicy.parseDuration | private static Duration parseDuration(String periodString) {
"""
Since months and years can have arbitrary days, joda time does not allow conversion of a period string containing
months or years to a duration. Hence we calculate the duration using 1970 01:01:00:00:00 UTC as a reference time.
<p>
<code>
(1970... | java | private static Duration parseDuration(String periodString) {
DateTime zeroEpoc = new DateTime(0);
return new Duration(zeroEpoc, zeroEpoc.plus(ISOPeriodFormat.standard().parsePeriod(periodString)));
} | [
"private",
"static",
"Duration",
"parseDuration",
"(",
"String",
"periodString",
")",
"{",
"DateTime",
"zeroEpoc",
"=",
"new",
"DateTime",
"(",
"0",
")",
";",
"return",
"new",
"Duration",
"(",
"zeroEpoc",
",",
"zeroEpoc",
".",
"plus",
"(",
"ISOPeriodFormat",
... | Since months and years can have arbitrary days, joda time does not allow conversion of a period string containing
months or years to a duration. Hence we calculate the duration using 1970 01:01:00:00:00 UTC as a reference time.
<p>
<code>
(1970 01:01:00:00:00 + P2Y) - 1970 01:01:00:00:00 = Duration for 2 years
</code>... | [
"Since",
"months",
"and",
"years",
"can",
"have",
"arbitrary",
"days",
"joda",
"time",
"does",
"not",
"allow",
"conversion",
"of",
"a",
"period",
"string",
"containing",
"months",
"or",
"years",
"to",
"a",
"duration",
".",
"Hence",
"we",
"calculate",
"the",
... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/retention/policy/TimeBasedRetentionPolicy.java#L114-L117 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java | IoUtil.writeObjects | public static void writeObjects(OutputStream out, boolean isCloseOut, Serializable... contents) throws IORuntimeException {
"""
将多部分内容写到流中
@param out 输出流
@param isCloseOut 写入完毕是否关闭输出流
@param contents 写入的内容
@throws IORuntimeException IO异常
"""
ObjectOutputStream osw = null;
try {
osw = out instan... | java | public static void writeObjects(OutputStream out, boolean isCloseOut, Serializable... contents) throws IORuntimeException {
ObjectOutputStream osw = null;
try {
osw = out instanceof ObjectOutputStream ? (ObjectOutputStream) out : new ObjectOutputStream(out);
for (Object content : contents) {
if (cont... | [
"public",
"static",
"void",
"writeObjects",
"(",
"OutputStream",
"out",
",",
"boolean",
"isCloseOut",
",",
"Serializable",
"...",
"contents",
")",
"throws",
"IORuntimeException",
"{",
"ObjectOutputStream",
"osw",
"=",
"null",
";",
"try",
"{",
"osw",
"=",
"out",
... | 将多部分内容写到流中
@param out 输出流
@param isCloseOut 写入完毕是否关闭输出流
@param contents 写入的内容
@throws IORuntimeException IO异常 | [
"将多部分内容写到流中"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L932-L949 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/SerializationUtils.java | SerializationUtils.fromByteArrayKryo | public static <T> T fromByteArrayKryo(byte[] data, Class<T> clazz) {
"""
Deserialize a byte array back to an object.
<p>
This method uses Kryo lib.
</p>
@param data
@param clazz
@return
"""
return fromByteArrayKryo(data, clazz, null);
} | java | public static <T> T fromByteArrayKryo(byte[] data, Class<T> clazz) {
return fromByteArrayKryo(data, clazz, null);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"fromByteArrayKryo",
"(",
"byte",
"[",
"]",
"data",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"fromByteArrayKryo",
"(",
"data",
",",
"clazz",
",",
"null",
")",
";",
"}"
] | Deserialize a byte array back to an object.
<p>
This method uses Kryo lib.
</p>
@param data
@param clazz
@return | [
"Deserialize",
"a",
"byte",
"array",
"back",
"to",
"an",
"object",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/SerializationUtils.java#L283-L285 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java | MariaDbDatabaseMetaData.getSuperTypes | public ResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern)
throws SQLException {
"""
Retrieves a description of the user-defined type (UDT) hierarchies defined in a particular
schema in this database. Only the immediate super type/ sub type relationship is modeled. Only
su... | java | public ResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern)
throws SQLException {
String sql =
"SELECT ' ' TYPE_CAT, NULL TYPE_SCHEM, ' ' TYPE_NAME, ' ' SUPERTYPE_CAT, ' ' SUPERTYPE_SCHEM, ' ' SUPERTYPE_NAME"
+ " FROM DUAL WHERE 1=0";
return executeQ... | [
"public",
"ResultSet",
"getSuperTypes",
"(",
"String",
"catalog",
",",
"String",
"schemaPattern",
",",
"String",
"typeNamePattern",
")",
"throws",
"SQLException",
"{",
"String",
"sql",
"=",
"\"SELECT ' ' TYPE_CAT, NULL TYPE_SCHEM, ' ' TYPE_NAME, ' ' SUPERTYPE_CAT, ' ' SUPERTYP... | Retrieves a description of the user-defined type (UDT) hierarchies defined in a particular
schema in this database. Only the immediate super type/ sub type relationship is modeled. Only
supertype information for UDTs matching the catalog, schema, and type name is returned. The
type name parameter may be a fully-qualifi... | [
"Retrieves",
"a",
"description",
"of",
"the",
"user",
"-",
"defined",
"type",
"(",
"UDT",
")",
"hierarchies",
"defined",
"in",
"a",
"particular",
"schema",
"in",
"this",
"database",
".",
"Only",
"the",
"immediate",
"super",
"type",
"/",
"sub",
"type",
"rel... | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java#L2746-L2753 |
alkacon/opencms-core | src-modules/org/opencms/workplace/explorer/CmsExplorer.java | CmsExplorer.getInitializationFooter | public String getInitializationFooter(int numberOfPages, int selectedPage) {
"""
Generates the footer of the explorer initialization code.<p>
@param numberOfPages the number of pages
@param selectedPage the selected page to display
@return js code for initializing the explorer view
@see #getInitializatio... | java | public String getInitializationFooter(int numberOfPages, int selectedPage) {
StringBuffer content = new StringBuffer(1024);
content.append("top.dU(document,");
content.append(numberOfPages);
content.append(",");
content.append(selectedPage);
content.append("); \n");
... | [
"public",
"String",
"getInitializationFooter",
"(",
"int",
"numberOfPages",
",",
"int",
"selectedPage",
")",
"{",
"StringBuffer",
"content",
"=",
"new",
"StringBuffer",
"(",
"1024",
")",
";",
"content",
".",
"append",
"(",
"\"top.dU(document,\"",
")",
";",
"cont... | Generates the footer of the explorer initialization code.<p>
@param numberOfPages the number of pages
@param selectedPage the selected page to display
@return js code for initializing the explorer view
@see #getInitializationHeader()
@see #getInitializationEntry(CmsResourceUtil, boolean, boolean, boolean, boolean, b... | [
"Generates",
"the",
"footer",
"of",
"the",
"explorer",
"initialization",
"code",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/explorer/CmsExplorer.java#L536-L567 |
Crab2died/Excel4J | src/main/java/com/github/crab2died/utils/Utils.java | Utils.getterOrSetter | public static Method getterOrSetter(Class clazz, String fieldName, FieldAccessType methodType)
throws IntrospectionException {
"""
<p>根据java对象属性{@link Field}获取该属性的getter或setter方法名,
另对{@link boolean}及{@link Boolean}做了行管处理</p>
@param clazz 操作对象
@param fieldName 对象属性
@param methodType 方法类型,get... | java | public static Method getterOrSetter(Class clazz, String fieldName, FieldAccessType methodType)
throws IntrospectionException {
if (null == fieldName || "".equals(fieldName))
return null;
BeanInfo beanInfo = Introspector.getBeanInfo(clazz);
PropertyDescriptor[] props = b... | [
"public",
"static",
"Method",
"getterOrSetter",
"(",
"Class",
"clazz",
",",
"String",
"fieldName",
",",
"FieldAccessType",
"methodType",
")",
"throws",
"IntrospectionException",
"{",
"if",
"(",
"null",
"==",
"fieldName",
"||",
"\"\"",
".",
"equals",
"(",
"fieldN... | <p>根据java对象属性{@link Field}获取该属性的getter或setter方法名,
另对{@link boolean}及{@link Boolean}做了行管处理</p>
@param clazz 操作对象
@param fieldName 对象属性
@param methodType 方法类型,getter或setter枚举
@return getter或setter方法
@throws IntrospectionException 异常
@author Crab2Died | [
"<p",
">",
"根据java对象属性",
"{",
"@link",
"Field",
"}",
"获取该属性的getter或setter方法名,",
"另对",
"{",
"@link",
"boolean",
"}",
"及",
"{",
"@link",
"Boolean",
"}",
"做了行管处理<",
"/",
"p",
">"
] | train | https://github.com/Crab2died/Excel4J/blob/2ab0a3b8226a69ff868c3ead6e724f3a774f5f77/src/main/java/com/github/crab2died/utils/Utils.java#L230-L249 |
QNJR-GROUP/EasyTransaction | easytrans-core/src/main/java/com/yiqiniu/easytrans/core/EasyTransSynchronizer.java | EasyTransSynchronizer.startSoftTrans | public void startSoftTrans(String busCode,long trxId) {
"""
create LogContext.<br>
pass in busCode and trxId will help about the execute efficient and the debug and statistics<br>
so I demand to pass in busCode and trxId to generate a global unique bus key
@param busCode the unique busCode in AppId
@param trxI... | java | public void startSoftTrans(String busCode,long trxId){
if(isSoftTransBegon()) {
throw new RuntimeException("transaction already started,but try to start again." + busCode + "," + trxId);
}
//hook to TransactionSynchronizer
TransactionSynchronizationManager.registerSynchronization(new Transaction... | [
"public",
"void",
"startSoftTrans",
"(",
"String",
"busCode",
",",
"long",
"trxId",
")",
"{",
"if",
"(",
"isSoftTransBegon",
"(",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"transaction already started,but try to start again.\"",
"+",
"busCode",
"+",
... | create LogContext.<br>
pass in busCode and trxId will help about the execute efficient and the debug and statistics<br>
so I demand to pass in busCode and trxId to generate a global unique bus key
@param busCode the unique busCode in AppId
@param trxId the unique trxId in appId+busCode | [
"create",
"LogContext",
".",
"<br",
">",
"pass",
"in",
"busCode",
"and",
"trxId",
"will",
"help",
"about",
"the",
"execute",
"efficient",
"and",
"the",
"debug",
"and",
"statistics<br",
">",
"so",
"I",
"demand",
"to",
"pass",
"in",
"busCode",
"and",
"trxId"... | train | https://github.com/QNJR-GROUP/EasyTransaction/blob/53b031724a3fd1145f32b9a7b5c6fb8138d6a426/easytrans-core/src/main/java/com/yiqiniu/easytrans/core/EasyTransSynchronizer.java#L78-L107 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/api/CoreAPI.java | CoreAPI.addHarEntry | private static void addHarEntry(HarEntries entries, RecordHistory recordHistory) {
"""
Adds the given history record to the given {@code entries}.
@param entries where to add the new {@code HarEntry}.
@param recordHistory the history record to add, after converting to {@code HarEntry}.
@see HarUtils#createHar... | java | private static void addHarEntry(HarEntries entries, RecordHistory recordHistory) {
entries.addEntry(
HarUtils.createHarEntry(
recordHistory.getHistoryId(),
recordHistory.getHistoryType(),
recordHistory.getHttpMessage()));
} | [
"private",
"static",
"void",
"addHarEntry",
"(",
"HarEntries",
"entries",
",",
"RecordHistory",
"recordHistory",
")",
"{",
"entries",
".",
"addEntry",
"(",
"HarUtils",
".",
"createHarEntry",
"(",
"recordHistory",
".",
"getHistoryId",
"(",
")",
",",
"recordHistory"... | Adds the given history record to the given {@code entries}.
@param entries where to add the new {@code HarEntry}.
@param recordHistory the history record to add, after converting to {@code HarEntry}.
@see HarUtils#createHarEntry(int, int, HttpMessage) | [
"Adds",
"the",
"given",
"history",
"record",
"to",
"the",
"given",
"{",
"@code",
"entries",
"}",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/api/CoreAPI.java#L1423-L1429 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasActivationUtils.java | KerasActivationUtils.mapToIActivation | public static IActivation mapToIActivation(String kerasActivation, KerasLayerConfiguration conf)
throws UnsupportedKerasConfigurationException {
"""
Map Keras to DL4J activation functions.
@param kerasActivation String containing Keras activation function name
@return DL4J activation function
"... | java | public static IActivation mapToIActivation(String kerasActivation, KerasLayerConfiguration conf)
throws UnsupportedKerasConfigurationException {
Activation activation = mapToActivation(kerasActivation, conf);
return activation.getActivationFunction();
} | [
"public",
"static",
"IActivation",
"mapToIActivation",
"(",
"String",
"kerasActivation",
",",
"KerasLayerConfiguration",
"conf",
")",
"throws",
"UnsupportedKerasConfigurationException",
"{",
"Activation",
"activation",
"=",
"mapToActivation",
"(",
"kerasActivation",
",",
"c... | Map Keras to DL4J activation functions.
@param kerasActivation String containing Keras activation function name
@return DL4J activation function | [
"Map",
"Keras",
"to",
"DL4J",
"activation",
"functions",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-modelimport/src/main/java/org/deeplearning4j/nn/modelimport/keras/utils/KerasActivationUtils.java#L81-L85 |
Azure/azure-sdk-for-java | kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesInner.java | DatabasesInner.checkNameAvailability | public CheckNameResultInner checkNameAvailability(String resourceGroupName, String clusterName, String name) {
"""
Checks that the database name is valid and is not already in use.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto clu... | java | public CheckNameResultInner checkNameAvailability(String resourceGroupName, String clusterName, String name) {
return checkNameAvailabilityWithServiceResponseAsync(resourceGroupName, clusterName, name).toBlocking().single().body();
} | [
"public",
"CheckNameResultInner",
"checkNameAvailability",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"String",
"name",
")",
"{",
"return",
"checkNameAvailabilityWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
",",
"name"... | Checks that the database name is valid and is not already in use.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@param name Database name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudExc... | [
"Checks",
"that",
"the",
"database",
"name",
"is",
"valid",
"and",
"is",
"not",
"already",
"in",
"use",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesInner.java#L125-L127 |
mikepenz/Android-Iconics | library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java | IconicsDrawable.roundedCornersRyDp | @NonNull
public IconicsDrawable roundedCornersRyDp(@Dimension(unit = DP) int sizeDp) {
"""
Set rounded corner from dp
@return The current IconicsDrawable for chaining.
"""
return roundedCornersRyPx(Utils.convertDpToPx(mContext, sizeDp));
} | java | @NonNull
public IconicsDrawable roundedCornersRyDp(@Dimension(unit = DP) int sizeDp) {
return roundedCornersRyPx(Utils.convertDpToPx(mContext, sizeDp));
} | [
"@",
"NonNull",
"public",
"IconicsDrawable",
"roundedCornersRyDp",
"(",
"@",
"Dimension",
"(",
"unit",
"=",
"DP",
")",
"int",
"sizeDp",
")",
"{",
"return",
"roundedCornersRyPx",
"(",
"Utils",
".",
"convertDpToPx",
"(",
"mContext",
",",
"sizeDp",
")",
")",
";... | Set rounded corner from dp
@return The current IconicsDrawable for chaining. | [
"Set",
"rounded",
"corner",
"from",
"dp"
] | train | https://github.com/mikepenz/Android-Iconics/blob/0b2c8f7d07b6d2715a417563c66311e7e1fcc7d8/library-core/src/main/java/com/mikepenz/iconics/IconicsDrawable.java#L945-L948 |
alkacon/opencms-core | src/org/opencms/cmis/CmsCmisRelationHelper.java | CmsCmisRelationHelper.collectAllowableActions | protected AllowableActions collectAllowableActions(CmsObject cms, CmsResource file, CmsRelation relation) {
"""
Collects the allowable actions for a relation.<p>
@param cms the current CMS context
@param file the source of the relation
@param relation the relation object
@return the allowable actions for t... | java | protected AllowableActions collectAllowableActions(CmsObject cms, CmsResource file, CmsRelation relation) {
try {
Set<Action> aas = new LinkedHashSet<Action>();
AllowableActionsImpl result = new AllowableActionsImpl();
CmsLock lock = cms.getLock(file);
Cm... | [
"protected",
"AllowableActions",
"collectAllowableActions",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"file",
",",
"CmsRelation",
"relation",
")",
"{",
"try",
"{",
"Set",
"<",
"Action",
">",
"aas",
"=",
"new",
"LinkedHashSet",
"<",
"Action",
">",
"(",
")",
... | Collects the allowable actions for a relation.<p>
@param cms the current CMS context
@param file the source of the relation
@param relation the relation object
@return the allowable actions for the given resource | [
"Collects",
"the",
"allowable",
"actions",
"for",
"a",
"relation",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cmis/CmsCmisRelationHelper.java#L384-L403 |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ServerUpgradeCodec.java | Http2ServerUpgradeCodec.decodeSettingsHeader | private Http2Settings decodeSettingsHeader(ChannelHandlerContext ctx, CharSequence settingsHeader)
throws Http2Exception {
"""
Decodes the settings header and returns a {@link Http2Settings} object.
"""
ByteBuf header = ByteBufUtil.encodeString(ctx.alloc(), CharBuffer.wrap(settingsHeader), ... | java | private Http2Settings decodeSettingsHeader(ChannelHandlerContext ctx, CharSequence settingsHeader)
throws Http2Exception {
ByteBuf header = ByteBufUtil.encodeString(ctx.alloc(), CharBuffer.wrap(settingsHeader), CharsetUtil.UTF_8);
try {
// Decode the SETTINGS payload.
... | [
"private",
"Http2Settings",
"decodeSettingsHeader",
"(",
"ChannelHandlerContext",
"ctx",
",",
"CharSequence",
"settingsHeader",
")",
"throws",
"Http2Exception",
"{",
"ByteBuf",
"header",
"=",
"ByteBufUtil",
".",
"encodeString",
"(",
"ctx",
".",
"alloc",
"(",
")",
",... | Decodes the settings header and returns a {@link Http2Settings} object. | [
"Decodes",
"the",
"settings",
"header",
"and",
"returns",
"a",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ServerUpgradeCodec.java#L170-L185 |
apiman/apiman | gateway/engine/jdbc/src/main/java/io/apiman/gateway/engine/jdbc/JdbcRegistry.java | JdbcRegistry.getApiId | protected String getApiId(String orgId, String apiId, String version) {
"""
Generates a valid document ID for a api, used to index the api in ES.
@param orgId
@param apiId
@param version
@return a api key
"""
return orgId + "|" + apiId + "|" + version; //$NON-NLS-1$ //$NON-NLS-2$
} | java | protected String getApiId(String orgId, String apiId, String version) {
return orgId + "|" + apiId + "|" + version; //$NON-NLS-1$ //$NON-NLS-2$
} | [
"protected",
"String",
"getApiId",
"(",
"String",
"orgId",
",",
"String",
"apiId",
",",
"String",
"version",
")",
"{",
"return",
"orgId",
"+",
"\"|\"",
"+",
"apiId",
"+",
"\"|\"",
"+",
"version",
";",
"//$NON-NLS-1$ //$NON-NLS-2$",
"}"
] | Generates a valid document ID for a api, used to index the api in ES.
@param orgId
@param apiId
@param version
@return a api key | [
"Generates",
"a",
"valid",
"document",
"ID",
"for",
"a",
"api",
"used",
"to",
"index",
"the",
"api",
"in",
"ES",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/jdbc/src/main/java/io/apiman/gateway/engine/jdbc/JdbcRegistry.java#L410-L412 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/device_profile.java | device_profile.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception {
"""
<pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre>
"""
device_profile_responses result = (device_profile_responses) service.ge... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
device_profile_responses result = (device_profile_responses) service.get_payload_formatter().string_to_resource(device_profile_responses.class, response);
if(result.errorcode != 0)
{
if (result.er... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"device_profile_responses",
"result",
"=",
"(",
"device_profile_responses",
")",
"service",
".",
"get_payload_... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/device_profile.java#L569-L586 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/HttpStatusException.java | HttpStatusException.of | public static HttpStatusException of(int statusCode) {
"""
Returns a new {@link HttpStatusException} instance with the specified HTTP status code.
"""
if (statusCode < 0 || statusCode >= 1000) {
final HttpStatus status = HttpStatus.valueOf(statusCode);
if (Flags.verboseException... | java | public static HttpStatusException of(int statusCode) {
if (statusCode < 0 || statusCode >= 1000) {
final HttpStatus status = HttpStatus.valueOf(statusCode);
if (Flags.verboseExceptions()) {
return new HttpStatusException(status);
} else {
retur... | [
"public",
"static",
"HttpStatusException",
"of",
"(",
"int",
"statusCode",
")",
"{",
"if",
"(",
"statusCode",
"<",
"0",
"||",
"statusCode",
">=",
"1000",
")",
"{",
"final",
"HttpStatus",
"status",
"=",
"HttpStatus",
".",
"valueOf",
"(",
"statusCode",
")",
... | Returns a new {@link HttpStatusException} instance with the specified HTTP status code. | [
"Returns",
"a",
"new",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/HttpStatusException.java#L42-L53 |
headius/invokebinder | src/main/java/com/headius/invokebinder/Binder.java | Binder.invokeSpecialQuiet | public MethodHandle invokeSpecialQuiet(MethodHandles.Lookup lookup, String name, Class<?> caller) {
"""
Apply the chain of transforms and bind them to a special method specified
using the end signature plus the given class and name. The method will
be retrieved using the given Lookup and must match the end signa... | java | public MethodHandle invokeSpecialQuiet(MethodHandles.Lookup lookup, String name, Class<?> caller) {
try {
return invokeSpecial(lookup, name, caller);
} catch (IllegalAccessException | NoSuchMethodException e) {
throw new InvalidTransformException(e);
}
} | [
"public",
"MethodHandle",
"invokeSpecialQuiet",
"(",
"MethodHandles",
".",
"Lookup",
"lookup",
",",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"caller",
")",
"{",
"try",
"{",
"return",
"invokeSpecial",
"(",
"lookup",
",",
"name",
",",
"caller",
")",
";... | Apply the chain of transforms and bind them to a special method specified
using the end signature plus the given class and name. The method will
be retrieved using the given Lookup and must match the end signature
exactly.
If the final handle's type does not exactly match the initial type for
this Binder, an additiona... | [
"Apply",
"the",
"chain",
"of",
"transforms",
"and",
"bind",
"them",
"to",
"a",
"special",
"method",
"specified",
"using",
"the",
"end",
"signature",
"plus",
"the",
"given",
"class",
"and",
"name",
".",
"The",
"method",
"will",
"be",
"retrieved",
"using",
"... | train | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L1319-L1325 |
alkacon/opencms-core | src/org/opencms/jsp/util/CmsJspObjectValueWrapper.java | CmsJspObjectValueWrapper.createWrapper | public static CmsJspObjectValueWrapper createWrapper(CmsObject cms, Object value) {
"""
Factory method to create a new XML content value wrapper.<p>
In case either parameter is <code>null</code>, the {@link #NULL_VALUE_WRAPPER} is returned.<p>
@param cms the current users OpenCms context
@param value the ob... | java | public static CmsJspObjectValueWrapper createWrapper(CmsObject cms, Object value) {
if ((value != null) && (cms != null)) {
return new CmsJspObjectValueWrapper(cms, value);
}
// if no value is available,
return NULL_VALUE_WRAPPER;
} | [
"public",
"static",
"CmsJspObjectValueWrapper",
"createWrapper",
"(",
"CmsObject",
"cms",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"(",
"value",
"!=",
"null",
")",
"&&",
"(",
"cms",
"!=",
"null",
")",
")",
"{",
"return",
"new",
"CmsJspObjectValueWrapper"... | Factory method to create a new XML content value wrapper.<p>
In case either parameter is <code>null</code>, the {@link #NULL_VALUE_WRAPPER} is returned.<p>
@param cms the current users OpenCms context
@param value the object to warp
@return a new content value wrapper instance, or <code>null</code> if any parameter ... | [
"Factory",
"method",
"to",
"create",
"a",
"new",
"XML",
"content",
"value",
"wrapper",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/CmsJspObjectValueWrapper.java#L96-L103 |
icode/ameba | src/main/java/ameba/db/ebean/filter/CommonExprTransformer.java | CommonExprTransformer.textSimple | public static Expression textSimple(String operator, Val<Expression>[] args, EbeanExprInvoker invoker) {
"""
<p>textSimple.</p>
@param operator a {@link java.lang.String} object.
@param args an array of {@link ameba.db.dsl.QueryExprMeta.Val} objects.
@param invoker a {@link ameba.db.ebean.filter.EbeanExprInvo... | java | public static Expression textSimple(String operator, Val<Expression>[] args, EbeanExprInvoker invoker) {
checkTextOptions(operator, args);
Map<String, Val<Expression>> ops = ((TextOptionsExpression) args[1].expr()).options;
TextSimple simple = new TextSimple();
for (String k : ops.keySet... | [
"public",
"static",
"Expression",
"textSimple",
"(",
"String",
"operator",
",",
"Val",
"<",
"Expression",
">",
"[",
"]",
"args",
",",
"EbeanExprInvoker",
"invoker",
")",
"{",
"checkTextOptions",
"(",
"operator",
",",
"args",
")",
";",
"Map",
"<",
"String",
... | <p>textSimple.</p>
@param operator a {@link java.lang.String} object.
@param args an array of {@link ameba.db.dsl.QueryExprMeta.Val} objects.
@param invoker a {@link ameba.db.ebean.filter.EbeanExprInvoker} object.
@return a {@link io.ebean.Expression} object. | [
"<p",
">",
"textSimple",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/filter/CommonExprTransformer.java#L510-L549 |
xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/util/type/instance/ParameterizedInstanceType.java | ParameterizedInstanceType.isMoreSpecificGenerics | public boolean isMoreSpecificGenerics(final Type... arguments) {
"""
Useful for types check before calling {@link #improveAccuracy(Type...)} which will fail if provided types
would be less specific (actually if at least one type is less specific).
@param arguments more specific generics for current type
@retu... | java | public boolean isMoreSpecificGenerics(final Type... arguments) {
if (arguments.length != actualArguments.length) {
throw new IllegalArgumentException(String.format(
"Wrong generics count provided <%s> in compare to current types <%s>",
TypeToStringUtils.toStri... | [
"public",
"boolean",
"isMoreSpecificGenerics",
"(",
"final",
"Type",
"...",
"arguments",
")",
"{",
"if",
"(",
"arguments",
".",
"length",
"!=",
"actualArguments",
".",
"length",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
... | Useful for types check before calling {@link #improveAccuracy(Type...)} which will fail if provided types
would be less specific (actually if at least one type is less specific).
@param arguments more specific generics for current type
@return true if provided generics are more specific, false otherwise
@throws Illega... | [
"Useful",
"for",
"types",
"check",
"before",
"calling",
"{",
"@link",
"#improveAccuracy",
"(",
"Type",
"...",
")",
"}",
"which",
"will",
"fail",
"if",
"provided",
"types",
"would",
"be",
"less",
"specific",
"(",
"actually",
"if",
"at",
"least",
"one",
"typ... | train | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/type/instance/ParameterizedInstanceType.java#L148-L162 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.