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 |
|---|---|---|---|---|---|---|---|---|---|---|
qiniu/android-sdk | library/src/main/java/com/qiniu/android/storage/UploadManager.java | UploadManager.syncPut | public ResponseInfo syncPut(String file, String key, String token, UploadOptions options) {
"""
同步上传文件。使用 form 表单方式上传,建议只在文件较小情况下使用此方式,如 file.size() < 1024 * 1024。
@param file 上传的文件绝对路径
@param key 上传数据保存的文件名
@param token 上传凭证
@param options 上传数据的可选参数
@return 响应信息 ResponseInfo#response 响应体,序列化后 json... | java | public ResponseInfo syncPut(String file, String key, String token, UploadOptions options) {
return syncPut(new File(file), key, token, options);
} | [
"public",
"ResponseInfo",
"syncPut",
"(",
"String",
"file",
",",
"String",
"key",
",",
"String",
"token",
",",
"UploadOptions",
"options",
")",
"{",
"return",
"syncPut",
"(",
"new",
"File",
"(",
"file",
")",
",",
"key",
",",
"token",
",",
"options",
")",... | 同步上传文件。使用 form 表单方式上传,建议只在文件较小情况下使用此方式,如 file.size() < 1024 * 1024。
@param file 上传的文件绝对路径
@param key 上传数据保存的文件名
@param token 上传凭证
@param options 上传数据的可选参数
@return 响应信息 ResponseInfo#response 响应体,序列化后 json 格式 | [
"同步上传文件。使用",
"form",
"表单方式上传,建议只在文件较小情况下使用此方式,如",
"file",
".",
"size",
"()",
"<",
"1024",
"*",
"1024。"
] | train | https://github.com/qiniu/android-sdk/blob/dbd2a01fb3bff7a5e75e8934bbf81713124d8466/library/src/main/java/com/qiniu/android/storage/UploadManager.java#L237-L239 |
playframework/play-ebean | play-ebean/src/main/java/play/db/ebean/EbeanParsedConfig.java | EbeanParsedConfig.parseFromConfig | public static EbeanParsedConfig parseFromConfig(Config config) {
"""
Parse a play configuration.
@param config play configuration
@return ebean parsed configuration
@see com.typesafe.config.Config
"""
Config playEbeanConfig = config.getConfig("play.ebean");
String defaultDatasource = playE... | java | public static EbeanParsedConfig parseFromConfig(Config config) {
Config playEbeanConfig = config.getConfig("play.ebean");
String defaultDatasource = playEbeanConfig.getString("defaultDatasource");
String ebeanConfigKey = playEbeanConfig.getString("config");
Map<String, List<String>> dat... | [
"public",
"static",
"EbeanParsedConfig",
"parseFromConfig",
"(",
"Config",
"config",
")",
"{",
"Config",
"playEbeanConfig",
"=",
"config",
".",
"getConfig",
"(",
"\"play.ebean\"",
")",
";",
"String",
"defaultDatasource",
"=",
"playEbeanConfig",
".",
"getString",
"("... | Parse a play configuration.
@param config play configuration
@return ebean parsed configuration
@see com.typesafe.config.Config | [
"Parse",
"a",
"play",
"configuration",
"."
] | train | https://github.com/playframework/play-ebean/blob/ca8dcb8865a06b949d40e05f050238979fd2f9a3/play-ebean/src/main/java/play/db/ebean/EbeanParsedConfig.java#L43-L65 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java | CommonOps_DDRM.columnsToVector | public static DMatrixRMaj[] columnsToVector(DMatrixRMaj A, DMatrixRMaj[] v) {
"""
Converts the columns in a matrix into a set of vectors.
@param A Matrix. Not modified.
@param v
@return An array of vectors.
"""
DMatrixRMaj[]ret;
if( v == null || v.length < A.numCols ) {
ret = ... | java | public static DMatrixRMaj[] columnsToVector(DMatrixRMaj A, DMatrixRMaj[] v)
{
DMatrixRMaj[]ret;
if( v == null || v.length < A.numCols ) {
ret = new DMatrixRMaj[ A.numCols ];
} else {
ret = v;
}
for( int i = 0; i < ret.length; i++ ) {
if( r... | [
"public",
"static",
"DMatrixRMaj",
"[",
"]",
"columnsToVector",
"(",
"DMatrixRMaj",
"A",
",",
"DMatrixRMaj",
"[",
"]",
"v",
")",
"{",
"DMatrixRMaj",
"[",
"]",
"ret",
";",
"if",
"(",
"v",
"==",
"null",
"||",
"v",
".",
"length",
"<",
"A",
".",
"numCols... | Converts the columns in a matrix into a set of vectors.
@param A Matrix. Not modified.
@param v
@return An array of vectors. | [
"Converts",
"the",
"columns",
"in",
"a",
"matrix",
"into",
"a",
"set",
"of",
"vectors",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L878-L902 |
ZuInnoTe/hadoopcryptoledger | inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/common/BitcoinBlockReader.java | BitcoinBlockReader.parseAuxPOWBranch | public BitcoinAuxPOWBranch parseAuxPOWBranch(ByteBuffer rawByteBuffer) {
"""
Parse an AUXPowBranch
@param rawByteBuffer ByteBuffer from which the AuxPOWBranch should be parsed
@return AuxPOWBranch
"""
byte[] noOfLinksVarInt=BitcoinUtil.convertVarIntByteBufferToByteArray(rawByteBuffer);
long currentNoO... | java | public BitcoinAuxPOWBranch parseAuxPOWBranch(ByteBuffer rawByteBuffer) {
byte[] noOfLinksVarInt=BitcoinUtil.convertVarIntByteBufferToByteArray(rawByteBuffer);
long currentNoOfLinks=BitcoinUtil.getVarInt(noOfLinksVarInt);
ArrayList<byte[]> links = new ArrayList((int)currentNoOfLinks);
for (int i=0;i<currentNoOfLink... | [
"public",
"BitcoinAuxPOWBranch",
"parseAuxPOWBranch",
"(",
"ByteBuffer",
"rawByteBuffer",
")",
"{",
"byte",
"[",
"]",
"noOfLinksVarInt",
"=",
"BitcoinUtil",
".",
"convertVarIntByteBufferToByteArray",
"(",
"rawByteBuffer",
")",
";",
"long",
"currentNoOfLinks",
"=",
"Bitc... | Parse an AUXPowBranch
@param rawByteBuffer ByteBuffer from which the AuxPOWBranch should be parsed
@return AuxPOWBranch | [
"Parse",
"an",
"AUXPowBranch"
] | train | https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/common/BitcoinBlockReader.java#L260-L273 |
OpenLiberty/open-liberty | dev/com.ibm.ws.session.db/src/com/ibm/ws/session/store/db/DatabaseHashMap.java | DatabaseHashMap.updateNukerTimeStamp | private void updateNukerTimeStamp(Connection nukerCon, String appName) throws SQLException {
"""
/*
updateNukerTimeStamp
When running in a clustered environment, there could be multiple machines processing invalidation.
This method updates the last time the invalidation was run. A server should not try to proce... | java | private void updateNukerTimeStamp(Connection nukerCon, String appName) throws SQLException {
if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
LoggingUtil.SESSION_LOGGER_WAS.entering(methodClassName, methodNames[UPDATE_NUKER_TI... | [
"private",
"void",
"updateNukerTimeStamp",
"(",
"Connection",
"nukerCon",
",",
"String",
"appName",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"websphere",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&... | /*
updateNukerTimeStamp
When running in a clustered environment, there could be multiple machines processing invalidation.
This method updates the last time the invalidation was run. A server should not try to process invalidation if
it was already done within the specified time interval for that app. | [
"/",
"*",
"updateNukerTimeStamp",
"When",
"running",
"in",
"a",
"clustered",
"environment",
"there",
"could",
"be",
"multiple",
"machines",
"processing",
"invalidation",
".",
"This",
"method",
"updates",
"the",
"last",
"time",
"the",
"invalidation",
"was",
"run",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session.db/src/com/ibm/ws/session/store/db/DatabaseHashMap.java#L3065-L3086 |
jtrfp/javamod | src/main/java/de/quippy/jflac/io/BitOutputStream.java | BitOutputStream.writeRiceSigned | public void writeRiceSigned(int val, int parameter) throws IOException {
"""
/*
DRR FIX # ifdef SYMMETRIC_RICE boolean
write_symmetric_rice_signed(BitBuffer8 * bb, int val, unsigned parameter) {
unsigned total_bits, interesting_bits, msbs; uint32 pattern;
ASSERT(0 != bb); ASSERT(0 != buffer); ASSERT(paramete... | java | public void writeRiceSigned(int val, int parameter) throws IOException {
int totalBits;
int interestingBits;
int msbs;
int uval;
int pattern;
// fold signed to unsigned
if (val < 0) {
// equivalent to (unsigned)(((--val) < < 1) - 1); but witho... | [
"public",
"void",
"writeRiceSigned",
"(",
"int",
"val",
",",
"int",
"parameter",
")",
"throws",
"IOException",
"{",
"int",
"totalBits",
";",
"int",
"interestingBits",
";",
"int",
"msbs",
";",
"int",
"uval",
";",
"int",
"pattern",
";",
"// fold signed to unsign... | /*
DRR FIX # ifdef SYMMETRIC_RICE boolean
write_symmetric_rice_signed(BitBuffer8 * bb, int val, unsigned parameter) {
unsigned total_bits, interesting_bits, msbs; uint32 pattern;
ASSERT(0 != bb); ASSERT(0 != buffer); ASSERT(parameter <= 31); // init
pattern with the unary end bit and the sign bit if (val < 0) { patter... | [
"/",
"*",
"DRR",
"FIX",
"#",
"ifdef",
"SYMMETRIC_RICE",
"boolean",
"write_symmetric_rice_signed",
"(",
"BitBuffer8",
"*",
"bb",
"int",
"val",
"unsigned",
"parameter",
")",
"{",
"unsigned",
"total_bits",
"interesting_bits",
"msbs",
";",
"uint32",
"pattern",
";"
] | train | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/jflac/io/BitOutputStream.java#L451-L478 |
keshrath/Giphy4J | src/main/java/at/mukprojects/giphy4j/Giphy.java | Giphy.searchRandomSticker | public SearchRandom searchRandomSticker(String tag) throws GiphyException {
"""
Returns a random GIF, limited by tag.
<p>
Be aware that not every response has all information available. In that
case the value will be returned as null.
@param tag
the GIF tag to limit randomness
@return the SerachGiphy obj... | java | public SearchRandom searchRandomSticker(String tag) throws GiphyException {
SearchRandom random = null;
HashMap<String, String> params = new HashMap<String, String>();
params.put("api_key", apiKey);
params.put("tag", tag);
Request request = new Request(UrlUtil.buildUrlQuery(RandomEndpointSticker, params));
tr... | [
"public",
"SearchRandom",
"searchRandomSticker",
"(",
"String",
"tag",
")",
"throws",
"GiphyException",
"{",
"SearchRandom",
"random",
"=",
"null",
";",
"HashMap",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String"... | Returns a random GIF, limited by tag.
<p>
Be aware that not every response has all information available. In that
case the value will be returned as null.
@param tag
the GIF tag to limit randomness
@return the SerachGiphy object
@throws GiphyException
if an error occurs during the search | [
"Returns",
"a",
"random",
"GIF",
"limited",
"by",
"tag",
"."
] | train | https://github.com/keshrath/Giphy4J/blob/e56b67f161e2184ccff9b9e8f95a70ef89cec897/src/main/java/at/mukprojects/giphy4j/Giphy.java#L448-L467 |
finmath/finmath-lib | src/main/java/net/finmath/time/SchedulePrototype.java | SchedulePrototype.generateSchedule | public Schedule generateSchedule(LocalDate referenceDate, LocalDate startDate, LocalDate endDate) {
"""
Generate a schedule for the given start and end date.
@param referenceDate The reference date (corresponds to \( t = 0 \).
@param startDate The start date.
@param endDate The end date.
@return The schedule... | java | public Schedule generateSchedule(LocalDate referenceDate, LocalDate startDate, LocalDate endDate) {
return ScheduleGenerator.createScheduleFromConventions(referenceDate, startDate, endDate, getFrequency(), getDaycountConvention(),
getShortPeriodConvention(), getDateRollConvention(), getBusinessdayCalendar(), ge... | [
"public",
"Schedule",
"generateSchedule",
"(",
"LocalDate",
"referenceDate",
",",
"LocalDate",
"startDate",
",",
"LocalDate",
"endDate",
")",
"{",
"return",
"ScheduleGenerator",
".",
"createScheduleFromConventions",
"(",
"referenceDate",
",",
"startDate",
",",
"endDate"... | Generate a schedule for the given start and end date.
@param referenceDate The reference date (corresponds to \( t = 0 \).
@param startDate The start date.
@param endDate The end date.
@return The schedule | [
"Generate",
"a",
"schedule",
"for",
"the",
"given",
"start",
"and",
"end",
"date",
"."
] | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/time/SchedulePrototype.java#L139-L142 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/internal/StackingComponentEventManager.java | StackingComponentEventManager.sendEvent | private void sendEvent(Event event, ComponentDescriptor<?> descriptor, ComponentManager componentManager) {
"""
Send the event.
@param event the event to send
@param descriptor the event related component descriptor.
@param componentManager the event related component manager instance.
"""
if (thi... | java | private void sendEvent(Event event, ComponentDescriptor<?> descriptor, ComponentManager componentManager)
{
if (this.observationManager != null) {
this.observationManager.notify(event, componentManager, descriptor);
}
} | [
"private",
"void",
"sendEvent",
"(",
"Event",
"event",
",",
"ComponentDescriptor",
"<",
"?",
">",
"descriptor",
",",
"ComponentManager",
"componentManager",
")",
"{",
"if",
"(",
"this",
".",
"observationManager",
"!=",
"null",
")",
"{",
"this",
".",
"observati... | Send the event.
@param event the event to send
@param descriptor the event related component descriptor.
@param componentManager the event related component manager instance. | [
"Send",
"the",
"event",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/main/java/org/xwiki/component/internal/StackingComponentEventManager.java#L139-L144 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/linear/SDCA.java | SDCA.setTolerance | public void setTolerance(double e_out) {
"""
Sets the tolerance parameter for convergence. Smaller values will be more
exact, but larger values will converge faster. The default value is
fairly exact at {@value #DEFAULT_EPS}, increasing it by an order of
magnitude can often be done without hurting accuracy.
... | java | public void setTolerance(double e_out)
{
if(e_out <= 0 || Double.isNaN(e_out))
throw new IllegalArgumentException("convergence tolerance paramter must be positive, not " + e_out);
this.tol = e_out;
} | [
"public",
"void",
"setTolerance",
"(",
"double",
"e_out",
")",
"{",
"if",
"(",
"e_out",
"<=",
"0",
"||",
"Double",
".",
"isNaN",
"(",
"e_out",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"convergence tolerance paramter must be positive, not \"",
"... | Sets the tolerance parameter for convergence. Smaller values will be more
exact, but larger values will converge faster. The default value is
fairly exact at {@value #DEFAULT_EPS}, increasing it by an order of
magnitude can often be done without hurting accuracy.
@param e_out the tolerance parameter. | [
"Sets",
"the",
"tolerance",
"parameter",
"for",
"convergence",
".",
"Smaller",
"values",
"will",
"be",
"more",
"exact",
"but",
"larger",
"values",
"will",
"converge",
"faster",
".",
"The",
"default",
"value",
"is",
"fairly",
"exact",
"at",
"{",
"@value",
"#D... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/SDCA.java#L246-L251 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalExtractGeometries.java | TrifocalExtractGeometries.extractFundmental | public void extractFundmental( DMatrixRMaj F21 , DMatrixRMaj F31 ) {
"""
<p>
Extract the fundamental matrices between views 1 + 2 and views 1 + 3. The returned Fundamental
matrices will have the following properties: x<sub>i</sub><sup>T</sup>*Fi*x<sub>1</sub> = 0, where i is view 2 or 3.
</p>
<p>
NOTE: The... | java | public void extractFundmental( DMatrixRMaj F21 , DMatrixRMaj F31 ) {
// compute the camera matrices one column at a time
for( int i = 0; i < 3; i++ ) {
DMatrixRMaj T = tensor.getT(i);
GeometryMath_F64.mult(T,e3,temp0);
GeometryMath_F64.cross(e2,temp0,column);
F21.set(0,i,column.x);
F21.set(1,i,col... | [
"public",
"void",
"extractFundmental",
"(",
"DMatrixRMaj",
"F21",
",",
"DMatrixRMaj",
"F31",
")",
"{",
"// compute the camera matrices one column at a time",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"3",
";",
"i",
"++",
")",
"{",
"DMatrixRMaj",
"T",
... | <p>
Extract the fundamental matrices between views 1 + 2 and views 1 + 3. The returned Fundamental
matrices will have the following properties: x<sub>i</sub><sup>T</sup>*Fi*x<sub>1</sub> = 0, where i is view 2 or 3.
</p>
<p>
NOTE: The first camera is assumed to have the camera matrix of P1 = [I|0]. Thus observations... | [
"<p",
">",
"Extract",
"the",
"fundamental",
"matrices",
"between",
"views",
"1",
"+",
"2",
"and",
"views",
"1",
"+",
"3",
".",
"The",
"returned",
"Fundamental",
"matrices",
"will",
"have",
"the",
"following",
"properties",
":",
"x<sub",
">",
"i<",
"/",
"... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalExtractGeometries.java#L210-L230 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_secondaryDnsDomains_domain_DELETE | public void serviceName_secondaryDnsDomains_domain_DELETE(String serviceName, String domain) throws IOException {
"""
remove this domain
REST: DELETE /dedicated/server/{serviceName}/secondaryDnsDomains/{domain}
@param serviceName [required] The internal name of your dedicated server
@param domain [required] d... | java | public void serviceName_secondaryDnsDomains_domain_DELETE(String serviceName, String domain) throws IOException {
String qPath = "/dedicated/server/{serviceName}/secondaryDnsDomains/{domain}";
StringBuilder sb = path(qPath, serviceName, domain);
exec(qPath, "DELETE", sb.toString(), null);
} | [
"public",
"void",
"serviceName_secondaryDnsDomains_domain_DELETE",
"(",
"String",
"serviceName",
",",
"String",
"domain",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/{serviceName}/secondaryDnsDomains/{domain}\"",
";",
"StringBuilder",
"sb",
... | remove this domain
REST: DELETE /dedicated/server/{serviceName}/secondaryDnsDomains/{domain}
@param serviceName [required] The internal name of your dedicated server
@param domain [required] domain on slave server | [
"remove",
"this",
"domain"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L1976-L1980 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/db/entitymanager/cache/DbEntityCache.java | DbEntityCache.getCachedEntity | public CachedDbEntity getCachedEntity(Class<?> type, String id) {
"""
Looks up an entity in the cache.
@param type the type of the object
@param id the id of the CachedEntity to lookup
@return the cached entity or null if the entity does not exist.
"""
Class<?> cacheKey = cacheKeyMapping.getEntityCach... | java | public CachedDbEntity getCachedEntity(Class<?> type, String id) {
Class<?> cacheKey = cacheKeyMapping.getEntityCacheKey(type);
Map<String, CachedDbEntity> entitiesByType = cachedEntites.get(cacheKey);
if(entitiesByType != null) {
return entitiesByType.get(id);
} else {
return null;
}
} | [
"public",
"CachedDbEntity",
"getCachedEntity",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"id",
")",
"{",
"Class",
"<",
"?",
">",
"cacheKey",
"=",
"cacheKeyMapping",
".",
"getEntityCacheKey",
"(",
"type",
")",
";",
"Map",
"<",
"String",
",",
"Ca... | Looks up an entity in the cache.
@param type the type of the object
@param id the id of the CachedEntity to lookup
@return the cached entity or null if the entity does not exist. | [
"Looks",
"up",
"an",
"entity",
"in",
"the",
"cache",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/db/entitymanager/cache/DbEntityCache.java#L126-L134 |
google/closure-compiler | src/com/google/debugging/sourcemap/SourceMapGeneratorV3.java | SourceMapGeneratorV3.setWrapperPrefix | @Override
public void setWrapperPrefix(String prefix) {
"""
Sets the prefix used for wrapping the generated source file before
it is written. This ensures that the source map is adjusted for the
change in character offsets.
@param prefix The prefix that is added before the generated source code.
"""
... | java | @Override
public void setWrapperPrefix(String prefix) {
// Determine the current line and character position.
int prefixLine = 0;
int prefixIndex = 0;
for (int i = 0; i < prefix.length(); ++i) {
if (prefix.charAt(i) == '\n') {
prefixLine++;
prefixIndex = 0;
} else {
... | [
"@",
"Override",
"public",
"void",
"setWrapperPrefix",
"(",
"String",
"prefix",
")",
"{",
"// Determine the current line and character position.",
"int",
"prefixLine",
"=",
"0",
";",
"int",
"prefixIndex",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"... | Sets the prefix used for wrapping the generated source file before
it is written. This ensures that the source map is adjusted for the
change in character offsets.
@param prefix The prefix that is added before the generated source code. | [
"Sets",
"the",
"prefix",
"used",
"for",
"wrapping",
"the",
"generated",
"source",
"file",
"before",
"it",
"is",
"written",
".",
"This",
"ensures",
"that",
"the",
"source",
"map",
"is",
"adjusted",
"for",
"the",
"change",
"in",
"character",
"offsets",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/debugging/sourcemap/SourceMapGeneratorV3.java#L166-L182 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/script/Script.java | Script.correctlySpends | @Deprecated
public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey)
throws ScriptException {
"""
Verifies that this script (interpreted as a scriptSig) correctly spends the given scriptPubKey, enabling all
validation rules.
@param txContainingThis The t... | java | @Deprecated
public void correctlySpends(Transaction txContainingThis, long scriptSigIndex, Script scriptPubKey)
throws ScriptException {
correctlySpends(txContainingThis, scriptSigIndex, scriptPubKey, ALL_VERIFY_FLAGS);
} | [
"@",
"Deprecated",
"public",
"void",
"correctlySpends",
"(",
"Transaction",
"txContainingThis",
",",
"long",
"scriptSigIndex",
",",
"Script",
"scriptPubKey",
")",
"throws",
"ScriptException",
"{",
"correctlySpends",
"(",
"txContainingThis",
",",
"scriptSigIndex",
",",
... | Verifies that this script (interpreted as a scriptSig) correctly spends the given scriptPubKey, enabling all
validation rules.
@param txContainingThis The transaction in which this input scriptSig resides.
Accessing txContainingThis from another thread while this method runs results in undefined behavior.
@param script... | [
"Verifies",
"that",
"this",
"script",
"(",
"interpreted",
"as",
"a",
"scriptSig",
")",
"correctly",
"spends",
"the",
"given",
"scriptPubKey",
"enabling",
"all",
"validation",
"rules",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/script/Script.java#L1560-L1564 |
iipc/openwayback | wayback-core/src/main/java/org/archive/wayback/partition/ToolBarData.java | ToolBarData.addDay | public static Date addDay(Date date, int amt) {
"""
Increment a Date object by +/- some days
@param date Date to +/- some days from
@param amt number of days to add/remove
@return new Date object offset by the indicated days
"""
return addDateField(date,Calendar.DATE,amt);
} | java | public static Date addDay(Date date, int amt) {
return addDateField(date,Calendar.DATE,amt);
} | [
"public",
"static",
"Date",
"addDay",
"(",
"Date",
"date",
",",
"int",
"amt",
")",
"{",
"return",
"addDateField",
"(",
"date",
",",
"Calendar",
".",
"DATE",
",",
"amt",
")",
";",
"}"
] | Increment a Date object by +/- some days
@param date Date to +/- some days from
@param amt number of days to add/remove
@return new Date object offset by the indicated days | [
"Increment",
"a",
"Date",
"object",
"by",
"+",
"/",
"-",
"some",
"days"
] | train | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/partition/ToolBarData.java#L182-L184 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java | PageFlowUtils.getRelativeURI | public static String getRelativeURI( HttpServletRequest request, String uri, PageFlowController relativeTo ) {
"""
Get a URI relative to the URI of the given PageFlowController.
@param request the current HttpServletRequest.
@param uri the URI which should be made relative.
@param relativeTo a PageFlowControl... | java | public static String getRelativeURI( HttpServletRequest request, String uri, PageFlowController relativeTo )
{
String contextPath = request.getContextPath();
if ( relativeTo != null ) contextPath += relativeTo.getModulePath();
int overlap = uri.indexOf( contextPath + '/' );
if ( over... | [
"public",
"static",
"String",
"getRelativeURI",
"(",
"HttpServletRequest",
"request",
",",
"String",
"uri",
",",
"PageFlowController",
"relativeTo",
")",
"{",
"String",
"contextPath",
"=",
"request",
".",
"getContextPath",
"(",
")",
";",
"if",
"(",
"relativeTo",
... | Get a URI relative to the URI of the given PageFlowController.
@param request the current HttpServletRequest.
@param uri the URI which should be made relative.
@param relativeTo a PageFlowController to which the returned URI should be relative, or
<code>null</code> if the returned URI should be relative to the webapp ... | [
"Get",
"a",
"URI",
"relative",
"to",
"the",
"URI",
"of",
"the",
"given",
"PageFlowController",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java#L150-L157 |
phax/ph-commons | ph-security/src/main/java/com/helger/security/certificate/CertificateHelper.java | CertificateHelper.convertByteArrayToCertficate | @Nullable
public static X509Certificate convertByteArrayToCertficate (@Nullable final byte [] aCertBytes) throws CertificateException {
"""
Convert the passed byte array to an X.509 certificate object.
@param aCertBytes
The original certificate bytes. May be <code>null</code> or empty.
@return <code>null</c... | java | @Nullable
public static X509Certificate convertByteArrayToCertficate (@Nullable final byte [] aCertBytes) throws CertificateException
{
if (ArrayHelper.isEmpty (aCertBytes))
return null;
// Certificate is always ISO-8859-1 encoded
return convertStringToCertficate (new String (aCertBytes, CERT_CHA... | [
"@",
"Nullable",
"public",
"static",
"X509Certificate",
"convertByteArrayToCertficate",
"(",
"@",
"Nullable",
"final",
"byte",
"[",
"]",
"aCertBytes",
")",
"throws",
"CertificateException",
"{",
"if",
"(",
"ArrayHelper",
".",
"isEmpty",
"(",
"aCertBytes",
")",
")"... | Convert the passed byte array to an X.509 certificate object.
@param aCertBytes
The original certificate bytes. May be <code>null</code> or empty.
@return <code>null</code> if the passed byte array is <code>null</code> or
empty
@throws CertificateException
In case the passed string cannot be converted to an X.509
cert... | [
"Convert",
"the",
"passed",
"byte",
"array",
"to",
"an",
"X",
".",
"509",
"certificate",
"object",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-security/src/main/java/com/helger/security/certificate/CertificateHelper.java#L211-L219 |
ralscha/wampspring | src/main/java/ch/rasc/wampspring/user/UserEventMessenger.java | UserEventMessenger.sendToUsersDirect | public void sendToUsersDirect(String topicURI, Object event, Set<String> users) {
"""
Send an EventMessage directly to each client listed in the users set parameter. A
user is ignored if there is no entry in the {@link SimpUserRegistry} for his
username.
<p>
In contrast to {@link #sendToUsers(String, Object, S... | java | public void sendToUsersDirect(String topicURI, Object event, Set<String> users) {
Set<String> webSocketSessionIds = null;
if (users != null && !users.isEmpty()) {
webSocketSessionIds = new HashSet<>(users.size());
for (String user : users) {
for (SimpSession session : this.simpUserRegistry.getUser(user)... | [
"public",
"void",
"sendToUsersDirect",
"(",
"String",
"topicURI",
",",
"Object",
"event",
",",
"Set",
"<",
"String",
">",
"users",
")",
"{",
"Set",
"<",
"String",
">",
"webSocketSessionIds",
"=",
"null",
";",
"if",
"(",
"users",
"!=",
"null",
"&&",
"!",
... | Send an EventMessage directly to each client listed in the users set parameter. A
user is ignored if there is no entry in the {@link SimpUserRegistry} for his
username.
<p>
In contrast to {@link #sendToUsers(String, Object, Set)} this method does not check
if the receivers are subscribed to the destination. The
{@link ... | [
"Send",
"an",
"EventMessage",
"directly",
"to",
"each",
"client",
"listed",
"in",
"the",
"users",
"set",
"parameter",
".",
"A",
"user",
"is",
"ignored",
"if",
"there",
"is",
"no",
"entry",
"in",
"the",
"{",
"@link",
"SimpUserRegistry",
"}",
"for",
"his",
... | train | https://github.com/ralscha/wampspring/blob/7571bb6773b848c580b29890587eb35397bfe5b5/src/main/java/ch/rasc/wampspring/user/UserEventMessenger.java#L188-L203 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/util/ParsedScheduleExpression.java | ParsedScheduleExpression.getFirstTimeout | public long getFirstTimeout() {
"""
Determines the first timeout of the schedule expression.
@return the first timeout in milliseconds, or -1 if there are no timeouts
for the expression
"""
long lastTimeout = Math.max(System.currentTimeMillis(), start); // d666295
// If we're already past ... | java | public long getFirstTimeout()
{
long lastTimeout = Math.max(System.currentTimeMillis(), start); // d666295
// If we're already past the end date, then there is no timeout.
if (lastTimeout > end)
{
return -1;
}
return getTimeout(lastTimeout, false);
} | [
"public",
"long",
"getFirstTimeout",
"(",
")",
"{",
"long",
"lastTimeout",
"=",
"Math",
".",
"max",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
",",
"start",
")",
";",
"// d666295",
"// If we're already past the end date, then there is no timeout.",
"if",
"("... | Determines the first timeout of the schedule expression.
@return the first timeout in milliseconds, or -1 if there are no timeouts
for the expression | [
"Determines",
"the",
"first",
"timeout",
"of",
"the",
"schedule",
"expression",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/util/ParsedScheduleExpression.java#L444-L455 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java | SvgGraphicsContext.setController | public void setController(Object parent, String name, GraphicsController controller) {
"""
Set the controller on an element of this <code>GraphicsContext</code> so it can react to events.
@param parent
the parent of the element on which the controller should be set.
@param name
the name of the child element ... | java | public void setController(Object parent, String name, GraphicsController controller) {
if (isAttached()) {
helper.setController(parent, name, controller);
}
} | [
"public",
"void",
"setController",
"(",
"Object",
"parent",
",",
"String",
"name",
",",
"GraphicsController",
"controller",
")",
"{",
"if",
"(",
"isAttached",
"(",
")",
")",
"{",
"helper",
".",
"setController",
"(",
"parent",
",",
"name",
",",
"controller",
... | Set the controller on an element of this <code>GraphicsContext</code> so it can react to events.
@param parent
the parent of the element on which the controller should be set.
@param name
the name of the child element on which the controller should be set
@param controller
The new <code>GraphicsController</code> | [
"Set",
"the",
"controller",
"on",
"an",
"element",
"of",
"this",
"<code",
">",
"GraphicsContext<",
"/",
"code",
">",
"so",
"it",
"can",
"react",
"to",
"events",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java#L631-L635 |
Impetus/Kundera | src/kundera-kudu/src/main/java/com/impetus/client/kudu/KuduDBClient.java | KuduDBClient.populatePartialRow | private void populatePartialRow(PartialRow row, EntityMetadata entityMetadata, Object entity) {
"""
Populate partial row.
@param row
the row
@param entityMetadata
the entity metadata
@param entity
the entity
"""
MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata()
... | java | private void populatePartialRow(PartialRow row, EntityMetadata entityMetadata, Object entity)
{
MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata()
.getMetamodel(entityMetadata.getPersistenceUnit());
Class entityClazz = entityMetadata.getEntityClazz();
... | [
"private",
"void",
"populatePartialRow",
"(",
"PartialRow",
"row",
",",
"EntityMetadata",
"entityMetadata",
",",
"Object",
"entity",
")",
"{",
"MetamodelImpl",
"metaModel",
"=",
"(",
"MetamodelImpl",
")",
"kunderaMetadata",
".",
"getApplicationMetadata",
"(",
")",
"... | Populate partial row.
@param row
the row
@param entityMetadata
the entity metadata
@param entity
the entity | [
"Populate",
"partial",
"row",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-kudu/src/main/java/com/impetus/client/kudu/KuduDBClient.java#L662-L671 |
apache/groovy | subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java | NioGroovyMethods.withObjectOutputStream | public static <T> T withObjectOutputStream(Path self, @ClosureParams(value = SimpleType.class, options = "java.io.ObjectOutputStream") Closure<T> closure) throws IOException {
"""
Create a new ObjectOutputStream for this path and then pass it to the
closure. This method ensures the stream is closed after the clo... | java | public static <T> T withObjectOutputStream(Path self, @ClosureParams(value = SimpleType.class, options = "java.io.ObjectOutputStream") Closure<T> closure) throws IOException {
return IOGroovyMethods.withStream(newObjectOutputStream(self), closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"withObjectOutputStream",
"(",
"Path",
"self",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.io.ObjectOutputStream\"",
")",
"Closure",
"<",
"T",
">",
"closure",
... | Create a new ObjectOutputStream for this path and then pass it to the
closure. This method ensures the stream is closed after the closure
returns.
@param self a Path
@param closure a closure
@return the value returned by the closure
@throws java.io.IOException if an IOException occurs.
@see IOGroovyMethods#withStr... | [
"Create",
"a",
"new",
"ObjectOutputStream",
"for",
"this",
"path",
"and",
"then",
"pass",
"it",
"to",
"the",
"closure",
".",
"This",
"method",
"ensures",
"the",
"stream",
"is",
"closed",
"after",
"the",
"closure",
"returns",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java#L121-L123 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java | AmazonS3Client.createSigner | protected Signer createSigner(final Request<?> request,
final String bucketName,
final String key) {
"""
Returns a "complete" S3 specific signer, taking into the S3 bucket, key,
and the current S3 client configuration into account.
"""
... | java | protected Signer createSigner(final Request<?> request,
final String bucketName,
final String key) {
return createSigner(request, bucketName, key, false);
} | [
"protected",
"Signer",
"createSigner",
"(",
"final",
"Request",
"<",
"?",
">",
"request",
",",
"final",
"String",
"bucketName",
",",
"final",
"String",
"key",
")",
"{",
"return",
"createSigner",
"(",
"request",
",",
"bucketName",
",",
"key",
",",
"false",
... | Returns a "complete" S3 specific signer, taking into the S3 bucket, key,
and the current S3 client configuration into account. | [
"Returns",
"a",
"complete",
"S3",
"specific",
"signer",
"taking",
"into",
"the",
"S3",
"bucket",
"key",
"and",
"the",
"current",
"S3",
"client",
"configuration",
"into",
"account",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L3975-L3979 |
google/error-prone-javac | src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor6.java | ElementKindVisitor6.visitTypeParameter | @Override
public R visitTypeParameter(TypeParameterElement e, P p) {
"""
{@inheritDoc}
The element argument has kind {@code TYPE_PARAMETER}.
@param e {@inheritDoc}
@param p {@inheritDoc}
@return {@inheritDoc}
"""
assert e.getKind() == TYPE_PARAMETER: "Bad kind on TypeParameterElement";
... | java | @Override
public R visitTypeParameter(TypeParameterElement e, P p) {
assert e.getKind() == TYPE_PARAMETER: "Bad kind on TypeParameterElement";
return defaultAction(e, p);
} | [
"@",
"Override",
"public",
"R",
"visitTypeParameter",
"(",
"TypeParameterElement",
"e",
",",
"P",
"p",
")",
"{",
"assert",
"e",
".",
"getKind",
"(",
")",
"==",
"TYPE_PARAMETER",
":",
"\"Bad kind on TypeParameterElement\"",
";",
"return",
"defaultAction",
"(",
"e... | {@inheritDoc}
The element argument has kind {@code TYPE_PARAMETER}.
@param e {@inheritDoc}
@param p {@inheritDoc}
@return {@inheritDoc} | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor6.java#L406-L410 |
banq/jdonframework | JdonAccessory/jdon-jdbc/src/main/java/com/jdon/model/query/PageIteratorSolver.java | PageIteratorSolver.getBlock | public Block getBlock(String sqlquery, Collection queryParams, int startIndex, int count) {
"""
get a data block by the sql sentence.
@param sqlqueryAllCount
@param sqlquery
@return if not found, return null;
"""
return blockStrategy.getBlock(sqlquery, queryParams, startIndex, count);
} | java | public Block getBlock(String sqlquery, Collection queryParams, int startIndex, int count) {
return blockStrategy.getBlock(sqlquery, queryParams, startIndex, count);
} | [
"public",
"Block",
"getBlock",
"(",
"String",
"sqlquery",
",",
"Collection",
"queryParams",
",",
"int",
"startIndex",
",",
"int",
"count",
")",
"{",
"return",
"blockStrategy",
".",
"getBlock",
"(",
"sqlquery",
",",
"queryParams",
",",
"startIndex",
",",
"count... | get a data block by the sql sentence.
@param sqlqueryAllCount
@param sqlquery
@return if not found, return null; | [
"get",
"a",
"data",
"block",
"by",
"the",
"sql",
"sentence",
"."
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/JdonAccessory/jdon-jdbc/src/main/java/com/jdon/model/query/PageIteratorSolver.java#L274-L276 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.convertPixelToNorm | public static Point2D_F32 convertPixelToNorm( FMatrixRMaj K , Point2D_F32 pixel , Point2D_F32 norm ) {
"""
<p>
Convenient function for converting from original image pixel coordinate to normalized< image coordinates.
If speed is a concern then {@link PinholePtoN_F64} should be used instead.
</p>
NOTE: norm a... | java | public static Point2D_F32 convertPixelToNorm( FMatrixRMaj K , Point2D_F32 pixel , Point2D_F32 norm ) {
return ImplPerspectiveOps_F32.convertPixelToNorm(K, pixel, norm);
} | [
"public",
"static",
"Point2D_F32",
"convertPixelToNorm",
"(",
"FMatrixRMaj",
"K",
",",
"Point2D_F32",
"pixel",
",",
"Point2D_F32",
"norm",
")",
"{",
"return",
"ImplPerspectiveOps_F32",
".",
"convertPixelToNorm",
"(",
"K",
",",
"pixel",
",",
"norm",
")",
";",
"}"... | <p>
Convenient function for converting from original image pixel coordinate to normalized< image coordinates.
If speed is a concern then {@link PinholePtoN_F64} should be used instead.
</p>
NOTE: norm and pixel can be the same instance.
@param K Intrinsic camera calibration matrix
@param pixel Pixel coordinate.
@para... | [
"<p",
">",
"Convenient",
"function",
"for",
"converting",
"from",
"original",
"image",
"pixel",
"coordinate",
"to",
"normalized<",
"image",
"coordinates",
".",
"If",
"speed",
"is",
"a",
"concern",
"then",
"{",
"@link",
"PinholePtoN_F64",
"}",
"should",
"be",
"... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L496-L498 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/SheetDiscussionResourcesImpl.java | SheetDiscussionResourcesImpl.createDiscussionWithAttachment | public Discussion createDiscussionWithAttachment(long sheetId, Discussion discussion, File file, String contentType) throws SmartsheetException, IOException {
"""
Create a discussion with attachments on a sheet.
It mirrors to the following Smartsheet REST API method: POST /sheets/{sheetId}/discussions
@param... | java | public Discussion createDiscussionWithAttachment(long sheetId, Discussion discussion, File file, String contentType) throws SmartsheetException, IOException{
Util.throwIfNull(discussion, file, contentType);
String path = "sheets/" + sheetId + "/discussions";
return this.createDiscussionWithAtta... | [
"public",
"Discussion",
"createDiscussionWithAttachment",
"(",
"long",
"sheetId",
",",
"Discussion",
"discussion",
",",
"File",
"file",
",",
"String",
"contentType",
")",
"throws",
"SmartsheetException",
",",
"IOException",
"{",
"Util",
".",
"throwIfNull",
"(",
"dis... | Create a discussion with attachments on a sheet.
It mirrors to the following Smartsheet REST API method: POST /sheets/{sheetId}/discussions
@param sheetId the sheet id
@param discussion the discussion object
@param file the file to attach
@param contentType the type of file
@return the created discussion
@throws Ille... | [
"Create",
"a",
"discussion",
"with",
"attachments",
"on",
"a",
"sheet",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/SheetDiscussionResourcesImpl.java#L95-L100 |
Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/server/ServerImpl.java | ServerImpl.setNickname | public void setNickname(User user, String nickname) {
"""
Sets the nickname of the user.
@param user The user.
@param nickname The nickname to set.
"""
nicknames.compute(user.getId(), (key, value) -> nickname);
} | java | public void setNickname(User user, String nickname) {
nicknames.compute(user.getId(), (key, value) -> nickname);
} | [
"public",
"void",
"setNickname",
"(",
"User",
"user",
",",
"String",
"nickname",
")",
"{",
"nicknames",
".",
"compute",
"(",
"user",
".",
"getId",
"(",
")",
",",
"(",
"key",
",",
"value",
")",
"->",
"nickname",
")",
";",
"}"
] | Sets the nickname of the user.
@param user The user.
@param nickname The nickname to set. | [
"Sets",
"the",
"nickname",
"of",
"the",
"user",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/server/ServerImpl.java#L720-L722 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_vendor_ovhId_POST | public OvhOvhId serviceName_vendor_ovhId_POST(String serviceName, OvhVendorObjectTypeEnum objectType, String vendorId) throws IOException {
"""
Get ovh id from object type
REST: POST /dedicatedCloud/{serviceName}/vendor/ovhId
@param vendorId [required] object type id
@param objectType [required] object type
... | java | public OvhOvhId serviceName_vendor_ovhId_POST(String serviceName, OvhVendorObjectTypeEnum objectType, String vendorId) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/vendor/ovhId";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(... | [
"public",
"OvhOvhId",
"serviceName_vendor_ovhId_POST",
"(",
"String",
"serviceName",
",",
"OvhVendorObjectTypeEnum",
"objectType",
",",
"String",
"vendorId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicatedCloud/{serviceName}/vendor/ovhId\"",
";",
"S... | Get ovh id from object type
REST: POST /dedicatedCloud/{serviceName}/vendor/ovhId
@param vendorId [required] object type id
@param objectType [required] object type
@param serviceName [required] Domain of the service | [
"Get",
"ovh",
"id",
"from",
"object",
"type"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L180-L188 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark-parameterserver/src/main/java/org/deeplearning4j/spark/parameterserver/networking/v1/SilentTrainingDriver.java | SilentTrainingDriver.finishTraining | @Override
public void finishTraining(long originatorId, long taskId) {
"""
This method is used on Master only, applies buffered updates to params
@param originatorId
@param taskId
"""
// on Master thread we'll be applying final gradients
if (params != null && stepFunction != null) {
... | java | @Override
public void finishTraining(long originatorId, long taskId) {
// on Master thread we'll be applying final gradients
if (params != null && stepFunction != null) {
if (hasSomething.get()) {
stepFunction.step(params, updates);
//Nd4j.getMemoryManage... | [
"@",
"Override",
"public",
"void",
"finishTraining",
"(",
"long",
"originatorId",
",",
"long",
"taskId",
")",
"{",
"// on Master thread we'll be applying final gradients",
"if",
"(",
"params",
"!=",
"null",
"&&",
"stepFunction",
"!=",
"null",
")",
"{",
"if",
"(",
... | This method is used on Master only, applies buffered updates to params
@param originatorId
@param taskId | [
"This",
"method",
"is",
"used",
"on",
"Master",
"only",
"applies",
"buffered",
"updates",
"to",
"params"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark-parameterserver/src/main/java/org/deeplearning4j/spark/parameterserver/networking/v1/SilentTrainingDriver.java#L218-L230 |
craftercms/core | src/main/java/org/craftercms/core/util/XmlUtils.java | XmlUtils.selectObject | public static Object selectObject(Node node, String xpathQuery) {
"""
Executes an XPath query to retrieve an object. Normally, if the XPath result doesn't have a result, an
empty collection is returned. This object checks that case and returns null accordingly.
"""
Object result = node.selectObject(xp... | java | public static Object selectObject(Node node, String xpathQuery) {
Object result = node.selectObject(xpathQuery);
if (result != null && result instanceof Collection && ((Collection) result).isEmpty()) {
return null;
} else {
return result;
}
} | [
"public",
"static",
"Object",
"selectObject",
"(",
"Node",
"node",
",",
"String",
"xpathQuery",
")",
"{",
"Object",
"result",
"=",
"node",
".",
"selectObject",
"(",
"xpathQuery",
")",
";",
"if",
"(",
"result",
"!=",
"null",
"&&",
"result",
"instanceof",
"C... | Executes an XPath query to retrieve an object. Normally, if the XPath result doesn't have a result, an
empty collection is returned. This object checks that case and returns null accordingly. | [
"Executes",
"an",
"XPath",
"query",
"to",
"retrieve",
"an",
"object",
".",
"Normally",
"if",
"the",
"XPath",
"result",
"doesn",
"t",
"have",
"a",
"result",
"an",
"empty",
"collection",
"is",
"returned",
".",
"This",
"object",
"checks",
"that",
"case",
"and... | train | https://github.com/craftercms/core/blob/d3ec74d669d3f8cfcf995177615d5f126edfa237/src/main/java/org/craftercms/core/util/XmlUtils.java#L46-L53 |
lastaflute/lastaflute | src/main/java/org/lastaflute/web/path/ActionPathResolver.java | ActionPathResolver.toActionUrl | public String toActionUrl(Class<?> actionType, UrlChain chain) {
"""
Convert to URL string to move the action. <br>
e.g. ProductListAction with moreUrl(3) to /product/list/3 <br>
And not contain context path.
@param actionType The class type of action that it redirects to. (NotNull)
@param chain The chain of U... | java | public String toActionUrl(Class<?> actionType, UrlChain chain) {
assertArgumentNotNull("actionType", actionType);
assertArgumentNotNull("chain", chain);
final UrlReverseOption option = customizeActionUrlReverse(actionType, chain); // not null, empty allowed
final StringBuilder sb = new S... | [
"public",
"String",
"toActionUrl",
"(",
"Class",
"<",
"?",
">",
"actionType",
",",
"UrlChain",
"chain",
")",
"{",
"assertArgumentNotNull",
"(",
"\"actionType\"",
",",
"actionType",
")",
";",
"assertArgumentNotNull",
"(",
"\"chain\"",
",",
"chain",
")",
";",
"f... | Convert to URL string to move the action. <br>
e.g. ProductListAction with moreUrl(3) to /product/list/3 <br>
And not contain context path.
@param actionType The class type of action that it redirects to. (NotNull)
@param chain The chain of URL to build additional info on URL. (NotNull)
@return The URL string to move t... | [
"Convert",
"to",
"URL",
"string",
"to",
"move",
"the",
"action",
".",
"<br",
">",
"e",
".",
"g",
".",
"ProductListAction",
"with",
"moreUrl",
"(",
"3",
")",
"to",
"/",
"product",
"/",
"list",
"/",
"3",
"<br",
">",
"And",
"not",
"contain",
"context",
... | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/path/ActionPathResolver.java#L374-L384 |
alipay/sofa-rpc | core/common/src/main/java/com/alipay/sofa/rpc/common/cache/ReflectCache.java | ReflectCache.putMethodSigsCache | public static void putMethodSigsCache(String serviceName, String methodName, String[] argSigs) {
"""
往缓存里放入方法参数签名
@param serviceName 服务名(非接口名)
@param methodName 方法名
@param argSigs 方法参数签名
"""
ConcurrentHashMap<String, String[]> cacheSigs = NOT_OVERLOAD_METHOD_SIGS_CACHE.get(serviceName);
... | java | public static void putMethodSigsCache(String serviceName, String methodName, String[] argSigs) {
ConcurrentHashMap<String, String[]> cacheSigs = NOT_OVERLOAD_METHOD_SIGS_CACHE.get(serviceName);
if (cacheSigs == null) {
cacheSigs = new ConcurrentHashMap<String, String[]>();
Concur... | [
"public",
"static",
"void",
"putMethodSigsCache",
"(",
"String",
"serviceName",
",",
"String",
"methodName",
",",
"String",
"[",
"]",
"argSigs",
")",
"{",
"ConcurrentHashMap",
"<",
"String",
",",
"String",
"[",
"]",
">",
"cacheSigs",
"=",
"NOT_OVERLOAD_METHOD_SI... | 往缓存里放入方法参数签名
@param serviceName 服务名(非接口名)
@param methodName 方法名
@param argSigs 方法参数签名 | [
"往缓存里放入方法参数签名"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/common/src/main/java/com/alipay/sofa/rpc/common/cache/ReflectCache.java#L211-L222 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/JobTracker.java | JobTracker.markCompletedTaskAttempt | void markCompletedTaskAttempt(String taskTracker, TaskAttemptID taskid) {
"""
Mark a 'task' for removal later.
This function assumes that the JobTracker is locked on entry.
@param taskTracker the tasktracker at which the 'task' was running
@param taskid completed (success/failure/killed) task
"""
// t... | java | void markCompletedTaskAttempt(String taskTracker, TaskAttemptID taskid) {
// tracker --> taskid
Set<TaskAttemptID> taskset = trackerToMarkedTasksMap.get(taskTracker);
if (taskset == null) {
taskset = new TreeSet<TaskAttemptID>();
trackerToMarkedTasksMap.put(taskTracker, taskset);
}
tasks... | [
"void",
"markCompletedTaskAttempt",
"(",
"String",
"taskTracker",
",",
"TaskAttemptID",
"taskid",
")",
"{",
"// tracker --> taskid",
"Set",
"<",
"TaskAttemptID",
">",
"taskset",
"=",
"trackerToMarkedTasksMap",
".",
"get",
"(",
"taskTracker",
")",
";",
"if",
"(",
"... | Mark a 'task' for removal later.
This function assumes that the JobTracker is locked on entry.
@param taskTracker the tasktracker at which the 'task' was running
@param taskid completed (success/failure/killed) task | [
"Mark",
"a",
"task",
"for",
"removal",
"later",
".",
"This",
"function",
"assumes",
"that",
"the",
"JobTracker",
"is",
"locked",
"on",
"entry",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/JobTracker.java#L1782-L1792 |
pressgang-ccms/PressGangCCMSContentSpecProcessor | src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java | ContentSpecParser.parseGlobalOptionsLine | protected boolean parseGlobalOptionsLine(final ParserData parserData, final String line, int lineNumber) throws ParsingException {
"""
Processes a line that represents the Global Options for the Content Specification.
@param parserData
@param line The line to be processed.
@return True if the line was p... | java | protected boolean parseGlobalOptionsLine(final ParserData parserData, final String line, int lineNumber) throws ParsingException {
// Read in the variables from the line
final HashMap<ParserType, String[]> variableMap = getLineVariables(parserData, line, lineNumber, '[', ']', ',', false);
// Ch... | [
"protected",
"boolean",
"parseGlobalOptionsLine",
"(",
"final",
"ParserData",
"parserData",
",",
"final",
"String",
"line",
",",
"int",
"lineNumber",
")",
"throws",
"ParsingException",
"{",
"// Read in the variables from the line",
"final",
"HashMap",
"<",
"ParserType",
... | Processes a line that represents the Global Options for the Content Specification.
@param parserData
@param line The line to be processed.
@return True if the line was processed without errors, otherwise false. | [
"Processes",
"a",
"line",
"that",
"represents",
"the",
"Global",
"Options",
"for",
"the",
"Content",
"Specification",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java#L918-L937 |
jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/filter/ContentMapping.java | ContentMapping.of | public static ContentMapping of(@Nonnull String original, @Nonnull String replacement) {
"""
Constructs a ContentMapping using an original and replacement value.
"""
return new ContentMapping(original, replacement);
} | java | public static ContentMapping of(@Nonnull String original, @Nonnull String replacement) {
return new ContentMapping(original, replacement);
} | [
"public",
"static",
"ContentMapping",
"of",
"(",
"@",
"Nonnull",
"String",
"original",
",",
"@",
"Nonnull",
"String",
"replacement",
")",
"{",
"return",
"new",
"ContentMapping",
"(",
"original",
",",
"replacement",
")",
";",
"}"
] | Constructs a ContentMapping using an original and replacement value. | [
"Constructs",
"a",
"ContentMapping",
"using",
"an",
"original",
"and",
"replacement",
"value",
"."
] | train | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/filter/ContentMapping.java#L82-L84 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/beans/AbstractBeanIntrospection.java | AbstractBeanIntrospection.addProperty | @SuppressWarnings("unused")
@Internal
@UsedByGeneratedCode
protected final void addProperty(@Nonnull BeanProperty<T, Object> property) {
"""
Adds a property at a particular index of the internal array passed to the constructor. Used by
generated byte code for subclasses and not for public consumption.... | java | @SuppressWarnings("unused")
@Internal
@UsedByGeneratedCode
protected final void addProperty(@Nonnull BeanProperty<T, Object> property) {
ArgumentUtils.requireNonNull("property", property);
beanProperties.put(property.getName(), property);
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"@",
"Internal",
"@",
"UsedByGeneratedCode",
"protected",
"final",
"void",
"addProperty",
"(",
"@",
"Nonnull",
"BeanProperty",
"<",
"T",
",",
"Object",
">",
"property",
")",
"{",
"ArgumentUtils",
".",
"requireNonN... | Adds a property at a particular index of the internal array passed to the constructor. Used by
generated byte code for subclasses and not for public consumption.
@param property The property. | [
"Adds",
"a",
"property",
"at",
"a",
"particular",
"index",
"of",
"the",
"internal",
"array",
"passed",
"to",
"the",
"constructor",
".",
"Used",
"by",
"generated",
"byte",
"code",
"for",
"subclasses",
"and",
"not",
"for",
"public",
"consumption",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/beans/AbstractBeanIntrospection.java#L162-L168 |
Squarespace/cldr | core/src/main/java/com/squarespace/cldr/dates/CalendarFormattingUtils.java | CalendarFormattingUtils.sameDay | public static boolean sameDay(ZonedDateTime d1, ZonedDateTime d2) {
"""
Returns a boolean indicating the two date times are on the same day.
"""
DateTimeField field = greatestDifference(d1, d2);
return (field != YEAR && field != MONTH && field != DAY);
} | java | public static boolean sameDay(ZonedDateTime d1, ZonedDateTime d2) {
DateTimeField field = greatestDifference(d1, d2);
return (field != YEAR && field != MONTH && field != DAY);
} | [
"public",
"static",
"boolean",
"sameDay",
"(",
"ZonedDateTime",
"d1",
",",
"ZonedDateTime",
"d2",
")",
"{",
"DateTimeField",
"field",
"=",
"greatestDifference",
"(",
"d1",
",",
"d2",
")",
";",
"return",
"(",
"field",
"!=",
"YEAR",
"&&",
"field",
"!=",
"MON... | Returns a boolean indicating the two date times are on the same day. | [
"Returns",
"a",
"boolean",
"indicating",
"the",
"two",
"date",
"times",
"are",
"on",
"the",
"same",
"day",
"."
] | train | https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/core/src/main/java/com/squarespace/cldr/dates/CalendarFormattingUtils.java#L21-L24 |
camunda/camunda-bpm-platform | engine-cdi/src/main/java/org/camunda/bpm/engine/cdi/jsf/TaskForm.java | TaskForm.startTask | @Deprecated
public void startTask(String taskId, String callbackUrl) {
"""
@deprecated use {@link startTaskForm()} instead
@param taskId
@param callbackUrl
"""
if (taskId==null || callbackUrl == null) {
if (FacesContext.getCurrentInstance().isPostback()) {
// if this is an AJAX request ... | java | @Deprecated
public void startTask(String taskId, String callbackUrl) {
if (taskId==null || callbackUrl == null) {
if (FacesContext.getCurrentInstance().isPostback()) {
// if this is an AJAX request ignore it, since we will receive multiple calls to this bean if it is added
// as preRenderVie... | [
"@",
"Deprecated",
"public",
"void",
"startTask",
"(",
"String",
"taskId",
",",
"String",
"callbackUrl",
")",
"{",
"if",
"(",
"taskId",
"==",
"null",
"||",
"callbackUrl",
"==",
"null",
")",
"{",
"if",
"(",
"FacesContext",
".",
"getCurrentInstance",
"(",
")... | @deprecated use {@link startTaskForm()} instead
@param taskId
@param callbackUrl | [
"@deprecated",
"use",
"{",
"@link",
"startTaskForm",
"()",
"}",
"instead"
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine-cdi/src/main/java/org/camunda/bpm/engine/cdi/jsf/TaskForm.java#L64-L80 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPUtils.java | RTMPUtils.diffTimestamps | public static long diffTimestamps(final int a, final int b) {
"""
Calculates the delta between two time stamps, adjusting for time stamp wrapping.
@param a
First time stamp
@param b
Second time stamp
@return the distance between a and b, which will be negative if a is less than b.
"""
// first ... | java | public static long diffTimestamps(final int a, final int b) {
// first convert each to unsigned integers
final long unsignedA = a & 0xFFFFFFFFL;
final long unsignedB = b & 0xFFFFFFFFL;
// then find the delta
final long delta = unsignedA - unsignedB;
return delta;
... | [
"public",
"static",
"long",
"diffTimestamps",
"(",
"final",
"int",
"a",
",",
"final",
"int",
"b",
")",
"{",
"// first convert each to unsigned integers\r",
"final",
"long",
"unsignedA",
"=",
"a",
"&",
"0xFFFFFFFF",
"L",
";",
"final",
"long",
"unsignedB",
"=",
... | Calculates the delta between two time stamps, adjusting for time stamp wrapping.
@param a
First time stamp
@param b
Second time stamp
@return the distance between a and b, which will be negative if a is less than b. | [
"Calculates",
"the",
"delta",
"between",
"two",
"time",
"stamps",
"adjusting",
"for",
"time",
"stamp",
"wrapping",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPUtils.java#L219-L226 |
jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/BaseServerResponseException.java | BaseServerResponseException.addResponseHeader | public BaseServerResponseException addResponseHeader(String theName, String theValue) {
"""
Add a header which will be added to any responses
@param theName The header name
@param theValue The header value
@return Returns a reference to <code>this</code> for easy method chaining
@since 2.0
"""
Validat... | java | public BaseServerResponseException addResponseHeader(String theName, String theValue) {
Validate.notBlank(theName, "theName must not be null or empty");
Validate.notBlank(theValue, "theValue must not be null or empty");
if (getResponseHeaders().containsKey(theName) == false) {
getResponseHeaders().put(theName,... | [
"public",
"BaseServerResponseException",
"addResponseHeader",
"(",
"String",
"theName",
",",
"String",
"theValue",
")",
"{",
"Validate",
".",
"notBlank",
"(",
"theName",
",",
"\"theName must not be null or empty\"",
")",
";",
"Validate",
".",
"notBlank",
"(",
"theValu... | Add a header which will be added to any responses
@param theName The header name
@param theValue The header value
@return Returns a reference to <code>this</code> for easy method chaining
@since 2.0 | [
"Add",
"a",
"header",
"which",
"will",
"be",
"added",
"to",
"any",
"responses"
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/exceptions/BaseServerResponseException.java#L193-L201 |
cucumber/cucumber-jvm | java/src/main/java/cucumber/runtime/java/MethodScanner.java | MethodScanner.scan | public void scan(JavaBackend javaBackend, Method method, Class<?> glueCodeClass) {
"""
Registers step definitions and hooks.
@param javaBackend the backend where stepdefs and hooks will be registered.
@param method a candidate for being a stepdef or hook.
@param glueCodeClass the class where the meth... | java | public void scan(JavaBackend javaBackend, Method method, Class<?> glueCodeClass) {
Annotation[] methodAnnotations = method.getAnnotations();
for (Annotation annotation : methodAnnotations) {
if (isHookAnnotation(annotation)) {
validateMethod(method, glueCodeClass);
... | [
"public",
"void",
"scan",
"(",
"JavaBackend",
"javaBackend",
",",
"Method",
"method",
",",
"Class",
"<",
"?",
">",
"glueCodeClass",
")",
"{",
"Annotation",
"[",
"]",
"methodAnnotations",
"=",
"method",
".",
"getAnnotations",
"(",
")",
";",
"for",
"(",
"Ann... | Registers step definitions and hooks.
@param javaBackend the backend where stepdefs and hooks will be registered.
@param method a candidate for being a stepdef or hook.
@param glueCodeClass the class where the method is declared. | [
"Registers",
"step",
"definitions",
"and",
"hooks",
"."
] | train | https://github.com/cucumber/cucumber-jvm/blob/437bb3a1f1d91b56f44059c835765b395eefc777/java/src/main/java/cucumber/runtime/java/MethodScanner.java#L56-L67 |
j256/ormlite-android | src/main/java/com/j256/ormlite/android/DatabaseTableConfigUtil.java | DatabaseTableConfigUtil.configFromField | private static DatabaseFieldConfig configFromField(DatabaseType databaseType, String tableName, Field field)
throws SQLException {
"""
Extract our configuration information from the field by looking for a {@link DatabaseField} annotation.
"""
if (configFieldNums == null) {
return DatabaseFieldConfig.f... | java | private static DatabaseFieldConfig configFromField(DatabaseType databaseType, String tableName, Field field)
throws SQLException {
if (configFieldNums == null) {
return DatabaseFieldConfig.fromField(databaseType, tableName, field);
}
/*
* This, unfortunately, we can't get around. This creates a Annotat... | [
"private",
"static",
"DatabaseFieldConfig",
"configFromField",
"(",
"DatabaseType",
"databaseType",
",",
"String",
"tableName",
",",
"Field",
"field",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"configFieldNums",
"==",
"null",
")",
"{",
"return",
"DatabaseFieldC... | Extract our configuration information from the field by looking for a {@link DatabaseField} annotation. | [
"Extract",
"our",
"configuration",
"information",
"from",
"the",
"field",
"by",
"looking",
"for",
"a",
"{"
] | train | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/DatabaseTableConfigUtil.java#L253-L286 |
JohnSnowLabs/spark-nlp | src/main/scala/com/johnsnowlabs/nlp/annotators/parser/typdep/DependencyPipe.java | DependencyPipe.createDictionaries | private void createDictionaries(String file, String conllFormat) throws IOException {
"""
*F
Build dictionariesSet that maps word strings, POS strings, etc into
corresponding integer IDs. This method is called before creating
the feature alphabets and before training a dependency model.
@param file file path... | java | private void createDictionaries(String file, String conllFormat) throws IOException
{
long start = System.currentTimeMillis();
logger.debug("Creating dictionariesSet ... ");
dictionariesSet.setCounters();
DependencyReader reader = DependencyReader.createDependencyReader(conllFormat... | [
"private",
"void",
"createDictionaries",
"(",
"String",
"file",
",",
"String",
"conllFormat",
")",
"throws",
"IOException",
"{",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"logger",
".",
"debug",
"(",
"\"Creating dictionariesSet ... \... | *F
Build dictionariesSet that maps word strings, POS strings, etc into
corresponding integer IDs. This method is called before creating
the feature alphabets and before training a dependency model.
@param file file path of the training data | [
"*",
"F",
"Build",
"dictionariesSet",
"that",
"maps",
"word",
"strings",
"POS",
"strings",
"etc",
"into",
"corresponding",
"integer",
"IDs",
".",
"This",
"method",
"is",
"called",
"before",
"creating",
"the",
"feature",
"alphabets",
"and",
"before",
"training",
... | train | https://github.com/JohnSnowLabs/spark-nlp/blob/cf6c7a86e044b82f7690157c195f77874858bb00/src/main/scala/com/johnsnowlabs/nlp/annotators/parser/typdep/DependencyPipe.java#L120-L174 |
zalando/logbook | logbook-core/src/main/java/org/zalando/logbook/BodyFilters.java | BodyFilters.replaceFormUrlEncodedProperty | @API(status = EXPERIMENTAL)
public static BodyFilter replaceFormUrlEncodedProperty(final Set<String> properties, final String replacement) {
"""
Creates a {@link BodyFilter} that replaces the properties in the form url encoded body with given replacement.
@param properties query names properties to replace... | java | @API(status = EXPERIMENTAL)
public static BodyFilter replaceFormUrlEncodedProperty(final Set<String> properties, final String replacement) {
final Predicate<String> formUrlEncoded = MediaTypeQuery.compile("application/x-www-form-urlencoded");
final QueryFilter delegate = properties.stream()
... | [
"@",
"API",
"(",
"status",
"=",
"EXPERIMENTAL",
")",
"public",
"static",
"BodyFilter",
"replaceFormUrlEncodedProperty",
"(",
"final",
"Set",
"<",
"String",
">",
"properties",
",",
"final",
"String",
"replacement",
")",
"{",
"final",
"Predicate",
"<",
"String",
... | Creates a {@link BodyFilter} that replaces the properties in the form url encoded body with given replacement.
@param properties query names properties to replace
@param replacement String to replace the properties values
@return BodyFilter generated | [
"Creates",
"a",
"{",
"@link",
"BodyFilter",
"}",
"that",
"replaces",
"the",
"properties",
"in",
"the",
"form",
"url",
"encoded",
"body",
"with",
"given",
"replacement",
"."
] | train | https://github.com/zalando/logbook/blob/1c2fe40a2f6a3d2f60e746ab1da173a3907a21c4/logbook-core/src/main/java/org/zalando/logbook/BodyFilters.java#L43-L53 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/index/BresenhamLine.java | BresenhamLine.calcPoints | public static void calcPoints(final double lat1, final double lon1,
final double lat2, final double lon2,
final PointEmitter emitter,
final double offsetLat, final double offsetLon,
fi... | java | public static void calcPoints(final double lat1, final double lon1,
final double lat2, final double lon2,
final PointEmitter emitter,
final double offsetLat, final double offsetLon,
fi... | [
"public",
"static",
"void",
"calcPoints",
"(",
"final",
"double",
"lat1",
",",
"final",
"double",
"lon1",
",",
"final",
"double",
"lat2",
",",
"final",
"double",
"lon2",
",",
"final",
"PointEmitter",
"emitter",
",",
"final",
"double",
"offsetLat",
",",
"fina... | Calls the Bresenham algorithm but make it working for double values | [
"Calls",
"the",
"Bresenham",
"algorithm",
"but",
"make",
"it",
"working",
"for",
"double",
"values"
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/index/BresenhamLine.java#L65-L82 |
atomix/atomix | protocols/raft/src/main/java/io/atomix/protocols/raft/impl/RaftContext.java | RaftContext.awaitState | public void awaitState(State state, Consumer<State> listener) {
"""
Awaits a state change.
@param state the state for which to wait
@param listener the listener to call when the next state change occurs
"""
if (this.state == state) {
listener.accept(this.state);
} else {
addStateChan... | java | public void awaitState(State state, Consumer<State> listener) {
if (this.state == state) {
listener.accept(this.state);
} else {
addStateChangeListener(new Consumer<State>() {
@Override
public void accept(State state) {
listener.accept(state);
removeStateChangeLis... | [
"public",
"void",
"awaitState",
"(",
"State",
"state",
",",
"Consumer",
"<",
"State",
">",
"listener",
")",
"{",
"if",
"(",
"this",
".",
"state",
"==",
"state",
")",
"{",
"listener",
".",
"accept",
"(",
"this",
".",
"state",
")",
";",
"}",
"else",
... | Awaits a state change.
@param state the state for which to wait
@param listener the listener to call when the next state change occurs | [
"Awaits",
"a",
"state",
"change",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/impl/RaftContext.java#L234-L246 |
square/dagger | compiler/src/main/java/dagger/internal/codegen/Util.java | Util.lenientIsInstance | private static boolean lenientIsInstance(Class<?> expectedClass, Object value) {
"""
Returns true if {@code value} can be assigned to {@code expectedClass}.
Like {@link Class#isInstance} but more lenient for {@code Class<?>} values.
"""
if (expectedClass.isArray()) {
Class<?> componentType = expecte... | java | private static boolean lenientIsInstance(Class<?> expectedClass, Object value) {
if (expectedClass.isArray()) {
Class<?> componentType = expectedClass.getComponentType();
if (!(value instanceof Object[])) {
return false;
}
for (Object element : (Object[]) value) {
if (!lenien... | [
"private",
"static",
"boolean",
"lenientIsInstance",
"(",
"Class",
"<",
"?",
">",
"expectedClass",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"expectedClass",
".",
"isArray",
"(",
")",
")",
"{",
"Class",
"<",
"?",
">",
"componentType",
"=",
"expectedClas... | Returns true if {@code value} can be assigned to {@code expectedClass}.
Like {@link Class#isInstance} but more lenient for {@code Class<?>} values. | [
"Returns",
"true",
"if",
"{"
] | train | https://github.com/square/dagger/blob/572cdd2fe97fc3c148fb3d8e1b2ce7beb4dcbcde/compiler/src/main/java/dagger/internal/codegen/Util.java#L272-L287 |
JodaOrg/joda-time | src/main/java/org/joda/time/Hours.java | Hours.hoursBetween | public static Hours hoursBetween(ReadableInstant start, ReadableInstant end) {
"""
Creates a <code>Hours</code> representing the number of whole hours
between the two specified datetimes.
@param start the start instant, must not be null
@param end the end instant, must not be null
@return the period in hou... | java | public static Hours hoursBetween(ReadableInstant start, ReadableInstant end) {
int amount = BaseSingleFieldPeriod.between(start, end, DurationFieldType.hours());
return Hours.hours(amount);
} | [
"public",
"static",
"Hours",
"hoursBetween",
"(",
"ReadableInstant",
"start",
",",
"ReadableInstant",
"end",
")",
"{",
"int",
"amount",
"=",
"BaseSingleFieldPeriod",
".",
"between",
"(",
"start",
",",
"end",
",",
"DurationFieldType",
".",
"hours",
"(",
")",
")... | Creates a <code>Hours</code> representing the number of whole hours
between the two specified datetimes.
@param start the start instant, must not be null
@param end the end instant, must not be null
@return the period in hours
@throws IllegalArgumentException if the instants are null or invalid | [
"Creates",
"a",
"<code",
">",
"Hours<",
"/",
"code",
">",
"representing",
"the",
"number",
"of",
"whole",
"hours",
"between",
"the",
"two",
"specified",
"datetimes",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Hours.java#L120-L123 |
j-a-w-r/jawr-main-repo | jawr-tools/jawr-bundle-processor/src/main/java/net/jawr/web/bundle/processor/BundleProcessor.java | BundleProcessor.getWebXmlDocument | protected Document getWebXmlDocument(String baseDir)
throws ParserConfigurationException, FactoryConfigurationError,
SAXException, IOException {
"""
Returns the XML document of the web.xml file
@param webXmlPath
the web.xml path
@return the Xml document of the web.xml file
@throws ParserConfiguration... | java | protected Document getWebXmlDocument(String baseDir)
throws ParserConfigurationException, FactoryConfigurationError,
SAXException, IOException {
File webXml = new File(baseDir, WEB_XML_FILE_PATH);
DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance()
.newDocumentBuilder();
docBuilder.setEnti... | [
"protected",
"Document",
"getWebXmlDocument",
"(",
"String",
"baseDir",
")",
"throws",
"ParserConfigurationException",
",",
"FactoryConfigurationError",
",",
"SAXException",
",",
"IOException",
"{",
"File",
"webXml",
"=",
"new",
"File",
"(",
"baseDir",
",",
"WEB_XML_F... | Returns the XML document of the web.xml file
@param webXmlPath
the web.xml path
@return the Xml document of the web.xml file
@throws ParserConfigurationException
if a parser configuration exception occurs
@throws FactoryConfigurationError
if a factory configuration exception occurs
@throws SAXException
if a SAX excep... | [
"Returns",
"the",
"XML",
"document",
"of",
"the",
"web",
".",
"xml",
"file"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr-tools/jawr-bundle-processor/src/main/java/net/jawr/web/bundle/processor/BundleProcessor.java#L297-L314 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryFileApi.java | RepositoryFileApi.getFileInfo | public RepositoryFile getFileInfo(Object projectIdOrPath, String filePath, String ref) throws GitLabApiException {
"""
Get information on a file in the repository. Allows you to receive information about file in repository like name, size.
Only works with GitLab 11.1.0+, returns an empty object for earlier versio... | java | public RepositoryFile getFileInfo(Object projectIdOrPath, String filePath, String ref) throws GitLabApiException {
Form form = new Form();
addFormParam(form, "ref", ref, true);
Response response = head(Response.Status.OK, form.asMap(),
"projects", getProjectIdOrPath(projectIdOrP... | [
"public",
"RepositoryFile",
"getFileInfo",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"filePath",
",",
"String",
"ref",
")",
"throws",
"GitLabApiException",
"{",
"Form",
"form",
"=",
"new",
"Form",
"(",
")",
";",
"addFormParam",
"(",
"form",
",",
"\"ref\... | Get information on a file in the repository. Allows you to receive information about file in repository like name, size.
Only works with GitLab 11.1.0+, returns an empty object for earlier versions of GitLab.
<pre><code>GitLab Endpoint: HEAD /projects/:id/repository/files</code></pre>
@param projectIdOrPath the id, p... | [
"Get",
"information",
"on",
"a",
"file",
"in",
"the",
"repository",
".",
"Allows",
"you",
"to",
"receive",
"information",
"about",
"file",
"in",
"repository",
"like",
"name",
"size",
".",
"Only",
"works",
"with",
"GitLab",
"11",
".",
"1",
".",
"0",
"+",
... | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryFileApi.java#L60-L80 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.beginGeneratevpnclientpackageAsync | public Observable<String> beginGeneratevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) {
"""
Generates VPN client package for P2S client of the virtual network gateway in the specified resource group.
@param resourceGroupName The name of the reso... | java | public Observable<String> beginGeneratevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) {
return beginGeneratevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1<ServiceResponse<String>,... | [
"public",
"Observable",
"<",
"String",
">",
"beginGeneratevpnclientpackageAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
",",
"VpnClientParameters",
"parameters",
")",
"{",
"return",
"beginGeneratevpnclientpackageWithServiceResponseAsync",... | Generates VPN client package for P2S client of the virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@param parameters Parameters supplied to the generate virtual network gateway VP... | [
"Generates",
"VPN",
"client",
"package",
"for",
"P2S",
"client",
"of",
"the",
"virtual",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L1567-L1574 |
apereo/cas | support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java | LdapUtils.getBoolean | public static Boolean getBoolean(final LdapEntry ctx, final String attribute, final Boolean nullValue) {
"""
Reads a Boolean value from the LdapEntry.
@param ctx the ldap entry
@param attribute the attribute name
@param nullValue the value which should be returning in case of a null value
@return {@cod... | java | public static Boolean getBoolean(final LdapEntry ctx, final String attribute, final Boolean nullValue) {
val v = getString(ctx, attribute, nullValue.toString());
if (v != null) {
return v.equalsIgnoreCase(Boolean.TRUE.toString());
}
return nullValue;
} | [
"public",
"static",
"Boolean",
"getBoolean",
"(",
"final",
"LdapEntry",
"ctx",
",",
"final",
"String",
"attribute",
",",
"final",
"Boolean",
"nullValue",
")",
"{",
"val",
"v",
"=",
"getString",
"(",
"ctx",
",",
"attribute",
",",
"nullValue",
".",
"toString",... | Reads a Boolean value from the LdapEntry.
@param ctx the ldap entry
@param attribute the attribute name
@param nullValue the value which should be returning in case of a null value
@return {@code true} if the attribute's value matches (case-insensitive) {@code "true"}, otherwise false | [
"Reads",
"a",
"Boolean",
"value",
"from",
"the",
"LdapEntry",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java#L148-L154 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java | GeometryUtil.shiftContainer | public static double[] shiftContainer(IAtomContainer container, double[] bounds, double[] last, double gap) {
"""
Shift the container horizontally to the right to make its bounds not overlap with the other
bounds. To avoid dependence on Java AWT, rectangles are described by arrays of double. Each
rectangle is sp... | java | public static double[] shiftContainer(IAtomContainer container, double[] bounds, double[] last, double gap) {
assert bounds.length == 4;
assert last.length == 4;
final double boundsMinX = bounds[0];
final double boundsMinY = bounds[1];
final double boundsMaxX = bounds[2];
... | [
"public",
"static",
"double",
"[",
"]",
"shiftContainer",
"(",
"IAtomContainer",
"container",
",",
"double",
"[",
"]",
"bounds",
",",
"double",
"[",
"]",
"last",
",",
"double",
"gap",
")",
"{",
"assert",
"bounds",
".",
"length",
"==",
"4",
";",
"assert",... | Shift the container horizontally to the right to make its bounds not overlap with the other
bounds. To avoid dependence on Java AWT, rectangles are described by arrays of double. Each
rectangle is specified by {minX, minY, maxX, maxY}.
@param container the {@link IAtomContainer} to shift to the
right
@param bounds ... | [
"Shift",
"the",
"container",
"horizontally",
"to",
"the",
"right",
"to",
"make",
"its",
"bounds",
"not",
"overlap",
"with",
"the",
"other",
"bounds",
".",
"To",
"avoid",
"dependence",
"on",
"Java",
"AWT",
"rectangles",
"are",
"described",
"by",
"arrays",
"of... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java#L1619-L1641 |
Syncleus/aparapi | src/main/java/com/aparapi/device/OpenCLDevice.java | OpenCLDevice.listDevices | public static List<OpenCLDevice> listDevices(TYPE type) {
"""
List OpenCLDevices of a given TYPE, or all OpenCLDevices if type == null.
"""
final OpenCLPlatform platform = new OpenCLPlatform(0, null, null, null);
final ArrayList<OpenCLDevice> results = new ArrayList<>();
for (final OpenCLPla... | java | public static List<OpenCLDevice> listDevices(TYPE type) {
final OpenCLPlatform platform = new OpenCLPlatform(0, null, null, null);
final ArrayList<OpenCLDevice> results = new ArrayList<>();
for (final OpenCLPlatform p : platform.getOpenCLPlatforms()) {
for (final OpenCLDevice device : p.getO... | [
"public",
"static",
"List",
"<",
"OpenCLDevice",
">",
"listDevices",
"(",
"TYPE",
"type",
")",
"{",
"final",
"OpenCLPlatform",
"platform",
"=",
"new",
"OpenCLPlatform",
"(",
"0",
",",
"null",
",",
"null",
",",
"null",
")",
";",
"final",
"ArrayList",
"<",
... | List OpenCLDevices of a given TYPE, or all OpenCLDevices if type == null. | [
"List",
"OpenCLDevices",
"of",
"a",
"given",
"TYPE",
"or",
"all",
"OpenCLDevices",
"if",
"type",
"==",
"null",
"."
] | train | https://github.com/Syncleus/aparapi/blob/6d5892c8e69854b3968c541023de37cf4762bd24/src/main/java/com/aparapi/device/OpenCLDevice.java#L513-L526 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getCharacterUnlockedRecipes | public void getCharacterUnlockedRecipes(String API, String name, Callback<CharacterRecipes> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on Character Recipes API go <a href="https://wiki.guildwars2.com/wiki/API:2/characters">here</a><br/>
Give user the access to {@link Callback#o... | java | public void getCharacterUnlockedRecipes(String API, String name, Callback<CharacterRecipes> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name));
gw2API.getCharacterUnlockedRecipes(name, API).enqueue(callback);
} | [
"public",
"void",
"getCharacterUnlockedRecipes",
"(",
"String",
"API",
",",
"String",
"name",
",",
"Callback",
"<",
"CharacterRecipes",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",... | For more info on Character Recipes API go <a href="https://wiki.guildwars2.com/wiki/API:2/characters">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param API API key
@param name character name
... | [
"For",
"more",
"info",
"on",
"Character",
"Recipes",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"characters",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"G... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L797-L800 |
jimmoores/quandl4j | core/src/main/java/com/jimmoores/quandl/util/ArgumentChecker.java | ArgumentChecker.notNull | public static void notNull(final Object argument, final String name) {
"""
Throws an exception if the argument is not null.
@param argument the object to check
@param name the name of the parameter
"""
if (argument == null) {
s_logger.error("Argument {} was null", name);
throw new QuandlRun... | java | public static void notNull(final Object argument, final String name) {
if (argument == null) {
s_logger.error("Argument {} was null", name);
throw new QuandlRuntimeException("Value " + name + " was null");
}
} | [
"public",
"static",
"void",
"notNull",
"(",
"final",
"Object",
"argument",
",",
"final",
"String",
"name",
")",
"{",
"if",
"(",
"argument",
"==",
"null",
")",
"{",
"s_logger",
".",
"error",
"(",
"\"Argument {} was null\"",
",",
"name",
")",
";",
"throw",
... | Throws an exception if the argument is not null.
@param argument the object to check
@param name the name of the parameter | [
"Throws",
"an",
"exception",
"if",
"the",
"argument",
"is",
"not",
"null",
"."
] | train | https://github.com/jimmoores/quandl4j/blob/5d67ae60279d889da93ae7aa3bf6b7d536f88822/core/src/main/java/com/jimmoores/quandl/util/ArgumentChecker.java#L23-L28 |
VoltDB/voltdb | src/frontend/org/voltdb/AbstractTopology.java | AbstractTopology.mutateAddNewHosts | public static Pair<AbstractTopology, ImmutableList<Integer>> mutateAddNewHosts(AbstractTopology currentTopology,
Map<Integer, HostInfo> newHostInfos) {
"""
Add new hosts to an existing topology and layout partitions on those hosts
@param currentTopology to extend
@param newHostInfos new hosts to... | java | public static Pair<AbstractTopology, ImmutableList<Integer>> mutateAddNewHosts(AbstractTopology currentTopology,
Map<Integer, HostInfo> newHostInfos) {
int startingPartitionId = getNextFreePartitionId(currentTopology);
TopologyBuilder topologyBuilder = addPartitionsToHosts(newHostInfos, Col... | [
"public",
"static",
"Pair",
"<",
"AbstractTopology",
",",
"ImmutableList",
"<",
"Integer",
">",
">",
"mutateAddNewHosts",
"(",
"AbstractTopology",
"currentTopology",
",",
"Map",
"<",
"Integer",
",",
"HostInfo",
">",
"newHostInfos",
")",
"{",
"int",
"startingPartit... | Add new hosts to an existing topology and layout partitions on those hosts
@param currentTopology to extend
@param newHostInfos new hosts to add to topology
@return update {@link AbstractTopology} with new hosts and {@link ImmutableList} of new partition IDs
@throws RuntimeException if hosts are not valid for topol... | [
"Add",
"new",
"hosts",
"to",
"an",
"existing",
"topology",
"and",
"layout",
"partitions",
"on",
"those",
"hosts"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/AbstractTopology.java#L923-L936 |
openbase/jul | extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/TimestampProcessor.java | TimestampProcessor.updateTimestamp | public static <M extends MessageOrBuilder> M updateTimestamp(final long timestamp, final M messageOrBuilder, final TimeUnit timeUnit, final Logger logger) {
"""
Method updates the timestamp field of the given message with the given timestamp.
In case of an error the original message is returned.
@param <M> ... | java | public static <M extends MessageOrBuilder> M updateTimestamp(final long timestamp, final M messageOrBuilder, final TimeUnit timeUnit, final Logger logger) {
try {
return updateTimestamp(timestamp, messageOrBuilder, timeUnit);
} catch (CouldNotPerformException ex) {
ExceptionPrint... | [
"public",
"static",
"<",
"M",
"extends",
"MessageOrBuilder",
">",
"M",
"updateTimestamp",
"(",
"final",
"long",
"timestamp",
",",
"final",
"M",
"messageOrBuilder",
",",
"final",
"TimeUnit",
"timeUnit",
",",
"final",
"Logger",
"logger",
")",
"{",
"try",
"{",
... | Method updates the timestamp field of the given message with the given timestamp.
In case of an error the original message is returned.
@param <M> the message type of the message to update.
@param timestamp the timestamp to update
@param messageOrBuilder the message
@param timeUnit the time... | [
"Method",
"updates",
"the",
"timestamp",
"field",
"of",
"the",
"given",
"message",
"with",
"the",
"given",
"timestamp",
".",
"In",
"case",
"of",
"an",
"error",
"the",
"original",
"message",
"is",
"returned",
"."
] | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/TimestampProcessor.java#L157-L164 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.isCase | public static boolean isCase(Class caseValue, Object switchValue) {
"""
Special 'Case' implementation for Class, which allows testing
for a certain class in a switch statement.
For example:
<pre>switch( obj ) {
case List :
// obj is a list
break;
case Set :
// etc
}</pre>
@param caseValue the case va... | java | public static boolean isCase(Class caseValue, Object switchValue) {
if (switchValue instanceof Class) {
Class val = (Class) switchValue;
return caseValue.isAssignableFrom(val);
}
return caseValue.isInstance(switchValue);
} | [
"public",
"static",
"boolean",
"isCase",
"(",
"Class",
"caseValue",
",",
"Object",
"switchValue",
")",
"{",
"if",
"(",
"switchValue",
"instanceof",
"Class",
")",
"{",
"Class",
"val",
"=",
"(",
"Class",
")",
"switchValue",
";",
"return",
"caseValue",
".",
"... | Special 'Case' implementation for Class, which allows testing
for a certain class in a switch statement.
For example:
<pre>switch( obj ) {
case List :
// obj is a list
break;
case Set :
// etc
}</pre>
@param caseValue the case value
@param switchValue the switch value
@return true if the switchValue is deemed to be ... | [
"Special",
"Case",
"implementation",
"for",
"Class",
"which",
"allows",
"testing",
"for",
"a",
"certain",
"class",
"in",
"a",
"switch",
"statement",
".",
"For",
"example",
":",
"<pre",
">",
"switch",
"(",
"obj",
")",
"{",
"case",
"List",
":",
"//",
"obj"... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L1134-L1140 |
ops4j/org.ops4j.base | ops4j-base-io/src/main/java/org/ops4j/io/ZipExploder.java | ZipExploder.processFile | @Deprecated
public void processFile(String zipName, String destDir) throws IOException {
"""
Explode source ZIP or JAR file into a target directory
@param zipName
names of source file
@param destDir
target directory name (should already exist)
@exception IOException
error creating a target file
@depre... | java | @Deprecated
public void processFile(String zipName, String destDir) throws IOException {
//Delegation to preferred method
processFile(new File(zipName), new File(destDir));
} | [
"@",
"Deprecated",
"public",
"void",
"processFile",
"(",
"String",
"zipName",
",",
"String",
"destDir",
")",
"throws",
"IOException",
"{",
"//Delegation to preferred method",
"processFile",
"(",
"new",
"File",
"(",
"zipName",
")",
",",
"new",
"File",
"(",
"destD... | Explode source ZIP or JAR file into a target directory
@param zipName
names of source file
@param destDir
target directory name (should already exist)
@exception IOException
error creating a target file
@deprecated use {@link #processFile(File, File)} for a type save variant | [
"Explode",
"source",
"ZIP",
"or",
"JAR",
"file",
"into",
"a",
"target",
"directory"
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/ZipExploder.java#L219-L223 |
infinispan/infinispan | server/integration/commons/src/main/java/org/infinispan/server/commons/features/Feature.java | Feature.isAvailableOrThrowException | public static Features isAvailableOrThrowException(Features features, String feature, ClassLoader classLoader) {
"""
Verify that the specified feature is enabled. Initializes features if the provided one is null, allowing for
lazily initialized Features instance.
@param features existing instance or null.
@para... | java | public static Features isAvailableOrThrowException(Features features, String feature, ClassLoader classLoader) {
if (features == null) {
features = new Features(classLoader);
}
isAvailableOrThrowException(features, feature);
return features;
} | [
"public",
"static",
"Features",
"isAvailableOrThrowException",
"(",
"Features",
"features",
",",
"String",
"feature",
",",
"ClassLoader",
"classLoader",
")",
"{",
"if",
"(",
"features",
"==",
"null",
")",
"{",
"features",
"=",
"new",
"Features",
"(",
"classLoade... | Verify that the specified feature is enabled. Initializes features if the provided one is null, allowing for
lazily initialized Features instance.
@param features existing instance or null.
@param feature the feature string to check.
@param classLoader to create the {@link Features} instance with if it doesn't already ... | [
"Verify",
"that",
"the",
"specified",
"feature",
"is",
"enabled",
".",
"Initializes",
"features",
"if",
"the",
"provided",
"one",
"is",
"null",
"allowing",
"for",
"lazily",
"initialized",
"Features",
"instance",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/integration/commons/src/main/java/org/infinispan/server/commons/features/Feature.java#L20-L26 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.getHeader | @Deprecated
public static String getHeader(HttpMessage message, CharSequence name, String defaultValue) {
"""
@deprecated Use {@link #get(CharSequence, String)} instead.
Returns the header value with the specified header name. If there are
more than one header value for the specified header name, the firs... | java | @Deprecated
public static String getHeader(HttpMessage message, CharSequence name, String defaultValue) {
return message.headers().get(name, defaultValue);
} | [
"@",
"Deprecated",
"public",
"static",
"String",
"getHeader",
"(",
"HttpMessage",
"message",
",",
"CharSequence",
"name",
",",
"String",
"defaultValue",
")",
"{",
"return",
"message",
".",
"headers",
"(",
")",
".",
"get",
"(",
"name",
",",
"defaultValue",
")... | @deprecated Use {@link #get(CharSequence, String)} instead.
Returns the header value with the specified header name. If there are
more than one header value for the specified header name, the first
value is returned.
@return the header value or the {@code defaultValue} if there is no such
header | [
"@deprecated",
"Use",
"{",
"@link",
"#get",
"(",
"CharSequence",
"String",
")",
"}",
"instead",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L589-L592 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/CollectionExtensions.java | CollectionExtensions.operator_remove | @Inline(value="$3.removeAll($1, $2)", imported=Iterables.class)
public static <E> boolean operator_remove(Collection<E> collection, Collection<? extends E> newElements) {
"""
The operator mapping from {@code -=} to {@link #removeAll(Collection, Collection)}. Returns <code>true</code> if the
collection changed du... | java | @Inline(value="$3.removeAll($1, $2)", imported=Iterables.class)
public static <E> boolean operator_remove(Collection<E> collection, Collection<? extends E> newElements) {
return removeAll(collection, newElements);
} | [
"@",
"Inline",
"(",
"value",
"=",
"\"$3.removeAll($1, $2)\"",
",",
"imported",
"=",
"Iterables",
".",
"class",
")",
"public",
"static",
"<",
"E",
">",
"boolean",
"operator_remove",
"(",
"Collection",
"<",
"E",
">",
"collection",
",",
"Collection",
"<",
"?",
... | The operator mapping from {@code -=} to {@link #removeAll(Collection, Collection)}. Returns <code>true</code> if the
collection changed due to this operation.
@param collection
the to-be-changed collection. May not be <code>null</code>.
@param newElements
elements to be removed from the collection. May not be <code>nu... | [
"The",
"operator",
"mapping",
"from",
"{",
"@code",
"-",
"=",
"}",
"to",
"{",
"@link",
"#removeAll",
"(",
"Collection",
"Collection",
")",
"}",
".",
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"collection",
"changed",
"due",
"to",
... | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/CollectionExtensions.java#L100-L103 |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java | JSONArray.optInt | public int optInt(int index, int fallback) {
"""
Returns the value at {@code index} if it exists and is an int or can be coerced to
an int. Returns {@code fallback} otherwise.
@param index the index to get the value from
@param fallback the fallback value
@return the value at {@code index} of {@code fallback}
... | java | public int optInt(int index, int fallback) {
Object object = opt(index);
Integer result = JSON.toInteger(object);
return result != null ? result : fallback;
} | [
"public",
"int",
"optInt",
"(",
"int",
"index",
",",
"int",
"fallback",
")",
"{",
"Object",
"object",
"=",
"opt",
"(",
"index",
")",
";",
"Integer",
"result",
"=",
"JSON",
".",
"toInteger",
"(",
"object",
")",
";",
"return",
"result",
"!=",
"null",
"... | Returns the value at {@code index} if it exists and is an int or can be coerced to
an int. Returns {@code fallback} otherwise.
@param index the index to get the value from
@param fallback the fallback value
@return the value at {@code index} of {@code fallback} | [
"Returns",
"the",
"value",
"at",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java#L436-L440 |
sockeqwe/mosby-conductor | mvi/src/main/java/com/hannesdorfmann/mosby3/MviConductorLifecycleListener.java | MviConductorLifecycleListener.retainPresenterInstance | static boolean retainPresenterInstance(boolean keepPresenterInstance, Controller controller) {
"""
Determines whether or not a Presenter Instance should be kept
@param keepPresenterInstance true, if the delegate has enabled keep
"""
return keepPresenterInstance && (controller.getActivity().isChangingCo... | java | static boolean retainPresenterInstance(boolean keepPresenterInstance, Controller controller) {
return keepPresenterInstance && (controller.getActivity().isChangingConfigurations()
|| !controller.getActivity().isFinishing()) && !controller.isBeingDestroyed();
} | [
"static",
"boolean",
"retainPresenterInstance",
"(",
"boolean",
"keepPresenterInstance",
",",
"Controller",
"controller",
")",
"{",
"return",
"keepPresenterInstance",
"&&",
"(",
"controller",
".",
"getActivity",
"(",
")",
".",
"isChangingConfigurations",
"(",
")",
"||... | Determines whether or not a Presenter Instance should be kept
@param keepPresenterInstance true, if the delegate has enabled keep | [
"Determines",
"whether",
"or",
"not",
"a",
"Presenter",
"Instance",
"should",
"be",
"kept"
] | train | https://github.com/sockeqwe/mosby-conductor/blob/2a70b20eb8262ca3bcddd30efdc080a3cdabb96c/mvi/src/main/java/com/hannesdorfmann/mosby3/MviConductorLifecycleListener.java#L109-L113 |
cdk/cdk | tool/charges/src/main/java/org/openscience/cdk/charges/Electronegativity.java | Electronegativity.calculateSigmaElectronegativity | public double calculateSigmaElectronegativity(IAtomContainer ac, IAtom atom, int maxIterations, int maxResonStruc) {
"""
calculate the electronegativity of orbitals sigma.
@param ac IAtomContainer
@param atom atom for which effective atom electronegativity should be calculat... | java | public double calculateSigmaElectronegativity(IAtomContainer ac, IAtom atom, int maxIterations, int maxResonStruc) {
maxI = maxIterations;
maxRS = maxResonStruc;
double electronegativity = 0;
try {
if (!ac.equals(acOldS)) {
molSigma = ac.getBuilder().newInst... | [
"public",
"double",
"calculateSigmaElectronegativity",
"(",
"IAtomContainer",
"ac",
",",
"IAtom",
"atom",
",",
"int",
"maxIterations",
",",
"int",
"maxResonStruc",
")",
"{",
"maxI",
"=",
"maxIterations",
";",
"maxRS",
"=",
"maxResonStruc",
";",
"double",
"electron... | calculate the electronegativity of orbitals sigma.
@param ac IAtomContainer
@param atom atom for which effective atom electronegativity should be calculated
@param maxIterations The maximal number of Iterations
@param maxResonStruc The maximal number of Resonance Str... | [
"calculate",
"the",
"electronegativity",
"of",
"orbitals",
"sigma",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/charges/src/main/java/org/openscience/cdk/charges/Electronegativity.java#L93-L122 |
JOML-CI/JOML | src/org/joml/Planed.java | Planed.equationFromPoints | public static Vector4d equationFromPoints(
Vector3d v0, Vector3d v1, Vector3d v2,
Vector4d dest) {
"""
Compute the factors <code>a</code>, <code>b</code>, <code>c</code> and <code>d</code> in the plane equation
<code>a*x + b*y + c*z + d = 0</code> from the given three points on the plane, ... | java | public static Vector4d equationFromPoints(
Vector3d v0, Vector3d v1, Vector3d v2,
Vector4d dest) {
return equationFromPoints(v0.x, v0.y, v0.z, v1.x, v1.y, v1.z, v2.x, v2.y, v2.z, dest);
} | [
"public",
"static",
"Vector4d",
"equationFromPoints",
"(",
"Vector3d",
"v0",
",",
"Vector3d",
"v1",
",",
"Vector3d",
"v2",
",",
"Vector4d",
"dest",
")",
"{",
"return",
"equationFromPoints",
"(",
"v0",
".",
"x",
",",
"v0",
".",
"y",
",",
"v0",
".",
"z",
... | Compute the factors <code>a</code>, <code>b</code>, <code>c</code> and <code>d</code> in the plane equation
<code>a*x + b*y + c*z + d = 0</code> from the given three points on the plane, and write the values
to the <code>x</code>, <code>y</code>, <code>z</code> and <code>w</code> components, respectively, of the given
... | [
"Compute",
"the",
"factors",
"<code",
">",
"a<",
"/",
"code",
">",
"<code",
">",
"b<",
"/",
"code",
">",
"<code",
">",
"c<",
"/",
"code",
">",
"and",
"<code",
">",
"d<",
"/",
"code",
">",
"in",
"the",
"plane",
"equation",
"<code",
">",
"a",
"*",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Planed.java#L156-L160 |
blinkfox/zealot | src/main/java/com/blinkfox/zealot/core/ZealotKhala.java | ZealotKhala.orLessThan | public ZealotKhala orLessThan(String field, Object value) {
"""
生成带" OR "前缀小于查询的SQL片段.
@param field 数据库字段
@param value 值
@return ZealotKhala实例
"""
return this.doNormal(ZealotConst.OR_PREFIX, field, value, ZealotConst.LT_SUFFIX, true);
} | java | public ZealotKhala orLessThan(String field, Object value) {
return this.doNormal(ZealotConst.OR_PREFIX, field, value, ZealotConst.LT_SUFFIX, true);
} | [
"public",
"ZealotKhala",
"orLessThan",
"(",
"String",
"field",
",",
"Object",
"value",
")",
"{",
"return",
"this",
".",
"doNormal",
"(",
"ZealotConst",
".",
"OR_PREFIX",
",",
"field",
",",
"value",
",",
"ZealotConst",
".",
"LT_SUFFIX",
",",
"true",
")",
";... | 生成带" OR "前缀小于查询的SQL片段.
@param field 数据库字段
@param value 值
@return ZealotKhala实例 | [
"生成带",
"OR",
"前缀小于查询的SQL片段",
"."
] | train | https://github.com/blinkfox/zealot/blob/21b00fa3e4ed42188eef3116d494e112e7a4194c/src/main/java/com/blinkfox/zealot/core/ZealotKhala.java#L753-L755 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/formatstring/FormatStringValidation.java | FormatStringValidation.getInstance | @Nullable
private static Object getInstance(Tree tree, VisitorState state) {
"""
Return an instance of the given type if it receives special handling by {@code String.format}.
For example, an intance of {@link Integer} will be returned for an input of type {@code int} or
{@link Integer}.
"""
Object val... | java | @Nullable
private static Object getInstance(Tree tree, VisitorState state) {
Object value = ASTHelpers.constValue(tree);
if (value != null) {
return value;
}
Type type = ASTHelpers.getType(tree);
return getInstance(type, state);
} | [
"@",
"Nullable",
"private",
"static",
"Object",
"getInstance",
"(",
"Tree",
"tree",
",",
"VisitorState",
"state",
")",
"{",
"Object",
"value",
"=",
"ASTHelpers",
".",
"constValue",
"(",
"tree",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"retur... | Return an instance of the given type if it receives special handling by {@code String.format}.
For example, an intance of {@link Integer} will be returned for an input of type {@code int} or
{@link Integer}. | [
"Return",
"an",
"instance",
"of",
"the",
"given",
"type",
"if",
"it",
"receives",
"special",
"handling",
"by",
"{"
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/formatstring/FormatStringValidation.java#L141-L149 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.powerOff | public OperationStatusResponseInner powerOff(String resourceGroupName, String vmScaleSetName, List<String> instanceIds) {
"""
Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release res... | java | public OperationStatusResponseInner powerOff(String resourceGroupName, String vmScaleSetName, List<String> instanceIds) {
return powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().body();
} | [
"public",
"OperationStatusResponseInner",
"powerOff",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
",",
"List",
"<",
"String",
">",
"instanceIds",
")",
"{",
"return",
"powerOffWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmScaleSetNam... | Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale ... | [
"Power",
"off",
"(",
"stop",
")",
"one",
"or",
"more",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
".",
"Note",
"that",
"resources",
"are",
"still",
"attached",
"and",
"you",
"are",
"getting",
"charged",
"for",
"the",
"resources",
".",
"Inste... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L1798-L1800 |
kaazing/java.client | ws/ws/src/main/java/org/kaazing/gateway/client/util/WrappedByteBuffer.java | WrappedByteBuffer.putBytesAt | public WrappedByteBuffer putBytesAt(int index, byte[] b) {
"""
Puts a single-byte array into the buffer at the specified index.
@param index the index
@param v the single-byte array
@return the buffer
"""
_checkForWriteAt(index, b.length);
int pos = _buf.position();
_buf.position... | java | public WrappedByteBuffer putBytesAt(int index, byte[] b) {
_checkForWriteAt(index, b.length);
int pos = _buf.position();
_buf.position(index);
_buf.put(b, 0, b.length);
_buf.position(pos);
return this;
} | [
"public",
"WrappedByteBuffer",
"putBytesAt",
"(",
"int",
"index",
",",
"byte",
"[",
"]",
"b",
")",
"{",
"_checkForWriteAt",
"(",
"index",
",",
"b",
".",
"length",
")",
";",
"int",
"pos",
"=",
"_buf",
".",
"position",
"(",
")",
";",
"_buf",
".",
"posi... | Puts a single-byte array into the buffer at the specified index.
@param index the index
@param v the single-byte array
@return the buffer | [
"Puts",
"a",
"single",
"-",
"byte",
"array",
"into",
"the",
"buffer",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/gateway/client/util/WrappedByteBuffer.java#L635-L642 |
depsypher/pngtastic | src/main/java/com/googlecode/pngtastic/core/processing/PngtasticFilterHandler.java | PngtasticFilterHandler.filter | @Override
public void filter(byte[] line, byte[] previousLine, int sampleBitCount) throws PngException {
"""
{@inheritDoc}
The bytes are named as follows (x = current, a = previous, b = above, c = previous and above)
<pre>
c b
a x
</pre>
"""
PngFilterType filterType = PngFilterType.forValue(line[0]);... | java | @Override
public void filter(byte[] line, byte[] previousLine, int sampleBitCount) throws PngException {
PngFilterType filterType = PngFilterType.forValue(line[0]);
line[0] = 0;
PngFilterType previousFilterType = PngFilterType.forValue(previousLine[0]);
previousLine[0] = 0;
switch (filterType) {
case NO... | [
"@",
"Override",
"public",
"void",
"filter",
"(",
"byte",
"[",
"]",
"line",
",",
"byte",
"[",
"]",
"previousLine",
",",
"int",
"sampleBitCount",
")",
"throws",
"PngException",
"{",
"PngFilterType",
"filterType",
"=",
"PngFilterType",
".",
"forValue",
"(",
"l... | {@inheritDoc}
The bytes are named as follows (x = current, a = previous, b = above, c = previous and above)
<pre>
c b
a x
</pre> | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/depsypher/pngtastic/blob/13fd2a63dd8b2febd7041273889a1bba4f2a6a07/src/main/java/com/googlecode/pngtastic/core/processing/PngtasticFilterHandler.java#L86-L134 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Input.java | Input.fireMouseClicked | private void fireMouseClicked(int button, int x, int y, int clickCount) {
"""
Notify listeners that the mouse button has been clicked
@param button The button that has been clicked
@param x The location at which the button was clicked
@param y The location at which the button was clicked
@param clickCount Th... | java | private void fireMouseClicked(int button, int x, int y, int clickCount) {
consumed = false;
for (int i=0;i<mouseListeners.size();i++) {
MouseListener listener = (MouseListener) mouseListeners.get(i);
if (listener.isAcceptingInput()) {
listener.mouseClicked(button, x, y, clickCount);
if (consumed... | [
"private",
"void",
"fireMouseClicked",
"(",
"int",
"button",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"clickCount",
")",
"{",
"consumed",
"=",
"false",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"mouseListeners",
".",
"size",
"(",
"... | Notify listeners that the mouse button has been clicked
@param button The button that has been clicked
@param x The location at which the button was clicked
@param y The location at which the button was clicked
@param clickCount The number of times the button was clicked (single or double click) | [
"Notify",
"listeners",
"that",
"the",
"mouse",
"button",
"has",
"been",
"clicked"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Input.java#L1523-L1534 |
bazaarvoice/emodb | auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/permissions/MatchingPermission.java | MatchingPermission.toPart | protected MatchingPart toPart(List<MatchingPart> leadingParts, String part) {
"""
Converts a String part into the corresponding {@link MatchingPart}.
"""
if (ANY_INDICATOR.equals(part)) {
return getAnyPart();
}
// This part is a constant string
return createConstantP... | java | protected MatchingPart toPart(List<MatchingPart> leadingParts, String part) {
if (ANY_INDICATOR.equals(part)) {
return getAnyPart();
}
// This part is a constant string
return createConstantPart(part);
} | [
"protected",
"MatchingPart",
"toPart",
"(",
"List",
"<",
"MatchingPart",
">",
"leadingParts",
",",
"String",
"part",
")",
"{",
"if",
"(",
"ANY_INDICATOR",
".",
"equals",
"(",
"part",
")",
")",
"{",
"return",
"getAnyPart",
"(",
")",
";",
"}",
"// This part ... | Converts a String part into the corresponding {@link MatchingPart}. | [
"Converts",
"a",
"String",
"part",
"into",
"the",
"corresponding",
"{"
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/permissions/MatchingPermission.java#L96-L102 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/FunctionExtensions.java | FunctionExtensions.andThen | public static <V1,V2,T,R> Function2<V1, V2, R> andThen(final Function2<? super V1,? super V2, ? extends T> before, final Function1<? super T, ? extends R> after) {
"""
Returns a composed function that first applies the {@code before}
function to its input, and then applies the {@code after} function to the result... | java | public static <V1,V2,T,R> Function2<V1, V2, R> andThen(final Function2<? super V1,? super V2, ? extends T> before, final Function1<? super T, ? extends R> after) {
if (after == null)
throw new NullPointerException("after");
if (before == null)
throw new NullPointerException("before");
return new Function2<V... | [
"public",
"static",
"<",
"V1",
",",
"V2",
",",
"T",
",",
"R",
">",
"Function2",
"<",
"V1",
",",
"V2",
",",
"R",
">",
"andThen",
"(",
"final",
"Function2",
"<",
"?",
"super",
"V1",
",",
"?",
"super",
"V2",
",",
"?",
"extends",
"T",
">",
"before"... | Returns a composed function that first applies the {@code before}
function to its input, and then applies the {@code after} function to the result.
If evaluation of either function throws an exception, it is relayed to
the caller of the composed function.
@param <V1> the type of the first parameter to the {@code befor... | [
"Returns",
"a",
"composed",
"function",
"that",
"first",
"applies",
"the",
"{",
"@code",
"before",
"}",
"function",
"to",
"its",
"input",
"and",
"then",
"applies",
"the",
"{",
"@code",
"after",
"}",
"function",
"to",
"the",
"result",
".",
"If",
"evaluation... | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/FunctionExtensions.java#L237-L248 |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/common/CoGProperties.java | CoGProperties.getTcpSourcePortRange | public String getTcpSourcePortRange() {
"""
Returns the tcp source port range.
It first checks the 'GLOBUS_TCP_SOURCE_PORT_RANGE' system property.
If that system property is not set then
'org.globus.source.tcp.port.range' system property is checked.
If that system property is not set then it returns
the value... | java | public String getTcpSourcePortRange() {
String value = null;
value = System.getProperty("GLOBUS_TCP_SOURCE_PORT_RANGE");
if (value != null) {
return value;
}
value = System.getProperty("org.globus.tcp.source.port.range");
if (value != null) {
return value;
}
return getProperty("tcp.source.port.range",... | [
"public",
"String",
"getTcpSourcePortRange",
"(",
")",
"{",
"String",
"value",
"=",
"null",
";",
"value",
"=",
"System",
".",
"getProperty",
"(",
"\"GLOBUS_TCP_SOURCE_PORT_RANGE\"",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"return",
"value",
";"... | Returns the tcp source port range.
It first checks the 'GLOBUS_TCP_SOURCE_PORT_RANGE' system property.
If that system property is not set then
'org.globus.source.tcp.port.range' system property is checked.
If that system property is not set then it returns
the value specified in the configuration file. Returns null if ... | [
"Returns",
"the",
"tcp",
"source",
"port",
"range",
".",
"It",
"first",
"checks",
"the",
"GLOBUS_TCP_SOURCE_PORT_RANGE",
"system",
"property",
".",
"If",
"that",
"system",
"property",
"is",
"not",
"set",
"then",
"org",
".",
"globus",
".",
"source",
".",
"tcp... | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/common/CoGProperties.java#L433-L444 |
deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/io/WritableUtils.java | WritableUtils.writeCompressedStringArray | public static void writeCompressedStringArray(DataOutput out, String[] s) throws IOException {
"""
/*
Write a String array as a Nework Int N, followed by Int N Byte Array of
compressed Strings. Handles also null arrays and null values.
Could be generalised using introspection.
"""
if (s == null) {
... | java | public static void writeCompressedStringArray(DataOutput out, String[] s) throws IOException {
if (s == null) {
out.writeInt(-1);
return;
}
out.writeInt(s.length);
for (int i = 0; i < s.length; i++) {
writeCompressedString(out, s[i]);
}
} | [
"public",
"static",
"void",
"writeCompressedStringArray",
"(",
"DataOutput",
"out",
",",
"String",
"[",
"]",
"s",
")",
"throws",
"IOException",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"out",
".",
"writeInt",
"(",
"-",
"1",
")",
";",
"return",
";",... | /*
Write a String array as a Nework Int N, followed by Int N Byte Array of
compressed Strings. Handles also null arrays and null values.
Could be generalised using introspection. | [
"/",
"*",
"Write",
"a",
"String",
"array",
"as",
"a",
"Nework",
"Int",
"N",
"followed",
"by",
"Int",
"N",
"Byte",
"Array",
"of",
"compressed",
"Strings",
".",
"Handles",
"also",
"null",
"arrays",
"and",
"null",
"values",
".",
"Could",
"be",
"generalised"... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/io/WritableUtils.java#L142-L151 |
roboconf/roboconf-platform | core/roboconf-target-embedded/src/main/java/net/roboconf/target/embedded/internal/EmbeddedHandler.java | EmbeddedHandler.acquireIpAddress | protected String acquireIpAddress( TargetHandlerParameters parameters, String machineId ) {
"""
Acquires an IP address among available ones.
@param parameters the target parameters
@param machineId the machine ID
@return The acquired IP address
"""
// Load IP addresses on demand (that's the case if we ar... | java | protected String acquireIpAddress( TargetHandlerParameters parameters, String machineId ) {
// Load IP addresses on demand (that's the case if we are in this method).
// This implementation is compliant with a same IP address being used in
// several "target.properties" files.
String result = null;
String ip... | [
"protected",
"String",
"acquireIpAddress",
"(",
"TargetHandlerParameters",
"parameters",
",",
"String",
"machineId",
")",
"{",
"// Load IP addresses on demand (that's the case if we are in this method).",
"// This implementation is compliant with a same IP address being used in",
"// sever... | Acquires an IP address among available ones.
@param parameters the target parameters
@param machineId the machine ID
@return The acquired IP address | [
"Acquires",
"an",
"IP",
"address",
"among",
"available",
"ones",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-embedded/src/main/java/net/roboconf/target/embedded/internal/EmbeddedHandler.java#L208-L229 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.orthoSymmetricLH | public Matrix4d orthoSymmetricLH(double width, double height, double zNear, double zFar, boolean zZeroToOne, Matrix4d dest) {
"""
Apply a symmetric orthographic projection transformation for a left-handed coordinate system
using the given NDC z range to this matrix and store the result in <code>dest</code>.
<p>
... | java | public Matrix4d orthoSymmetricLH(double width, double height, double zNear, double zFar, boolean zZeroToOne, Matrix4d dest) {
if ((properties & PROPERTY_IDENTITY) != 0)
return dest.setOrthoSymmetricLH(width, height, zNear, zFar, zZeroToOne);
return orthoSymmetricLHGeneric(width, height, zNea... | [
"public",
"Matrix4d",
"orthoSymmetricLH",
"(",
"double",
"width",
",",
"double",
"height",
",",
"double",
"zNear",
",",
"double",
"zFar",
",",
"boolean",
"zZeroToOne",
",",
"Matrix4d",
"dest",
")",
"{",
"if",
"(",
"(",
"properties",
"&",
"PROPERTY_IDENTITY",
... | Apply a symmetric orthographic projection transformation for a left-handed coordinate system
using the given NDC z range to this matrix and store the result in <code>dest</code>.
<p>
This method is equivalent to calling {@link #orthoLH(double, double, double, double, double, double, boolean, Matrix4d) orthoLH()} with
<... | [
"Apply",
"a",
"symmetric",
"orthographic",
"projection",
"transformation",
"for",
"a",
"left",
"-",
"handed",
"coordinate",
"system",
"using",
"the",
"given",
"NDC",
"z",
"range",
"to",
"this",
"matrix",
"and",
"store",
"the",
"result",
"in",
"<code",
">",
"... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L10261-L10265 |
ACRA/acra | acra-core/src/main/java/org/acra/attachment/AcraContentProvider.java | AcraContentProvider.openFile | @NonNull
@Override
public ParcelFileDescriptor openFile(@NonNull Uri uri, @NonNull String mode) throws FileNotFoundException {
"""
Open a file for read
@param uri the file uri
@param mode ignored
@return a {@link ParcelFileDescriptor} for the File
@throws FileNotFoundException if the file cannot be ... | java | @NonNull
@Override
public ParcelFileDescriptor openFile(@NonNull Uri uri, @NonNull String mode) throws FileNotFoundException {
final File file = getFileForUri(uri);
if (file == null || !file.exists()) throw new FileNotFoundException("File represented by uri " + uri + " could not be found");
... | [
"@",
"NonNull",
"@",
"Override",
"public",
"ParcelFileDescriptor",
"openFile",
"(",
"@",
"NonNull",
"Uri",
"uri",
",",
"@",
"NonNull",
"String",
"mode",
")",
"throws",
"FileNotFoundException",
"{",
"final",
"File",
"file",
"=",
"getFileForUri",
"(",
"uri",
")"... | Open a file for read
@param uri the file uri
@param mode ignored
@return a {@link ParcelFileDescriptor} for the File
@throws FileNotFoundException if the file cannot be resolved | [
"Open",
"a",
"file",
"for",
"read"
] | train | https://github.com/ACRA/acra/blob/bfa3235ab110328c5ab2f792ddf8ee87be4a32d1/acra-core/src/main/java/org/acra/attachment/AcraContentProvider.java#L178-L191 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java | DateUtil.formatBetween | public static String formatBetween(Date beginDate, Date endDate) {
"""
格式化日期间隔输出,精确到毫秒
@param beginDate 起始日期
@param endDate 结束日期
@return XX天XX小时XX分XX秒
@since 3.0.1
"""
return formatBetween(between(beginDate, endDate, DateUnit.MS));
} | java | public static String formatBetween(Date beginDate, Date endDate) {
return formatBetween(between(beginDate, endDate, DateUnit.MS));
} | [
"public",
"static",
"String",
"formatBetween",
"(",
"Date",
"beginDate",
",",
"Date",
"endDate",
")",
"{",
"return",
"formatBetween",
"(",
"between",
"(",
"beginDate",
",",
"endDate",
",",
"DateUnit",
".",
"MS",
")",
")",
";",
"}"
] | 格式化日期间隔输出,精确到毫秒
@param beginDate 起始日期
@param endDate 结束日期
@return XX天XX小时XX分XX秒
@since 3.0.1 | [
"格式化日期间隔输出,精确到毫秒"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java#L1330-L1332 |
Codearte/catch-exception | catch-exception/src/main/java/com/googlecode/catchexception/CatchException.java | CatchException.verifyException | public static void verifyException(ThrowingCallable actor, Class<? extends Exception> clazz) {
"""
Use it to verify that an exception of specific type is thrown and to get
access to the thrown exception (for further verifications).
The following example verifies that obj.doX() throws a MyException:
<code>veri... | java | public static void verifyException(ThrowingCallable actor, Class<? extends Exception> clazz) {
validateArguments(actor, clazz);
catchException(actor, clazz, true);
} | [
"public",
"static",
"void",
"verifyException",
"(",
"ThrowingCallable",
"actor",
",",
"Class",
"<",
"?",
"extends",
"Exception",
">",
"clazz",
")",
"{",
"validateArguments",
"(",
"actor",
",",
"clazz",
")",
";",
"catchException",
"(",
"actor",
",",
"clazz",
... | Use it to verify that an exception of specific type is thrown and to get
access to the thrown exception (for further verifications).
The following example verifies that obj.doX() throws a MyException:
<code>verifyException(obj, MyException.class).doX(); // catch and verify
assert "foobar".equals(caughtException().getM... | [
"Use",
"it",
"to",
"verify",
"that",
"an",
"exception",
"of",
"specific",
"type",
"is",
"thrown",
"and",
"to",
"get",
"access",
"to",
"the",
"thrown",
"exception",
"(",
"for",
"further",
"verifications",
")",
"."
] | train | https://github.com/Codearte/catch-exception/blob/8cfb1c0a68661ef622011484ff0061b41796b165/catch-exception/src/main/java/com/googlecode/catchexception/CatchException.java#L267-L270 |
weld/core | impl/src/main/java/org/jboss/weld/bean/attributes/ExternalBeanAttributesFactory.java | ExternalBeanAttributesFactory.validateBeanAttributes | public static void validateBeanAttributes(BeanAttributes<?> attributes, BeanManager manager) {
"""
Validates {@link BeanAttributes}.
@param attributes {@link BeanAttributes} to validate
"""
validateStereotypes(attributes, manager);
validateQualifiers(attributes, manager);
validateTypes... | java | public static void validateBeanAttributes(BeanAttributes<?> attributes, BeanManager manager) {
validateStereotypes(attributes, manager);
validateQualifiers(attributes, manager);
validateTypes(attributes, manager);
validateScope(attributes, manager);
} | [
"public",
"static",
"void",
"validateBeanAttributes",
"(",
"BeanAttributes",
"<",
"?",
">",
"attributes",
",",
"BeanManager",
"manager",
")",
"{",
"validateStereotypes",
"(",
"attributes",
",",
"manager",
")",
";",
"validateQualifiers",
"(",
"attributes",
",",
"ma... | Validates {@link BeanAttributes}.
@param attributes {@link BeanAttributes} to validate | [
"Validates",
"{"
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/bean/attributes/ExternalBeanAttributesFactory.java#L67-L72 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java | CQLSSTableWriter.addRow | public CQLSSTableWriter addRow(Map<String, Object> values)
throws InvalidRequestException, IOException {
"""
Adds a new row to the writer.
<p>
This is equivalent to the other addRow methods, but takes a map whose
keys are the names of the columns to add instead of taking a list of the
values in the order o... | java | public CQLSSTableWriter addRow(Map<String, Object> values)
throws InvalidRequestException, IOException
{
int size = boundNames.size();
List<ByteBuffer> rawValues = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
ColumnSpecification spec = boundNames.get(i);
... | [
"public",
"CQLSSTableWriter",
"addRow",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"values",
")",
"throws",
"InvalidRequestException",
",",
"IOException",
"{",
"int",
"size",
"=",
"boundNames",
".",
"size",
"(",
")",
";",
"List",
"<",
"ByteBuffer",
">",
... | Adds a new row to the writer.
<p>
This is equivalent to the other addRow methods, but takes a map whose
keys are the names of the columns to add instead of taking a list of the
values in the order of the insert statement used during construction of
this write.
<p>
Please note that the column names in the map keys must ... | [
"Adds",
"a",
"new",
"row",
"to",
"the",
"writer",
".",
"<p",
">",
"This",
"is",
"equivalent",
"to",
"the",
"other",
"addRow",
"methods",
"but",
"takes",
"a",
"map",
"whose",
"keys",
"are",
"the",
"names",
"of",
"the",
"columns",
"to",
"add",
"instead",... | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java#L166-L177 |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeRenderer.java | TreeRenderer.renderLabel | protected void renderLabel(AbstractRenderAppender writer, TreeElement node) {
"""
Render the label for this node (if any).
@param writer the appender where the tree markup is appended
@param node the node to render
"""
String label = node.getLabel();
if (label != null) {
renderLab... | java | protected void renderLabel(AbstractRenderAppender writer, TreeElement node)
{
String label = node.getLabel();
if (label != null) {
renderLabelPrefix(writer, node);
if (_trs.escapeContent) {
HtmlUtils.filter(label, writer);
}
else {
... | [
"protected",
"void",
"renderLabel",
"(",
"AbstractRenderAppender",
"writer",
",",
"TreeElement",
"node",
")",
"{",
"String",
"label",
"=",
"node",
".",
"getLabel",
"(",
")",
";",
"if",
"(",
"label",
"!=",
"null",
")",
"{",
"renderLabelPrefix",
"(",
"writer",... | Render the label for this node (if any).
@param writer the appender where the tree markup is appended
@param node the node to render | [
"Render",
"the",
"label",
"for",
"this",
"node",
"(",
"if",
"any",
")",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeRenderer.java#L739-L752 |
kaazing/gateway | mina.netty/src/main/java/org/kaazing/mina/netty/bootstrap/ConnectionlessBootstrap.java | ConnectionlessBootstrap.bindAsync | public ChannelFuture bindAsync(final SocketAddress localAddress) {
"""
Creates a new channel which is bound to the specified local address.
@return a new {@link ChannelFuture} which will be notified once the Channel is
bound and accepts incoming connections
@throws ChannelException
if failed to create a ne... | java | public ChannelFuture bindAsync(final SocketAddress localAddress) {
if (localAddress == null) {
throw new NullPointerException("localAddress");
}
ChannelPipeline pipeline;
try {
pipeline = getPipelineFactory().getPipeline();
} catch (Exception e) {
... | [
"public",
"ChannelFuture",
"bindAsync",
"(",
"final",
"SocketAddress",
"localAddress",
")",
"{",
"if",
"(",
"localAddress",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"localAddress\"",
")",
";",
"}",
"ChannelPipeline",
"pipeline",
";",
... | Creates a new channel which is bound to the specified local address.
@return a new {@link ChannelFuture} which will be notified once the Channel is
bound and accepts incoming connections
@throws ChannelException
if failed to create a new channel and
bind it to the local address | [
"Creates",
"a",
"new",
"channel",
"which",
"is",
"bound",
"to",
"the",
"specified",
"local",
"address",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/kaazing/mina/netty/bootstrap/ConnectionlessBootstrap.java#L81-L110 |
graknlabs/grakn | server/src/server/exception/TransactionException.java | TransactionException.illegalUnhasNotExist | public static TransactionException illegalUnhasNotExist(String type, String attributeType, boolean isKey) {
"""
Thrown when there exists and instance of {@code type} HAS {@code attributeType} upon unlinking the AttributeType from the Type
"""
return create(ErrorMessage.ILLEGAL_TYPE_UNHAS_ATTRIBUTE_NOT_... | java | public static TransactionException illegalUnhasNotExist(String type, String attributeType, boolean isKey) {
return create(ErrorMessage.ILLEGAL_TYPE_UNHAS_ATTRIBUTE_NOT_EXIST.getMessage(type, isKey ? "key" : "has", attributeType));
} | [
"public",
"static",
"TransactionException",
"illegalUnhasNotExist",
"(",
"String",
"type",
",",
"String",
"attributeType",
",",
"boolean",
"isKey",
")",
"{",
"return",
"create",
"(",
"ErrorMessage",
".",
"ILLEGAL_TYPE_UNHAS_ATTRIBUTE_NOT_EXIST",
".",
"getMessage",
"(",
... | Thrown when there exists and instance of {@code type} HAS {@code attributeType} upon unlinking the AttributeType from the Type | [
"Thrown",
"when",
"there",
"exists",
"and",
"instance",
"of",
"{"
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/exception/TransactionException.java#L136-L138 |
derari/cthul | objects/src/main/java/org/cthul/objects/reflection/Signatures.java | Signatures.bestMethod | public static Method bestMethod(Method[] methods, Object[] args) throws AmbiguousMethodMatchException {
"""
Selects the best method for the given arguments.
@param methods
@param args
@return method
@throws AmbiguousSignatureMatchException if multiple methods match equally
"""
return bestMethod(me... | java | public static Method bestMethod(Method[] methods, Object[] args) throws AmbiguousMethodMatchException {
return bestMethod(methods, collectArgTypes(args));
} | [
"public",
"static",
"Method",
"bestMethod",
"(",
"Method",
"[",
"]",
"methods",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"AmbiguousMethodMatchException",
"{",
"return",
"bestMethod",
"(",
"methods",
",",
"collectArgTypes",
"(",
"args",
")",
")",
";",
... | Selects the best method for the given arguments.
@param methods
@param args
@return method
@throws AmbiguousSignatureMatchException if multiple methods match equally | [
"Selects",
"the",
"best",
"method",
"for",
"the",
"given",
"arguments",
"."
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L150-L152 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SharedFieldComparatorSource.java | SharedFieldComparatorSource.newComparator | @Override
public FieldComparator<?> newComparator(String propertyName, int numHits, int sortPos, boolean reversed)
throws IOException {
"""
Create a new <code>FieldComparator</code> for an embedded <code>propertyName</code>
and a <code>reader</code>.
@param propertyName the relative path to the proper... | java | @Override
public FieldComparator<?> newComparator(String propertyName, int numHits, int sortPos, boolean reversed)
throws IOException
{
try
{
QPath path = locationFactory.parseJCRPath(propertyName).getInternalPath();
SimpleFieldComparator simple = (SimpleFieldComparator)create... | [
"@",
"Override",
"public",
"FieldComparator",
"<",
"?",
">",
"newComparator",
"(",
"String",
"propertyName",
",",
"int",
"numHits",
",",
"int",
"sortPos",
",",
"boolean",
"reversed",
")",
"throws",
"IOException",
"{",
"try",
"{",
"QPath",
"path",
"=",
"locat... | Create a new <code>FieldComparator</code> for an embedded <code>propertyName</code>
and a <code>reader</code>.
@param propertyName the relative path to the property to sort on as returned
by org.apache.jackrabbit.spi.Path#getString().
@return a <code>FieldComparator</code>
@throws java.io.IOException if an error occur... | [
"Create",
"a",
"new",
"<code",
">",
"FieldComparator<",
"/",
"code",
">",
"for",
"an",
"embedded",
"<code",
">",
"propertyName<",
"/",
"code",
">",
"and",
"a",
"<code",
">",
"reader<",
"/",
"code",
">",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SharedFieldComparatorSource.java#L107-L133 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Scanner.java | Scanner.findInLine | public String findInLine(Pattern pattern) {
"""
Attempts to find the next occurrence of the specified pattern ignoring
delimiters. If the pattern is found before the next line separator, the
scanner advances past the input that matched and returns the string that
matched the pattern.
If no such pattern is dete... | java | public String findInLine(Pattern pattern) {
ensureOpen();
if (pattern == null)
throw new NullPointerException();
clearCaches();
// Expand buffer to include the next newline or end of input
int endPosition = 0;
saveState();
while (true) {
St... | [
"public",
"String",
"findInLine",
"(",
"Pattern",
"pattern",
")",
"{",
"ensureOpen",
"(",
")",
";",
"if",
"(",
"pattern",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"clearCaches",
"(",
")",
";",
"// Expand buffer to include the n... | Attempts to find the next occurrence of the specified pattern ignoring
delimiters. If the pattern is found before the next line separator, the
scanner advances past the input that matched and returns the string that
matched the pattern.
If no such pattern is detected in the input up to the next line
separator, then <co... | [
"Attempts",
"to",
"find",
"the",
"next",
"occurrence",
"of",
"the",
"specified",
"pattern",
"ignoring",
"delimiters",
".",
"If",
"the",
"pattern",
"is",
"found",
"before",
"the",
"next",
"line",
"separator",
"the",
"scanner",
"advances",
"past",
"the",
"input"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Scanner.java#L1559-L1589 |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/AbstractDirector.java | AbstractDirector.isEmpty | boolean isEmpty(Map<String, List<List<RepositoryResource>>> installResources) {
"""
Checks if installResources map contains any resources
@param installResources the map of installResources
@return true if all lists in the map are empty
"""
if (installResources == null)
return true;
... | java | boolean isEmpty(Map<String, List<List<RepositoryResource>>> installResources) {
if (installResources == null)
return true;
for (List<List<RepositoryResource>> targetList : installResources.values()) {
for (List<RepositoryResource> mrList : targetList) {
if (!mrLis... | [
"boolean",
"isEmpty",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"List",
"<",
"RepositoryResource",
">",
">",
">",
"installResources",
")",
"{",
"if",
"(",
"installResources",
"==",
"null",
")",
"return",
"true",
";",
"for",
"(",
"List",
"<",
"List",
... | Checks if installResources map contains any resources
@param installResources the map of installResources
@return true if all lists in the map are empty | [
"Checks",
"if",
"installResources",
"map",
"contains",
"any",
"resources"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/AbstractDirector.java#L119-L129 |
FedericoPecora/meta-csp-framework | src/main/java/org/metacsp/multi/spatioTemporal/paths/TrajectoryEnvelope.java | TrajectoryEnvelope.makeInnerFootprint | public Geometry makeInnerFootprint(double x, double y, double theta) {
"""
Returns a {@link Geometry} representing the inner footprint of the robot in a given pose.
@param x The x coordinate of the pose used to create the inner footprint.
@param y The y coordinate of the pose used to create the inner footprint.
... | java | public Geometry makeInnerFootprint(double x, double y, double theta) {
AffineTransformation at = new AffineTransformation();
at.rotate(theta);
at.translate(x,y);
Geometry rect = at.transform(innerFootprint);
return rect;
} | [
"public",
"Geometry",
"makeInnerFootprint",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"theta",
")",
"{",
"AffineTransformation",
"at",
"=",
"new",
"AffineTransformation",
"(",
")",
";",
"at",
".",
"rotate",
"(",
"theta",
")",
";",
"at",
".",
... | Returns a {@link Geometry} representing the inner footprint of the robot in a given pose.
@param x The x coordinate of the pose used to create the inner footprint.
@param y The y coordinate of the pose used to create the inner footprint.
@param theta The orientation of the pose used to create the inner footprint.
@retu... | [
"Returns",
"a",
"{"
] | train | https://github.com/FedericoPecora/meta-csp-framework/blob/42aaef2e2b76d0f738427f0dd9653c4f62b40517/src/main/java/org/metacsp/multi/spatioTemporal/paths/TrajectoryEnvelope.java#L646-L652 |
baratine/baratine | web/src/main/java/com/caucho/v5/http/protocol/RequestHttpBase.java | RequestHttpBase.setFooter | public void setFooter(String key, String value) {
"""
Sets a footer, replacing an already-existing footer
@param key the header key to set.
@param value the header value to set.
"""
Objects.requireNonNull(value);
int i = 0;
boolean hasFooter = false;
for (i = _footerKeys.size() - 1; i >= ... | java | public void setFooter(String key, String value)
{
Objects.requireNonNull(value);
int i = 0;
boolean hasFooter = false;
for (i = _footerKeys.size() - 1; i >= 0; i--) {
String oldKey = _footerKeys.get(i);
if (oldKey.equalsIgnoreCase(key)) {
if (hasFooter) {
_footerKeys.r... | [
"public",
"void",
"setFooter",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"value",
")",
";",
"int",
"i",
"=",
"0",
";",
"boolean",
"hasFooter",
"=",
"false",
";",
"for",
"(",
"i",
"=",
"_footerKeys",
... | Sets a footer, replacing an already-existing footer
@param key the header key to set.
@param value the header value to set. | [
"Sets",
"a",
"footer",
"replacing",
"an",
"already",
"-",
"existing",
"footer"
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/http/protocol/RequestHttpBase.java#L2214-L2241 |
davidmoten/rxjava-jdbc | src/main/java/com/github/davidmoten/rx/RxUtil.java | RxUtil.getAndAddRequest | public static long getAndAddRequest(AtomicLong requested, long n) {
"""
Adds {@code n} to {@code requested} and returns the value prior to
addition once the addition is successful (uses CAS semantics). If
overflows then sets {@code requested} field to {@code Long.MAX_VALUE}.
@param requested
atomic field upd... | java | public static long getAndAddRequest(AtomicLong requested, long n) {
// add n to field but check for overflow
while (true) {
long current = requested.get();
long next = current + n;
// check for overflow
if (next < 0) {
next = Long.MAX_VALUE... | [
"public",
"static",
"long",
"getAndAddRequest",
"(",
"AtomicLong",
"requested",
",",
"long",
"n",
")",
"{",
"// add n to field but check for overflow",
"while",
"(",
"true",
")",
"{",
"long",
"current",
"=",
"requested",
".",
"get",
"(",
")",
";",
"long",
"nex... | Adds {@code n} to {@code requested} and returns the value prior to
addition once the addition is successful (uses CAS semantics). If
overflows then sets {@code requested} field to {@code Long.MAX_VALUE}.
@param requested
atomic field updater for a request count
@param object
contains the field updated by the updater
@... | [
"Adds",
"{",
"@code",
"n",
"}",
"to",
"{",
"@code",
"requested",
"}",
"and",
"returns",
"the",
"value",
"prior",
"to",
"addition",
"once",
"the",
"addition",
"is",
"successful",
"(",
"uses",
"CAS",
"semantics",
")",
".",
"If",
"overflows",
"then",
"sets"... | train | https://github.com/davidmoten/rxjava-jdbc/blob/81e157d7071a825086bde81107b8694684cdff14/src/main/java/com/github/davidmoten/rx/RxUtil.java#L187-L200 |
cloudant/java-cloudant | cloudant-client/src/main/java/com/cloudant/client/org/lightcouch/CouchDatabaseBase.java | CouchDatabaseBase.saveAttachment | public Response saveAttachment(InputStream in, String name, String contentType, String docId,
String docRev) {
"""
Saves an attachment to an existing document given both a document id
and revision, or save to a new document given only the id, and rev as {@code null}.
<p>To retr... | java | public Response saveAttachment(InputStream in, String name, String contentType, String docId,
String docRev) {
assertNotEmpty(in, "in");
assertNotEmpty(name, "name");
assertNotEmpty(contentType, "ContentType");
if (docId == null) {
docId = g... | [
"public",
"Response",
"saveAttachment",
"(",
"InputStream",
"in",
",",
"String",
"name",
",",
"String",
"contentType",
",",
"String",
"docId",
",",
"String",
"docRev",
")",
"{",
"assertNotEmpty",
"(",
"in",
",",
"\"in\"",
")",
";",
"assertNotEmpty",
"(",
"na... | Saves an attachment to an existing document given both a document id
and revision, or save to a new document given only the id, and rev as {@code null}.
<p>To retrieve an attachment, see {@link #find(String)}.
@param in The {@link InputStream} holding the binary data.
@param name The attachment name.
@... | [
"Saves",
"an",
"attachment",
"to",
"an",
"existing",
"document",
"given",
"both",
"a",
"document",
"id",
"and",
"revision",
"or",
"save",
"to",
"a",
"new",
"document",
"given",
"only",
"the",
"id",
"and",
"rev",
"as",
"{",
"@code",
"null",
"}",
".",
"<... | train | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/org/lightcouch/CouchDatabaseBase.java#L361-L380 |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java | PyExpressionGenerator._generate | protected XExpression _generate(XWhileExpression whileLoop, IAppendable it, IExtraLanguageGeneratorContext context) {
"""
Generate the given object.
@param whileLoop the while-loop.
@param it the target for the generated content.
@param context the context.
@return the last statement in the loop or {@code nu... | java | protected XExpression _generate(XWhileExpression whileLoop, IAppendable it, IExtraLanguageGeneratorContext context) {
it.append("while "); //$NON-NLS-1$
generate(whileLoop.getPredicate(), it, context);
it.append(":"); //$NON-NLS-1$
it.increaseIndentation().newLine();
final XExpression last = generate(whileLoo... | [
"protected",
"XExpression",
"_generate",
"(",
"XWhileExpression",
"whileLoop",
",",
"IAppendable",
"it",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"it",
".",
"append",
"(",
"\"while \"",
")",
";",
"//$NON-NLS-1$",
"generate",
"(",
"whileLoop",
".",... | Generate the given object.
@param whileLoop the while-loop.
@param it the target for the generated content.
@param context the context.
@return the last statement in the loop or {@code null}. | [
"Generate",
"the",
"given",
"object",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java#L593-L601 |
BlueBrain/bluima | modules/bluima_opennlp/src/main/java/ch/epfl/bbp/shaded/opennlp/maxent/GIS.java | GIS.trainModel | public static GISModel trainModel(int iterations, DataIndexer indexer) {
"""
Train a model using the GIS algorithm.
@param iterations The number of GIS iterations to perform.
@param indexer The object which will be used for event compilation.
@return The newly trained model, which can be used immediately or sav... | java | public static GISModel trainModel(int iterations, DataIndexer indexer) {
return trainModel(iterations,indexer,true,false);
} | [
"public",
"static",
"GISModel",
"trainModel",
"(",
"int",
"iterations",
",",
"DataIndexer",
"indexer",
")",
"{",
"return",
"trainModel",
"(",
"iterations",
",",
"indexer",
",",
"true",
",",
"false",
")",
";",
"}"
] | Train a model using the GIS algorithm.
@param iterations The number of GIS iterations to perform.
@param indexer The object which will be used for event compilation.
@return The newly trained model, which can be used immediately or saved
to disk using an opennlp.maxent.io.GISModelWriter object. | [
"Train",
"a",
"model",
"using",
"the",
"GIS",
"algorithm",
"."
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_opennlp/src/main/java/ch/epfl/bbp/shaded/opennlp/maxent/GIS.java#L144-L146 |
foundation-runtime/configuration | configuration-api/src/main/java/com/cisco/oss/foundation/configuration/ConfigUtil.java | ConfigUtil.parseSimpleArrayAsMap | public static Map<String, String> parseSimpleArrayAsMap(String configPrefix) {
"""
parse an simple array and return it as a Map. Can be used in conjunction with {@code ConfigUtil#parseComplexArrayStructure(String)}
@param configPrefix the prefix that is the basis of the array. E.g.
given:
smartcardAdaptor.c... | java | public static Map<String, String> parseSimpleArrayAsMap(String configPrefix) {
Configuration configuration = ConfigurationFactory.getConfiguration();
return parseSimpleArrayAsMap(configuration, configPrefix);
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"parseSimpleArrayAsMap",
"(",
"String",
"configPrefix",
")",
"{",
"Configuration",
"configuration",
"=",
"ConfigurationFactory",
".",
"getConfiguration",
"(",
")",
";",
"return",
"parseSimpleArrayAsMap",
... | parse an simple array and return it as a Map. Can be used in conjunction with {@code ConfigUtil#parseComplexArrayStructure(String)}
@param configPrefix the prefix that is the basis of the array. E.g.
given:
smartcardAdaptor.cardFeatures.23.sbmMSB.0=0x00
smartcardAdaptor.cardFeatures.23.sbmMSB.1=0x01
the config prefi... | [
"parse",
"an",
"simple",
"array",
"and",
"return",
"it",
"as",
"a",
"Map",
".",
"Can",
"be",
"used",
"in",
"conjunction",
"with",
"{",
"@code",
"ConfigUtil#parseComplexArrayStructure",
"(",
"String",
")",
"}",
"@param",
"configPrefix",
"the",
"prefix",
"that",... | train | https://github.com/foundation-runtime/configuration/blob/c5bd171a2cca0dc1c8d568f987843ca47c6d1eed/configuration-api/src/main/java/com/cisco/oss/foundation/configuration/ConfigUtil.java#L194-L199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.