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 |
|---|---|---|---|---|---|---|---|---|---|---|
jMotif/SAX | src/main/java/net/seninp/jmotif/distance/EuclideanDistance.java | EuclideanDistance.distance2 | public long distance2(int[] point1, int[] point2) throws Exception {
"""
Calculates the square of the Euclidean distance between two multidimensional points represented
by integer vectors.
@param point1 The first point.
@param point2 The second point.
@return The Euclidean distance.
@throws Exception In the... | java | public long distance2(int[] point1, int[] point2) throws Exception {
if (point1.length == point2.length) {
long sum = 0;
for (int i = 0; i < point1.length; i++) {
sum = sum + (point2[i] - point1[i]) * (point2[i] - point1[i]);
}
return sum;
}
else {
throw new Ex... | [
"public",
"long",
"distance2",
"(",
"int",
"[",
"]",
"point1",
",",
"int",
"[",
"]",
"point2",
")",
"throws",
"Exception",
"{",
"if",
"(",
"point1",
".",
"length",
"==",
"point2",
".",
"length",
")",
"{",
"long",
"sum",
"=",
"0",
";",
"for",
"(",
... | Calculates the square of the Euclidean distance between two multidimensional points represented
by integer vectors.
@param point1 The first point.
@param point2 The second point.
@return The Euclidean distance.
@throws Exception In the case of error. | [
"Calculates",
"the",
"square",
"of",
"the",
"Euclidean",
"distance",
"between",
"two",
"multidimensional",
"points",
"represented",
"by",
"integer",
"vectors",
"."
] | train | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/distance/EuclideanDistance.java#L98-L109 |
jblas-project/jblas | src/main/java/org/jblas/Eigen.java | Eigen.symmetricGeneralizedEigenvalues | public static FloatMatrix symmetricGeneralizedEigenvalues(FloatMatrix A, FloatMatrix B, float vl, float vu) {
"""
Computes selected eigenvalues of the real generalized symmetric-definite eigenproblem of the form A x = L B x
or, equivalently, (A - L B)x = 0. Here A and B are assumed to be symmetric and B is also p... | java | public static FloatMatrix symmetricGeneralizedEigenvalues(FloatMatrix A, FloatMatrix B, float vl, float vu) {
A.assertSquare();
B.assertSquare();
A.assertSameSize(B);
if (vu <= vl) {
throw new IllegalArgumentException("Bound exception: make sure vu > vl");
}
float abstol = (float) 1e-9; ... | [
"public",
"static",
"FloatMatrix",
"symmetricGeneralizedEigenvalues",
"(",
"FloatMatrix",
"A",
",",
"FloatMatrix",
"B",
",",
"float",
"vl",
",",
"float",
"vu",
")",
"{",
"A",
".",
"assertSquare",
"(",
")",
";",
"B",
".",
"assertSquare",
"(",
")",
";",
"A",... | Computes selected eigenvalues of the real generalized symmetric-definite eigenproblem of the form A x = L B x
or, equivalently, (A - L B)x = 0. Here A and B are assumed to be symmetric and B is also positive definite.
The selection is based on the given range of values for the desired eigenvalues.
<p/>
The range is hal... | [
"Computes",
"selected",
"eigenvalues",
"of",
"the",
"real",
"generalized",
"symmetric",
"-",
"definite",
"eigenproblem",
"of",
"the",
"form",
"A",
"x",
"=",
"L",
"B",
"x",
"or",
"equivalently",
"(",
"A",
"-",
"L",
"B",
")",
"x",
"=",
"0",
".",
"Here",
... | train | https://github.com/jblas-project/jblas/blob/2818f231228e655cda80dfd8e0b87709fdfd8a70/src/main/java/org/jblas/Eigen.java#L437-L453 |
deeplearning4j/deeplearning4j | datavec/datavec-perf/src/main/java/org/datavec/perf/timing/IOTiming.java | IOTiming.averageFileRead | public static TimingStatistics averageFileRead(long nTimes, RecordReader recordReader, File file, INDArrayCreationFunction function) throws Exception {
"""
Returns statistics for components of a datavec pipeline
averaged over the specified number of times
@param nTimes the number of times to run the pipeline fo... | java | public static TimingStatistics averageFileRead(long nTimes, RecordReader recordReader, File file, INDArrayCreationFunction function) throws Exception {
TimingStatistics timingStatistics = null;
for(int i = 0; i < nTimes; i++) {
TimingStatistics timingStatistics1 = timeNDArrayCreation(recordR... | [
"public",
"static",
"TimingStatistics",
"averageFileRead",
"(",
"long",
"nTimes",
",",
"RecordReader",
"recordReader",
",",
"File",
"file",
",",
"INDArrayCreationFunction",
"function",
")",
"throws",
"Exception",
"{",
"TimingStatistics",
"timingStatistics",
"=",
"null",... | Returns statistics for components of a datavec pipeline
averaged over the specified number of times
@param nTimes the number of times to run the pipeline for averaging
@param recordReader the record reader
@param file the file to read
@param function the function
@return the averaged {@link TimingStatistics} for input... | [
"Returns",
"statistics",
"for",
"components",
"of",
"a",
"datavec",
"pipeline",
"averaged",
"over",
"the",
"specified",
"number",
"of",
"times"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-perf/src/main/java/org/datavec/perf/timing/IOTiming.java#L59-L72 |
aol/cyclops | cyclops/src/main/java/com/oath/cyclops/util/ExceptionSoftener.java | ExceptionSoftener.throwOrHandle | public static <X extends Throwable> void throwOrHandle(final X e, final Predicate<X> p, final Consumer<X> handler) {
"""
Throw the exception as upwards if the predicate holds, otherwise pass to the handler
@param e Exception
@param p Predicate to check exception should be thrown or not
@param handler Handles... | java | public static <X extends Throwable> void throwOrHandle(final X e, final Predicate<X> p, final Consumer<X> handler) {
if (p.test(e))
throw ExceptionSoftener.<RuntimeException> uncheck(e);
else
handler.accept(e);
} | [
"public",
"static",
"<",
"X",
"extends",
"Throwable",
">",
"void",
"throwOrHandle",
"(",
"final",
"X",
"e",
",",
"final",
"Predicate",
"<",
"X",
">",
"p",
",",
"final",
"Consumer",
"<",
"X",
">",
"handler",
")",
"{",
"if",
"(",
"p",
".",
"test",
"(... | Throw the exception as upwards if the predicate holds, otherwise pass to the handler
@param e Exception
@param p Predicate to check exception should be thrown or not
@param handler Handles exceptions that should not be thrown | [
"Throw",
"the",
"exception",
"as",
"upwards",
"if",
"the",
"predicate",
"holds",
"otherwise",
"pass",
"to",
"the",
"handler"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/com/oath/cyclops/util/ExceptionSoftener.java#L692-L697 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheProviderWrapper.java | CacheProviderWrapper.updateStatisticsForVBC | @Override
public void updateStatisticsForVBC(com.ibm.websphere.cache.CacheEntry cacheEntry, boolean directive) {
"""
This method needs to change if cache provider supports PMI and CacheStatisticsListener.
"""
// TODO needs to change if cache provider supports PMI and CacheStatisticsListener
... | java | @Override
public void updateStatisticsForVBC(com.ibm.websphere.cache.CacheEntry cacheEntry, boolean directive) {
// TODO needs to change if cache provider supports PMI and CacheStatisticsListener
final String methodName = "updateStatisticsForVBC()";
Object id = null;
if (cacheEntry !... | [
"@",
"Override",
"public",
"void",
"updateStatisticsForVBC",
"(",
"com",
".",
"ibm",
".",
"websphere",
".",
"cache",
".",
"CacheEntry",
"cacheEntry",
",",
"boolean",
"directive",
")",
"{",
"// TODO needs to change if cache provider supports PMI and CacheStatisticsListener",... | This method needs to change if cache provider supports PMI and CacheStatisticsListener. | [
"This",
"method",
"needs",
"to",
"change",
"if",
"cache",
"provider",
"supports",
"PMI",
"and",
"CacheStatisticsListener",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheProviderWrapper.java#L1497-L1508 |
brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java | DateUtils.isTimeInRange | @SuppressWarnings("deprecation")
public static boolean isTimeInRange(java.sql.Time start, java.sql.Time end, java.util.Date d) {
"""
Tells you if the date part of a datetime is in a certain time range.
"""
d = new java.sql.Time(d.getHours(), d.getMinutes(), d.getSeconds());
if (start == null ... | java | @SuppressWarnings("deprecation")
public static boolean isTimeInRange(java.sql.Time start, java.sql.Time end, java.util.Date d) {
d = new java.sql.Time(d.getHours(), d.getMinutes(), d.getSeconds());
if (start == null || end == null) {
return false;
}
if (start.before(end) &... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"static",
"boolean",
"isTimeInRange",
"(",
"java",
".",
"sql",
".",
"Time",
"start",
",",
"java",
".",
"sql",
".",
"Time",
"end",
",",
"java",
".",
"util",
".",
"Date",
"d",
")",
"{",
"d",... | Tells you if the date part of a datetime is in a certain time range. | [
"Tells",
"you",
"if",
"the",
"date",
"part",
"of",
"a",
"datetime",
"is",
"in",
"a",
"certain",
"time",
"range",
"."
] | train | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/thirdparty/DateUtils.java#L410-L426 |
rometools/rome | rome/src/main/java/com/rometools/rome/io/impl/RSS090Parser.java | RSS090Parser.parseItem | protected Item parseItem(final Element rssRoot, final Element eItem, final Locale locale) {
"""
Parses an item element of an RSS document looking for item information.
<p/>
It reads title and link out of the 'item' element.
<p/>
@param rssRoot the root element of the RSS document in case it's needed for cont... | java | protected Item parseItem(final Element rssRoot, final Element eItem, final Locale locale) {
final Item item = new Item();
final Element title = eItem.getChild("title", getRSSNamespace());
if (title != null) {
item.setTitle(title.getText());
}
final Element link = e... | [
"protected",
"Item",
"parseItem",
"(",
"final",
"Element",
"rssRoot",
",",
"final",
"Element",
"eItem",
",",
"final",
"Locale",
"locale",
")",
"{",
"final",
"Item",
"item",
"=",
"new",
"Item",
"(",
")",
";",
"final",
"Element",
"title",
"=",
"eItem",
"."... | Parses an item element of an RSS document looking for item information.
<p/>
It reads title and link out of the 'item' element.
<p/>
@param rssRoot the root element of the RSS document in case it's needed for context.
@param eItem the item element to parse.
@return the parsed RSSItem bean. | [
"Parses",
"an",
"item",
"element",
"of",
"an",
"RSS",
"document",
"looking",
"for",
"item",
"information",
".",
"<p",
"/",
">",
"It",
"reads",
"title",
"and",
"link",
"out",
"of",
"the",
"item",
"element",
".",
"<p",
"/",
">"
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/impl/RSS090Parser.java#L293-L329 |
ironjacamar/ironjacamar | codegenerator/src/main/java/org/ironjacamar/codegenerator/code/MbeanImplCodeGen.java | MbeanImplCodeGen.writeClassBody | @Override
public void writeClassBody(Definition def, Writer out) throws IOException {
"""
Output class
@param def definition
@param out Writer
@throws IOException ioException
"""
int indent = 1;
out.write("public class " + getClassName(def) + " implements " + def.getMbeanInterfaceClass());
... | java | @Override
public void writeClassBody(Definition def, Writer out) throws IOException
{
int indent = 1;
out.write("public class " + getClassName(def) + " implements " + def.getMbeanInterfaceClass());
writeLeftCurlyBracket(out, 0);
writeVars(def, out, indent);
writeEol(out);
writ... | [
"@",
"Override",
"public",
"void",
"writeClassBody",
"(",
"Definition",
"def",
",",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"int",
"indent",
"=",
"1",
";",
"out",
".",
"write",
"(",
"\"public class \"",
"+",
"getClassName",
"(",
"def",
")",
"+"... | Output class
@param def definition
@param out Writer
@throws IOException ioException | [
"Output",
"class"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/codegenerator/src/main/java/org/ironjacamar/codegenerator/code/MbeanImplCodeGen.java#L46-L62 |
alibaba/transmittable-thread-local | src/main/java/com/alibaba/ttl/TtlCallable.java | TtlCallable.gets | @Nonnull
public static <T> List<TtlCallable<T>> gets(@Nullable Collection<? extends Callable<T>> tasks) {
"""
wrap input {@link Callable} Collection to {@link TtlCallable} Collection.
@param tasks task to be wrapped
@return Wrapped {@link Callable}
"""
return gets(tasks, false, false);
} | java | @Nonnull
public static <T> List<TtlCallable<T>> gets(@Nullable Collection<? extends Callable<T>> tasks) {
return gets(tasks, false, false);
} | [
"@",
"Nonnull",
"public",
"static",
"<",
"T",
">",
"List",
"<",
"TtlCallable",
"<",
"T",
">",
">",
"gets",
"(",
"@",
"Nullable",
"Collection",
"<",
"?",
"extends",
"Callable",
"<",
"T",
">",
">",
"tasks",
")",
"{",
"return",
"gets",
"(",
"tasks",
"... | wrap input {@link Callable} Collection to {@link TtlCallable} Collection.
@param tasks task to be wrapped
@return Wrapped {@link Callable} | [
"wrap",
"input",
"{",
"@link",
"Callable",
"}",
"Collection",
"to",
"{",
"@link",
"TtlCallable",
"}",
"Collection",
"."
] | train | https://github.com/alibaba/transmittable-thread-local/blob/30b4d99cdb7064b4c1797d2e40bfa07adce8e7f9/src/main/java/com/alibaba/ttl/TtlCallable.java#L140-L143 |
lucee/Lucee | core/src/main/java/lucee/runtime/reflection/Invoker.java | Invoker.getFieldIgnoreCase | public static Field getFieldIgnoreCase(Class c, String name) throws NoSuchFieldException {
"""
same like method getField from Class but ignore case from field name
@param c class to search the field
@param name name to search
@return Matching Field
@throws NoSuchFieldException
"""
Field[] fields = c.get... | java | public static Field getFieldIgnoreCase(Class c, String name) throws NoSuchFieldException {
Field[] fields = c.getFields();
for (int i = 0; i < fields.length; i++) {
Field f = fields[i];
// Same Name
if (f.getName().equalsIgnoreCase(name)) {
return f;
}
}
throw new NoSuchFieldException("Field d... | [
"public",
"static",
"Field",
"getFieldIgnoreCase",
"(",
"Class",
"c",
",",
"String",
"name",
")",
"throws",
"NoSuchFieldException",
"{",
"Field",
"[",
"]",
"fields",
"=",
"c",
".",
"getFields",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",... | same like method getField from Class but ignore case from field name
@param c class to search the field
@param name name to search
@return Matching Field
@throws NoSuchFieldException | [
"same",
"like",
"method",
"getField",
"from",
"Class",
"but",
"ignore",
"case",
"from",
"field",
"name"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/reflection/Invoker.java#L388-L398 |
alipay/sofa-rpc | core/common/src/main/java/com/alipay/sofa/rpc/common/utils/HashUtils.java | HashUtils.messageDigest | public static byte[] messageDigest(String value) {
"""
换算法? MD5 SHA-1 MurMurHash???
@param value the value
@return the byte []
"""
MessageDigest md5;
try {
md5 = MessageDigest.getInstance("MD5");
md5.update(value.getBytes("UTF-8"));
return md5.digest();
... | java | public static byte[] messageDigest(String value) {
MessageDigest md5;
try {
md5 = MessageDigest.getInstance("MD5");
md5.update(value.getBytes("UTF-8"));
return md5.digest();
} catch (NoSuchAlgorithmException e) {
throw new SofaRpcRuntimeException("... | [
"public",
"static",
"byte",
"[",
"]",
"messageDigest",
"(",
"String",
"value",
")",
"{",
"MessageDigest",
"md5",
";",
"try",
"{",
"md5",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"\"MD5\"",
")",
";",
"md5",
".",
"update",
"(",
"value",
".",
"getByte... | 换算法? MD5 SHA-1 MurMurHash???
@param value the value
@return the byte [] | [
"换算法?",
"MD5",
"SHA",
"-",
"1",
"MurMurHash???"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/common/src/main/java/com/alipay/sofa/rpc/common/utils/HashUtils.java#L37-L48 |
alipay/sofa-rpc | extension-impl/codec-sofa-hessian/src/main/java/com/alipay/sofa/rpc/codec/sofahessian/BlackListFileLoader.java | BlackListFileLoader.readToList | private static void readToList(InputStream input, String encoding, List<String> blackPrefixList) {
"""
读文件,将结果丢入List
@param input 输入流程
@param encoding 编码
@param blackPrefixList 保持黑名单前缀的List
"""
InputStreamReader reader = null;
BufferedReader bufferedReader = null;
... | java | private static void readToList(InputStream input, String encoding, List<String> blackPrefixList) {
InputStreamReader reader = null;
BufferedReader bufferedReader = null;
try {
reader = new InputStreamReader(input, encoding);
bufferedReader = new BufferedReader(reader);
... | [
"private",
"static",
"void",
"readToList",
"(",
"InputStream",
"input",
",",
"String",
"encoding",
",",
"List",
"<",
"String",
">",
"blackPrefixList",
")",
"{",
"InputStreamReader",
"reader",
"=",
"null",
";",
"BufferedReader",
"bufferedReader",
"=",
"null",
";"... | 读文件,将结果丢入List
@param input 输入流程
@param encoding 编码
@param blackPrefixList 保持黑名单前缀的List | [
"读文件,将结果丢入List"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/codec-sofa-hessian/src/main/java/com/alipay/sofa/rpc/codec/sofahessian/BlackListFileLoader.java#L77-L98 |
RestComm/sip-servlets | sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/SipNetworkInterfaceManagerImpl.java | SipNetworkInterfaceManagerImpl.checkPortRange | public static int checkPortRange(int port, String transport) {
"""
Checks if the port is in the UDP-TCP port numbers (0-65355) range
otherwise defaulting to 5060 if UDP, TCP or SCTP or to 5061 if TLS
@param port port to check
@return the smae port number if in range, otherwise 5060 if UDP, TCP or SCTP or to 506... | java | public static int checkPortRange(int port, String transport) {
if(port < MIN_PORT_NUMBER || port > MAX_PORT_NUMBER) {
if((ListeningPoint.TLS).equalsIgnoreCase(transport)) {
return ListeningPoint.PORT_5061;
} else {
return ListeningPoint.PORT_5060;
}
}
else {
return port;
}
} | [
"public",
"static",
"int",
"checkPortRange",
"(",
"int",
"port",
",",
"String",
"transport",
")",
"{",
"if",
"(",
"port",
"<",
"MIN_PORT_NUMBER",
"||",
"port",
">",
"MAX_PORT_NUMBER",
")",
"{",
"if",
"(",
"(",
"ListeningPoint",
".",
"TLS",
")",
".",
"equ... | Checks if the port is in the UDP-TCP port numbers (0-65355) range
otherwise defaulting to 5060 if UDP, TCP or SCTP or to 5061 if TLS
@param port port to check
@return the smae port number if in range, otherwise 5060 if UDP, TCP or SCTP or to 5061 if TLS | [
"Checks",
"if",
"the",
"port",
"is",
"in",
"the",
"UDP",
"-",
"TCP",
"port",
"numbers",
"(",
"0",
"-",
"65355",
")",
"range",
"otherwise",
"defaulting",
"to",
"5060",
"if",
"UDP",
"TCP",
"or",
"SCTP",
"or",
"to",
"5061",
"if",
"TLS"
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/SipNetworkInterfaceManagerImpl.java#L412-L423 |
mpetazzoni/ttorrent | common/src/main/java/com/turn/ttorrent/common/creation/MetadataBuilder.java | MetadataBuilder.addDataSource | public MetadataBuilder addDataSource(@NotNull InputStream dataSource, String path) {
"""
add custom source in torrent with custom path. Path can be separated with any slash.
"""
addDataSource(dataSource, path, true);
return this;
} | java | public MetadataBuilder addDataSource(@NotNull InputStream dataSource, String path) {
addDataSource(dataSource, path, true);
return this;
} | [
"public",
"MetadataBuilder",
"addDataSource",
"(",
"@",
"NotNull",
"InputStream",
"dataSource",
",",
"String",
"path",
")",
"{",
"addDataSource",
"(",
"dataSource",
",",
"path",
",",
"true",
")",
";",
"return",
"this",
";",
"}"
] | add custom source in torrent with custom path. Path can be separated with any slash. | [
"add",
"custom",
"source",
"in",
"torrent",
"with",
"custom",
"path",
".",
"Path",
"can",
"be",
"separated",
"with",
"any",
"slash",
"."
] | train | https://github.com/mpetazzoni/ttorrent/blob/ecd0e6caf853b63393c4ab63cfd8f20114f73f70/common/src/main/java/com/turn/ttorrent/common/creation/MetadataBuilder.java#L207-L210 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/web/JavaScriptUtils.java | JavaScriptUtils.getUnencodedHtmlCookieString | public String getUnencodedHtmlCookieString(String name, String value, Map<String, String> cookieProperties) {
"""
Creates and returns a JavaScript line for setting a cookie with the specified name, value, and cookie properties. Note: The
properties will be HTML-encoded but the name and value will not be.
"""
... | java | public String getUnencodedHtmlCookieString(String name, String value, Map<String, String> cookieProperties) {
return createHtmlCookieString(name, value, cookieProperties, false);
} | [
"public",
"String",
"getUnencodedHtmlCookieString",
"(",
"String",
"name",
",",
"String",
"value",
",",
"Map",
"<",
"String",
",",
"String",
">",
"cookieProperties",
")",
"{",
"return",
"createHtmlCookieString",
"(",
"name",
",",
"value",
",",
"cookieProperties",
... | Creates and returns a JavaScript line for setting a cookie with the specified name, value, and cookie properties. Note: The
properties will be HTML-encoded but the name and value will not be. | [
"Creates",
"and",
"returns",
"a",
"JavaScript",
"line",
"for",
"setting",
"a",
"cookie",
"with",
"the",
"specified",
"name",
"value",
"and",
"cookie",
"properties",
".",
"Note",
":",
"The",
"properties",
"will",
"be",
"HTML",
"-",
"encoded",
"but",
"the",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/web/JavaScriptUtils.java#L99-L101 |
ontop/ontop | mapping/sql/owlapi/src/main/java/it/unibz/inf/ontop/spec/mapping/bootstrap/impl/DirectMappingEngine.java | DirectMappingEngine.bootstrapMappings | private SQLPPMapping bootstrapMappings(SQLPPMapping ppMapping)
throws SQLException, DuplicateMappingException {
"""
*
extract mappings from given datasource, and insert them into the pre-processed mapping
Duplicate Exception may happen,
since mapping id is generated randomly and same id may occur
"""
... | java | private SQLPPMapping bootstrapMappings(SQLPPMapping ppMapping)
throws SQLException, DuplicateMappingException {
if (ppMapping == null) {
throw new IllegalArgumentException("Model should not be null");
}
try (Connection conn = LocalJDBCConnectionUtils.createConnection(settings)) {
RDBMetadata metadata = R... | [
"private",
"SQLPPMapping",
"bootstrapMappings",
"(",
"SQLPPMapping",
"ppMapping",
")",
"throws",
"SQLException",
",",
"DuplicateMappingException",
"{",
"if",
"(",
"ppMapping",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Model should not b... | *
extract mappings from given datasource, and insert them into the pre-processed mapping
Duplicate Exception may happen,
since mapping id is generated randomly and same id may occur | [
"*",
"extract",
"mappings",
"from",
"given",
"datasource",
"and",
"insert",
"them",
"into",
"the",
"pre",
"-",
"processed",
"mapping"
] | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/mapping/sql/owlapi/src/main/java/it/unibz/inf/ontop/spec/mapping/bootstrap/impl/DirectMappingEngine.java#L238-L249 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AnycastOutputHandler.java | AnycastOutputHandler.deleteAndUnlockPersistentStream | private void deleteAndUnlockPersistentStream(StreamInfo sinfo, ArrayList valueTicks) throws MessageStoreException, SIRollbackException, SIConnectionLostException, SIIncorrectCallException, SIResourceException, SIErrorException {
"""
remove the persistent ticks and the itemstream and started-flush item
"""
... | java | private void deleteAndUnlockPersistentStream(StreamInfo sinfo, ArrayList valueTicks) throws MessageStoreException, SIRollbackException, SIConnectionLostException, SIIncorrectCallException, SIResourceException, SIErrorException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc... | [
"private",
"void",
"deleteAndUnlockPersistentStream",
"(",
"StreamInfo",
"sinfo",
",",
"ArrayList",
"valueTicks",
")",
"throws",
"MessageStoreException",
",",
"SIRollbackException",
",",
"SIConnectionLostException",
",",
"SIIncorrectCallException",
",",
"SIResourceException",
... | remove the persistent ticks and the itemstream and started-flush item | [
"remove",
"the",
"persistent",
"ticks",
"and",
"the",
"itemstream",
"and",
"started",
"-",
"flush",
"item"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AnycastOutputHandler.java#L3207-L3230 |
GenesysPureEngage/authentication-client-java | src/main/java/com/genesys/authentication/AuthenticationApi.java | AuthenticationApi.getUserInfo | public CloudUserDetails getUserInfo(String authorization) throws AuthenticationApiException {
"""
Get user information by access token
Get information about a user by their OAuth 2 access token.
@param authorization The OAuth 2 bearer access token. For example: \"Authorization: bearer a4b5da75-a584-4053-9... | java | public CloudUserDetails getUserInfo(String authorization) throws AuthenticationApiException {
try {
return authenticationApi.getInfo1(authorization);
} catch (ApiException e) {
throw new AuthenticationApiException("Error getting userinfo", e);
}
} | [
"public",
"CloudUserDetails",
"getUserInfo",
"(",
"String",
"authorization",
")",
"throws",
"AuthenticationApiException",
"{",
"try",
"{",
"return",
"authenticationApi",
".",
"getInfo1",
"(",
"authorization",
")",
";",
"}",
"catch",
"(",
"ApiException",
"e",
")",
... | Get user information by access token
Get information about a user by their OAuth 2 access token.
@param authorization The OAuth 2 bearer access token. For example: \"Authorization: bearer a4b5da75-a584-4053-9227-0f0ab23ff06e\" (required)
@return CloudUserDetails
@throws AuthenticationApiException if the cal... | [
"Get",
"user",
"information",
"by",
"access",
"token",
"Get",
"information",
"about",
"a",
"user",
"by",
"their",
"OAuth",
"2",
"access",
"token",
"."
] | train | https://github.com/GenesysPureEngage/authentication-client-java/blob/eb0d58343ee42ebd3c037163c1137f611dfcbb3a/src/main/java/com/genesys/authentication/AuthenticationApi.java#L103-L109 |
livetribe/livetribe-slp | core/src/main/java/org/livetribe/slp/da/StandardDirectoryAgentServer.java | StandardDirectoryAgentServer.handleUDPSrvRqst | protected void handleUDPSrvRqst(SrvRqst srvRqst, InetSocketAddress localAddress, InetSocketAddress remoteAddress) {
"""
Handles a unicast UDP SrvRqst message arrived to this directory agent.
<br />
This directory agent will reply with a list of matching services.
@param srvRqst the SrvRqst message to ha... | java | protected void handleUDPSrvRqst(SrvRqst srvRqst, InetSocketAddress localAddress, InetSocketAddress remoteAddress)
{
// Match scopes, RFC 2608, 11.1
if (!scopes.weakMatch(srvRqst.getScopes()))
{
udpSrvRply.perform(localAddress, remoteAddress, srvRqst, SLPError.SCOPE_NOT_SUPPORTED)... | [
"protected",
"void",
"handleUDPSrvRqst",
"(",
"SrvRqst",
"srvRqst",
",",
"InetSocketAddress",
"localAddress",
",",
"InetSocketAddress",
"remoteAddress",
")",
"{",
"// Match scopes, RFC 2608, 11.1",
"if",
"(",
"!",
"scopes",
".",
"weakMatch",
"(",
"srvRqst",
".",
"getS... | Handles a unicast UDP SrvRqst message arrived to this directory agent.
<br />
This directory agent will reply with a list of matching services.
@param srvRqst the SrvRqst message to handle
@param localAddress the address on this server on which the message arrived
@param remoteAddress the address on the remote ... | [
"Handles",
"a",
"unicast",
"UDP",
"SrvRqst",
"message",
"arrived",
"to",
"this",
"directory",
"agent",
".",
"<br",
"/",
">",
"This",
"directory",
"agent",
"will",
"reply",
"with",
"a",
"list",
"of",
"matching",
"services",
"."
] | train | https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/core/src/main/java/org/livetribe/slp/da/StandardDirectoryAgentServer.java#L457-L471 |
xiaosunzhu/resource-utils | src/main/java/net/sunyijun/resource/config/PropertiesIO.java | PropertiesIO.store | public static void store(String absolutePath, Properties configs) throws IOException {
"""
Write into properties file.
@param absolutePath absolute path in file system.
@param configs all configs to write.
@throws java.io.IOException
"""
OutputStream outStream = null;
try {
... | java | public static void store(String absolutePath, Properties configs) throws IOException {
OutputStream outStream = null;
try {
outStream = new FileOutputStream(new File(absolutePath));
configs.store(outStream, null);
} finally {
try {
if (o... | [
"public",
"static",
"void",
"store",
"(",
"String",
"absolutePath",
",",
"Properties",
"configs",
")",
"throws",
"IOException",
"{",
"OutputStream",
"outStream",
"=",
"null",
";",
"try",
"{",
"outStream",
"=",
"new",
"FileOutputStream",
"(",
"new",
"File",
"("... | Write into properties file.
@param absolutePath absolute path in file system.
@param configs all configs to write.
@throws java.io.IOException | [
"Write",
"into",
"properties",
"file",
"."
] | train | https://github.com/xiaosunzhu/resource-utils/blob/4f2bf3f36df10195a978f122ed682ba1eb0462b5/src/main/java/net/sunyijun/resource/config/PropertiesIO.java#L88-L102 |
Azure/azure-sdk-for-java | cognitiveservices/resource-manager/v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsInner.java | AccountsInner.updateAsync | public Observable<CognitiveServicesAccountInner> updateAsync(String resourceGroupName, String accountName, Sku sku, Map<String, String> tags) {
"""
Updates a Cognitive Services account.
@param resourceGroupName The name of the resource group within the user's subscription.
@param accountName The name of Cognit... | java | public Observable<CognitiveServicesAccountInner> updateAsync(String resourceGroupName, String accountName, Sku sku, Map<String, String> tags) {
return updateWithServiceResponseAsync(resourceGroupName, accountName, sku, tags).map(new Func1<ServiceResponse<CognitiveServicesAccountInner>, CognitiveServicesAccountI... | [
"public",
"Observable",
"<",
"CognitiveServicesAccountInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"Sku",
"sku",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"updateWithServiceResp... | Updates a Cognitive Services account.
@param resourceGroupName The name of the resource group within the user's subscription.
@param accountName The name of Cognitive Services account.
@param sku Gets or sets the SKU of the resource.
@param tags Gets or sets a list of key value pairs that describe the resource. These ... | [
"Updates",
"a",
"Cognitive",
"Services",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/resource-manager/v2017_04_18/src/main/java/com/microsoft/azure/management/cognitiveservices/v2017_04_18/implementation/AccountsInner.java#L345-L352 |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java | CommerceDiscountPersistenceImpl.findByGroupId | @Override
public List<CommerceDiscount> findByGroupId(long groupId, int start, int end) {
"""
Returns a range of all the commerce discounts where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primar... | java | @Override
public List<CommerceDiscount> findByGroupId(long groupId, int start, int end) {
return findByGroupId(groupId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceDiscount",
">",
"findByGroupId",
"(",
"long",
"groupId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce discounts where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set.... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"discounts",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java#L1535-L1538 |
cdk/cdk | base/data/src/main/java/org/openscience/cdk/formula/AdductFormula.java | AdductFormula.isTheSame | private boolean isTheSame(IIsotope isotopeOne, IIsotope isotopeTwo) {
"""
Compare to IIsotope. The method doesn't compare instance but if they
have the same symbol, natural abundance and exact mass.
@param isotopeOne The first Isotope to compare
@param isotopeTwo The second Isotope to compare
@return ... | java | private boolean isTheSame(IIsotope isotopeOne, IIsotope isotopeTwo) {
// XXX: floating point comparision!
if (!Objects.equals(isotopeOne.getSymbol(), isotopeTwo.getSymbol())) return false;
if (!Objects.equals(isotopeOne.getNaturalAbundance(), isotopeTwo.getNaturalAbundance())) return false;
... | [
"private",
"boolean",
"isTheSame",
"(",
"IIsotope",
"isotopeOne",
",",
"IIsotope",
"isotopeTwo",
")",
"{",
"// XXX: floating point comparision!",
"if",
"(",
"!",
"Objects",
".",
"equals",
"(",
"isotopeOne",
".",
"getSymbol",
"(",
")",
",",
"isotopeTwo",
".",
"ge... | Compare to IIsotope. The method doesn't compare instance but if they
have the same symbol, natural abundance and exact mass.
@param isotopeOne The first Isotope to compare
@param isotopeTwo The second Isotope to compare
@return True, if both isotope are the same | [
"Compare",
"to",
"IIsotope",
".",
"The",
"method",
"doesn",
"t",
"compare",
"instance",
"but",
"if",
"they",
"have",
"the",
"same",
"symbol",
"natural",
"abundance",
"and",
"exact",
"mass",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/data/src/main/java/org/openscience/cdk/formula/AdductFormula.java#L345-L352 |
pravega/pravega | segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/HierarchyUtils.java | HierarchyUtils.getPath | static String getPath(int nodeId, int depth) {
"""
Gets a hierarchical path using the value of nodeId to construct the intermediate paths.
Examples:
* nodeId = 1234, depth = 3 -> /4/3/2/1234
* nodeId = 1234, depth = 0 -> /1234
* nodeId = 1234, depth = 6 -> /4/3/2/1/0/0/1234
@param nodeId The node id to crea... | java | static String getPath(int nodeId, int depth) {
StringBuilder pathBuilder = new StringBuilder();
int value = nodeId;
for (int i = 0; i < depth; i++) {
int r = value % DIVISOR;
value = value / DIVISOR;
pathBuilder.append(SEPARATOR).append(r);
}
... | [
"static",
"String",
"getPath",
"(",
"int",
"nodeId",
",",
"int",
"depth",
")",
"{",
"StringBuilder",
"pathBuilder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"int",
"value",
"=",
"nodeId",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"dept... | Gets a hierarchical path using the value of nodeId to construct the intermediate paths.
Examples:
* nodeId = 1234, depth = 3 -> /4/3/2/1234
* nodeId = 1234, depth = 0 -> /1234
* nodeId = 1234, depth = 6 -> /4/3/2/1/0/0/1234
@param nodeId The node id to create the path for.
@param depth The hierarchy depth (0 means fl... | [
"Gets",
"a",
"hierarchical",
"path",
"using",
"the",
"value",
"of",
"nodeId",
"to",
"construct",
"the",
"intermediate",
"paths",
".",
"Examples",
":",
"*",
"nodeId",
"=",
"1234",
"depth",
"=",
"3",
"-",
">",
"/",
"4",
"/",
"3",
"/",
"2",
"/",
"1234",... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/storage/impl/src/main/java/io/pravega/segmentstore/storage/impl/bookkeeper/HierarchyUtils.java#L37-L47 |
fozziethebeat/S-Space | opt/src/main/java/edu/ucla/sspace/lra/LatentRelationalAnalysis.java | LatentRelationalAnalysis.initializeIndex | public static void initializeIndex(String indexDir, String dataDir) {
"""
Initializes an index given the index directory and data directory.
@param indexDir a {@code String} containing the directory where the index
will be stored
@param dataDir a {@code String} containing the directory where the data
is foun... | java | public static void initializeIndex(String indexDir, String dataDir) {
File indexDir_f = new File(indexDir);
File dataDir_f = new File(dataDir);
long start = new Date().getTime();
try {
int numIndexed = index(indexDir_f, dataDir_f);
long end = new Date().getTime()... | [
"public",
"static",
"void",
"initializeIndex",
"(",
"String",
"indexDir",
",",
"String",
"dataDir",
")",
"{",
"File",
"indexDir_f",
"=",
"new",
"File",
"(",
"indexDir",
")",
";",
"File",
"dataDir_f",
"=",
"new",
"File",
"(",
"dataDir",
")",
";",
"long",
... | Initializes an index given the index directory and data directory.
@param indexDir a {@code String} containing the directory where the index
will be stored
@param dataDir a {@code String} containing the directory where the data
is found | [
"Initializes",
"an",
"index",
"given",
"the",
"index",
"directory",
"and",
"data",
"directory",
"."
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/opt/src/main/java/edu/ucla/sspace/lra/LatentRelationalAnalysis.java#L289-L302 |
alkacon/opencms-core | src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java | CmsSitemapController.disableModelPage | public void disableModelPage(final CmsUUID id, final boolean disable) {
"""
Disables the given model page entry within the configuration.<p>
@param id the entry id
@param disable <code>true</code> to disable the entry
"""
CmsRpcAction<Void> action = new CmsRpcAction<Void>() {
@Overrid... | java | public void disableModelPage(final CmsUUID id, final boolean disable) {
CmsRpcAction<Void> action = new CmsRpcAction<Void>() {
@Override
public void execute() {
start(200, true);
getService().disableModelPage(getEntryPoint(), id, disable, this);
... | [
"public",
"void",
"disableModelPage",
"(",
"final",
"CmsUUID",
"id",
",",
"final",
"boolean",
"disable",
")",
"{",
"CmsRpcAction",
"<",
"Void",
">",
"action",
"=",
"new",
"CmsRpcAction",
"<",
"Void",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
... | Disables the given model page entry within the configuration.<p>
@param id the entry id
@param disable <code>true</code> to disable the entry | [
"Disables",
"the",
"given",
"model",
"page",
"entry",
"within",
"the",
"configuration",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/sitemap/client/control/CmsSitemapController.java#L783-L804 |
hsiafan/requests | src/main/java/net/dongliu/requests/RawResponse.java | RawResponse.readToText | public String readToText() {
"""
Read response body to string. return empty string if response has no body
"""
Charset charset = getCharset();
try (InputStream in = body();
Reader reader = new InputStreamReader(in, charset)) {
return Readers.readAll(reader);
} c... | java | public String readToText() {
Charset charset = getCharset();
try (InputStream in = body();
Reader reader = new InputStreamReader(in, charset)) {
return Readers.readAll(reader);
} catch (IOException e) {
throw new RequestsException(e);
} finally {
... | [
"public",
"String",
"readToText",
"(",
")",
"{",
"Charset",
"charset",
"=",
"getCharset",
"(",
")",
";",
"try",
"(",
"InputStream",
"in",
"=",
"body",
"(",
")",
";",
"Reader",
"reader",
"=",
"new",
"InputStreamReader",
"(",
"in",
",",
"charset",
")",
"... | Read response body to string. return empty string if response has no body | [
"Read",
"response",
"body",
"to",
"string",
".",
"return",
"empty",
"string",
"if",
"response",
"has",
"no",
"body"
] | train | https://github.com/hsiafan/requests/blob/a6cc6f8293e808cc937d3789aec2616a8383dee0/src/main/java/net/dongliu/requests/RawResponse.java#L115-L125 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java | SARLQuickfixProvider.fixDiscouragedFieldName | @Fix(org.eclipse.xtext.xbase.validation.IssueCodes.VARIABLE_NAME_DISCOURAGED)
public void fixDiscouragedFieldName(final Issue issue, IssueResolutionAcceptor acceptor) {
"""
Quick fix for "disallowed variable name".
@param issue the issue.
@param acceptor the quick fix acceptor.
"""
MemberRemoveModificat... | java | @Fix(org.eclipse.xtext.xbase.validation.IssueCodes.VARIABLE_NAME_DISCOURAGED)
public void fixDiscouragedFieldName(final Issue issue, IssueResolutionAcceptor acceptor) {
MemberRemoveModification.accept(this, issue, acceptor);
} | [
"@",
"Fix",
"(",
"org",
".",
"eclipse",
".",
"xtext",
".",
"xbase",
".",
"validation",
".",
"IssueCodes",
".",
"VARIABLE_NAME_DISCOURAGED",
")",
"public",
"void",
"fixDiscouragedFieldName",
"(",
"final",
"Issue",
"issue",
",",
"IssueResolutionAcceptor",
"acceptor"... | Quick fix for "disallowed variable name".
@param issue the issue.
@param acceptor the quick fix acceptor. | [
"Quick",
"fix",
"for",
"disallowed",
"variable",
"name",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L708-L711 |
alkacon/opencms-core | src/org/opencms/util/CmsHtml2TextConverter.java | CmsHtml2TextConverter.appendLinebreak | private void appendLinebreak(int count, boolean force) {
"""
Appends line breaks.<p>
@param count the number of line breaks
@param force if the line break should be forced
"""
if (m_appendBr) {
if (m_storedBrCount > count) {
count = m_storedBrCount;
}
... | java | private void appendLinebreak(int count, boolean force) {
if (m_appendBr) {
if (m_storedBrCount > count) {
count = m_storedBrCount;
}
m_storedBrCount = 0;
if (force) {
m_brCount = 0;
}
while (m_brCount < coun... | [
"private",
"void",
"appendLinebreak",
"(",
"int",
"count",
",",
"boolean",
"force",
")",
"{",
"if",
"(",
"m_appendBr",
")",
"{",
"if",
"(",
"m_storedBrCount",
">",
"count",
")",
"{",
"count",
"=",
"m_storedBrCount",
";",
"}",
"m_storedBrCount",
"=",
"0",
... | Appends line breaks.<p>
@param count the number of line breaks
@param force if the line break should be forced | [
"Appends",
"line",
"breaks",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsHtml2TextConverter.java#L176-L196 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-native-api/src/main/java/org/nd4j/storage/CompressedRamStorage.java | CompressedRamStorage.storeIfAbsent | @Override
public boolean storeIfAbsent(T key, INDArray object) {
"""
Store object into storage, if it doesn't exist
@param key
@param object
@return Returns TRUE if store operation was applied, FALSE otherwise
"""
try {
if (emulateIsAbsent)
lock.writeLock().lock();
... | java | @Override
public boolean storeIfAbsent(T key, INDArray object) {
try {
if (emulateIsAbsent)
lock.writeLock().lock();
if (compressedEntries.containsKey(key)) {
return false;
} else {
store(key, object);
retur... | [
"@",
"Override",
"public",
"boolean",
"storeIfAbsent",
"(",
"T",
"key",
",",
"INDArray",
"object",
")",
"{",
"try",
"{",
"if",
"(",
"emulateIsAbsent",
")",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"if",
"(",
"compressedEntries",
... | Store object into storage, if it doesn't exist
@param key
@param object
@return Returns TRUE if store operation was applied, FALSE otherwise | [
"Store",
"object",
"into",
"storage",
"if",
"it",
"doesn",
"t",
"exist"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-native-api/src/main/java/org/nd4j/storage/CompressedRamStorage.java#L121-L137 |
osglworks/java-tool | src/main/java/org/osgl/util/IO.java | IO.registerInputStreamHandler | public static void registerInputStreamHandler(MimeType.Trait trait, InputStreamHandler handler) {
"""
Register an {@link InputStreamHandler} with all {@link MimeType mime types} by {@link MimeType.Trait}.
@param trait
the trait of mimetype
@param handler
the input stream handler
"""
$.requireNotN... | java | public static void registerInputStreamHandler(MimeType.Trait trait, InputStreamHandler handler) {
$.requireNotNull(handler);
List<MimeType> mimeTypes = MimeType.filterByTrait(trait);
for (MimeType mimeType : mimeTypes) {
registerInputStreamHandler(mimeType, handler);
}
} | [
"public",
"static",
"void",
"registerInputStreamHandler",
"(",
"MimeType",
".",
"Trait",
"trait",
",",
"InputStreamHandler",
"handler",
")",
"{",
"$",
".",
"requireNotNull",
"(",
"handler",
")",
";",
"List",
"<",
"MimeType",
">",
"mimeTypes",
"=",
"MimeType",
... | Register an {@link InputStreamHandler} with all {@link MimeType mime types} by {@link MimeType.Trait}.
@param trait
the trait of mimetype
@param handler
the input stream handler | [
"Register",
"an",
"{",
"@link",
"InputStreamHandler",
"}",
"with",
"all",
"{",
"@link",
"MimeType",
"mime",
"types",
"}",
"by",
"{",
"@link",
"MimeType",
".",
"Trait",
"}",
"."
] | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/util/IO.java#L179-L185 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/breadcrumbs/BreadcrumbsRenderer.java | BreadcrumbsRenderer.encodeEnd | @Override
public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
"""
This methods generates the HTML code of the current b:breadcrumbs. <code>encodeBegin</code> generates the
start of the component. After the, the JSF framework calls <code>encodeChildren()</code> to generate the ... | java | @Override
public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
ResponseWriter rw = context.getResponseWriter();
// End point / current page
UIComponent end = component.getFacet("end");
if (end != null) {
rw.startElement("li"... | [
"@",
"Override",
"public",
"void",
"encodeEnd",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"component",
".",
"isRendered",
"(",
")",
")",
"{",
"return",
";",
"}",
"ResponseWriter",
"rw"... | This methods generates the HTML code of the current b:breadcrumbs. <code>encodeBegin</code> generates the
start of the component. After the, the JSF framework calls <code>encodeChildren()</code> to generate the HTML
code between the beginning and the end of the component. For instance, in the case of a panel component ... | [
"This",
"methods",
"generates",
"the",
"HTML",
"code",
"of",
"the",
"current",
"b",
":",
"breadcrumbs",
".",
"<code",
">",
"encodeBegin<",
"/",
"code",
">",
"generates",
"the",
"start",
"of",
"the",
"component",
".",
"After",
"the",
"the",
"JSF",
"framewor... | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/breadcrumbs/BreadcrumbsRenderer.java#L91-L108 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableExtendedScan.java | BigtableExtendedScan.addRange | public void addRange(byte[] startRow, byte[] stopRow) {
"""
Adds a range to scan. This is similar to calling a combination of
{@link Scan#setStartRow(byte[])} and {@link Scan#setStopRow(byte[])}. Other ranges can be
constructed by creating a {@link RowRange} and calling {@link #addRange(RowRange)}
@param startR... | java | public void addRange(byte[] startRow, byte[] stopRow) {
addRange(RowRange.newBuilder()
.setStartKeyClosed(ByteStringer.wrap(startRow))
.setEndKeyOpen(ByteStringer.wrap(stopRow))
.build());
} | [
"public",
"void",
"addRange",
"(",
"byte",
"[",
"]",
"startRow",
",",
"byte",
"[",
"]",
"stopRow",
")",
"{",
"addRange",
"(",
"RowRange",
".",
"newBuilder",
"(",
")",
".",
"setStartKeyClosed",
"(",
"ByteStringer",
".",
"wrap",
"(",
"startRow",
")",
")",
... | Adds a range to scan. This is similar to calling a combination of
{@link Scan#setStartRow(byte[])} and {@link Scan#setStopRow(byte[])}. Other ranges can be
constructed by creating a {@link RowRange} and calling {@link #addRange(RowRange)}
@param startRow a byte array.
@param stopRow a byte array. | [
"Adds",
"a",
"range",
"to",
"scan",
".",
"This",
"is",
"similar",
"to",
"calling",
"a",
"combination",
"of",
"{"
] | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableExtendedScan.java#L73-L78 |
wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/http/Result.java | Result.render | public Result render(String padding, JsonNode node) {
"""
Sets the content of the current result to the JSONP response using the given padding (callback). It also sets
the content-type header to JavaScript and the charset to UTF-8.
@param node the content
@return the current result
"""
this.conten... | java | public Result render(String padding, JsonNode node) {
this.content = new RenderableJsonP(padding, node);
setContentType(MimeTypes.JAVASCRIPT);
charset = Charsets.UTF_8;
return this;
} | [
"public",
"Result",
"render",
"(",
"String",
"padding",
",",
"JsonNode",
"node",
")",
"{",
"this",
".",
"content",
"=",
"new",
"RenderableJsonP",
"(",
"padding",
",",
"node",
")",
";",
"setContentType",
"(",
"MimeTypes",
".",
"JAVASCRIPT",
")",
";",
"chars... | Sets the content of the current result to the JSONP response using the given padding (callback). It also sets
the content-type header to JavaScript and the charset to UTF-8.
@param node the content
@return the current result | [
"Sets",
"the",
"content",
"of",
"the",
"current",
"result",
"to",
"the",
"JSONP",
"response",
"using",
"the",
"given",
"padding",
"(",
"callback",
")",
".",
"It",
"also",
"sets",
"the",
"content",
"-",
"type",
"header",
"to",
"JavaScript",
"and",
"the",
... | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/http/Result.java#L141-L146 |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java | TupleGenerator.createPropertyProviders | private MultiValuedMap<String,VarBindingDef> createPropertyProviders( FunctionInputDef inputDef) {
"""
Return a map that associates each value property with the set of bindings that provide it.
"""
propertyProviders_ = MultiMapUtils.newListValuedHashMap();
for( VarDefIterator varDefs = new VarDefIterat... | java | private MultiValuedMap<String,VarBindingDef> createPropertyProviders( FunctionInputDef inputDef)
{
propertyProviders_ = MultiMapUtils.newListValuedHashMap();
for( VarDefIterator varDefs = new VarDefIterator( inputDef.getVarDefs()); varDefs.hasNext(); )
{
VarDef varDef = varDefs.next();
for... | [
"private",
"MultiValuedMap",
"<",
"String",
",",
"VarBindingDef",
">",
"createPropertyProviders",
"(",
"FunctionInputDef",
"inputDef",
")",
"{",
"propertyProviders_",
"=",
"MultiMapUtils",
".",
"newListValuedHashMap",
"(",
")",
";",
"for",
"(",
"VarDefIterator",
"varD... | Return a map that associates each value property with the set of bindings that provide it. | [
"Return",
"a",
"map",
"that",
"associates",
"each",
"value",
"property",
"with",
"the",
"set",
"of",
"bindings",
"that",
"provide",
"it",
"."
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleGenerator.java#L733-L754 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.switchFrame | protected void switchFrame(PageElement element, Object... args) throws FailureException, TechnicalException {
"""
Switches to the given frame.
@param element
The PageElement representing a frame.
@param args
list of arguments to format the found selector with
@throws TechnicalException
is thrown if you hav... | java | protected void switchFrame(PageElement element, Object... args) throws FailureException, TechnicalException {
try {
Context.waitUntil(ExpectedConditions.frameToBeAvailableAndSwitchToIt(Utilities.getLocator(element, args)));
} catch (final Exception e) {
new Result.Failure<>(e... | [
"protected",
"void",
"switchFrame",
"(",
"PageElement",
"element",
",",
"Object",
"...",
"args",
")",
"throws",
"FailureException",
",",
"TechnicalException",
"{",
"try",
"{",
"Context",
".",
"waitUntil",
"(",
"ExpectedConditions",
".",
"frameToBeAvailableAndSwitchToI... | Switches to the given frame.
@param element
The PageElement representing a frame.
@param args
list of arguments to format the found selector with
@throws TechnicalException
is thrown if you have a technical error (format, configuration, datas, ...) in NoraUi.
Exception with {@value com.github.noraui.utils.Messages#FAI... | [
"Switches",
"to",
"the",
"given",
"frame",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L769-L776 |
jbundle/jbundle | app/program/screen/src/main/java/org/jbundle/app/program/resource/screen/ResourceGridScreen.java | ResourceGridScreen.doCommand | public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions) {
"""
Process the command.
<br />Step 1 - Process the command if possible and return true if processed.
<br />Step 2 - If I can't process, pass to all children (with me as the source).
<br />Step 3 - If children didn't pr... | java | public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions)
{
if (strCommand.equalsIgnoreCase(MenuConstants.FORMDETAIL))
return (this.onForm(null, ScreenConstants.DETAIL_MODE, true, iCommandOptions, null) != null);
else
return super.doCommand(st... | [
"public",
"boolean",
"doCommand",
"(",
"String",
"strCommand",
",",
"ScreenField",
"sourceSField",
",",
"int",
"iCommandOptions",
")",
"{",
"if",
"(",
"strCommand",
".",
"equalsIgnoreCase",
"(",
"MenuConstants",
".",
"FORMDETAIL",
")",
")",
"return",
"(",
"this"... | Process the command.
<br />Step 1 - Process the command if possible and return true if processed.
<br />Step 2 - If I can't process, pass to all children (with me as the source).
<br />Step 3 - If children didn't process, pass to parent (with me as the source).
<br />Note: Never pass to a parent or child that matches t... | [
"Process",
"the",
"command",
".",
"<br",
"/",
">",
"Step",
"1",
"-",
"Process",
"the",
"command",
"if",
"possible",
"and",
"return",
"true",
"if",
"processed",
".",
"<br",
"/",
">",
"Step",
"2",
"-",
"If",
"I",
"can",
"t",
"process",
"pass",
"to",
... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/app/program/screen/src/main/java/org/jbundle/app/program/resource/screen/ResourceGridScreen.java#L165-L171 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/auth/BoxAuthentication.java | BoxAuthentication.logoutAllUsers | public synchronized void logoutAllUsers(Context context) {
"""
Log out all users. After logging out, all authentication information will be gone.
@param context current context
"""
getAuthInfoMap(context);
for (String userId : mCurrentAccessInfo.keySet()) {
BoxSession session = new... | java | public synchronized void logoutAllUsers(Context context) {
getAuthInfoMap(context);
for (String userId : mCurrentAccessInfo.keySet()) {
BoxSession session = new BoxSession(context, userId);
logout(session);
}
authStorage.clearAuthInfoMap(context);
} | [
"public",
"synchronized",
"void",
"logoutAllUsers",
"(",
"Context",
"context",
")",
"{",
"getAuthInfoMap",
"(",
"context",
")",
";",
"for",
"(",
"String",
"userId",
":",
"mCurrentAccessInfo",
".",
"keySet",
"(",
")",
")",
"{",
"BoxSession",
"session",
"=",
"... | Log out all users. After logging out, all authentication information will be gone.
@param context current context | [
"Log",
"out",
"all",
"users",
".",
"After",
"logging",
"out",
"all",
"authentication",
"information",
"will",
"be",
"gone",
"."
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/auth/BoxAuthentication.java#L275-L283 |
sagiegurari/fax4j | src/main/java/org/fax4j/bridge/http/MultiPartHTTPRequestParser.java | MultiPartHTTPRequestParser.getContentPartAsString | protected String getContentPartAsString(Map<String,ContentPart<?>> contentPartsMap,String parameter) {
"""
This function returns the content part string value.
@param contentPartsMap
The content parts map
@param parameter
The part parameter name
@return The part string value
"""
//get part
... | java | protected String getContentPartAsString(Map<String,ContentPart<?>> contentPartsMap,String parameter)
{
//get part
String stringValue=null;
ContentPart<?> contentPart=contentPartsMap.get(parameter);
if(contentPart!=null)
{
ContentPartType contentPartType=contentPar... | [
"protected",
"String",
"getContentPartAsString",
"(",
"Map",
"<",
"String",
",",
"ContentPart",
"<",
"?",
">",
">",
"contentPartsMap",
",",
"String",
"parameter",
")",
"{",
"//get part",
"String",
"stringValue",
"=",
"null",
";",
"ContentPart",
"<",
"?",
">",
... | This function returns the content part string value.
@param contentPartsMap
The content parts map
@param parameter
The part parameter name
@return The part string value | [
"This",
"function",
"returns",
"the",
"content",
"part",
"string",
"value",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/bridge/http/MultiPartHTTPRequestParser.java#L340-L375 |
ehcache/ehcache3 | core/src/main/java/org/ehcache/core/EhcacheManager.java | EhcacheManager.removeCache | private void removeCache(final String alias, final boolean removeFromConfig) {
"""
Closes and removes a cache, by alias, from this cache manager.
@param alias the alias of the cache to remove
@param removeFromConfig if {@code true}, the cache configuration is altered to remove the cache
"""
statusTrans... | java | private void removeCache(final String alias, final boolean removeFromConfig) {
statusTransitioner.checkAvailable();
final CacheHolder cacheHolder = caches.remove(alias);
if(cacheHolder != null) {
final InternalCache<?, ?> ehcache = cacheHolder.retrieve(cacheHolder.keyType, cacheHolder.valueType);
... | [
"private",
"void",
"removeCache",
"(",
"final",
"String",
"alias",
",",
"final",
"boolean",
"removeFromConfig",
")",
"{",
"statusTransitioner",
".",
"checkAvailable",
"(",
")",
";",
"final",
"CacheHolder",
"cacheHolder",
"=",
"caches",
".",
"remove",
"(",
"alias... | Closes and removes a cache, by alias, from this cache manager.
@param alias the alias of the cache to remove
@param removeFromConfig if {@code true}, the cache configuration is altered to remove the cache | [
"Closes",
"and",
"removes",
"a",
"cache",
"by",
"alias",
"from",
"this",
"cache",
"manager",
"."
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/core/src/main/java/org/ehcache/core/EhcacheManager.java#L199-L220 |
mapsforge/mapsforge | mapsforge-poi-writer/src/main/java/org/mapsforge/poi/writer/PoiWriter.java | PoiWriter.tagsToString | String tagsToString(Map<String, String> tagMap) {
"""
Convert tags to a string representation using '\r' delimiter.
"""
StringBuilder sb = new StringBuilder();
for (String key : tagMap.keySet()) {
// Skip some tags
if (key.equalsIgnoreCase("created_by")) {
... | java | String tagsToString(Map<String, String> tagMap) {
StringBuilder sb = new StringBuilder();
for (String key : tagMap.keySet()) {
// Skip some tags
if (key.equalsIgnoreCase("created_by")) {
continue;
}
if (sb.length() > 0) {
sb... | [
"String",
"tagsToString",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"tagMap",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"String",
"key",
":",
"tagMap",
".",
"keySet",
"(",
")",
")",
"{",
"// Skip some... | Convert tags to a string representation using '\r' delimiter. | [
"Convert",
"tags",
"to",
"a",
"string",
"representation",
"using",
"\\",
"r",
"delimiter",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-poi-writer/src/main/java/org/mapsforge/poi/writer/PoiWriter.java#L597-L610 |
JodaOrg/joda-time | src/main/java/org/joda/time/YearMonth.java | YearMonth.withChronologyRetainFields | public YearMonth withChronologyRetainFields(Chronology newChronology) {
"""
Returns a copy of this year-month with the specified chronology.
This instance is immutable and unaffected by this method call.
<p>
This method retains the values of the fields, thus the result will
typically refer to a different insta... | java | public YearMonth withChronologyRetainFields(Chronology newChronology) {
newChronology = DateTimeUtils.getChronology(newChronology);
newChronology = newChronology.withUTC();
if (newChronology == getChronology()) {
return this;
} else {
YearMonth newYearMonth = new ... | [
"public",
"YearMonth",
"withChronologyRetainFields",
"(",
"Chronology",
"newChronology",
")",
"{",
"newChronology",
"=",
"DateTimeUtils",
".",
"getChronology",
"(",
"newChronology",
")",
";",
"newChronology",
"=",
"newChronology",
".",
"withUTC",
"(",
")",
";",
"if"... | Returns a copy of this year-month with the specified chronology.
This instance is immutable and unaffected by this method call.
<p>
This method retains the values of the fields, thus the result will
typically refer to a different instant.
<p>
The time zone of the specified chronology is ignored, as YearMonth
operates w... | [
"Returns",
"a",
"copy",
"of",
"this",
"year",
"-",
"month",
"with",
"the",
"specified",
"chronology",
".",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
".",
"<p",
">",
"This",
"method",
"retains",
"the",
"valu... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/YearMonth.java#L447-L457 |
jenkinsci/java-client-api | jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java | JenkinsServer.getJobXml | public String getJobXml(FolderJob folder, String jobName) throws IOException {
"""
Get the xml description of an existing job.
@param jobName name of the job.
@param folder {@link FolderJob}
@return the new job object
@throws IOException in case of an error.
"""
return client.get(UrlUtils.toJobBa... | java | public String getJobXml(FolderJob folder, String jobName) throws IOException {
return client.get(UrlUtils.toJobBaseUrl(folder, jobName) + "/config.xml");
} | [
"public",
"String",
"getJobXml",
"(",
"FolderJob",
"folder",
",",
"String",
"jobName",
")",
"throws",
"IOException",
"{",
"return",
"client",
".",
"get",
"(",
"UrlUtils",
".",
"toJobBaseUrl",
"(",
"folder",
",",
"jobName",
")",
"+",
"\"/config.xml\"",
")",
"... | Get the xml description of an existing job.
@param jobName name of the job.
@param folder {@link FolderJob}
@return the new job object
@throws IOException in case of an error. | [
"Get",
"the",
"xml",
"description",
"of",
"an",
"existing",
"job",
"."
] | train | https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java#L523-L525 |
alkacon/opencms-core | src-modules/org/opencms/workplace/tools/projects/CmsPublishProjectReport.java | CmsPublishProjectReport.startValidationThread | private void startValidationThread(CmsPublishList publishList) throws JspException {
"""
Starts the link validation thread for the project.<p>
@param publishList the list of resources to publish
@throws JspException if something goes wrong
"""
try {
CmsRelationsValidatorThread thread... | java | private void startValidationThread(CmsPublishList publishList) throws JspException {
try {
CmsRelationsValidatorThread thread = new CmsRelationsValidatorThread(getCms(), publishList, getSettings());
thread.start();
setParamThread(thread.getUUID().toString());
se... | [
"private",
"void",
"startValidationThread",
"(",
"CmsPublishList",
"publishList",
")",
"throws",
"JspException",
"{",
"try",
"{",
"CmsRelationsValidatorThread",
"thread",
"=",
"new",
"CmsRelationsValidatorThread",
"(",
"getCms",
"(",
")",
",",
"publishList",
",",
"get... | Starts the link validation thread for the project.<p>
@param publishList the list of resources to publish
@throws JspException if something goes wrong | [
"Starts",
"the",
"link",
"validation",
"thread",
"for",
"the",
"project",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/projects/CmsPublishProjectReport.java#L215-L232 |
kaichunlin/android-transition | core/src/main/java/com/kaichunlin/transition/AbstractTransitionBuilder.java | AbstractTransitionBuilder.transitInt | public T transitInt(int propertyId, int... vals) {
"""
Transits a float property from the start value to the end value.
@param propertyId
@param vals
@return self
"""
String property = getPropertyName(propertyId);
mHolders.put(propertyId, PropertyValuesHolder.ofInt(property, vals));
... | java | public T transitInt(int propertyId, int... vals) {
String property = getPropertyName(propertyId);
mHolders.put(propertyId, PropertyValuesHolder.ofInt(property, vals));
mShadowHolders.put(propertyId, ShadowValuesHolder.ofInt(property, vals));
return self();
} | [
"public",
"T",
"transitInt",
"(",
"int",
"propertyId",
",",
"int",
"...",
"vals",
")",
"{",
"String",
"property",
"=",
"getPropertyName",
"(",
"propertyId",
")",
";",
"mHolders",
".",
"put",
"(",
"propertyId",
",",
"PropertyValuesHolder",
".",
"ofInt",
"(",
... | Transits a float property from the start value to the end value.
@param propertyId
@param vals
@return self | [
"Transits",
"a",
"float",
"property",
"from",
"the",
"start",
"value",
"to",
"the",
"end",
"value",
"."
] | train | https://github.com/kaichunlin/android-transition/blob/7b53074206622f5cf5d82091d891a7ed8b9f06cd/core/src/main/java/com/kaichunlin/transition/AbstractTransitionBuilder.java#L656-L661 |
samskivert/pythagoras | src/main/java/pythagoras/i/Points.java | Points.manhattanDistance | public static int manhattanDistance (int x1, int y1, int x2, int y2) {
"""
Returns the Manhattan distance between the specified two points.
"""
return Math.abs(x2 - x1) + Math.abs(y2 - y1);
} | java | public static int manhattanDistance (int x1, int y1, int x2, int y2)
{
return Math.abs(x2 - x1) + Math.abs(y2 - y1);
} | [
"public",
"static",
"int",
"manhattanDistance",
"(",
"int",
"x1",
",",
"int",
"y1",
",",
"int",
"x2",
",",
"int",
"y2",
")",
"{",
"return",
"Math",
".",
"abs",
"(",
"x2",
"-",
"x1",
")",
"+",
"Math",
".",
"abs",
"(",
"y2",
"-",
"y1",
")",
";",
... | Returns the Manhattan distance between the specified two points. | [
"Returns",
"the",
"Manhattan",
"distance",
"between",
"the",
"specified",
"two",
"points",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/i/Points.java#L32-L35 |
UrielCh/ovh-java-sdk | ovh-java-sdk-connectivity/src/main/java/net/minidev/ovh/api/ApiOvhConnectivity.java | ApiOvhConnectivity.eligibility_search_buildingsByLine_POST | public OvhAsyncTaskArray<OvhBuilding> eligibility_search_buildingsByLine_POST(String lineNumber, OvhLineStatusEnum status) throws IOException {
"""
Get building references from a given line number
REST: POST /connectivity/eligibility/search/buildingsByLine
@param lineNumber [required] Line number
@param statu... | java | public OvhAsyncTaskArray<OvhBuilding> eligibility_search_buildingsByLine_POST(String lineNumber, OvhLineStatusEnum status) throws IOException {
String qPath = "/connectivity/eligibility/search/buildingsByLine";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, ... | [
"public",
"OvhAsyncTaskArray",
"<",
"OvhBuilding",
">",
"eligibility_search_buildingsByLine_POST",
"(",
"String",
"lineNumber",
",",
"OvhLineStatusEnum",
"status",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/connectivity/eligibility/search/buildingsByLine\"",... | Get building references from a given line number
REST: POST /connectivity/eligibility/search/buildingsByLine
@param lineNumber [required] Line number
@param status [required] Status of the line number | [
"Get",
"building",
"references",
"from",
"a",
"given",
"line",
"number"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-connectivity/src/main/java/net/minidev/ovh/api/ApiOvhConnectivity.java#L139-L147 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/HybridRunbookWorkerGroupsInner.java | HybridRunbookWorkerGroupsInner.getAsync | public Observable<HybridRunbookWorkerGroupInner> getAsync(String resourceGroupName, String automationAccountName, String hybridRunbookWorkerGroupName) {
"""
Retrieve a hybrid runbook worker group.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation ... | java | public Observable<HybridRunbookWorkerGroupInner> getAsync(String resourceGroupName, String automationAccountName, String hybridRunbookWorkerGroupName) {
return getWithServiceResponseAsync(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName).map(new Func1<ServiceResponse<HybridRunbookWorkerGro... | [
"public",
"Observable",
"<",
"HybridRunbookWorkerGroupInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"hybridRunbookWorkerGroupName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName... | Retrieve a hybrid runbook worker group.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param hybridRunbookWorkerGroupName The hybrid runbook worker group name
@throws IllegalArgumentException thrown if parameters fail the validation
@return t... | [
"Retrieve",
"a",
"hybrid",
"runbook",
"worker",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/HybridRunbookWorkerGroupsInner.java#L216-L223 |
trellis-ldp/trellis | core/http/src/main/java/org/trellisldp/http/impl/GetHandler.java | GetHandler.addMementoHeaders | public ResponseBuilder addMementoHeaders(final ResponseBuilder builder, final SortedSet<Instant> mementos) {
"""
Add the memento headers.
@param builder the ResponseBuilder
@param mementos the list of memento ranges
@return the response builder
"""
// Only show memento links for the user-managed gra... | java | public ResponseBuilder addMementoHeaders(final ResponseBuilder builder, final SortedSet<Instant> mementos) {
// Only show memento links for the user-managed graph (not ACL)
if (!ACL.equals(getRequest().getExt())) {
builder.link(getIdentifier(), "original timegate")
.links(Mem... | [
"public",
"ResponseBuilder",
"addMementoHeaders",
"(",
"final",
"ResponseBuilder",
"builder",
",",
"final",
"SortedSet",
"<",
"Instant",
">",
"mementos",
")",
"{",
"// Only show memento links for the user-managed graph (not ACL)",
"if",
"(",
"!",
"ACL",
".",
"equals",
"... | Add the memento headers.
@param builder the ResponseBuilder
@param mementos the list of memento ranges
@return the response builder | [
"Add",
"the",
"memento",
"headers",
"."
] | train | https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/core/http/src/main/java/org/trellisldp/http/impl/GetHandler.java#L242-L251 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/crypto/CertUtils.java | CertUtils.isExpired | public static boolean isExpired(final X509CRL crl, final ZonedDateTime reference) {
"""
Determines whether the given CRL is expired by comparing the nextUpdate field
with a given date.
@param crl CRL to examine.
@param reference Reference date for comparison.
@return True if reference date is after CRL... | java | public static boolean isExpired(final X509CRL crl, final ZonedDateTime reference) {
return reference.isAfter(DateTimeUtils.zonedDateTimeOf(crl.getNextUpdate()));
} | [
"public",
"static",
"boolean",
"isExpired",
"(",
"final",
"X509CRL",
"crl",
",",
"final",
"ZonedDateTime",
"reference",
")",
"{",
"return",
"reference",
".",
"isAfter",
"(",
"DateTimeUtils",
".",
"zonedDateTimeOf",
"(",
"crl",
".",
"getNextUpdate",
"(",
")",
"... | Determines whether the given CRL is expired by comparing the nextUpdate field
with a given date.
@param crl CRL to examine.
@param reference Reference date for comparison.
@return True if reference date is after CRL next update, false otherwise. | [
"Determines",
"whether",
"the",
"given",
"CRL",
"is",
"expired",
"by",
"comparing",
"the",
"nextUpdate",
"field",
"with",
"a",
"given",
"date",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/crypto/CertUtils.java#L55-L57 |
phoenixnap/springmvc-raml-plugin | src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/helpers/SchemaHelper.java | SchemaHelper.resolveSchema | public static String resolveSchema(String schema, RamlRoot document) {
"""
Utility method that will return a schema if the identifier is valid and
exists in the raml file definition.
@param schema
The name of the schema to resolve
@param document
The Parent Raml Document
@return The full schema if containe... | java | public static String resolveSchema(String schema, RamlRoot document) {
if (document == null || schema == null || schema.indexOf("{") != -1) {
return null;
}
if (document.getSchemas() != null && !document.getSchemas().isEmpty()) {
for (Map<String, String> map : document.getSchemas()) {
if (map.containsKe... | [
"public",
"static",
"String",
"resolveSchema",
"(",
"String",
"schema",
",",
"RamlRoot",
"document",
")",
"{",
"if",
"(",
"document",
"==",
"null",
"||",
"schema",
"==",
"null",
"||",
"schema",
".",
"indexOf",
"(",
"\"{\"",
")",
"!=",
"-",
"1",
")",
"{... | Utility method that will return a schema if the identifier is valid and
exists in the raml file definition.
@param schema
The name of the schema to resolve
@param document
The Parent Raml Document
@return The full schema if contained in the raml document or null if not
found | [
"Utility",
"method",
"that",
"will",
"return",
"a",
"schema",
"if",
"the",
"identifier",
"is",
"valid",
"and",
"exists",
"in",
"the",
"raml",
"file",
"definition",
"."
] | train | https://github.com/phoenixnap/springmvc-raml-plugin/blob/6387072317cd771eb7d6f30943f556ac20dd3c84/src/main/java/com/phoenixnap/oss/ramlplugin/raml2code/helpers/SchemaHelper.java#L68-L80 |
sksamuel/scrimage | scrimage-filters/src/main/java/thirdparty/marvin/image/MarvinImage.java | MarvinImage.getBufferedImage | public BufferedImage getBufferedImage(int width, int height, int type) {
"""
Resize and return the image passing the new height and width, but maintains width/height factor
@param height
@param width
@return
"""
int wDif,
hDif,
fWidth = 0,
fHeight = ... | java | public BufferedImage getBufferedImage(int width, int height, int type) {
int wDif,
hDif,
fWidth = 0,
fHeight = 0;
double imgWidth,
imgHeight;
double factor;
imgWidth = image.getWidth();
imgHeight = image.getHeight(... | [
"public",
"BufferedImage",
"getBufferedImage",
"(",
"int",
"width",
",",
"int",
"height",
",",
"int",
"type",
")",
"{",
"int",
"wDif",
",",
"hDif",
",",
"fWidth",
"=",
"0",
",",
"fHeight",
"=",
"0",
";",
"double",
"imgWidth",
",",
"imgHeight",
";",
"do... | Resize and return the image passing the new height and width, but maintains width/height factor
@param height
@param width
@return | [
"Resize",
"and",
"return",
"the",
"image",
"passing",
"the",
"new",
"height",
"and",
"width",
"but",
"maintains",
"width",
"/",
"height",
"factor"
] | train | https://github.com/sksamuel/scrimage/blob/52dab448136e6657a71951b0e6b7d5e64dc979ac/scrimage-filters/src/main/java/thirdparty/marvin/image/MarvinImage.java#L497-L525 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java | AppServicePlansInner.listWebAppsByHybridConnectionAsync | public Observable<Page<String>> listWebAppsByHybridConnectionAsync(final String resourceGroupName, final String name, final String namespaceName, final String relayName) {
"""
Get all apps that use a Hybrid Connection in an App Service Plan.
Get all apps that use a Hybrid Connection in an App Service Plan.
@pa... | java | public Observable<Page<String>> listWebAppsByHybridConnectionAsync(final String resourceGroupName, final String name, final String namespaceName, final String relayName) {
return listWebAppsByHybridConnectionWithServiceResponseAsync(resourceGroupName, name, namespaceName, relayName)
.map(new Func1<S... | [
"public",
"Observable",
"<",
"Page",
"<",
"String",
">",
">",
"listWebAppsByHybridConnectionAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
",",
"final",
"String",
"namespaceName",
",",
"final",
"String",
"relayName",
")",
"{",... | Get all apps that use a Hybrid Connection in an App Service Plan.
Get all apps that use a Hybrid Connection in an App Service Plan.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service plan.
@param namespaceName Name of the Hybrid Connection namespace.
... | [
"Get",
"all",
"apps",
"that",
"use",
"a",
"Hybrid",
"Connection",
"in",
"an",
"App",
"Service",
"Plan",
".",
"Get",
"all",
"apps",
"that",
"use",
"a",
"Hybrid",
"Connection",
"in",
"an",
"App",
"Service",
"Plan",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServicePlansInner.java#L1492-L1500 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/widget/MapWidget.java | MapWidget.setScalebarEnabled | public void setScalebarEnabled(boolean enabled) {
"""
Enables or disables the scale bar. This setting has immediate effect on the map.
@param enabled
set status
"""
scaleBarEnabled = enabled;
final String scaleBarId = "scalebar";
if (scaleBarEnabled) {
if (!getMapAddons().containsKey(scaleBarId))... | java | public void setScalebarEnabled(boolean enabled) {
scaleBarEnabled = enabled;
final String scaleBarId = "scalebar";
if (scaleBarEnabled) {
if (!getMapAddons().containsKey(scaleBarId)) {
ScaleBar scalebar = new ScaleBar(scaleBarId, this);
scalebar.setVerticalAlignment(VerticalAlignment.BOTTOM);
scal... | [
"public",
"void",
"setScalebarEnabled",
"(",
"boolean",
"enabled",
")",
"{",
"scaleBarEnabled",
"=",
"enabled",
";",
"final",
"String",
"scaleBarId",
"=",
"\"scalebar\"",
";",
"if",
"(",
"scaleBarEnabled",
")",
"{",
"if",
"(",
"!",
"getMapAddons",
"(",
")",
... | Enables or disables the scale bar. This setting has immediate effect on the map.
@param enabled
set status | [
"Enables",
"or",
"disables",
"the",
"scale",
"bar",
".",
"This",
"setting",
"has",
"immediate",
"effect",
"on",
"the",
"map",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/widget/MapWidget.java#L727-L744 |
protegeproject/jpaul | src/main/java/jpaul/DataStructs/DSUtil.java | DSUtil.mapColl | public static <E1,E2> Collection<E2> mapColl(Iterable<E1> coll, Map<E1,E2> map, Collection<E2> newColl) {
"""
Similar to teh other <code>mapColl</code> method, but the
function is given as a map. This map is expected to map all
elements from the entry collection <code>coll</code>.
@see #mapColl(Iterable, Fun... | java | public static <E1,E2> Collection<E2> mapColl(Iterable<E1> coll, Map<E1,E2> map, Collection<E2> newColl) {
return mapColl(coll, map2fun(map), newColl);
} | [
"public",
"static",
"<",
"E1",
",",
"E2",
">",
"Collection",
"<",
"E2",
">",
"mapColl",
"(",
"Iterable",
"<",
"E1",
">",
"coll",
",",
"Map",
"<",
"E1",
",",
"E2",
">",
"map",
",",
"Collection",
"<",
"E2",
">",
"newColl",
")",
"{",
"return",
"mapC... | Similar to teh other <code>mapColl</code> method, but the
function is given as a map. This map is expected to map all
elements from the entry collection <code>coll</code>.
@see #mapColl(Iterable, Function, Collection) | [
"Similar",
"to",
"teh",
"other",
"<code",
">",
"mapColl<",
"/",
"code",
">",
"method",
"but",
"the",
"function",
"is",
"given",
"as",
"a",
"map",
".",
"This",
"map",
"is",
"expected",
"to",
"map",
"all",
"elements",
"from",
"the",
"entry",
"collection",
... | train | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/DSUtil.java#L279-L281 |
apache/groovy | src/main/java/org/codehaus/groovy/classgen/InnerClassCompletionVisitor.java | InnerClassCompletionVisitor.addCompilationErrorOnCustomMethodNode | private void addCompilationErrorOnCustomMethodNode(InnerClassNode node, String methodName, Parameter[] parameters) {
"""
Adds a compilation error if a {@link MethodNode} with the given <tt>methodName</tt> and
<tt>parameters</tt> exists in the {@link InnerClassNode}.
"""
MethodNode existingMethodNode =... | java | private void addCompilationErrorOnCustomMethodNode(InnerClassNode node, String methodName, Parameter[] parameters) {
MethodNode existingMethodNode = node.getMethod(methodName, parameters);
// if there is a user-defined methodNode, add compiler error msg and continue
if (existingMethodNode != nul... | [
"private",
"void",
"addCompilationErrorOnCustomMethodNode",
"(",
"InnerClassNode",
"node",
",",
"String",
"methodName",
",",
"Parameter",
"[",
"]",
"parameters",
")",
"{",
"MethodNode",
"existingMethodNode",
"=",
"node",
".",
"getMethod",
"(",
"methodName",
",",
"pa... | Adds a compilation error if a {@link MethodNode} with the given <tt>methodName</tt> and
<tt>parameters</tt> exists in the {@link InnerClassNode}. | [
"Adds",
"a",
"compilation",
"error",
"if",
"a",
"{"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/InnerClassCompletionVisitor.java#L349-L358 |
ykrasik/jaci | jaci-cli-core/src/main/java/com/github/ykrasik/jaci/cli/output/CliPrinter.java | CliPrinter.printCommand | public void printCommand(CliCommand command) {
"""
Print a command (it's name, description and parameters).
@param command Command to describe.
"""
final PrintContext context = new PrintContext();
// Print command name : description
printIdentifiable(context, command);
// P... | java | public void printCommand(CliCommand command) {
final PrintContext context = new PrintContext();
// Print command name : description
printIdentifiable(context, command);
// Print each param name : description
printIdentifiables(context, command.getParams());
} | [
"public",
"void",
"printCommand",
"(",
"CliCommand",
"command",
")",
"{",
"final",
"PrintContext",
"context",
"=",
"new",
"PrintContext",
"(",
")",
";",
"// Print command name : description",
"printIdentifiable",
"(",
"context",
",",
"command",
")",
";",
"// Print e... | Print a command (it's name, description and parameters).
@param command Command to describe. | [
"Print",
"a",
"command",
"(",
"it",
"s",
"name",
"description",
"and",
"parameters",
")",
"."
] | train | https://github.com/ykrasik/jaci/blob/4615edef7c76288ad5ea8d678132b161645ca1e3/jaci-cli-core/src/main/java/com/github/ykrasik/jaci/cli/output/CliPrinter.java#L132-L140 |
openengsb/openengsb | components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/InstantiateOperation.java | InstantiateOperation.initiateByMethodName | private Object initiateByMethodName(Class<?> targetClass, String initMethodName, List<Object> objects)
throws Exception {
"""
Tries to initiate an object of the target class through the given init method name with the given object as
parameter.
"""
Method method = targetClass.getMethod(initMet... | java | private Object initiateByMethodName(Class<?> targetClass, String initMethodName, List<Object> objects)
throws Exception {
Method method = targetClass.getMethod(initMethodName, getClassList(objects));
if (Modifier.isStatic(method.getModifiers())) {
return method.invoke(null, objects.t... | [
"private",
"Object",
"initiateByMethodName",
"(",
"Class",
"<",
"?",
">",
"targetClass",
",",
"String",
"initMethodName",
",",
"List",
"<",
"Object",
">",
"objects",
")",
"throws",
"Exception",
"{",
"Method",
"method",
"=",
"targetClass",
".",
"getMethod",
"("... | Tries to initiate an object of the target class through the given init method name with the given object as
parameter. | [
"Tries",
"to",
"initiate",
"an",
"object",
"of",
"the",
"target",
"class",
"through",
"the",
"given",
"init",
"method",
"name",
"with",
"the",
"given",
"object",
"as",
"parameter",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/ekb/transformation-wonderland/src/main/java/org/openengsb/core/ekb/transformation/wonderland/internal/operation/InstantiateOperation.java#L103-L111 |
apereo/cas | core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java | WebUtils.putServiceIntoFlashScope | public static void putServiceIntoFlashScope(final RequestContext context, final Service service) {
"""
Put service into flashscope.
@param context the context
@param service the service
"""
context.getFlashScope().put(PARAMETER_SERVICE, service);
} | java | public static void putServiceIntoFlashScope(final RequestContext context, final Service service) {
context.getFlashScope().put(PARAMETER_SERVICE, service);
} | [
"public",
"static",
"void",
"putServiceIntoFlashScope",
"(",
"final",
"RequestContext",
"context",
",",
"final",
"Service",
"service",
")",
"{",
"context",
".",
"getFlashScope",
"(",
")",
".",
"put",
"(",
"PARAMETER_SERVICE",
",",
"service",
")",
";",
"}"
] | Put service into flashscope.
@param context the context
@param service the service | [
"Put",
"service",
"into",
"flashscope",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java#L309-L311 |
telly/groundy | library/src/main/java/com/telly/groundy/DeviceStatus.java | DeviceStatus.keepCpuAwake | public static void keepCpuAwake(Context context, boolean awake) {
"""
Register a wake lock to power management in the device.
@param context Context to use
@param awake if true the device cpu will keep awake until false is called back. if true is
passed several times only the first time after a false call wil... | java | public static void keepCpuAwake(Context context, boolean awake) {
if (cpuWakeLock == null) {
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
if (pm != null) {
cpuWakeLock =
pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE... | [
"public",
"static",
"void",
"keepCpuAwake",
"(",
"Context",
"context",
",",
"boolean",
"awake",
")",
"{",
"if",
"(",
"cpuWakeLock",
"==",
"null",
")",
"{",
"PowerManager",
"pm",
"=",
"(",
"PowerManager",
")",
"context",
".",
"getSystemService",
"(",
"Context... | Register a wake lock to power management in the device.
@param context Context to use
@param awake if true the device cpu will keep awake until false is called back. if true is
passed several times only the first time after a false call will take effect,
also if false is passed and previously the cpu was not turned on... | [
"Register",
"a",
"wake",
"lock",
"to",
"power",
"management",
"in",
"the",
"device",
"."
] | train | https://github.com/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/DeviceStatus.java#L85-L103 |
google/closure-templates | java/src/com/google/template/soy/types/SoyTypeRegistry.java | SoyTypeRegistry.getOrCreateRecordType | public RecordType getOrCreateRecordType(Map<String, SoyType> fields) {
"""
Factory function which creates a record type, given a map of fields. This folds map types with
identical key/value types together, so asking for the same key/value type twice will return a
pointer to the same type object.
@param fields... | java | public RecordType getOrCreateRecordType(Map<String, SoyType> fields) {
return recordTypes.intern(RecordType.of(fields));
} | [
"public",
"RecordType",
"getOrCreateRecordType",
"(",
"Map",
"<",
"String",
",",
"SoyType",
">",
"fields",
")",
"{",
"return",
"recordTypes",
".",
"intern",
"(",
"RecordType",
".",
"of",
"(",
"fields",
")",
")",
";",
"}"
] | Factory function which creates a record type, given a map of fields. This folds map types with
identical key/value types together, so asking for the same key/value type twice will return a
pointer to the same type object.
@param fields The map containing field names and types.
@return The record type. | [
"Factory",
"function",
"which",
"creates",
"a",
"record",
"type",
"given",
"a",
"map",
"of",
"fields",
".",
"This",
"folds",
"map",
"types",
"with",
"identical",
"key",
"/",
"value",
"types",
"together",
"so",
"asking",
"for",
"the",
"same",
"key",
"/",
... | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/types/SoyTypeRegistry.java#L297-L299 |
aws/aws-sdk-java | aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/ListInventoryEntriesResult.java | ListInventoryEntriesResult.withEntries | public ListInventoryEntriesResult withEntries(java.util.Collection<java.util.Map<String, String>> entries) {
"""
<p>
A list of inventory items on the instance(s).
</p>
@param entries
A list of inventory items on the instance(s).
@return Returns a reference to this object so that method calls can be chained ... | java | public ListInventoryEntriesResult withEntries(java.util.Collection<java.util.Map<String, String>> entries) {
setEntries(entries);
return this;
} | [
"public",
"ListInventoryEntriesResult",
"withEntries",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
">",
"entries",
")",
"{",
"setEntries",
"(",
"entries",
")",
";",
"return",
"this",... | <p>
A list of inventory items on the instance(s).
</p>
@param entries
A list of inventory items on the instance(s).
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"A",
"list",
"of",
"inventory",
"items",
"on",
"the",
"instance",
"(",
"s",
")",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/ListInventoryEntriesResult.java#L292-L295 |
hal/core | gui/src/main/java/org/jboss/as/console/client/domain/model/impl/ServerGroupDAOImpl.java | ServerGroupDAOImpl.model2ServerGroup | private ServerGroupRecord model2ServerGroup(String groupName, ModelNode model) {
"""
Turns a server group DMR model into a strongly typed entity
@param groupName
@param model
@return
"""
ServerGroupRecord record = factory.serverGroup().as();
record.setName(groupName);
record.setProf... | java | private ServerGroupRecord model2ServerGroup(String groupName, ModelNode model) {
ServerGroupRecord record = factory.serverGroup().as();
record.setName(groupName);
record.setProfileName(model.get("profile").asString());
record.setSocketBinding(model.get("socket-binding-group").asString()... | [
"private",
"ServerGroupRecord",
"model2ServerGroup",
"(",
"String",
"groupName",
",",
"ModelNode",
"model",
")",
"{",
"ServerGroupRecord",
"record",
"=",
"factory",
".",
"serverGroup",
"(",
")",
".",
"as",
"(",
")",
";",
"record",
".",
"setName",
"(",
"groupNa... | Turns a server group DMR model into a strongly typed entity
@param groupName
@param model
@return | [
"Turns",
"a",
"server",
"group",
"DMR",
"model",
"into",
"a",
"strongly",
"typed",
"entity"
] | train | https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/client/domain/model/impl/ServerGroupDAOImpl.java#L217-L235 |
landawn/AbacusUtil | src/com/landawn/abacus/util/JdbcUtil.java | JdbcUtil.importData | public static int importData(final DataSet dataset, final Collection<String> selectColumnNames, final int offset, final int count,
final PreparedStatement stmt, final int batchSize, final int batchInterval) throws UncheckedSQLException {
"""
Imports the data from <code>DataSet</code> to database.
@... | java | public static int importData(final DataSet dataset, final Collection<String> selectColumnNames, final int offset, final int count,
final PreparedStatement stmt, final int batchSize, final int batchInterval) throws UncheckedSQLException {
return importData(dataset, selectColumnNames, offset, count,... | [
"public",
"static",
"int",
"importData",
"(",
"final",
"DataSet",
"dataset",
",",
"final",
"Collection",
"<",
"String",
">",
"selectColumnNames",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"count",
",",
"final",
"PreparedStatement",
"stmt",
",",
"fina... | Imports the data from <code>DataSet</code> to database.
@param dataset
@param selectColumnNames
@param offset
@param count
@param stmt the column order in the sql must be consistent with the column order in the DataSet.
@return
@throws UncheckedSQLException | [
"Imports",
"the",
"data",
"from",
"<code",
">",
"DataSet<",
"/",
"code",
">",
"to",
"database",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/JdbcUtil.java#L2220-L2223 |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/login/TypicalLoginAssist.java | TypicalLoginAssist.createRememberMeKey | protected String createRememberMeKey(USER_ENTITY userEntity, USER_BEAN userBean) {
"""
Create remember-me key for the user. <br>
You can change user key's structure by override. #change_user_key
@param userEntity The selected entity of login user. (NotNull)
@param userBean The user bean saved in session. (NotNu... | java | protected String createRememberMeKey(USER_ENTITY userEntity, USER_BEAN userBean) {
return String.valueOf(userBean.getUserId()); // as default (override if it needs)
} | [
"protected",
"String",
"createRememberMeKey",
"(",
"USER_ENTITY",
"userEntity",
",",
"USER_BEAN",
"userBean",
")",
"{",
"return",
"String",
".",
"valueOf",
"(",
"userBean",
".",
"getUserId",
"(",
")",
")",
";",
"// as default (override if it needs)",
"}"
] | Create remember-me key for the user. <br>
You can change user key's structure by override. #change_user_key
@param userEntity The selected entity of login user. (NotNull)
@param userBean The user bean saved in session. (NotNull)
@return The string expression for remember-me key. (NotNull) | [
"Create",
"remember",
"-",
"me",
"key",
"for",
"the",
"user",
".",
"<br",
">",
"You",
"can",
"change",
"user",
"key",
"s",
"structure",
"by",
"override",
".",
"#change_user_key"
] | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/login/TypicalLoginAssist.java#L466-L468 |
sangupta/jerry-web | src/main/java/com/sangupta/jerry/web/filters/JavascriptReorderingFilter.java | JavascriptReorderingFilter.doFilter | @Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
"""
Move all included JavaScript files to the end of <code>BODY</code> tag in the same order
that they appeared in the original HTML response.
@param s... | java | @Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
// try and see if this request is for an HTML page
HttpServletRequest request = (HttpServletRequest) servletRequest;
String uri = request.get... | [
"@",
"Override",
"public",
"void",
"doFilter",
"(",
"ServletRequest",
"servletRequest",
",",
"ServletResponse",
"servletResponse",
",",
"FilterChain",
"filterChain",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"// try and see if this request is for an HTML pag... | Move all included JavaScript files to the end of <code>BODY</code> tag in the same order
that they appeared in the original HTML response.
@param servletRequest
the incoming {@link ServletRequest} instance
@param servletResponse
the outgoing {@link ServletResponse} instance
@param filterChain
the {@link FilterChain}... | [
"Move",
"all",
"included",
"JavaScript",
"files",
"to",
"the",
"end",
"of",
"<code",
">",
"BODY<",
"/",
"code",
">",
"tag",
"in",
"the",
"same",
"order",
"that",
"they",
"appeared",
"in",
"the",
"original",
"HTML",
"response",
"."
] | train | https://github.com/sangupta/jerry-web/blob/f0d02a5d6e7d1c15292509ce588caf52a4ddb895/src/main/java/com/sangupta/jerry/web/filters/JavascriptReorderingFilter.java#L93-L130 |
pmwmedia/tinylog | benchmarks/src/main/java/org/tinylog/benchmarks/api/WritingBenchmark.java | WritingBenchmark.byteBufferFileChannel | @Benchmark
@BenchmarkMode(Mode.AverageTime)
public void byteBufferFileChannel(final Configuration configuration) throws IOException {
"""
Benchmarks writing via {@link FileChannel} with using a {@link ByteBuffer} for buffering.
@param configuration
Configuration with target file
@throws IOException
Failed ... | java | @Benchmark
@BenchmarkMode(Mode.AverageTime)
public void byteBufferFileChannel(final Configuration configuration) throws IOException {
ByteBuffer buffer = ByteBuffer.allocate(BUFFER_CAPACITY);
try (RandomAccessFile file = new RandomAccessFile(configuration.file, "rw")) {
try (FileChannel channel = file.getChan... | [
"@",
"Benchmark",
"@",
"BenchmarkMode",
"(",
"Mode",
".",
"AverageTime",
")",
"public",
"void",
"byteBufferFileChannel",
"(",
"final",
"Configuration",
"configuration",
")",
"throws",
"IOException",
"{",
"ByteBuffer",
"buffer",
"=",
"ByteBuffer",
".",
"allocate",
... | Benchmarks writing via {@link FileChannel} with using a {@link ByteBuffer} for buffering.
@param configuration
Configuration with target file
@throws IOException
Failed to write to target file | [
"Benchmarks",
"writing",
"via",
"{",
"@link",
"FileChannel",
"}",
"with",
"using",
"a",
"{",
"@link",
"ByteBuffer",
"}",
"for",
"buffering",
"."
] | train | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/benchmarks/src/main/java/org/tinylog/benchmarks/api/WritingBenchmark.java#L217-L244 |
elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/BetaDistribution.java | BetaDistribution.regularizedIncBeta | public static double regularizedIncBeta(double x, double alpha, double beta) {
"""
Computes the regularized incomplete beta function I_x(a, b) which is also
the CDF of the beta distribution. Based on the book "Numerical Recipes"
@param alpha Parameter a
@param beta Parameter b
@param x Parameter x
@return V... | java | public static double regularizedIncBeta(double x, double alpha, double beta) {
if(alpha <= 0.0 || beta <= 0.0 || Double.isNaN(alpha) || Double.isNaN(beta) || Double.isNaN(x)) {
return Double.NaN;
}
if(x <= 0.0) {
return 0.0;
}
if(x >= 1.0) {
return 1.0;
}
if(alpha > SWITCH ... | [
"public",
"static",
"double",
"regularizedIncBeta",
"(",
"double",
"x",
",",
"double",
"alpha",
",",
"double",
"beta",
")",
"{",
"if",
"(",
"alpha",
"<=",
"0.0",
"||",
"beta",
"<=",
"0.0",
"||",
"Double",
".",
"isNaN",
"(",
"alpha",
")",
"||",
"Double"... | Computes the regularized incomplete beta function I_x(a, b) which is also
the CDF of the beta distribution. Based on the book "Numerical Recipes"
@param alpha Parameter a
@param beta Parameter b
@param x Parameter x
@return Value of the regularized incomplete beta function | [
"Computes",
"the",
"regularized",
"incomplete",
"beta",
"function",
"I_x",
"(",
"a",
"b",
")",
"which",
"is",
"also",
"the",
"CDF",
"of",
"the",
"beta",
"distribution",
".",
"Based",
"on",
"the",
"book",
"Numerical",
"Recipes"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/BetaDistribution.java#L241-L258 |
Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/query/values/JcElement.java | JcElement.numberProperty | public JcNumber numberProperty(String name) {
"""
<div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>access a named number property, return a <b>JcNumber</b></i></div>
<br/>
"""
JcNumber ret = new JcNumber(name, this, OP... | java | public JcNumber numberProperty(String name) {
JcNumber ret = new JcNumber(name, this, OPERATOR.PropertyContainer.PROPERTY_ACCESS);
QueryRecorder.recordInvocationConditional(this, "numberProperty", ret, QueryRecorder.literal(name));
return ret;
} | [
"public",
"JcNumber",
"numberProperty",
"(",
"String",
"name",
")",
"{",
"JcNumber",
"ret",
"=",
"new",
"JcNumber",
"(",
"name",
",",
"this",
",",
"OPERATOR",
".",
"PropertyContainer",
".",
"PROPERTY_ACCESS",
")",
";",
"QueryRecorder",
".",
"recordInvocationCond... | <div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>access a named number property, return a <b>JcNumber</b></i></div>
<br/> | [
"<div",
"color",
"=",
"red",
"style",
"=",
"font",
"-",
"size",
":",
"24px",
";",
"color",
":",
"red",
">",
"<b",
">",
"<i",
">",
"<u",
">",
"JCYPHER<",
"/",
"u",
">",
"<",
"/",
"i",
">",
"<",
"/",
"b",
">",
"<",
"/",
"div",
">",
"<div",
... | train | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/query/values/JcElement.java#L64-L68 |
cdapio/tigon | tigon-api/src/main/java/co/cask/tigon/api/common/Bytes.java | Bytes.toInt | public static int toInt(byte[] bytes, int offset, final int length) {
"""
Converts a byte array to an int value.
@param bytes byte array
@param offset offset into array
@param length length of int (has to be {@link #SIZEOF_INT})
@return the int value
@throws IllegalArgumentException if length is not {@link #S... | java | public static int toInt(byte[] bytes, int offset, final int length) {
if (length != SIZEOF_INT || offset + length > bytes.length) {
throw explainWrongLengthOrOffset(bytes, offset, length, SIZEOF_INT);
}
int n = 0;
for (int i = offset; i < (offset + length); i++) {
n <<= 8;
n ^= bytes[i... | [
"public",
"static",
"int",
"toInt",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"final",
"int",
"length",
")",
"{",
"if",
"(",
"length",
"!=",
"SIZEOF_INT",
"||",
"offset",
"+",
"length",
">",
"bytes",
".",
"length",
")",
"{",
"throw",... | Converts a byte array to an int value.
@param bytes byte array
@param offset offset into array
@param length length of int (has to be {@link #SIZEOF_INT})
@return the int value
@throws IllegalArgumentException if length is not {@link #SIZEOF_INT} or
if there's not enough room in the array at the offset indicated. | [
"Converts",
"a",
"byte",
"array",
"to",
"an",
"int",
"value",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-api/src/main/java/co/cask/tigon/api/common/Bytes.java#L567-L577 |
NLPchina/ansj_seg | src/main/java/org/ansj/app/extracting/ExtractingTask.java | ExtractingTask._validate | private boolean _validate(Token token, Term term) {
"""
验证term的名字或者词性是否符合条件
@param token
@param term
@return true, 不符合,false 符合
"""
if (token == null) {
return true;
}
Set<String> terms = token.getTerms();
if ((!terms.contains(Token.ALL)) && !terms.contains(term.getName()) && !(terms.contain... | java | private boolean _validate(Token token, Term term) {
if (token == null) {
return true;
}
Set<String> terms = token.getTerms();
if ((!terms.contains(Token.ALL)) && !terms.contains(term.getName()) && !(terms.contains(":" + term.getNatureStr()))) {
return true;
}
boolean flag = token.getRegexs().size()... | [
"private",
"boolean",
"_validate",
"(",
"Token",
"token",
",",
"Term",
"term",
")",
"{",
"if",
"(",
"token",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"Set",
"<",
"String",
">",
"terms",
"=",
"token",
".",
"getTerms",
"(",
")",
";",
"if",... | 验证term的名字或者词性是否符合条件
@param token
@param term
@return true, 不符合,false 符合 | [
"验证term的名字或者词性是否符合条件"
] | train | https://github.com/NLPchina/ansj_seg/blob/1addfa08c9dc86872fcdb06c7f0955dd5d197585/src/main/java/org/ansj/app/extracting/ExtractingTask.java#L169-L190 |
medallia/Word2VecJava | src/main/java/com/medallia/word2vec/util/IO.java | IO.createTempFile | public static File createTempFile(byte[] fileContents, String namePrefix, String extension) throws IOException {
"""
Stores the given contents into a temporary file
@param fileContents the raw contents to store in the temporary file
@param namePrefix the desired file name prefix (must be at least 3 characters lo... | java | public static File createTempFile(byte[] fileContents, String namePrefix, String extension) throws IOException {
Preconditions.checkNotNull(fileContents, "file contents missing");
File tempFile = File.createTempFile(namePrefix, extension);
try (FileOutputStream fos = new FileOutputStream(tempFile)) {
fos.write... | [
"public",
"static",
"File",
"createTempFile",
"(",
"byte",
"[",
"]",
"fileContents",
",",
"String",
"namePrefix",
",",
"String",
"extension",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"fileContents",
",",
"\"file contents missing\... | Stores the given contents into a temporary file
@param fileContents the raw contents to store in the temporary file
@param namePrefix the desired file name prefix (must be at least 3 characters long)
@param extension the desired extension including the '.' character (use null for '.tmp')
@return a {@link File} referenc... | [
"Stores",
"the",
"given",
"contents",
"into",
"a",
"temporary",
"file"
] | train | https://github.com/medallia/Word2VecJava/blob/eb31fbb99ac6bbab82d7f807b3e2240edca50eb7/src/main/java/com/medallia/word2vec/util/IO.java#L248-L255 |
skuzzle/jeve | jeve/src/main/java/de/skuzzle/jeve/stores/DefaultListenerStoreImpl.java | DefaultListenerStoreImpl.removeInternal | @Deprecated
protected <T extends Listener> void removeInternal(Class<T> listenerClass,
Iterator<Object> it) {
"""
Internal method for removing a single listener and notifying it about the
removal. Prior to calling this method, the passed iterators
{@link Iterator#hasNext() hasNext} method must ho... | java | @Deprecated
protected <T extends Listener> void removeInternal(Class<T> listenerClass,
Iterator<Object> it) {
final Object next = it.next();
final T listener = listenerClass.cast(next);
it.remove();
final RegistrationEvent e = new RegistrationEvent(this, listenerClass);
... | [
"@",
"Deprecated",
"protected",
"<",
"T",
"extends",
"Listener",
">",
"void",
"removeInternal",
"(",
"Class",
"<",
"T",
">",
"listenerClass",
",",
"Iterator",
"<",
"Object",
">",
"it",
")",
"{",
"final",
"Object",
"next",
"=",
"it",
".",
"next",
"(",
"... | Internal method for removing a single listener and notifying it about the
removal. Prior to calling this method, the passed iterators
{@link Iterator#hasNext() hasNext} method must hold <code>true</code>.
@param <T> Type of the listener to remove
@param listenerClass The class of the listener to remove.
@param it Iter... | [
"Internal",
"method",
"for",
"removing",
"a",
"single",
"listener",
"and",
"notifying",
"it",
"about",
"the",
"removal",
".",
"Prior",
"to",
"calling",
"this",
"method",
"the",
"passed",
"iterators",
"{",
"@link",
"Iterator#hasNext",
"()",
"hasNext",
"}",
"met... | train | https://github.com/skuzzle/jeve/blob/42cc18947c9c8596c34410336e4e375e9fcd7c47/jeve/src/main/java/de/skuzzle/jeve/stores/DefaultListenerStoreImpl.java#L142-L150 |
phax/ph-web | ph-servlet/src/main/java/com/helger/servlet/request/RequestHelper.java | RequestHelper.getUserAgent | @Nonnull
public static IUserAgent getUserAgent (@Nonnull final HttpServletRequest aHttpRequest) {
"""
Get the user agent object from the given HTTP request.
@param aHttpRequest
The HTTP request to extract the information from.
@return A non-<code>null</code> user agent object.
"""
IUserAgent aUserAg... | java | @Nonnull
public static IUserAgent getUserAgent (@Nonnull final HttpServletRequest aHttpRequest)
{
IUserAgent aUserAgent = (IUserAgent) aHttpRequest.getAttribute (IUserAgent.class.getName ());
if (aUserAgent == null)
{
// Extract HTTP header from request
final String sUserAgent = getHttpUserA... | [
"@",
"Nonnull",
"public",
"static",
"IUserAgent",
"getUserAgent",
"(",
"@",
"Nonnull",
"final",
"HttpServletRequest",
"aHttpRequest",
")",
"{",
"IUserAgent",
"aUserAgent",
"=",
"(",
"IUserAgent",
")",
"aHttpRequest",
".",
"getAttribute",
"(",
"IUserAgent",
".",
"c... | Get the user agent object from the given HTTP request.
@param aHttpRequest
The HTTP request to extract the information from.
@return A non-<code>null</code> user agent object. | [
"Get",
"the",
"user",
"agent",
"object",
"from",
"the",
"given",
"HTTP",
"request",
"."
] | train | https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-servlet/src/main/java/com/helger/servlet/request/RequestHelper.java#L857-L874 |
actframework/actframework | src/main/java/act/util/ClassNode.java | ClassNode.visitTree | public ClassNode visitTree($.Visitor<ClassNode> visitor, final boolean publicOnly, final boolean noAbstract) {
"""
Accept a visitor that visit all descendants of the class represetned by
this `ClassNode` including this `ClassNode` itself.
@param visitor the visitor
@param publicOnly specify if only public class... | java | public ClassNode visitTree($.Visitor<ClassNode> visitor, final boolean publicOnly, final boolean noAbstract) {
return visitTree($.guardedVisitor(classNodeFilter(publicOnly, noAbstract), visitor));
} | [
"public",
"ClassNode",
"visitTree",
"(",
"$",
".",
"Visitor",
"<",
"ClassNode",
">",
"visitor",
",",
"final",
"boolean",
"publicOnly",
",",
"final",
"boolean",
"noAbstract",
")",
"{",
"return",
"visitTree",
"(",
"$",
".",
"guardedVisitor",
"(",
"classNodeFilte... | Accept a visitor that visit all descendants of the class represetned by
this `ClassNode` including this `ClassNode` itself.
@param visitor the visitor
@param publicOnly specify if only public class shall be visited
@param noAbstract specify if abstract class can be visited
@return this `ClassNode` instance | [
"Accept",
"a",
"visitor",
"that",
"visit",
"all",
"descendants",
"of",
"the",
"class",
"represetned",
"by",
"this",
"ClassNode",
"including",
"this",
"ClassNode",
"itself",
"."
] | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/util/ClassNode.java#L218-L220 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java | CoverageUtilities.buildDummyCoverage | public static GridCoverage2D buildDummyCoverage() {
"""
Creates a useless {@link GridCoverage2D} that might be usefull as placeholder.
@return the dummy grod coverage.
"""
HashMap<String, Double> envelopeParams = new HashMap<String, Double>();
envelopeParams.put(NORTH, 1.0);
envelope... | java | public static GridCoverage2D buildDummyCoverage() {
HashMap<String, Double> envelopeParams = new HashMap<String, Double>();
envelopeParams.put(NORTH, 1.0);
envelopeParams.put(SOUTH, 0.0);
envelopeParams.put(WEST, 0.0);
envelopeParams.put(EAST, 1.0);
envelopeParams.put(XRE... | [
"public",
"static",
"GridCoverage2D",
"buildDummyCoverage",
"(",
")",
"{",
"HashMap",
"<",
"String",
",",
"Double",
">",
"envelopeParams",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Double",
">",
"(",
")",
";",
"envelopeParams",
".",
"put",
"(",
"NORTH",
... | Creates a useless {@link GridCoverage2D} that might be usefull as placeholder.
@return the dummy grod coverage. | [
"Creates",
"a",
"useless",
"{",
"@link",
"GridCoverage2D",
"}",
"that",
"might",
"be",
"usefull",
"as",
"placeholder",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java#L916-L930 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/debug/cli/Shell.java | Shell.addAuxHandler | public void addAuxHandler(Object handler, String prefix) {
"""
This method is very similar to addMainHandler, except ShellFactory
will pass all handlers registered with this method to all this shell's subshells.
@see org.gearvrf.debug.cli.Shell#addMainHandler(java.lang.Object, java.lang.String)
@param handl... | java | public void addAuxHandler(Object handler, String prefix) {
if (handler == null) {
throw new NullPointerException();
}
auxHandlers.put(prefix, handler);
allHandlers.add(handler);
addDeclaredMethods(handler, prefix);
inputConverter.addDeclaredConverters(handler... | [
"public",
"void",
"addAuxHandler",
"(",
"Object",
"handler",
",",
"String",
"prefix",
")",
"{",
"if",
"(",
"handler",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"auxHandlers",
".",
"put",
"(",
"prefix",
",",
"hand... | This method is very similar to addMainHandler, except ShellFactory
will pass all handlers registered with this method to all this shell's subshells.
@see org.gearvrf.debug.cli.Shell#addMainHandler(java.lang.Object, java.lang.String)
@param handler Object which should be registered as handler.
@param prefix Prefix tha... | [
"This",
"method",
"is",
"very",
"similar",
"to",
"addMainHandler",
"except",
"ShellFactory",
"will",
"pass",
"all",
"handlers",
"registered",
"with",
"this",
"method",
"to",
"all",
"this",
"shell",
"s",
"subshells",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/debug/cli/Shell.java#L164-L178 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEEJBInvocationInfoBase.java | TEEJBInvocationInfoBase.turnNullString2EmptyString | protected static String turnNullString2EmptyString(String str, String NullDefaultStr) {
"""
Helper method to convert a String object to its textual representation.
If class is null, the <i>NullDefaultStr</i> is returned.
"""
return (str == null) ? NullDefaultStr : str;
} | java | protected static String turnNullString2EmptyString(String str, String NullDefaultStr)
{
return (str == null) ? NullDefaultStr : str;
} | [
"protected",
"static",
"String",
"turnNullString2EmptyString",
"(",
"String",
"str",
",",
"String",
"NullDefaultStr",
")",
"{",
"return",
"(",
"str",
"==",
"null",
")",
"?",
"NullDefaultStr",
":",
"str",
";",
"}"
] | Helper method to convert a String object to its textual representation.
If class is null, the <i>NullDefaultStr</i> is returned. | [
"Helper",
"method",
"to",
"convert",
"a",
"String",
"object",
"to",
"its",
"textual",
"representation",
".",
"If",
"class",
"is",
"null",
"the",
"<i",
">",
"NullDefaultStr<",
"/",
"i",
">",
"is",
"returned",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEEJBInvocationInfoBase.java#L43-L46 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/components/DatePickerSettings.java | DatePickerSettings.zGetDefaultBorderPropertiesList | private ArrayList<CalendarBorderProperties> zGetDefaultBorderPropertiesList() {
"""
zGetDefaultBorderPropertiesList, This creates and returns a list of default border properties
for the calendar. The default border properties will be slightly different depending on
whether or not the week numbers are currently d... | java | private ArrayList<CalendarBorderProperties> zGetDefaultBorderPropertiesList() {
ArrayList<CalendarBorderProperties> results = new ArrayList<CalendarBorderProperties>();
Color defaultDateBoxBorderColor = new Color(99, 130, 191);
Color defaultWeekdayEndcapsBorderColor = colorBackgroundWeekdayLabel... | [
"private",
"ArrayList",
"<",
"CalendarBorderProperties",
">",
"zGetDefaultBorderPropertiesList",
"(",
")",
"{",
"ArrayList",
"<",
"CalendarBorderProperties",
">",
"results",
"=",
"new",
"ArrayList",
"<",
"CalendarBorderProperties",
">",
"(",
")",
";",
"Color",
"defaul... | zGetDefaultBorderPropertiesList, This creates and returns a list of default border properties
for the calendar. The default border properties will be slightly different depending on
whether or not the week numbers are currently displayed in the calendar.
Technical notes: This does not save the default border propertie... | [
"zGetDefaultBorderPropertiesList",
"This",
"creates",
"and",
"returns",
"a",
"list",
"of",
"default",
"border",
"properties",
"for",
"the",
"calendar",
".",
"The",
"default",
"border",
"properties",
"will",
"be",
"slightly",
"different",
"depending",
"on",
"whether"... | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/components/DatePickerSettings.java#L2292-L2313 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/doc/DocClient.java | DocClient.registerDocument | private RegisterDocumentResponse registerDocument(RegisterDocumentRequest request) {
"""
publish a Document.
@param request The request object containing register infomation.
@return A RegisterDocumentResponse object containing the information returned by Document.
"""
checkNotNull(request, "The... | java | private RegisterDocumentResponse registerDocument(RegisterDocumentRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
InternalRequest internalRequest = createRequest(HttpMethodName.POST, request, DOC);
internalRequest.addParameter("register", null);
St... | [
"private",
"RegisterDocumentResponse",
"registerDocument",
"(",
"RegisterDocumentRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"InternalRequest",
"internalRequest",
"=",
"createRequest",
"(",
"Ht... | publish a Document.
@param request The request object containing register infomation.
@return A RegisterDocumentResponse object containing the information returned by Document. | [
"publish",
"a",
"Document",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/doc/DocClient.java#L405-L422 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java | StreamSet.getPersistentData | protected long getPersistentData(int priority, Reliability reliability) throws SIResourceException {
"""
Get the persistent data for a specific stream
@param priority
@param reliability
@throws SIResourceException
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
... | java | protected long getPersistentData(int priority, Reliability reliability) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"getPersistentData",
new Object[] { new Integer(priority), reliability });
long prefix = getSubs... | [
"protected",
"long",
"getPersistentData",
"(",
"int",
"priority",
",",
"Reliability",
"reliability",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"... | Get the persistent data for a specific stream
@param priority
@param reliability
@throws SIResourceException | [
"Get",
"the",
"persistent",
"data",
"for",
"a",
"specific",
"stream"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java#L882-L896 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/DefaultElementProducer.java | DefaultElementProducer.createElementByStyler | public <E extends Element> E createElementByStyler(Collection<? extends BaseStyler> stylers, Object data, Class<E> clazz) throws VectorPrintException {
"""
leaves object creation to the first styler in the list
@param <E>
@param stylers
@param data
@param clazz
@return
@throws VectorPrintException
"""
... | java | public <E extends Element> E createElementByStyler(Collection<? extends BaseStyler> stylers, Object data, Class<E> clazz) throws VectorPrintException {
// pdfptable, Section and others do not have a default constructor, a styler creates it
E e = null;
return styleHelper.style(e, data, stylers);
} | [
"public",
"<",
"E",
"extends",
"Element",
">",
"E",
"createElementByStyler",
"(",
"Collection",
"<",
"?",
"extends",
"BaseStyler",
">",
"stylers",
",",
"Object",
"data",
",",
"Class",
"<",
"E",
">",
"clazz",
")",
"throws",
"VectorPrintException",
"{",
"// pd... | leaves object creation to the first styler in the list
@param <E>
@param stylers
@param data
@param clazz
@return
@throws VectorPrintException | [
"leaves",
"object",
"creation",
"to",
"the",
"first",
"styler",
"in",
"the",
"list"
] | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/DefaultElementProducer.java#L133-L138 |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java | ConvertBitmap.grayToBitmap | public static void grayToBitmap( GrayU8 input , Bitmap output , byte[] storage) {
"""
Converts ImageGray into Bitmap.
@see #declareStorage(android.graphics.Bitmap, byte[])
@param input Input gray scale image.
@param output Output Bitmap image.
@param storage Byte array used for internal storage. If null it... | java | public static void grayToBitmap( GrayU8 input , Bitmap output , byte[] storage) {
if( output.getWidth() != input.getWidth() || output.getHeight() != input.getHeight() ) {
throw new IllegalArgumentException("Image shapes are not the same");
}
if( storage == null )
storage = declareStorage(output,null);
... | [
"public",
"static",
"void",
"grayToBitmap",
"(",
"GrayU8",
"input",
",",
"Bitmap",
"output",
",",
"byte",
"[",
"]",
"storage",
")",
"{",
"if",
"(",
"output",
".",
"getWidth",
"(",
")",
"!=",
"input",
".",
"getWidth",
"(",
")",
"||",
"output",
".",
"g... | Converts ImageGray into Bitmap.
@see #declareStorage(android.graphics.Bitmap, byte[])
@param input Input gray scale image.
@param output Output Bitmap image.
@param storage Byte array used for internal storage. If null it will be declared internally. | [
"Converts",
"ImageGray",
"into",
"Bitmap",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/ConvertBitmap.java#L269-L279 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/CustomserviceAPI.java | CustomserviceAPI.msgrecordGetrecord | public static KFMsgRecord msgrecordGetrecord(String access_token, int endtime, int pageindex, int pagesize, int starttime) {
"""
获取客服聊天记录
@param access_token access_token
@param endtime 查询结束时间,UNIX时间戳,每次查询不能跨日查询
@param pageindex 查询第几页,从1开始
@param pagesize 每页大小,每页最多拉取50条
@param starttime 查询开始时间,UNIX时间戳
@retur... | java | public static KFMsgRecord msgrecordGetrecord(String access_token, int endtime, int pageindex, int pagesize, int starttime) {
String jsonPostData = String.format("{\"endtime\":%1d,\"pageindex\":%2d,\"pagesize\":%3d,\"starttime\":%4d}",
endtime,
pageindex,
pagesize,
starttime);
HttpUriReq... | [
"public",
"static",
"KFMsgRecord",
"msgrecordGetrecord",
"(",
"String",
"access_token",
",",
"int",
"endtime",
",",
"int",
"pageindex",
",",
"int",
"pagesize",
",",
"int",
"starttime",
")",
"{",
"String",
"jsonPostData",
"=",
"String",
".",
"format",
"(",
"\"{... | 获取客服聊天记录
@param access_token access_token
@param endtime 查询结束时间,UNIX时间戳,每次查询不能跨日查询
@param pageindex 查询第几页,从1开始
@param pagesize 每页大小,每页最多拉取50条
@param starttime 查询开始时间,UNIX时间戳
@return KFMsgRecord | [
"获取客服聊天记录"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/CustomserviceAPI.java#L235-L248 |
Azure/azure-sdk-for-java | hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationsInner.java | ApplicationsInner.beginCreate | public ApplicationInner beginCreate(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) {
"""
Creates applications for the HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param applicationNa... | java | public ApplicationInner beginCreate(String resourceGroupName, String clusterName, String applicationName, ApplicationInner parameters) {
return beginCreateWithServiceResponseAsync(resourceGroupName, clusterName, applicationName, parameters).toBlocking().single().body();
} | [
"public",
"ApplicationInner",
"beginCreate",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"String",
"applicationName",
",",
"ApplicationInner",
"parameters",
")",
"{",
"return",
"beginCreateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Creates applications for the HDInsight cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@param applicationName The constant value for the application name.
@param parameters The application create request.
@throws IllegalArgumentException thrown if parameter... | [
"Creates",
"applications",
"for",
"the",
"HDInsight",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ApplicationsInner.java#L406-L408 |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/CommonOps_ZDRM.java | CommonOps_ZDRM.extractDiag | public static void extractDiag(ZMatrixRMaj src, ZMatrixRMaj dst ) {
"""
<p>
Extracts the diagonal elements 'src' write it to the 'dst' vector. 'dst'
can either be a row or column vector.
<p>
@param src Matrix whose diagonal elements are being extracted. Not modified.
@param dst A vector the results will be... | java | public static void extractDiag(ZMatrixRMaj src, ZMatrixRMaj dst )
{
int N = Math.min(src.numRows, src.numCols);
// reshape if it's not the right size
if( !MatrixFeatures_ZDRM.isVector(dst) || dst.numCols*dst.numCols != N ) {
dst.reshape(N,1);
}
for( int i = 0; i... | [
"public",
"static",
"void",
"extractDiag",
"(",
"ZMatrixRMaj",
"src",
",",
"ZMatrixRMaj",
"dst",
")",
"{",
"int",
"N",
"=",
"Math",
".",
"min",
"(",
"src",
".",
"numRows",
",",
"src",
".",
"numCols",
")",
";",
"// reshape if it's not the right size",
"if",
... | <p>
Extracts the diagonal elements 'src' write it to the 'dst' vector. 'dst'
can either be a row or column vector.
<p>
@param src Matrix whose diagonal elements are being extracted. Not modified.
@param dst A vector the results will be written into. Modified. | [
"<p",
">",
"Extracts",
"the",
"diagonal",
"elements",
"src",
"write",
"it",
"to",
"the",
"dst",
"vector",
".",
"dst",
"can",
"either",
"be",
"a",
"row",
"or",
"column",
"vector",
".",
"<p",
">"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/CommonOps_ZDRM.java#L122-L136 |
Atmosphere/wasync | wasync/src/main/java/org/atmosphere/wasync/util/TypeResolver.java | TypeResolver.buildTypeVariableMap | static void buildTypeVariableMap(final Type[] types, final Map<TypeVariable<?>, Type> map) {
"""
Populates the {@code map} with with variable/argument pairs for the given {@code types}.
"""
for (Type type : types) {
if (type instanceof ParameterizedType) {
ParameterizedType ... | java | static void buildTypeVariableMap(final Type[] types, final Map<TypeVariable<?>, Type> map) {
for (Type type : types) {
if (type instanceof ParameterizedType) {
ParameterizedType parameterizedType = (ParameterizedType) type;
buildTypeVariableMap(parameterizedType, map)... | [
"static",
"void",
"buildTypeVariableMap",
"(",
"final",
"Type",
"[",
"]",
"types",
",",
"final",
"Map",
"<",
"TypeVariable",
"<",
"?",
">",
",",
"Type",
">",
"map",
")",
"{",
"for",
"(",
"Type",
"type",
":",
"types",
")",
"{",
"if",
"(",
"type",
"i... | Populates the {@code map} with with variable/argument pairs for the given {@code types}. | [
"Populates",
"the",
"{"
] | train | https://github.com/Atmosphere/wasync/blob/0146828b2f5138d4cbb4872fcbfe7d6e1887ac14/wasync/src/main/java/org/atmosphere/wasync/util/TypeResolver.java#L255-L267 |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection/src/com/ibm/ws/injectionengine/osgi/internal/OSGiInjectionScopeData.java | OSGiInjectionScopeData.addCompBinding | public void addCompBinding(String name, InjectionBinding<?> binding) {
"""
Add a non-env java:comp binding.
@param name a name relative to java:comp
"""
if (!compLock.writeLock().isHeldByCurrentThread()) {
throw new IllegalStateException();
}
if (compBindings == null) {
... | java | public void addCompBinding(String name, InjectionBinding<?> binding) {
if (!compLock.writeLock().isHeldByCurrentThread()) {
throw new IllegalStateException();
}
if (compBindings == null) {
compBindings = new JavaColonNamespaceBindings<InjectionBinding<?>>(NamingConstants... | [
"public",
"void",
"addCompBinding",
"(",
"String",
"name",
",",
"InjectionBinding",
"<",
"?",
">",
"binding",
")",
"{",
"if",
"(",
"!",
"compLock",
".",
"writeLock",
"(",
")",
".",
"isHeldByCurrentThread",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateE... | Add a non-env java:comp binding.
@param name a name relative to java:comp | [
"Add",
"a",
"non",
"-",
"env",
"java",
":",
"comp",
"binding",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection/src/com/ibm/ws/injectionengine/osgi/internal/OSGiInjectionScopeData.java#L220-L229 |
haraldk/TwelveMonkeys | common/common-image/src/main/java/com/twelvemonkeys/image/IndexImage.java | IndexImage.getIndexedImage | public static BufferedImage getIndexedImage(BufferedImage pImage, int pNumberOfColors, Color pMatte, int pHints) {
"""
Converts the input image (must be {@code TYPE_INT_RGB} or
{@code TYPE_INT_ARGB}) to an indexed image. Generating an adaptive
palette with the given number of colors.
Dithering, transparency an... | java | public static BufferedImage getIndexedImage(BufferedImage pImage, int pNumberOfColors, Color pMatte, int pHints) {
// NOTE: We need to apply matte before creating color model, otherwise we
// won't have colors for potential faded transitions
IndexColorModel icm;
if (pMatte != null)... | [
"public",
"static",
"BufferedImage",
"getIndexedImage",
"(",
"BufferedImage",
"pImage",
",",
"int",
"pNumberOfColors",
",",
"Color",
"pMatte",
",",
"int",
"pHints",
")",
"{",
"// NOTE: We need to apply matte before creating color model, otherwise we\r",
"// won't have colors fo... | Converts the input image (must be {@code TYPE_INT_RGB} or
{@code TYPE_INT_ARGB}) to an indexed image. Generating an adaptive
palette with the given number of colors.
Dithering, transparency and color selection is controlled with the
{@code pHints}parameter.
<p/>
The image returned is a new image, the input image is no... | [
"Converts",
"the",
"input",
"image",
"(",
"must",
"be",
"{",
"@code",
"TYPE_INT_RGB",
"}",
"or",
"{",
"@code",
"TYPE_INT_ARGB",
"}",
")",
"to",
"an",
"indexed",
"image",
".",
"Generating",
"an",
"adaptive",
"palette",
"with",
"the",
"given",
"number",
"of"... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-image/src/main/java/com/twelvemonkeys/image/IndexImage.java#L930-L947 |
Abnaxos/markdown-doclet | doclet/jdk8/src/main/java/ch/raffael/mddoclet/mdtaglet/argval/PredefinedArgumentValidators.java | PredefinedArgumentValidators.inRange | public static ArgumentValidator inRange(int expectedMin, int expectedMax, String description) {
"""
Creates a {@link ArgumentValidator} which checks for _expectedMin <= #arguments <= expectedMax_.
@param expectedMin the minimum number of expected arguments
@param expectedMax the maximum number of expected argu... | java | public static ArgumentValidator inRange(int expectedMin, int expectedMax, String description) {
if (expectedMin > 0)
return allOf(
atLeast(expectedMin, description),
atMost(expectedMax, description)
);
return atMost(expectedMax, descriptio... | [
"public",
"static",
"ArgumentValidator",
"inRange",
"(",
"int",
"expectedMin",
",",
"int",
"expectedMax",
",",
"String",
"description",
")",
"{",
"if",
"(",
"expectedMin",
">",
"0",
")",
"return",
"allOf",
"(",
"atLeast",
"(",
"expectedMin",
",",
"description"... | Creates a {@link ArgumentValidator} which checks for _expectedMin <= #arguments <= expectedMax_.
@param expectedMin the minimum number of expected arguments
@param expectedMax the maximum number of expected arguments
@param description any description
@return an ArgumentValidator | [
"Creates",
"a",
"{",
"@link",
"ArgumentValidator",
"}",
"which",
"checks",
"for",
"_expectedMin",
"<",
"=",
"#arguments",
"<",
"=",
"expectedMax_",
"."
] | train | https://github.com/Abnaxos/markdown-doclet/blob/e98a9630206fc9c8d813cf2349ff594be8630054/doclet/jdk8/src/main/java/ch/raffael/mddoclet/mdtaglet/argval/PredefinedArgumentValidators.java#L227-L235 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/GeoPackageOverlayFactory.java | GeoPackageOverlayFactory.getCompositeOverlay | public static CompositeOverlay getCompositeOverlay(TileDao tileDao, BoundedOverlay overlay) {
"""
Create a composite overlay by first adding a tile overlay for the tile DAO followed by the provided overlay
@param tileDao tile dao
@param overlay bounded overlay
@return composite overlay
"""
List<Ti... | java | public static CompositeOverlay getCompositeOverlay(TileDao tileDao, BoundedOverlay overlay) {
List<TileDao> tileDaos = new ArrayList<>();
tileDaos.add(tileDao);
return getCompositeOverlay(tileDaos, overlay);
} | [
"public",
"static",
"CompositeOverlay",
"getCompositeOverlay",
"(",
"TileDao",
"tileDao",
",",
"BoundedOverlay",
"overlay",
")",
"{",
"List",
"<",
"TileDao",
">",
"tileDaos",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"tileDaos",
".",
"add",
"(",
"tileDao",... | Create a composite overlay by first adding a tile overlay for the tile DAO followed by the provided overlay
@param tileDao tile dao
@param overlay bounded overlay
@return composite overlay | [
"Create",
"a",
"composite",
"overlay",
"by",
"first",
"adding",
"a",
"tile",
"overlay",
"for",
"the",
"tile",
"DAO",
"followed",
"by",
"the",
"provided",
"overlay"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/GeoPackageOverlayFactory.java#L118-L122 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/DatabaseRecommendedActionsInner.java | DatabaseRecommendedActionsInner.updateAsync | public Observable<RecommendedActionInner> updateAsync(String resourceGroupName, String serverName, String databaseName, String advisorName, String recommendedActionName, RecommendedActionStateInfo state) {
"""
Updates a database recommended action.
@param resourceGroupName The name of the resource group that co... | java | public Observable<RecommendedActionInner> updateAsync(String resourceGroupName, String serverName, String databaseName, String advisorName, String recommendedActionName, RecommendedActionStateInfo state) {
return updateWithServiceResponseAsync(resourceGroupName, serverName, databaseName, advisorName, recommende... | [
"public",
"Observable",
"<",
"RecommendedActionInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"advisorName",
",",
"String",
"recommendedActionName",
",",
"RecommendedActionStateInf... | Updates a database recommended action.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database.
@param advisorName The name of ... | [
"Updates",
"a",
"database",
"recommended",
"action",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/DatabaseRecommendedActionsInner.java#L327-L334 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/util/ArrayUtils.java | ArrayUtils.nullSafeArray | @NullSafe
public static <T> T[] nullSafeArray(T[] array) {
"""
Null-safe method returning the array if not null otherwise returns an empty array.
@param <T> Class type of the elements in the array.
@param array array to evaluate.
@return the array if not null otherwise an empty array.
@see #nullSafeArray(O... | java | @NullSafe
public static <T> T[] nullSafeArray(T[] array) {
return nullSafeArray(array, componentType(array));
} | [
"@",
"NullSafe",
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"nullSafeArray",
"(",
"T",
"[",
"]",
"array",
")",
"{",
"return",
"nullSafeArray",
"(",
"array",
",",
"componentType",
"(",
"array",
")",
")",
";",
"}"
] | Null-safe method returning the array if not null otherwise returns an empty array.
@param <T> Class type of the elements in the array.
@param array array to evaluate.
@return the array if not null otherwise an empty array.
@see #nullSafeArray(Object[], Class)
@see #componentType(Object[]) | [
"Null",
"-",
"safe",
"method",
"returning",
"the",
"array",
"if",
"not",
"null",
"otherwise",
"returns",
"an",
"empty",
"array",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/util/ArrayUtils.java#L610-L613 |
landawn/AbacusUtil | src/com/landawn/abacus/eventBus/EventBus.java | EventBus.removeStickyEvent | public boolean removeStickyEvent(final Object event, final String eventId) {
"""
Remove the sticky event posted with the specified <code>eventId</code>.
@param event
@param eventId
@return
"""
synchronized (stickyEventMap) {
final String val = stickyEventMap.get(event);
if... | java | public boolean removeStickyEvent(final Object event, final String eventId) {
synchronized (stickyEventMap) {
final String val = stickyEventMap.get(event);
if (N.equals(val, eventId) && (val != null || stickyEventMap.containsKey(event))) {
stickyEventMap.remove(event);
... | [
"public",
"boolean",
"removeStickyEvent",
"(",
"final",
"Object",
"event",
",",
"final",
"String",
"eventId",
")",
"{",
"synchronized",
"(",
"stickyEventMap",
")",
"{",
"final",
"String",
"val",
"=",
"stickyEventMap",
".",
"get",
"(",
"event",
")",
";",
"if"... | Remove the sticky event posted with the specified <code>eventId</code>.
@param event
@param eventId
@return | [
"Remove",
"the",
"sticky",
"event",
"posted",
"with",
"the",
"specified",
"<code",
">",
"eventId<",
"/",
"code",
">",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/eventBus/EventBus.java#L529-L542 |
kubernetes-client/java | kubernetes/src/main/java/io/kubernetes/client/ApiClient.java | ApiClient.executeAsync | public <T> void executeAsync(Call call, ApiCallback<T> callback) {
"""
{@link #executeAsync(Call, Type, ApiCallback)}
@param <T> Type
@param call An instance of the Call object
@param callback ApiCallback<T>
"""
executeAsync(call, null, callback);
} | java | public <T> void executeAsync(Call call, ApiCallback<T> callback) {
executeAsync(call, null, callback);
} | [
"public",
"<",
"T",
">",
"void",
"executeAsync",
"(",
"Call",
"call",
",",
"ApiCallback",
"<",
"T",
">",
"callback",
")",
"{",
"executeAsync",
"(",
"call",
",",
"null",
",",
"callback",
")",
";",
"}"
] | {@link #executeAsync(Call, Type, ApiCallback)}
@param <T> Type
@param call An instance of the Call object
@param callback ApiCallback<T> | [
"{",
"@link",
"#executeAsync",
"(",
"Call",
"Type",
"ApiCallback",
")",
"}"
] | train | https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/kubernetes/src/main/java/io/kubernetes/client/ApiClient.java#L816-L818 |
logic-ng/LogicNG | src/main/java/org/logicng/solvers/maxsat/algorithms/MaxSAT.java | MaxSAT.computeCostModel | public int computeCostModel(final LNGBooleanVector currentModel, int weight) {
"""
Computes the cost of a given model. The cost of a model is the sum of the weights of the unsatisfied soft
clauses. If a weight is specified, then it only considers the sum of the weights of the unsatisfied soft clauses
with the s... | java | public int computeCostModel(final LNGBooleanVector currentModel, int weight) {
assert currentModel.size() != 0;
int currentCost = 0;
for (int i = 0; i < nSoft(); i++) {
boolean unsatisfied = true;
for (int j = 0; j < softClauses.get(i).clause().size(); j++) {
if (weight != Integer.MAX_VA... | [
"public",
"int",
"computeCostModel",
"(",
"final",
"LNGBooleanVector",
"currentModel",
",",
"int",
"weight",
")",
"{",
"assert",
"currentModel",
".",
"size",
"(",
")",
"!=",
"0",
";",
"int",
"currentCost",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",... | Computes the cost of a given model. The cost of a model is the sum of the weights of the unsatisfied soft
clauses. If a weight is specified, then it only considers the sum of the weights of the unsatisfied soft clauses
with the specified weight.
@param currentModel the model
@param weight the weight
@return the ... | [
"Computes",
"the",
"cost",
"of",
"a",
"given",
"model",
".",
"The",
"cost",
"of",
"a",
"model",
"is",
"the",
"sum",
"of",
"the",
"weights",
"of",
"the",
"unsatisfied",
"soft",
"clauses",
".",
"If",
"a",
"weight",
"is",
"specified",
"then",
"it",
"only"... | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/solvers/maxsat/algorithms/MaxSAT.java#L345-L366 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/BarcodePDF417.java | BarcodePDF417.createAwtImage | public java.awt.Image createAwtImage(Color foreground, Color background) {
"""
Creates a <CODE>java.awt.Image</CODE>.
@param foreground the color of the bars
@param background the color of the background
@return the image
"""
int f = foreground.getRGB();
int g = background.getRGB();
... | java | public java.awt.Image createAwtImage(Color foreground, Color background) {
int f = foreground.getRGB();
int g = background.getRGB();
Canvas canvas = new Canvas();
paintCode();
int h = (int)yHeight;
int pix[] = new int[bitColumns * codeRows * h];
int stride = (bit... | [
"public",
"java",
".",
"awt",
".",
"Image",
"createAwtImage",
"(",
"Color",
"foreground",
",",
"Color",
"background",
")",
"{",
"int",
"f",
"=",
"foreground",
".",
"getRGB",
"(",
")",
";",
"int",
"g",
"=",
"background",
".",
"getRGB",
"(",
")",
";",
... | Creates a <CODE>java.awt.Image</CODE>.
@param foreground the color of the bars
@param background the color of the background
@return the image | [
"Creates",
"a",
"<CODE",
">",
"java",
".",
"awt",
".",
"Image<",
"/",
"CODE",
">",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/BarcodePDF417.java#L901-L926 |
jhunters/jprotobuf | android/src/main/java/com/baidu/bjf/remoting/protobuf/CodedConstant.java | CodedConstant.writeToList | public static void writeToList(CodedOutputStream out, int order, FieldType type, List list) throws IOException {
"""
write list to {@link CodedOutputStream} object.
@param out target output stream to write
@param order field order
@param type field type
@param list target list object to be serialized
"""... | java | public static void writeToList(CodedOutputStream out, int order, FieldType type, List list) throws IOException {
if (list == null) {
return;
}
for (Object object : list) {
writeObject(out, order, type, object, true);
}
} | [
"public",
"static",
"void",
"writeToList",
"(",
"CodedOutputStream",
"out",
",",
"int",
"order",
",",
"FieldType",
"type",
",",
"List",
"list",
")",
"throws",
"IOException",
"{",
"if",
"(",
"list",
"==",
"null",
")",
"{",
"return",
";",
"}",
"for",
"(",
... | write list to {@link CodedOutputStream} object.
@param out target output stream to write
@param order field order
@param type field type
@param list target list object to be serialized | [
"write",
"list",
"to",
"{",
"@link",
"CodedOutputStream",
"}",
"object",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/android/src/main/java/com/baidu/bjf/remoting/protobuf/CodedConstant.java#L291-L299 |
hawkular/hawkular-agent | hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/protocol/platform/OshiPlatformCache.java | OshiPlatformCache.getProcessorMetric | public Double getProcessorMetric(String processorNumber, ID metricToCollect) {
"""
Returns the given metric's value, or null if there is no processor with the given number.
@param processorNumber number of the processor, as a String
@param metricToCollect the metric to collect
@return the value of the metric,... | java | public Double getProcessorMetric(String processorNumber, ID metricToCollect) {
CentralProcessor processor = getProcessor();
if (processor == null) {
return null;
}
int processorIndex;
try {
processorIndex = Integer.parseInt(processorNumber);
... | [
"public",
"Double",
"getProcessorMetric",
"(",
"String",
"processorNumber",
",",
"ID",
"metricToCollect",
")",
"{",
"CentralProcessor",
"processor",
"=",
"getProcessor",
"(",
")",
";",
"if",
"(",
"processor",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",... | Returns the given metric's value, or null if there is no processor with the given number.
@param processorNumber number of the processor, as a String
@param metricToCollect the metric to collect
@return the value of the metric, or null if there is no processor with the given number | [
"Returns",
"the",
"given",
"metric",
"s",
"value",
"or",
"null",
"if",
"there",
"is",
"no",
"processor",
"with",
"the",
"given",
"number",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-agent-core/src/main/java/org/hawkular/agent/monitor/protocol/platform/OshiPlatformCache.java#L278-L300 |
dihedron/dihedron-commons | src/main/java/org/dihedron/core/strings/Strings.java | Strings.asString | public static String asString(Object object, String otherwise) {
"""
Returns the given object as a string, if not null, otherwise
returns null.
@param object
the object to be safely converted to a string.
@param otherwise
if the object is null, return this value instead.
@return
the string representation ... | java | public static String asString(Object object, String otherwise) {
return object != null ? object.toString() : otherwise;
} | [
"public",
"static",
"String",
"asString",
"(",
"Object",
"object",
",",
"String",
"otherwise",
")",
"{",
"return",
"object",
"!=",
"null",
"?",
"object",
".",
"toString",
"(",
")",
":",
"otherwise",
";",
"}"
] | Returns the given object as a string, if not null, otherwise
returns null.
@param object
the object to be safely converted to a string.
@param otherwise
if the object is null, return this value instead.
@return
the string representation of the object if not null, the default
value passed in otherwise. | [
"Returns",
"the",
"given",
"object",
"as",
"a",
"string",
"if",
"not",
"null",
"otherwise",
"returns",
"null",
"."
] | train | https://github.com/dihedron/dihedron-commons/blob/a5194cdaa0d6417ef4aade6ea407a1cad6e8458e/src/main/java/org/dihedron/core/strings/Strings.java#L82-L84 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.