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 |
|---|---|---|---|---|---|---|---|---|---|---|
sebastiangraf/treetank | coremodules/node/src/main/java/org/treetank/axis/AbsAxis.java | AbsAxis.addAtomicToItemList | public static int addAtomicToItemList(final INodeReadTrx pRtx, final AtomicValue pVal) {
"""
Adding any AtomicVal to any ItemList staticly.
@param pRtx
as key
@param pVal
to be added
@return the index in the ItemList
"""
if (!atomics.containsKey(pRtx)) {
atomics.put(pRtx, new ItemLis... | java | public static int addAtomicToItemList(final INodeReadTrx pRtx, final AtomicValue pVal) {
if (!atomics.containsKey(pRtx)) {
atomics.put(pRtx, new ItemList());
}
return atomics.get(pRtx).addItem(pVal);
} | [
"public",
"static",
"int",
"addAtomicToItemList",
"(",
"final",
"INodeReadTrx",
"pRtx",
",",
"final",
"AtomicValue",
"pVal",
")",
"{",
"if",
"(",
"!",
"atomics",
".",
"containsKey",
"(",
"pRtx",
")",
")",
"{",
"atomics",
".",
"put",
"(",
"pRtx",
",",
"ne... | Adding any AtomicVal to any ItemList staticly.
@param pRtx
as key
@param pVal
to be added
@return the index in the ItemList | [
"Adding",
"any",
"AtomicVal",
"to",
"any",
"ItemList",
"staticly",
"."
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/coremodules/node/src/main/java/org/treetank/axis/AbsAxis.java#L264-L270 |
JM-Lab/utils-java9 | src/main/java/kr/jm/utils/helper/JMJson.java | JMJson.toJsonFile | public static <D> File toJsonFile(D dataObject, File returnJsonFile) {
"""
To json file file.
@param <D> the type parameter
@param dataObject the data object
@param returnJsonFile the return json file
@return the file
"""
try {
jsonMapper.writeValue(returnJsonFile, data... | java | public static <D> File toJsonFile(D dataObject, File returnJsonFile) {
try {
jsonMapper.writeValue(returnJsonFile, dataObject);
return returnJsonFile;
} catch (Exception e) {
return JMExceptionManager.handleExceptionAndReturnNull(log, e,
"toJsonFil... | [
"public",
"static",
"<",
"D",
">",
"File",
"toJsonFile",
"(",
"D",
"dataObject",
",",
"File",
"returnJsonFile",
")",
"{",
"try",
"{",
"jsonMapper",
".",
"writeValue",
"(",
"returnJsonFile",
",",
"dataObject",
")",
";",
"return",
"returnJsonFile",
";",
"}",
... | To json file file.
@param <D> the type parameter
@param dataObject the data object
@param returnJsonFile the return json file
@return the file | [
"To",
"json",
"file",
"file",
"."
] | train | https://github.com/JM-Lab/utils-java9/blob/ee80235b2760396a616cf7563cbdc98d4affe8e1/src/main/java/kr/jm/utils/helper/JMJson.java#L105-L113 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEEJBInvocationInfo.java | TEEJBInvocationInfo.tracePostInvokeEnds | public static void tracePostInvokeEnds(EJSDeployedSupport s, EJSWrapperBase wrapper) {
"""
This is called by the EJB container server code to write a
EJB method call postinvoke ends record to the trace log, if enabled.
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
... | java | public static void tracePostInvokeEnds(EJSDeployedSupport s, EJSWrapperBase wrapper)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(MthdPostInvokeExit_Type_Str).append(Data... | [
"public",
"static",
"void",
"tracePostInvokeEnds",
"(",
"EJSDeployedSupport",
"s",
",",
"EJSWrapperBase",
"wrapper",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"StringBuffer... | This is called by the EJB container server code to write a
EJB method call postinvoke ends record to the trace log, if enabled. | [
"This",
"is",
"called",
"by",
"the",
"EJB",
"container",
"server",
"code",
"to",
"write",
"a",
"EJB",
"method",
"call",
"postinvoke",
"ends",
"record",
"to",
"the",
"trace",
"log",
"if",
"enabled",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEEJBInvocationInfo.java#L114-L128 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/BufferUtil.java | BufferUtil.lineEnd | public static int lineEnd(ByteBuffer buffer, int maxLength) {
"""
一行的末尾位置,查找位置时位移ByteBuffer到结束位置<br>
支持的换行符如下:
<pre>
1. \r\n
2. \n
</pre>
@param buffer {@link ByteBuffer}
@param maxLength 读取最大长度
@return 末尾位置,未找到或达到最大长度返回-1
"""
int primitivePosition = buffer.position();
boolean canEnd = false;... | java | public static int lineEnd(ByteBuffer buffer, int maxLength) {
int primitivePosition = buffer.position();
boolean canEnd = false;
int charIndex = primitivePosition;
byte b;
while (buffer.hasRemaining()) {
b = buffer.get();
charIndex++;
if (b == StrUtil.C_CR) {
canEnd = true;
} else if... | [
"public",
"static",
"int",
"lineEnd",
"(",
"ByteBuffer",
"buffer",
",",
"int",
"maxLength",
")",
"{",
"int",
"primitivePosition",
"=",
"buffer",
".",
"position",
"(",
")",
";",
"boolean",
"canEnd",
"=",
"false",
";",
"int",
"charIndex",
"=",
"primitivePositi... | 一行的末尾位置,查找位置时位移ByteBuffer到结束位置<br>
支持的换行符如下:
<pre>
1. \r\n
2. \n
</pre>
@param buffer {@link ByteBuffer}
@param maxLength 读取最大长度
@return 末尾位置,未找到或达到最大长度返回-1 | [
"一行的末尾位置,查找位置时位移ByteBuffer到结束位置<br",
">",
"支持的换行符如下:"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/BufferUtil.java#L161-L189 |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.setMinutes | public static Date setMinutes(Date d, int minutes) {
"""
Set minutes to a date
@param d date
@param minutes minutes
@return new date
"""
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.set(Calendar.MINUTE, minutes);
return cal.getTime();
} | java | public static Date setMinutes(Date d, int minutes) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.set(Calendar.MINUTE, minutes);
return cal.getTime();
} | [
"public",
"static",
"Date",
"setMinutes",
"(",
"Date",
"d",
",",
"int",
"minutes",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"set",
"(",
"Calendar",
".",
... | Set minutes to a date
@param d date
@param minutes minutes
@return new date | [
"Set",
"minutes",
"to",
"a",
"date"
] | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L444-L449 |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/BandwidthClient.java | BandwidthClient.generatePutRequest | protected HttpPut generatePutRequest(final String path, final Map<String, Object> paramMap) {
"""
Helper method to build the PUT request for the server.
@param path the path
@param paramMap the parameters map.
@return the put object.
"""
final HttpPut put = new HttpPut(buildUri(path));
if ... | java | protected HttpPut generatePutRequest(final String path, final Map<String, Object> paramMap) {
final HttpPut put = new HttpPut(buildUri(path));
if (paramMap != null) {
put.setEntity(new StringEntity(JSONObject.toJSONString(paramMap), ContentType.APPLICATION_JSON));
}
return pu... | [
"protected",
"HttpPut",
"generatePutRequest",
"(",
"final",
"String",
"path",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"paramMap",
")",
"{",
"final",
"HttpPut",
"put",
"=",
"new",
"HttpPut",
"(",
"buildUri",
"(",
"path",
")",
")",
";",
"if... | Helper method to build the PUT request for the server.
@param path the path
@param paramMap the parameters map.
@return the put object. | [
"Helper",
"method",
"to",
"build",
"the",
"PUT",
"request",
"for",
"the",
"server",
"."
] | train | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/BandwidthClient.java#L652-L658 |
GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/outputs/LevelDbOutputWriter.java | LevelDbOutputWriter.createRecord | private static Record createRecord(ByteBuffer data, int bytesToBlockEnd, Record lastRecord) {
"""
Fills a {@link Record} object with data about the physical record to write.
@param data the users data.
@param bytesToBlockEnd remaining bytes in the current block.
@param lastRecord a {@link Record} representing... | java | private static Record createRecord(ByteBuffer data, int bytesToBlockEnd, Record lastRecord) {
int bytesToDataEnd = data.remaining();
RecordType type = RecordType.UNKNOWN;
int bytes = -1;
if ((lastRecord.getType() == RecordType.NONE)
&& ((bytesToDataEnd + LevelDbConstants.HEADER_LENGTH) <= bytesT... | [
"private",
"static",
"Record",
"createRecord",
"(",
"ByteBuffer",
"data",
",",
"int",
"bytesToBlockEnd",
",",
"Record",
"lastRecord",
")",
"{",
"int",
"bytesToDataEnd",
"=",
"data",
".",
"remaining",
"(",
")",
";",
"RecordType",
"type",
"=",
"RecordType",
".",... | Fills a {@link Record} object with data about the physical record to write.
@param data the users data.
@param bytesToBlockEnd remaining bytes in the current block.
@param lastRecord a {@link Record} representing the last physical record written.
@return the {@link Record} with new write data. | [
"Fills",
"a",
"{",
"@link",
"Record",
"}",
"object",
"with",
"data",
"about",
"the",
"physical",
"record",
"to",
"write",
"."
] | train | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/outputs/LevelDbOutputWriter.java#L150-L173 |
TheHortonMachine/hortonmachine | modules/src/main/java/org/hortonmachine/modules/Raster.java | Raster.buildRaster | public GridCoverage2D buildRaster() {
"""
Creates a {@link GridCoverage2D} from the {@link Raster}.
@return the coverage.
"""
if (makeNew) {
GridCoverage2D coverage = buildCoverage("raster", newWR, regionMap, crs);
return coverage;
} else {
throw new Runti... | java | public GridCoverage2D buildRaster() {
if (makeNew) {
GridCoverage2D coverage = buildCoverage("raster", newWR, regionMap, crs);
return coverage;
} else {
throw new RuntimeException("The raster is readonly, so no new raster can be built.");
}
} | [
"public",
"GridCoverage2D",
"buildRaster",
"(",
")",
"{",
"if",
"(",
"makeNew",
")",
"{",
"GridCoverage2D",
"coverage",
"=",
"buildCoverage",
"(",
"\"raster\"",
",",
"newWR",
",",
"regionMap",
",",
"crs",
")",
";",
"return",
"coverage",
";",
"}",
"else",
"... | Creates a {@link GridCoverage2D} from the {@link Raster}.
@return the coverage. | [
"Creates",
"a",
"{",
"@link",
"GridCoverage2D",
"}",
"from",
"the",
"{",
"@link",
"Raster",
"}",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/modules/src/main/java/org/hortonmachine/modules/Raster.java#L344-L351 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpBackOffIOExceptionHandler.java | HttpBackOffIOExceptionHandler.handleIOException | public boolean handleIOException(HttpRequest request, boolean supportsRetry) throws IOException {
"""
{@inheritDoc}
<p>Handles the request with {@link BackOff}. That means that if back-off is required a call to
{@link Sleeper#sleep(long)} will be made.
"""
if (!supportsRetry) {
return false;
... | java | public boolean handleIOException(HttpRequest request, boolean supportsRetry) throws IOException {
if (!supportsRetry) {
return false;
}
try {
return BackOffUtils.next(sleeper, backOff);
} catch (InterruptedException exception) {
return false;
}
} | [
"public",
"boolean",
"handleIOException",
"(",
"HttpRequest",
"request",
",",
"boolean",
"supportsRetry",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"supportsRetry",
")",
"{",
"return",
"false",
";",
"}",
"try",
"{",
"return",
"BackOffUtils",
".",
"nex... | {@inheritDoc}
<p>Handles the request with {@link BackOff}. That means that if back-off is required a call to
{@link Sleeper#sleep(long)} will be made. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpBackOffIOExceptionHandler.java#L93-L102 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/PersistenceBrokerThreadMapping.java | PersistenceBrokerThreadMapping.unsetCurrentPersistenceBroker | public static void unsetCurrentPersistenceBroker(PBKey key, PersistenceBrokerInternal broker)
throws PBFactoryException {
"""
Unmark a PersistenceBroker as preferred choice for current Thread
@param key The PBKey the broker is associated to
@param broker The PersistenceBroker to unmark
"""
... | java | public static void unsetCurrentPersistenceBroker(PBKey key, PersistenceBrokerInternal broker)
throws PBFactoryException
{
HashMap map = (HashMap) currentBrokerMap.get();
WeakHashMap set = null;
if(map != null)
{
set = (WeakHashMap) map.get(key);
... | [
"public",
"static",
"void",
"unsetCurrentPersistenceBroker",
"(",
"PBKey",
"key",
",",
"PersistenceBrokerInternal",
"broker",
")",
"throws",
"PBFactoryException",
"{",
"HashMap",
"map",
"=",
"(",
"HashMap",
")",
"currentBrokerMap",
".",
"get",
"(",
")",
";",
"Weak... | Unmark a PersistenceBroker as preferred choice for current Thread
@param key The PBKey the broker is associated to
@param broker The PersistenceBroker to unmark | [
"Unmark",
"a",
"PersistenceBroker",
"as",
"preferred",
"choice",
"for",
"current",
"Thread"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/PersistenceBrokerThreadMapping.java#L93-L117 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexChangeAdapters.java | IndexChangeAdapters.forEnumeratedProperty | public static IndexChangeAdapter forEnumeratedProperty( ExecutionContext context,
NodeTypePredicate matcher,
String workspaceName,
Name prop... | java | public static IndexChangeAdapter forEnumeratedProperty( ExecutionContext context,
NodeTypePredicate matcher,
String workspaceName,
Name prop... | [
"public",
"static",
"IndexChangeAdapter",
"forEnumeratedProperty",
"(",
"ExecutionContext",
"context",
",",
"NodeTypePredicate",
"matcher",
",",
"String",
"workspaceName",
",",
"Name",
"propertyName",
",",
"ProvidedIndex",
"<",
"?",
">",
"index",
")",
"{",
"return",
... | Create an {@link IndexChangeAdapter} implementation that handles a enumerated properties, either single or multi-valued.
@param context the execution context; may not be null
@param matcher the node type matcher used to determine which nodes should be included in the index; may not be null
@param workspaceName the nam... | [
"Create",
"an",
"{",
"@link",
"IndexChangeAdapter",
"}",
"implementation",
"that",
"handles",
"a",
"enumerated",
"properties",
"either",
"single",
"or",
"multi",
"-",
"valued",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexChangeAdapters.java#L218-L224 |
VoltDB/voltdb | third_party/java/src/org/apache/commons_voltpatches/cli/Options.java | Options.addOption | public Options addOption(String opt, String longOpt, boolean hasArg, String description) {
"""
Add an option that contains a short-name and a long-name.
It may be specified as requiring an argument.
@param opt Short single-character name of the option.
@param longOpt Long multi-character name of the option.
... | java | public Options addOption(String opt, String longOpt, boolean hasArg, String description)
{
addOption(new Option(opt, longOpt, hasArg, description));
return this;
} | [
"public",
"Options",
"addOption",
"(",
"String",
"opt",
",",
"String",
"longOpt",
",",
"boolean",
"hasArg",
",",
"String",
"description",
")",
"{",
"addOption",
"(",
"new",
"Option",
"(",
"opt",
",",
"longOpt",
",",
"hasArg",
",",
"description",
")",
")",
... | Add an option that contains a short-name and a long-name.
It may be specified as requiring an argument.
@param opt Short single-character name of the option.
@param longOpt Long multi-character name of the option.
@param hasArg flag signally if an argument is required after this option
@param description Self-document... | [
"Add",
"an",
"option",
"that",
"contains",
"a",
"short",
"-",
"name",
"and",
"a",
"long",
"-",
"name",
".",
"It",
"may",
"be",
"specified",
"as",
"requiring",
"an",
"argument",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/commons_voltpatches/cli/Options.java#L140-L144 |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassInfoList.java | ClassInfoList.exclude | public ClassInfoList exclude(final ClassInfoList other) {
"""
Find the set difference between this {@link ClassInfoList} and another {@link ClassInfoList}, i.e. (this \
other).
@param other
The other {@link ClassInfoList} to subtract from this one.
@return The set difference of this {@link ClassInfoList} and... | java | public ClassInfoList exclude(final ClassInfoList other) {
final Set<ClassInfo> reachableClassesDifference = new LinkedHashSet<>(this);
final Set<ClassInfo> directlyRelatedClassesDifference = new LinkedHashSet<>(directlyRelatedClasses);
reachableClassesDifference.removeAll(other);
directl... | [
"public",
"ClassInfoList",
"exclude",
"(",
"final",
"ClassInfoList",
"other",
")",
"{",
"final",
"Set",
"<",
"ClassInfo",
">",
"reachableClassesDifference",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
"this",
")",
";",
"final",
"Set",
"<",
"ClassInfo",
">",
"direc... | Find the set difference between this {@link ClassInfoList} and another {@link ClassInfoList}, i.e. (this \
other).
@param other
The other {@link ClassInfoList} to subtract from this one.
@return The set difference of this {@link ClassInfoList} and other, i.e. (this \ other). | [
"Find",
"the",
"set",
"difference",
"between",
"this",
"{",
"@link",
"ClassInfoList",
"}",
"and",
"another",
"{",
"@link",
"ClassInfoList",
"}",
"i",
".",
"e",
".",
"(",
"this",
"\\",
"other",
")",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassInfoList.java#L362-L368 |
BlueBrain/bluima | modules/bluima_protein_concentrations/src/main/java/ch/epfl/bbp/nlp/ie/proteinconc/normalizer/ConcentrationNormalizer.java | ConcentrationNormalizer.normalizeMassUnit | private ValueUnitWrapper normalizeMassUnit(final double value, final String unit)
throws UnknownUnitException {
"""
deals with the normalization of unit confronting weight and volume
"""
Matcher matcher = mMassUnitPatter.matcher(unit);
if (matcher.find()) {
double norma... | java | private ValueUnitWrapper normalizeMassUnit(final double value, final String unit)
throws UnknownUnitException {
Matcher matcher = mMassUnitPatter.matcher(unit);
if (matcher.find()) {
double normalizationFactor = 1.0;
String numeratorSIPrefix = matcher.group(1);
... | [
"private",
"ValueUnitWrapper",
"normalizeMassUnit",
"(",
"final",
"double",
"value",
",",
"final",
"String",
"unit",
")",
"throws",
"UnknownUnitException",
"{",
"Matcher",
"matcher",
"=",
"mMassUnitPatter",
".",
"matcher",
"(",
"unit",
")",
";",
"if",
"(",
"matc... | deals with the normalization of unit confronting weight and volume | [
"deals",
"with",
"the",
"normalization",
"of",
"unit",
"confronting",
"weight",
"and",
"volume"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_protein_concentrations/src/main/java/ch/epfl/bbp/nlp/ie/proteinconc/normalizer/ConcentrationNormalizer.java#L83-L115 |
geomajas/geomajas-project-client-gwt2 | impl/src/main/java/org/geomajas/gwt2/client/service/JsonService.java | JsonService.getStringValue | public static String getStringValue(JSONObject jsonObject, String key) throws JSONException {
"""
Get a string value from a {@link JSONObject}.
@param jsonObject The object to get the key value from.
@param key The name of the key to search the value for.
@return Returns the value for the key in the object or... | java | public static String getStringValue(JSONObject jsonObject, String key) throws JSONException {
checkArguments(jsonObject, key);
JSONValue value = jsonObject.get(key);
if (value != null) {
if (value.isString() != null) {
return ((JSONString) value).stringValue();
} else {
String valueString = value.to... | [
"public",
"static",
"String",
"getStringValue",
"(",
"JSONObject",
"jsonObject",
",",
"String",
"key",
")",
"throws",
"JSONException",
"{",
"checkArguments",
"(",
"jsonObject",
",",
"key",
")",
";",
"JSONValue",
"value",
"=",
"jsonObject",
".",
"get",
"(",
"ke... | Get a string value from a {@link JSONObject}.
@param jsonObject The object to get the key value from.
@param key The name of the key to search the value for.
@return Returns the value for the key in the object or null.
@throws JSONException Thrown in case the key could not be found in the JSON object. | [
"Get",
"a",
"string",
"value",
"from",
"a",
"{",
"@link",
"JSONObject",
"}",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/impl/src/main/java/org/geomajas/gwt2/client/service/JsonService.java#L138-L155 |
Whiley/WhileyCompiler | src/main/java/wyil/transform/VerificationConditionGenerator.java | VerificationConditionGenerator.implies | private WyalFile.Stmt implies(WyalFile.Stmt antecedent, WyalFile.Stmt consequent) {
"""
Construct an implication from one expression to another
@param antecedent
@param consequent
@return
"""
if (antecedent == null) {
return consequent;
} else {
WyalFile.Stmt.Block antecedentBlock = new WyalFile... | java | private WyalFile.Stmt implies(WyalFile.Stmt antecedent, WyalFile.Stmt consequent) {
if (antecedent == null) {
return consequent;
} else {
WyalFile.Stmt.Block antecedentBlock = new WyalFile.Stmt.Block(antecedent);
WyalFile.Stmt.Block consequentBlock = new WyalFile.Stmt.Block(consequent);
return new WyalF... | [
"private",
"WyalFile",
".",
"Stmt",
"implies",
"(",
"WyalFile",
".",
"Stmt",
"antecedent",
",",
"WyalFile",
".",
"Stmt",
"consequent",
")",
"{",
"if",
"(",
"antecedent",
"==",
"null",
")",
"{",
"return",
"consequent",
";",
"}",
"else",
"{",
"WyalFile",
"... | Construct an implication from one expression to another
@param antecedent
@param consequent
@return | [
"Construct",
"an",
"implication",
"from",
"one",
"expression",
"to",
"another"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/transform/VerificationConditionGenerator.java#L1721-L1729 |
graphql-java/graphql-java | src/main/java/graphql/schema/diff/SchemaDiff.java | SchemaDiff.diffSchema | @SuppressWarnings("unchecked")
public int diffSchema(DiffSet diffSet, DifferenceReporter reporter) {
"""
This will perform a difference on the two schemas. The reporter callback
interface will be called when differences are encountered.
@param diffSet the two schemas to compare for difference
@param rep... | java | @SuppressWarnings("unchecked")
public int diffSchema(DiffSet diffSet, DifferenceReporter reporter) {
CountingReporter countingReporter = new CountingReporter(reporter);
diffSchemaImpl(diffSet, countingReporter);
return countingReporter.breakingCount;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"int",
"diffSchema",
"(",
"DiffSet",
"diffSet",
",",
"DifferenceReporter",
"reporter",
")",
"{",
"CountingReporter",
"countingReporter",
"=",
"new",
"CountingReporter",
"(",
"reporter",
")",
";",
"diffSch... | This will perform a difference on the two schemas. The reporter callback
interface will be called when differences are encountered.
@param diffSet the two schemas to compare for difference
@param reporter the place to report difference events to
@return the number of API breaking changes | [
"This",
"will",
"perform",
"a",
"difference",
"on",
"the",
"two",
"schemas",
".",
"The",
"reporter",
"callback",
"interface",
"will",
"be",
"called",
"when",
"differences",
"are",
"encountered",
"."
] | train | https://github.com/graphql-java/graphql-java/blob/9214b6044317849388bd88a14b54fc1c18c9f29f/src/main/java/graphql/schema/diff/SchemaDiff.java#L120-L126 |
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpVersion.java | HttpVersion.valueOf | public static HttpVersion valueOf(String text) {
"""
Returns an existing or new {@link HttpVersion} instance which matches to
the specified protocol version string. If the specified {@code text} is
equal to {@code "HTTP/1.0"}, {@link #HTTP_1_0} will be returned. If the
specified {@code text} is equal to {@cod... | java | public static HttpVersion valueOf(String text) {
if (text == null) {
throw new NullPointerException("text");
}
text = text.trim();
if (text.isEmpty()) {
throw new IllegalArgumentException("text is empty (possibly HTTP/0.9)");
}
// Try to match w... | [
"public",
"static",
"HttpVersion",
"valueOf",
"(",
"String",
"text",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"text\"",
")",
";",
"}",
"text",
"=",
"text",
".",
"trim",
"(",
")",
";",
"if",
"... | Returns an existing or new {@link HttpVersion} instance which matches to
the specified protocol version string. If the specified {@code text} is
equal to {@code "HTTP/1.0"}, {@link #HTTP_1_0} will be returned. If the
specified {@code text} is equal to {@code "HTTP/1.1"}, {@link #HTTP_1_1}
will be returned. Otherwise... | [
"Returns",
"an",
"existing",
"or",
"new",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpVersion.java#L57-L81 |
meltmedia/cadmium | core/src/main/java/com/meltmedia/cadmium/core/util/Jsr250Utils.java | Jsr250Utils.removeMethodByName | private static void removeMethodByName(Method method, List<Method> methods) {
"""
Removes a method from the given list and adds it to the end of the list.
@param method
@param methods
"""
if(methods != null) {
Iterator<Method> itr = methods.iterator();
Method aMethod = null;
while(itr.h... | java | private static void removeMethodByName(Method method, List<Method> methods) {
if(methods != null) {
Iterator<Method> itr = methods.iterator();
Method aMethod = null;
while(itr.hasNext()) {
aMethod = itr.next();
if(aMethod.getName().equals(method.getName())) {
itr.remove()... | [
"private",
"static",
"void",
"removeMethodByName",
"(",
"Method",
"method",
",",
"List",
"<",
"Method",
">",
"methods",
")",
"{",
"if",
"(",
"methods",
"!=",
"null",
")",
"{",
"Iterator",
"<",
"Method",
">",
"itr",
"=",
"methods",
".",
"iterator",
"(",
... | Removes a method from the given list and adds it to the end of the list.
@param method
@param methods | [
"Removes",
"a",
"method",
"from",
"the",
"given",
"list",
"and",
"adds",
"it",
"to",
"the",
"end",
"of",
"the",
"list",
"."
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/core/src/main/java/com/meltmedia/cadmium/core/util/Jsr250Utils.java#L184-L199 |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/internal/Utils.java | Utils.assertNotNullOrEmpty | @NonNull
public static String assertNotNullOrEmpty(String text, @Nullable String name) {
"""
Throws a {@link NullPointerException} if the given text is null or empty.
"""
if (isNullOrEmpty(text)) {
throw new NullPointerException(name + " cannot be null or empty");
}
return text;
} | java | @NonNull
public static String assertNotNullOrEmpty(String text, @Nullable String name) {
if (isNullOrEmpty(text)) {
throw new NullPointerException(name + " cannot be null or empty");
}
return text;
} | [
"@",
"NonNull",
"public",
"static",
"String",
"assertNotNullOrEmpty",
"(",
"String",
"text",
",",
"@",
"Nullable",
"String",
"name",
")",
"{",
"if",
"(",
"isNullOrEmpty",
"(",
"text",
")",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"name",
"+",
... | Throws a {@link NullPointerException} if the given text is null or empty. | [
"Throws",
"a",
"{"
] | train | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/internal/Utils.java#L209-L215 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/variational/VariationalAutoencoder.java | VariationalAutoencoder.generateRandomGivenZ | public INDArray generateRandomGivenZ(INDArray latentSpaceValues, LayerWorkspaceMgr workspaceMgr) {
"""
Given a specified values for the latent space as input (latent space being z in p(z|data)), randomly generate output
x, where x ~ P(x|z)
@param latentSpaceValues Values for the latent space. size(1) must e... | java | public INDArray generateRandomGivenZ(INDArray latentSpaceValues, LayerWorkspaceMgr workspaceMgr) {
INDArray pxzDistributionPreOut = decodeGivenLatentSpaceValues(latentSpaceValues, workspaceMgr);
return reconstructionDistribution.generateRandom(pxzDistributionPreOut);
} | [
"public",
"INDArray",
"generateRandomGivenZ",
"(",
"INDArray",
"latentSpaceValues",
",",
"LayerWorkspaceMgr",
"workspaceMgr",
")",
"{",
"INDArray",
"pxzDistributionPreOut",
"=",
"decodeGivenLatentSpaceValues",
"(",
"latentSpaceValues",
",",
"workspaceMgr",
")",
";",
"return... | Given a specified values for the latent space as input (latent space being z in p(z|data)), randomly generate output
x, where x ~ P(x|z)
@param latentSpaceValues Values for the latent space. size(1) must equal nOut configuration parameter
@return Sample of data: x ~ P(x|z) | [
"Given",
"a",
"specified",
"values",
"for",
"the",
"latent",
"space",
"as",
"input",
"(",
"latent",
"space",
"being",
"z",
"in",
"p",
"(",
"z|data",
"))",
"randomly",
"generate",
"output",
"x",
"where",
"x",
"~",
"P",
"(",
"x|z",
")"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/variational/VariationalAutoencoder.java#L1054-L1057 |
DDTH/ddth-kafka | src/main/java/com/github/ddth/kafka/KafkaClient.java | KafkaClient.commmit | public boolean commmit(KafkaMessage msg, String groupId) {
"""
Commit the specified offsets for the last consumed message.
@param msg
@param groupId
@return {@code true} if the topic is in subscription list, {@code false}
otherwise
@since 1.3.2
"""
KafkaMsgConsumer kafkaConsumer = cacheConsumers... | java | public boolean commmit(KafkaMessage msg, String groupId) {
KafkaMsgConsumer kafkaConsumer = cacheConsumers.get(groupId);
return kafkaConsumer != null ? kafkaConsumer.commit(msg) : false;
} | [
"public",
"boolean",
"commmit",
"(",
"KafkaMessage",
"msg",
",",
"String",
"groupId",
")",
"{",
"KafkaMsgConsumer",
"kafkaConsumer",
"=",
"cacheConsumers",
".",
"get",
"(",
"groupId",
")",
";",
"return",
"kafkaConsumer",
"!=",
"null",
"?",
"kafkaConsumer",
".",
... | Commit the specified offsets for the last consumed message.
@param msg
@param groupId
@return {@code true} if the topic is in subscription list, {@code false}
otherwise
@since 1.3.2 | [
"Commit",
"the",
"specified",
"offsets",
"for",
"the",
"last",
"consumed",
"message",
"."
] | train | https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/KafkaClient.java#L566-L569 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java | Unchecked.doubleBinaryOperator | public static DoubleBinaryOperator doubleBinaryOperator(CheckedDoubleBinaryOperator operator, Consumer<Throwable> handler) {
"""
Wrap a {@link CheckedDoubleBinaryOperator} in a {@link DoubleBinaryOperator} with a custom handler for checked exceptions.
<p>
Example:
<code><pre>
DoubleStream.of(1.0, 2.0, 3.0).red... | java | public static DoubleBinaryOperator doubleBinaryOperator(CheckedDoubleBinaryOperator operator, Consumer<Throwable> handler) {
return (d1, d2) -> {
try {
return operator.applyAsDouble(d1, d2);
}
catch (Throwable e) {
handler.accept(e);
... | [
"public",
"static",
"DoubleBinaryOperator",
"doubleBinaryOperator",
"(",
"CheckedDoubleBinaryOperator",
"operator",
",",
"Consumer",
"<",
"Throwable",
">",
"handler",
")",
"{",
"return",
"(",
"d1",
",",
"d2",
")",
"->",
"{",
"try",
"{",
"return",
"operator",
"."... | Wrap a {@link CheckedDoubleBinaryOperator} in a {@link DoubleBinaryOperator} with a custom handler for checked exceptions.
<p>
Example:
<code><pre>
DoubleStream.of(1.0, 2.0, 3.0).reduce(Unchecked.doubleBinaryOperator(
(d1, d2) -> {
if (d2 < 0.0)
throw new Exception("Only positive numbers allowed");
return d1 + d2;
... | [
"Wrap",
"a",
"{",
"@link",
"CheckedDoubleBinaryOperator",
"}",
"in",
"a",
"{",
"@link",
"DoubleBinaryOperator",
"}",
"with",
"a",
"custom",
"handler",
"for",
"checked",
"exceptions",
".",
"<p",
">",
"Example",
":",
"<code",
">",
"<pre",
">",
"DoubleStream",
... | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Unchecked.java#L643-L654 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/UnderFileSystemUtils.java | UnderFileSystemUtils.touch | public static void touch(UnderFileSystem ufs, String path) throws IOException {
"""
Creates an empty file.
@param ufs instance of {@link UnderFileSystem}
@param path path to the file
"""
OutputStream os = ufs.create(path);
os.close();
} | java | public static void touch(UnderFileSystem ufs, String path) throws IOException {
OutputStream os = ufs.create(path);
os.close();
} | [
"public",
"static",
"void",
"touch",
"(",
"UnderFileSystem",
"ufs",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"OutputStream",
"os",
"=",
"ufs",
".",
"create",
"(",
"path",
")",
";",
"os",
".",
"close",
"(",
")",
";",
"}"
] | Creates an empty file.
@param ufs instance of {@link UnderFileSystem}
@param path path to the file | [
"Creates",
"an",
"empty",
"file",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/UnderFileSystemUtils.java#L63-L66 |
beangle/beangle3 | ioc/spring/src/main/java/org/beangle/inject/spring/config/BeanDefinitionParser.java | BeanDefinitionParser.buildTypedStringValue | protected TypedStringValue buildTypedStringValue(String value, String targetTypeName)
throws ClassNotFoundException {
"""
Build a typed String value Object for the given raw value.
@see org.springframework.beans.factory.config.TypedStringValue
@param value a {@link java.lang.String} object.
@param targe... | java | protected TypedStringValue buildTypedStringValue(String value, String targetTypeName)
throws ClassNotFoundException {
TypedStringValue typedValue;
if (!StringUtils.hasText(targetTypeName)) typedValue = new TypedStringValue(value);
else typedValue = new TypedStringValue(value, targetTypeName);
retu... | [
"protected",
"TypedStringValue",
"buildTypedStringValue",
"(",
"String",
"value",
",",
"String",
"targetTypeName",
")",
"throws",
"ClassNotFoundException",
"{",
"TypedStringValue",
"typedValue",
";",
"if",
"(",
"!",
"StringUtils",
".",
"hasText",
"(",
"targetTypeName",
... | Build a typed String value Object for the given raw value.
@see org.springframework.beans.factory.config.TypedStringValue
@param value a {@link java.lang.String} object.
@param targetTypeName a {@link java.lang.String} object.
@return a {@link org.springframework.beans.factory.config.TypedStringValue} object.
@throws ... | [
"Build",
"a",
"typed",
"String",
"value",
"Object",
"for",
"the",
"given",
"raw",
"value",
"."
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/ioc/spring/src/main/java/org/beangle/inject/spring/config/BeanDefinitionParser.java#L782-L788 |
Azure/azure-sdk-for-java | datamigration/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_07_15_preview/implementation/FilesInner.java | FilesInner.getAsync | public Observable<ProjectFileInner> getAsync(String groupName, String serviceName, String projectName, String fileName) {
"""
Get file information.
The files resource is a nested, proxy-only resource representing a file stored under the project resource. This method retrieves information about a file.
@param g... | java | public Observable<ProjectFileInner> getAsync(String groupName, String serviceName, String projectName, String fileName) {
return getWithServiceResponseAsync(groupName, serviceName, projectName, fileName).map(new Func1<ServiceResponse<ProjectFileInner>, ProjectFileInner>() {
@Override
pub... | [
"public",
"Observable",
"<",
"ProjectFileInner",
">",
"getAsync",
"(",
"String",
"groupName",
",",
"String",
"serviceName",
",",
"String",
"projectName",
",",
"String",
"fileName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"groupName",
",",
"serviceNam... | Get file information.
The files resource is a nested, proxy-only resource representing a file stored under the project resource. This method retrieves information about a file.
@param groupName Name of the resource group
@param serviceName Name of the service
@param projectName Name of the project
@param fileName Name... | [
"Get",
"file",
"information",
".",
"The",
"files",
"resource",
"is",
"a",
"nested",
"proxy",
"-",
"only",
"resource",
"representing",
"a",
"file",
"stored",
"under",
"the",
"project",
"resource",
".",
"This",
"method",
"retrieves",
"information",
"about",
"a",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_07_15_preview/implementation/FilesInner.java#L280-L287 |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java | AbstractExternalHighlightingFragment2.generateReadme | protected void generateReadme(String basename) {
"""
Generate the README file.
@param basename the basename of the generated file.
@since 0.6
"""
final Object content = getReadmeFileContent(basename);
if (content != null) {
final String textualContent = content.toString();
if (!Strings.isEmpty(te... | java | protected void generateReadme(String basename) {
final Object content = getReadmeFileContent(basename);
if (content != null) {
final String textualContent = content.toString();
if (!Strings.isEmpty(textualContent)) {
final byte[] bytes = textualContent.getBytes();
for (final String output : getOutputs... | [
"protected",
"void",
"generateReadme",
"(",
"String",
"basename",
")",
"{",
"final",
"Object",
"content",
"=",
"getReadmeFileContent",
"(",
"basename",
")",
";",
"if",
"(",
"content",
"!=",
"null",
")",
"{",
"final",
"String",
"textualContent",
"=",
"content",... | Generate the README file.
@param basename the basename of the generated file.
@since 0.6 | [
"Generate",
"the",
"README",
"file",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/AbstractExternalHighlightingFragment2.java#L584-L602 |
xdcrafts/flower | flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapDotApi.java | MapDotApi.dotGetList | public static <T> Optional<List<T>> dotGetList(final Map map, final String pathString, final Class<T> clazz) {
"""
Get list value by path.
@param <T> list value type
@param clazz type of value
@param map subject
@param pathString nodes to walk in map
@return value
"""
return dotGet(map, List.class... | java | public static <T> Optional<List<T>> dotGetList(final Map map, final String pathString, final Class<T> clazz) {
return dotGet(map, List.class, pathString).map(c -> (List<T>) c);
} | [
"public",
"static",
"<",
"T",
">",
"Optional",
"<",
"List",
"<",
"T",
">",
">",
"dotGetList",
"(",
"final",
"Map",
"map",
",",
"final",
"String",
"pathString",
",",
"final",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"dotGet",
"(",
"map",
... | Get list value by path.
@param <T> list value type
@param clazz type of value
@param map subject
@param pathString nodes to walk in map
@return value | [
"Get",
"list",
"value",
"by",
"path",
"."
] | train | https://github.com/xdcrafts/flower/blob/96a8e49102fea434bd383a3c7852f0ee9545f999/flower-tools/src/main/java/com/github/xdcrafts/flower/tools/map/MapDotApi.java#L204-L206 |
dustin/java-memcached-client | src/main/java/net/spy/memcached/DefaultConnectionFactory.java | DefaultConnectionFactory.getListenerExecutorService | @Override
public ExecutorService getListenerExecutorService() {
"""
Returns the stored {@link ExecutorService} for listeners.
By default, a {@link ThreadPoolExecutor} is used that acts exactly
like a default cachedThreadPool, but defines the upper limit of
Threads to be created as the number of available pr... | java | @Override
public ExecutorService getListenerExecutorService() {
if (executorService == null) {
ThreadFactory threadFactory = new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {
return new Thread(r, "FutureNotifyListener");
}
};
executorService... | [
"@",
"Override",
"public",
"ExecutorService",
"getListenerExecutorService",
"(",
")",
"{",
"if",
"(",
"executorService",
"==",
"null",
")",
"{",
"ThreadFactory",
"threadFactory",
"=",
"new",
"ThreadFactory",
"(",
")",
"{",
"@",
"Override",
"public",
"Thread",
"n... | Returns the stored {@link ExecutorService} for listeners.
By default, a {@link ThreadPoolExecutor} is used that acts exactly
like a default cachedThreadPool, but defines the upper limit of
Threads to be created as the number of available processors to
prevent resource exhaustion.
@return the stored {@link ExecutorSer... | [
"Returns",
"the",
"stored",
"{",
"@link",
"ExecutorService",
"}",
"for",
"listeners",
"."
] | train | https://github.com/dustin/java-memcached-client/blob/c232307ad8e0c7ccc926e495dd7d5aad2d713318/src/main/java/net/spy/memcached/DefaultConnectionFactory.java#L291-L312 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/FileUtil.java | FileUtil.mkdir | private static void mkdir(@NonNull final File directory, final boolean createParents)
throws IOException {
"""
Creates a specific directory, if it does not already exist.
@param directory
The directory, which should be created, as an instance of the class {@link File}. The
directory may not be nul... | java | private static void mkdir(@NonNull final File directory, final boolean createParents)
throws IOException {
Condition.INSTANCE.ensureNotNull(directory, "The directory may not be null");
boolean result = createParents ? directory.mkdirs() : directory.mkdir();
if (!result && !directory... | [
"private",
"static",
"void",
"mkdir",
"(",
"@",
"NonNull",
"final",
"File",
"directory",
",",
"final",
"boolean",
"createParents",
")",
"throws",
"IOException",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureNotNull",
"(",
"directory",
",",
"\"The directory may no... | Creates a specific directory, if it does not already exist.
@param directory
The directory, which should be created, as an instance of the class {@link File}. The
directory may not be null
@param createParents
True, if the parent directories should also be created, if necessary, false
otherwise
@throws IOException
The... | [
"Creates",
"a",
"specific",
"directory",
"if",
"it",
"does",
"not",
"already",
"exist",
"."
] | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/FileUtil.java#L42-L50 |
lucidworks/spark-solr | src/main/java/com/lucidworks/spark/query/StreamingExpressionResultIterator.java | StreamingExpressionResultIterator.getStreamContext | protected StreamContext getStreamContext() {
"""
We have to set the streaming context so that we can pass our own cloud client with authentication
"""
StreamContext context = new StreamContext();
solrClientCache = new SparkSolrClientCache(cloudSolrClient, httpSolrClient);
context.setSolrClientCache... | java | protected StreamContext getStreamContext() {
StreamContext context = new StreamContext();
solrClientCache = new SparkSolrClientCache(cloudSolrClient, httpSolrClient);
context.setSolrClientCache(solrClientCache);
return context;
} | [
"protected",
"StreamContext",
"getStreamContext",
"(",
")",
"{",
"StreamContext",
"context",
"=",
"new",
"StreamContext",
"(",
")",
";",
"solrClientCache",
"=",
"new",
"SparkSolrClientCache",
"(",
"cloudSolrClient",
",",
"httpSolrClient",
")",
";",
"context",
".",
... | We have to set the streaming context so that we can pass our own cloud client with authentication | [
"We",
"have",
"to",
"set",
"the",
"streaming",
"context",
"so",
"that",
"we",
"can",
"pass",
"our",
"own",
"cloud",
"client",
"with",
"authentication"
] | train | https://github.com/lucidworks/spark-solr/blob/8ff1b3cdd99041be6070077c18ec9c1cd7257cc3/src/main/java/com/lucidworks/spark/query/StreamingExpressionResultIterator.java#L92-L97 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/bci/AbstractRasClassAdapter.java | AbstractRasClassAdapter.visit | @Override
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
"""
Begin processing a class. We save some of the header information that
we only get from the header to assist with processing.
"""
this.classVersion = version;
thi... | java | @Override
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
this.classVersion = version;
this.classType = Type.getObjectType(name);
this.isInterface = (access & Opcodes.ACC_INTERFACE) != 0;
this.isSynthetic = (access & ... | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"int",
"version",
",",
"int",
"access",
",",
"String",
"name",
",",
"String",
"signature",
",",
"String",
"superName",
",",
"String",
"[",
"]",
"interfaces",
")",
"{",
"this",
".",
"classVersion",
"=",
"ve... | Begin processing a class. We save some of the header information that
we only get from the header to assist with processing. | [
"Begin",
"processing",
"a",
"class",
".",
"We",
"save",
"some",
"of",
"the",
"header",
"information",
"that",
"we",
"only",
"get",
"from",
"the",
"header",
"to",
"assist",
"with",
"processing",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/bci/AbstractRasClassAdapter.java#L135-L143 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/mining/word2vec/AbstractVectorModel.java | AbstractVectorModel.nearest | public List<Map.Entry<K, Float>> nearest(Vector vector) {
"""
获取与向量最相似的词语(默认10个)
@param vector 向量
@return 键值对列表, 键是相似词语, 值是相似度, 按相似度降序排列
"""
return nearest(vector, 10);
} | java | public List<Map.Entry<K, Float>> nearest(Vector vector)
{
return nearest(vector, 10);
} | [
"public",
"List",
"<",
"Map",
".",
"Entry",
"<",
"K",
",",
"Float",
">",
">",
"nearest",
"(",
"Vector",
"vector",
")",
"{",
"return",
"nearest",
"(",
"vector",
",",
"10",
")",
";",
"}"
] | 获取与向量最相似的词语(默认10个)
@param vector 向量
@return 键值对列表, 键是相似词语, 值是相似度, 按相似度降序排列 | [
"获取与向量最相似的词语(默认10个)"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/word2vec/AbstractVectorModel.java#L149-L152 |
EdwardRaff/JSAT | JSAT/src/jsat/io/LIBSVMLoader.java | LIBSVMLoader.loadC | public static ClassificationDataSet loadC(File file, double sparseRatio) throws FileNotFoundException, IOException {
"""
Loads a new classification data set from a LIBSVM file, assuming the
label is a nominal target value
@param file the file to load
@param sparseRatio the fraction of non zero values to quali... | java | public static ClassificationDataSet loadC(File file, double sparseRatio) throws FileNotFoundException, IOException
{
return loadC(file, sparseRatio, -1);
} | [
"public",
"static",
"ClassificationDataSet",
"loadC",
"(",
"File",
"file",
",",
"double",
"sparseRatio",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"return",
"loadC",
"(",
"file",
",",
"sparseRatio",
",",
"-",
"1",
")",
";",
"}"
] | Loads a new classification data set from a LIBSVM file, assuming the
label is a nominal target value
@param file the file to load
@param sparseRatio the fraction of non zero values to qualify a data
point as sparse
@return a classification data set
@throws FileNotFoundException if the file was not found
@throws IOExce... | [
"Loads",
"a",
"new",
"classification",
"data",
"set",
"from",
"a",
"LIBSVM",
"file",
"assuming",
"the",
"label",
"is",
"a",
"nominal",
"target",
"value"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/io/LIBSVMLoader.java#L180-L183 |
tango-controls/JTango | common/src/main/java/org/tango/utils/ArrayUtils.java | ArrayUtils.toPrimitiveArray | public final static Object toPrimitiveArray(final Object array) {
"""
Convert an array of Objects to primitives if possible. Return input otherwise
@param array
the array to convert
@return The array of primitives
"""
if (!array.getClass().isArray()) {
return array;
}
f... | java | public final static Object toPrimitiveArray(final Object array) {
if (!array.getClass().isArray()) {
return array;
}
final Class<?> clazz = OBJ_TO_PRIMITIVE.get(array.getClass().getComponentType());
return setArray(clazz, array);
} | [
"public",
"final",
"static",
"Object",
"toPrimitiveArray",
"(",
"final",
"Object",
"array",
")",
"{",
"if",
"(",
"!",
"array",
".",
"getClass",
"(",
")",
".",
"isArray",
"(",
")",
")",
"{",
"return",
"array",
";",
"}",
"final",
"Class",
"<",
"?",
">"... | Convert an array of Objects to primitives if possible. Return input otherwise
@param array
the array to convert
@return The array of primitives | [
"Convert",
"an",
"array",
"of",
"Objects",
"to",
"primitives",
"if",
"possible",
".",
"Return",
"input",
"otherwise"
] | train | https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/common/src/main/java/org/tango/utils/ArrayUtils.java#L45-L51 |
matiascamiletti/MCDropdownMenu | app/src/main/java/com/mobileia/mcdropdownmenu/example/ViewHolder.java | ViewHolder.get | @SuppressWarnings("unchecked")
public static <T extends View> T get(View view, int id) {
"""
I added a generic return type to reduce the casting noise in client code
"""
SparseArray<View> viewHolder = (SparseArray<View>) view.getTag();
if (viewHolder == null) {
viewHolder = new ... | java | @SuppressWarnings("unchecked")
public static <T extends View> T get(View view, int id) {
SparseArray<View> viewHolder = (SparseArray<View>) view.getTag();
if (viewHolder == null) {
viewHolder = new SparseArray<View>();
view.setTag(viewHolder);
}
View childView... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
"extends",
"View",
">",
"T",
"get",
"(",
"View",
"view",
",",
"int",
"id",
")",
"{",
"SparseArray",
"<",
"View",
">",
"viewHolder",
"=",
"(",
"SparseArray",
"<",
"View",
... | I added a generic return type to reduce the casting noise in client code | [
"I",
"added",
"a",
"generic",
"return",
"type",
"to",
"reduce",
"the",
"casting",
"noise",
"in",
"client",
"code"
] | train | https://github.com/matiascamiletti/MCDropdownMenu/blob/eba3dac505c2b9945151430406aee82ed809ab15/app/src/main/java/com/mobileia/mcdropdownmenu/example/ViewHolder.java#L11-L24 |
wcm-io/wcm-io-wcm | commons/src/main/java/io/wcm/wcm/commons/caching/CacheHeader.java | CacheHeader.setExpiresHours | public static void setExpiresHours(@NotNull HttpServletResponse response, int hours) {
"""
Set expires header to given amount of hours in the future.
@param response Response
@param hours Hours to expire
"""
Date expiresDate = DateUtils.addHours(new Date(), hours);
setExpires(response, expiresDate);
... | java | public static void setExpiresHours(@NotNull HttpServletResponse response, int hours) {
Date expiresDate = DateUtils.addHours(new Date(), hours);
setExpires(response, expiresDate);
} | [
"public",
"static",
"void",
"setExpiresHours",
"(",
"@",
"NotNull",
"HttpServletResponse",
"response",
",",
"int",
"hours",
")",
"{",
"Date",
"expiresDate",
"=",
"DateUtils",
".",
"addHours",
"(",
"new",
"Date",
"(",
")",
",",
"hours",
")",
";",
"setExpires"... | Set expires header to given amount of hours in the future.
@param response Response
@param hours Hours to expire | [
"Set",
"expires",
"header",
"to",
"given",
"amount",
"of",
"hours",
"in",
"the",
"future",
"."
] | train | https://github.com/wcm-io/wcm-io-wcm/blob/8eff9434f2f4b6462fdb718f8769ad793c55b8d7/commons/src/main/java/io/wcm/wcm/commons/caching/CacheHeader.java#L242-L245 |
sendgrid/sendgrid-java | src/main/java/com/sendgrid/helpers/mail/Mail.java | Mail.addCustomArg | public void addCustomArg(String key, String value) {
"""
Add a custom argument to the email.
@param key argument's key.
@param value the argument's value.
"""
this.customArgs = addToMap(key, value, this.customArgs);
} | java | public void addCustomArg(String key, String value) {
this.customArgs = addToMap(key, value, this.customArgs);
} | [
"public",
"void",
"addCustomArg",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"this",
".",
"customArgs",
"=",
"addToMap",
"(",
"key",
",",
"value",
",",
"this",
".",
"customArgs",
")",
";",
"}"
] | Add a custom argument to the email.
@param key argument's key.
@param value the argument's value. | [
"Add",
"a",
"custom",
"argument",
"to",
"the",
"email",
"."
] | train | https://github.com/sendgrid/sendgrid-java/blob/22292142bf243d1a838744ee43902b5050bb6e5b/src/main/java/com/sendgrid/helpers/mail/Mail.java#L356-L358 |
twitter/cloudhopper-commons | ch-commons-util/src/main/java/com/cloudhopper/commons/util/URL.java | URL.parseQueryProperties | public static void parseQueryProperties(String q, Properties props) throws MalformedURLException {
"""
Tool function: queries a query string and adds the key/value pairs to the specified
properties map
@param q String
@param toAddTo Properties
"""
if (q == null || q.length() == 0) {
re... | java | public static void parseQueryProperties(String q, Properties props) throws MalformedURLException {
if (q == null || q.length() == 0) {
return;
}
for (StringTokenizer iter = new StringTokenizer(q, "&");
iter.hasMoreElements();) {
String pair = iter.nextToken();... | [
"public",
"static",
"void",
"parseQueryProperties",
"(",
"String",
"q",
",",
"Properties",
"props",
")",
"throws",
"MalformedURLException",
"{",
"if",
"(",
"q",
"==",
"null",
"||",
"q",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
";",
"}",
... | Tool function: queries a query string and adds the key/value pairs to the specified
properties map
@param q String
@param toAddTo Properties | [
"Tool",
"function",
":",
"queries",
"a",
"query",
"string",
"and",
"adds",
"the",
"key",
"/",
"value",
"pairs",
"to",
"the",
"specified",
"properties",
"map"
] | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/URL.java#L300-L324 |
Azure/azure-sdk-for-java | datamigration/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_07_15_preview/implementation/FilesInner.java | FilesInner.readWrite | public FileStorageInfoInner readWrite(String groupName, String serviceName, String projectName, String fileName) {
"""
Request information for reading and writing file content.
This method is used for requesting information for reading and writing the file content.
@param groupName Name of the resource group
... | java | public FileStorageInfoInner readWrite(String groupName, String serviceName, String projectName, String fileName) {
return readWriteWithServiceResponseAsync(groupName, serviceName, projectName, fileName).toBlocking().single().body();
} | [
"public",
"FileStorageInfoInner",
"readWrite",
"(",
"String",
"groupName",
",",
"String",
"serviceName",
",",
"String",
"projectName",
",",
"String",
"fileName",
")",
"{",
"return",
"readWriteWithServiceResponseAsync",
"(",
"groupName",
",",
"serviceName",
",",
"proje... | Request information for reading and writing file content.
This method is used for requesting information for reading and writing the file content.
@param groupName Name of the resource group
@param serviceName Name of the service
@param projectName Name of the project
@param fileName Name of the File
@throws IllegalAr... | [
"Request",
"information",
"for",
"reading",
"and",
"writing",
"file",
"content",
".",
"This",
"method",
"is",
"used",
"for",
"requesting",
"information",
"for",
"reading",
"and",
"writing",
"the",
"file",
"content",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2018_07_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2018_07_15_preview/implementation/FilesInner.java#L786-L788 |
Impetus/Kundera | src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBUtils.java | CouchDBUtils.createDesignDocumentIfNotExist | public static void createDesignDocumentIfNotExist(HttpClient httpClient, HttpHost httpHost, Gson gson,
String tableName, String schemaName, String viewName, List<String> columns) throws URISyntaxException,
UnsupportedEncodingException, IOException, ClientProtocolException {
"""
Creates the ... | java | public static void createDesignDocumentIfNotExist(HttpClient httpClient, HttpHost httpHost, Gson gson,
String tableName, String schemaName, String viewName, List<String> columns) throws URISyntaxException,
UnsupportedEncodingException, IOException, ClientProtocolException
{
URI uri;
... | [
"public",
"static",
"void",
"createDesignDocumentIfNotExist",
"(",
"HttpClient",
"httpClient",
",",
"HttpHost",
"httpHost",
",",
"Gson",
"gson",
",",
"String",
"tableName",
",",
"String",
"schemaName",
",",
"String",
"viewName",
",",
"List",
"<",
"String",
">",
... | Creates the design document if not exist.
@param httpClient
the http client
@param httpHost
the http host
@param gson
the gson
@param tableName
the table name
@param schemaName
the schema name
@param viewName
the view name
@param columns
the columns
@throws URISyntaxException
the URI syntax exception
@throws Unsupport... | [
"Creates",
"the",
"design",
"document",
"if",
"not",
"exist",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBUtils.java#L194-L241 |
bekkopen/NoCommons | src/main/java/no/bekk/bekkopen/person/FodselsnummerValidator.java | FodselsnummerValidator.isValid | public boolean isValid(String fodselsnummer, ConstraintValidatorContext constraintValidatorContext) {
"""
Validation method used by a JSR303 validator. Normally it is better to call the static methods directly.
@param fodselsnummer
The fodselsnummer to be validated
@param constraintValidatorContext
context s... | java | public boolean isValid(String fodselsnummer, ConstraintValidatorContext constraintValidatorContext) {
if(fodselsnummer == null){
return true;
}
return isValid(fodselsnummer);
} | [
"public",
"boolean",
"isValid",
"(",
"String",
"fodselsnummer",
",",
"ConstraintValidatorContext",
"constraintValidatorContext",
")",
"{",
"if",
"(",
"fodselsnummer",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"return",
"isValid",
"(",
"fodselsnummer",
")... | Validation method used by a JSR303 validator. Normally it is better to call the static methods directly.
@param fodselsnummer
The fodselsnummer to be validated
@param constraintValidatorContext
context sent in by a validator
@return boolean
whether or not the given fodselsnummer is valid | [
"Validation",
"method",
"used",
"by",
"a",
"JSR303",
"validator",
".",
"Normally",
"it",
"is",
"better",
"to",
"call",
"the",
"static",
"methods",
"directly",
"."
] | train | https://github.com/bekkopen/NoCommons/blob/5a576696390cecaac111fa97fde581e0c1afb9b8/src/main/java/no/bekk/bekkopen/person/FodselsnummerValidator.java#L122-L128 |
apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/TableConnectorUtils.java | TableConnectorUtils.generateRuntimeName | public static String generateRuntimeName(Class<?> clazz, String[] fields) {
"""
Returns the table connector name used for logging and web UI.
"""
String className = clazz.getSimpleName();
if (null == fields) {
return className + "(*)";
} else {
return className + "(" + String.join(", ", fields) + "... | java | public static String generateRuntimeName(Class<?> clazz, String[] fields) {
String className = clazz.getSimpleName();
if (null == fields) {
return className + "(*)";
} else {
return className + "(" + String.join(", ", fields) + ")";
}
} | [
"public",
"static",
"String",
"generateRuntimeName",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"[",
"]",
"fields",
")",
"{",
"String",
"className",
"=",
"clazz",
".",
"getSimpleName",
"(",
")",
";",
"if",
"(",
"null",
"==",
"fields",
")",
"{... | Returns the table connector name used for logging and web UI. | [
"Returns",
"the",
"table",
"connector",
"name",
"used",
"for",
"logging",
"and",
"web",
"UI",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/TableConnectorUtils.java#L36-L43 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.splitEachLine | public static <T> T splitEachLine(InputStream stream, String regex, String charset, @ClosureParams(value=FromString.class,options="List<String>") Closure<T> closure) throws IOException {
"""
Iterates through the given InputStream line by line using the specified
encoding, splitting each line using the given separ... | java | public static <T> T splitEachLine(InputStream stream, String regex, String charset, @ClosureParams(value=FromString.class,options="List<String>") Closure<T> closure) throws IOException {
return splitEachLine(new BufferedReader(new InputStreamReader(stream, charset)), regex, closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"splitEachLine",
"(",
"InputStream",
"stream",
",",
"String",
"regex",
",",
"String",
"charset",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"FromString",
".",
"class",
",",
"options",
"=",
"\"List<String>\"",
")",
... | Iterates through the given InputStream line by line using the specified
encoding, splitting each line using the given separator. The list of tokens
for each line is then passed to the given closure. Finally, the stream
is closed.
@param stream an InputStream
@param regex the delimiting regular expression
@param ch... | [
"Iterates",
"through",
"the",
"given",
"InputStream",
"line",
"by",
"line",
"using",
"the",
"specified",
"encoding",
"splitting",
"each",
"line",
"using",
"the",
"given",
"separator",
".",
"The",
"list",
"of",
"tokens",
"for",
"each",
"line",
"is",
"then",
"... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java#L603-L605 |
virgo47/javasimon | console-embed/src/main/java/org/javasimon/console/html/HtmlBuilder.java | HtmlBuilder.simonProperty | public T simonProperty(Simon simon, String propertyName) throws IOException {
"""
Write Simon property (using Java Bean convention).
@param simon Simon
@param propertyName Property name
"""
Getter getter = GetterFactory.getGetter(simon.getClass(), propertyName);
if (getter != null) {
value(getter... | java | public T simonProperty(Simon simon, String propertyName) throws IOException {
Getter getter = GetterFactory.getGetter(simon.getClass(), propertyName);
if (getter != null) {
value(getter.get(simon), getter.getSubType());
}
return (T) this;
} | [
"public",
"T",
"simonProperty",
"(",
"Simon",
"simon",
",",
"String",
"propertyName",
")",
"throws",
"IOException",
"{",
"Getter",
"getter",
"=",
"GetterFactory",
".",
"getGetter",
"(",
"simon",
".",
"getClass",
"(",
")",
",",
"propertyName",
")",
";",
"if",... | Write Simon property (using Java Bean convention).
@param simon Simon
@param propertyName Property name | [
"Write",
"Simon",
"property",
"(",
"using",
"Java",
"Bean",
"convention",
")",
"."
] | train | https://github.com/virgo47/javasimon/blob/17dfaa93cded9ce8ef64a134b28ccbf4d0284d2f/console-embed/src/main/java/org/javasimon/console/html/HtmlBuilder.java#L199-L205 |
banjocreek/java-builder | src/main/java/com/banjocreek/riverbed/builder/map/AbstractMutableMapBuilder.java | AbstractMutableMapBuilder.doDefaults | protected final void doDefaults(final Map<K, ? extends V> defaults) {
"""
Post a delta consisting of defaults to register.
@param defaults
default entries.
"""
apply(defaults.isEmpty() ? Nop.instance() : new Defaults<>(defaults));
} | java | protected final void doDefaults(final Map<K, ? extends V> defaults) {
apply(defaults.isEmpty() ? Nop.instance() : new Defaults<>(defaults));
} | [
"protected",
"final",
"void",
"doDefaults",
"(",
"final",
"Map",
"<",
"K",
",",
"?",
"extends",
"V",
">",
"defaults",
")",
"{",
"apply",
"(",
"defaults",
".",
"isEmpty",
"(",
")",
"?",
"Nop",
".",
"instance",
"(",
")",
":",
"new",
"Defaults",
"<>",
... | Post a delta consisting of defaults to register.
@param defaults
default entries. | [
"Post",
"a",
"delta",
"consisting",
"of",
"defaults",
"to",
"register",
"."
] | train | https://github.com/banjocreek/java-builder/blob/4cc6ce461e58a8a9eac988e8a51073ea6dc1cc81/src/main/java/com/banjocreek/riverbed/builder/map/AbstractMutableMapBuilder.java#L64-L68 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getAllEmblemInfo | public void getAllEmblemInfo(Emblem.Type type, int[] ids, Callback<List<Emblem>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on emblem API go <a href="https://wiki.guildwars2.com/wiki/API:2/emblem">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)}... | java | public void getAllEmblemInfo(Emblem.Type type, int[] ids, Callback<List<Emblem>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
if (ids.length > 200)
throw new GuildWars2Exception(ErrorCode.ID, "id list too long; this endpoint is limited to 200 ids at once");
... | [
"public",
"void",
"getAllEmblemInfo",
"(",
"Emblem",
".",
"Type",
"type",
",",
"int",
"[",
"]",
"ids",
",",
"Callback",
"<",
"List",
"<",
"Emblem",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
... | For more info on emblem API go <a href="https://wiki.guildwars2.com/wiki/API:2/emblem">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param type foregrounds/backgrounds
@param ids list of emblem... | [
"For",
"more",
"info",
"on",
"emblem",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"emblem",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Give",
"user",
"t... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1330-L1335 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java | Gen.genStats | public void genStats(List<? extends JCTree> trees, Env<GenContext> env) {
"""
Derived visitor method: generate code for a list of statements.
"""
for (List<? extends JCTree> l = trees; l.nonEmpty(); l = l.tail)
genStat(l.head, env, CRT_STATEMENT);
} | java | public void genStats(List<? extends JCTree> trees, Env<GenContext> env) {
for (List<? extends JCTree> l = trees; l.nonEmpty(); l = l.tail)
genStat(l.head, env, CRT_STATEMENT);
} | [
"public",
"void",
"genStats",
"(",
"List",
"<",
"?",
"extends",
"JCTree",
">",
"trees",
",",
"Env",
"<",
"GenContext",
">",
"env",
")",
"{",
"for",
"(",
"List",
"<",
"?",
"extends",
"JCTree",
">",
"l",
"=",
"trees",
";",
"l",
".",
"nonEmpty",
"(",
... | Derived visitor method: generate code for a list of statements. | [
"Derived",
"visitor",
"method",
":",
"generate",
"code",
"for",
"a",
"list",
"of",
"statements",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java#L663-L666 |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/operators/join/JoinOperatorSetsBase.java | JoinOperatorSetsBase.where | public <K> JoinOperatorSetsPredicateBase where(KeySelector<I1, K> keySelector) {
"""
Continues a Join transformation and defines a {@link KeySelector} function for the first join {@link DataSet}.
<p>The KeySelector function is called for each element of the first DataSet and extracts a single
key value on whic... | java | public <K> JoinOperatorSetsPredicateBase where(KeySelector<I1, K> keySelector) {
TypeInformation<K> keyType = TypeExtractor.getKeySelectorTypes(keySelector, input1.getType());
return new JoinOperatorSetsPredicateBase(new Keys.SelectorFunctionKeys<>(keySelector, input1.getType(), keyType));
} | [
"public",
"<",
"K",
">",
"JoinOperatorSetsPredicateBase",
"where",
"(",
"KeySelector",
"<",
"I1",
",",
"K",
">",
"keySelector",
")",
"{",
"TypeInformation",
"<",
"K",
">",
"keyType",
"=",
"TypeExtractor",
".",
"getKeySelectorTypes",
"(",
"keySelector",
",",
"i... | Continues a Join transformation and defines a {@link KeySelector} function for the first join {@link DataSet}.
<p>The KeySelector function is called for each element of the first DataSet and extracts a single
key value on which the DataSet is joined.
@param keySelector The KeySelector function which extracts the key ... | [
"Continues",
"a",
"Join",
"transformation",
"and",
"defines",
"a",
"{",
"@link",
"KeySelector",
"}",
"function",
"for",
"the",
"first",
"join",
"{",
"@link",
"DataSet",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/operators/join/JoinOperatorSetsBase.java#L128-L131 |
Stratio/deep-spark | deep-core/src/main/java/com/stratio/deep/core/context/DeepSparkContext.java | DeepSparkContext.createJavaSchemaRDD | public DataFrame createJavaSchemaRDD(ExtractorConfig<Cells> config) throws UnsupportedDataTypeException, UnsupportedOperationException {
"""
Creates a JavaSchemaRDD from a DeepJobConfig and a JavaSQLContext.
@param config Specific Deep ExtractorConfig.
@return A JavaSchemaRDD built from Cells.
@throws Unsupport... | java | public DataFrame createJavaSchemaRDD(ExtractorConfig<Cells> config) throws UnsupportedDataTypeException, UnsupportedOperationException {
JavaRDD<Cells> cellsRDD = createJavaRDD(config);
JavaRDD<Row> rowsRDD = DeepSparkContext.createJavaRowRDD(cellsRDD);
try {
Cells firstCells = cells... | [
"public",
"DataFrame",
"createJavaSchemaRDD",
"(",
"ExtractorConfig",
"<",
"Cells",
">",
"config",
")",
"throws",
"UnsupportedDataTypeException",
",",
"UnsupportedOperationException",
"{",
"JavaRDD",
"<",
"Cells",
">",
"cellsRDD",
"=",
"createJavaRDD",
"(",
"config",
... | Creates a JavaSchemaRDD from a DeepJobConfig and a JavaSQLContext.
@param config Specific Deep ExtractorConfig.
@return A JavaSchemaRDD built from Cells.
@throws UnsupportedDataTypeException | [
"Creates",
"a",
"JavaSchemaRDD",
"from",
"a",
"DeepJobConfig",
"and",
"a",
"JavaSQLContext",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-core/src/main/java/com/stratio/deep/core/context/DeepSparkContext.java#L201-L211 |
sagiegurari/fax4j | src/main/java/org/fax4j/spi/java4less/RFaxFaxClientSpi.java | RFaxFaxClientSpi.submitFaxJobImpl | @Override
protected void submitFaxJobImpl(FaxJob faxJob) {
"""
This function will submit a new fax job.<br>
The fax job ID may be populated by this method in the provided
fax job object.
@param faxJob
The fax job object containing the needed information
"""
try
{
this.su... | java | @Override
protected void submitFaxJobImpl(FaxJob faxJob)
{
try
{
this.submitFaxJobViaFaxModem(faxJob);
}
catch(RuntimeException exception)
{
throw exception;
}
catch(Exception exception)
{
throw new FaxException(... | [
"@",
"Override",
"protected",
"void",
"submitFaxJobImpl",
"(",
"FaxJob",
"faxJob",
")",
"{",
"try",
"{",
"this",
".",
"submitFaxJobViaFaxModem",
"(",
"faxJob",
")",
";",
"}",
"catch",
"(",
"RuntimeException",
"exception",
")",
"{",
"throw",
"exception",
";",
... | This function will submit a new fax job.<br>
The fax job ID may be populated by this method in the provided
fax job object.
@param faxJob
The fax job object containing the needed information | [
"This",
"function",
"will",
"submit",
"a",
"new",
"fax",
"job",
".",
"<br",
">",
"The",
"fax",
"job",
"ID",
"may",
"be",
"populated",
"by",
"this",
"method",
"in",
"the",
"provided",
"fax",
"job",
"object",
"."
] | train | https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/java4less/RFaxFaxClientSpi.java#L204-L219 |
livetribe/livetribe-slp | osgi/bundle/src/main/java/org/livetribe/slp/osgi/ByServicePropertiesServiceTracker.java | ByServicePropertiesServiceTracker.modifiedService | @Override
public void modifiedService(ServiceReference reference, Object service) {
"""
Deregister the instance of {@link ServiceInfo} from the {@link ServiceAgent},
effectively unregistering the SLP service URL, and reregister a new
{@link ServiceInfo} which was created from the modified OSGi service
refer... | java | @Override
public void modifiedService(ServiceReference reference, Object service)
{
LOGGER.entering(CLASS_NAME, "modifiedService", new Object[]{reference, service});
ServiceInfo serviceInfo = (ServiceInfo)service;
serviceAgent.deregister(serviceInfo.getServiceURL(), serviceInfo.getLangu... | [
"@",
"Override",
"public",
"void",
"modifiedService",
"(",
"ServiceReference",
"reference",
",",
"Object",
"service",
")",
"{",
"LOGGER",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"modifiedService\"",
",",
"new",
"Object",
"[",
"]",
"{",
"reference",
",",
"se... | Deregister the instance of {@link ServiceInfo} from the {@link ServiceAgent},
effectively unregistering the SLP service URL, and reregister a new
{@link ServiceInfo} which was created from the modified OSGi service
reference's properties.
@param reference The reference to the OSGi service that implicitly registered th... | [
"Deregister",
"the",
"instance",
"of",
"{",
"@link",
"ServiceInfo",
"}",
"from",
"the",
"{",
"@link",
"ServiceAgent",
"}",
"effectively",
"unregistering",
"the",
"SLP",
"service",
"URL",
"and",
"reregister",
"a",
"new",
"{",
"@link",
"ServiceInfo",
"}",
"which... | train | https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/osgi/bundle/src/main/java/org/livetribe/slp/osgi/ByServicePropertiesServiceTracker.java#L181-L193 |
google/error-prone | core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/DoubleCheckedLocking.java | DoubleCheckedLocking.findFieldDeclaration | @Nullable
private static JCTree findFieldDeclaration(TreePath path, VarSymbol var) {
"""
Performs a best-effort search for the AST node of a field declaration.
<p>It will only find fields declared in a lexically enclosing scope of the current location.
Since double-checked locking should always be used on a ... | java | @Nullable
private static JCTree findFieldDeclaration(TreePath path, VarSymbol var) {
for (TreePath curr = path; curr != null; curr = curr.getParentPath()) {
Tree leaf = curr.getLeaf();
if (!(leaf instanceof JCClassDecl)) {
continue;
}
for (JCTree tree : ((JCClassDecl) leaf).getMemb... | [
"@",
"Nullable",
"private",
"static",
"JCTree",
"findFieldDeclaration",
"(",
"TreePath",
"path",
",",
"VarSymbol",
"var",
")",
"{",
"for",
"(",
"TreePath",
"curr",
"=",
"path",
";",
"curr",
"!=",
"null",
";",
"curr",
"=",
"curr",
".",
"getParentPath",
"(",... | Performs a best-effort search for the AST node of a field declaration.
<p>It will only find fields declared in a lexically enclosing scope of the current location.
Since double-checked locking should always be used on a private field, this should be
reasonably effective. | [
"Performs",
"a",
"best",
"-",
"effort",
"search",
"for",
"the",
"AST",
"node",
"of",
"a",
"field",
"declaration",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/DoubleCheckedLocking.java#L309-L323 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworks.java | PrepareRoutingSubnetworks.removeDeadEndUnvisitedNetworks | int removeDeadEndUnvisitedNetworks(final PrepEdgeFilter bothFilter) {
"""
This method removes networks that will be never be visited by this filter. See #235 for
example, small areas like parking lots are sometimes connected to the whole network through a
one-way road. This is clearly an error - but it causes th... | java | int removeDeadEndUnvisitedNetworks(final PrepEdgeFilter bothFilter) {
StopWatch sw = new StopWatch(bothFilter.getAccessEnc() + " findComponents").start();
final EdgeFilter outFilter = DefaultEdgeFilter.outEdges(bothFilter.getAccessEnc());
// partition graph into strongly connected components us... | [
"int",
"removeDeadEndUnvisitedNetworks",
"(",
"final",
"PrepEdgeFilter",
"bothFilter",
")",
"{",
"StopWatch",
"sw",
"=",
"new",
"StopWatch",
"(",
"bothFilter",
".",
"getAccessEnc",
"(",
")",
"+",
"\" findComponents\"",
")",
".",
"start",
"(",
")",
";",
"final",
... | This method removes networks that will be never be visited by this filter. See #235 for
example, small areas like parking lots are sometimes connected to the whole network through a
one-way road. This is clearly an error - but it causes the routing to fail when a point gets
connected to this small area. This routine re... | [
"This",
"method",
"removes",
"networks",
"that",
"will",
"be",
"never",
"be",
"visited",
"by",
"this",
"filter",
".",
"See",
"#235",
"for",
"example",
"small",
"areas",
"like",
"parking",
"lots",
"are",
"sometimes",
"connected",
"to",
"the",
"whole",
"networ... | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/subnetwork/PrepareRoutingSubnetworks.java#L198-L208 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/ZonedDateTime.java | ZonedDateTime.withLaterOffsetAtOverlap | @Override
public ZonedDateTime withLaterOffsetAtOverlap() {
"""
Returns a copy of this date-time changing the zone offset to the
later of the two valid offsets at a local time-line overlap.
<p>
This method only has any effect when the local time-line overlaps, such as
at an autumn daylight savings cutover.... | java | @Override
public ZonedDateTime withLaterOffsetAtOverlap() {
ZoneOffsetTransition trans = getZone().getRules().getTransition(toLocalDateTime());
if (trans != null) {
ZoneOffset laterOffset = trans.getOffsetAfter();
if (laterOffset.equals(offset) == false) {
ret... | [
"@",
"Override",
"public",
"ZonedDateTime",
"withLaterOffsetAtOverlap",
"(",
")",
"{",
"ZoneOffsetTransition",
"trans",
"=",
"getZone",
"(",
")",
".",
"getRules",
"(",
")",
".",
"getTransition",
"(",
"toLocalDateTime",
"(",
")",
")",
";",
"if",
"(",
"trans",
... | Returns a copy of this date-time changing the zone offset to the
later of the two valid offsets at a local time-line overlap.
<p>
This method only has any effect when the local time-line overlaps, such as
at an autumn daylight savings cutover. In this scenario, there are two
valid offsets for the local date-time. Calli... | [
"Returns",
"a",
"copy",
"of",
"this",
"date",
"-",
"time",
"changing",
"the",
"zone",
"offset",
"to",
"the",
"later",
"of",
"the",
"two",
"valid",
"offsets",
"at",
"a",
"local",
"time",
"-",
"line",
"overlap",
".",
"<p",
">",
"This",
"method",
"only",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/ZonedDateTime.java#L911-L921 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/util/SchedulerUtils.java | SchedulerUtils.loadGenericJobConfig | public static Properties loadGenericJobConfig(Properties sysProps, Path jobConfigPath, Path jobConfigPathDir)
throws ConfigurationException, IOException {
"""
Load a given job configuration file from a general file system.
@param sysProps Gobblin framework configuration properties
@param jobConfigPath jo... | java | public static Properties loadGenericJobConfig(Properties sysProps, Path jobConfigPath, Path jobConfigPathDir)
throws ConfigurationException, IOException {
PullFileLoader loader = new PullFileLoader(jobConfigPathDir, jobConfigPathDir.getFileSystem(new Configuration()),
getJobConfigurationFileExtension... | [
"public",
"static",
"Properties",
"loadGenericJobConfig",
"(",
"Properties",
"sysProps",
",",
"Path",
"jobConfigPath",
",",
"Path",
"jobConfigPathDir",
")",
"throws",
"ConfigurationException",
",",
"IOException",
"{",
"PullFileLoader",
"loader",
"=",
"new",
"PullFileLoa... | Load a given job configuration file from a general file system.
@param sysProps Gobblin framework configuration properties
@param jobConfigPath job configuration file to be loaded
@param jobConfigPathDir root job configuration file directory
@return a job configuration in the form of {@link java.util.Properties} | [
"Load",
"a",
"given",
"job",
"configuration",
"file",
"from",
"a",
"general",
"file",
"system",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/util/SchedulerUtils.java#L129-L138 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/FileUtils.java | FileUtils.toXML | public static String toXML(final String aFilePath, final boolean aDeepConversion) throws FileNotFoundException,
TransformerException {
"""
Creates a string of XML that describes the supplied file or directory (and, optionally, all its
subdirectories). Includes absolute path, last modified time, read/w... | java | public static String toXML(final String aFilePath, final boolean aDeepConversion) throws FileNotFoundException,
TransformerException {
return toXML(aFilePath, WILDCARD, aDeepConversion);
} | [
"public",
"static",
"String",
"toXML",
"(",
"final",
"String",
"aFilePath",
",",
"final",
"boolean",
"aDeepConversion",
")",
"throws",
"FileNotFoundException",
",",
"TransformerException",
"{",
"return",
"toXML",
"(",
"aFilePath",
",",
"WILDCARD",
",",
"aDeepConvers... | Creates a string of XML that describes the supplied file or directory (and, optionally, all its
subdirectories). Includes absolute path, last modified time, read/write permissions, etc.
@param aFilePath The file or directory to be returned as XML
@param aDeepConversion Whether the subdirectories are included
@return A... | [
"Creates",
"a",
"string",
"of",
"XML",
"that",
"describes",
"the",
"supplied",
"file",
"or",
"directory",
"(",
"and",
"optionally",
"all",
"its",
"subdirectories",
")",
".",
"Includes",
"absolute",
"path",
"last",
"modified",
"time",
"read",
"/",
"write",
"p... | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/FileUtils.java#L152-L155 |
CodeNarc/CodeNarc | src/main/java/org/codenarc/rule/AbstractRule.java | AbstractRule.createViolation | protected Violation createViolation(SourceCode sourceCode, ASTNode node, String message) {
"""
Create a new Violation for the AST node.
@param sourceCode - the SourceCode
@param node - the Groovy AST Node
@param message - the message for the violation; defaults to null
"""
String sourceLine = source... | java | protected Violation createViolation(SourceCode sourceCode, ASTNode node, String message) {
String sourceLine = sourceCode.line(node.getLineNumber()-1);
return createViolation(node.getLineNumber(), sourceLine, message);
} | [
"protected",
"Violation",
"createViolation",
"(",
"SourceCode",
"sourceCode",
",",
"ASTNode",
"node",
",",
"String",
"message",
")",
"{",
"String",
"sourceLine",
"=",
"sourceCode",
".",
"line",
"(",
"node",
".",
"getLineNumber",
"(",
")",
"-",
"1",
")",
";",... | Create a new Violation for the AST node.
@param sourceCode - the SourceCode
@param node - the Groovy AST Node
@param message - the message for the violation; defaults to null | [
"Create",
"a",
"new",
"Violation",
"for",
"the",
"AST",
"node",
"."
] | train | https://github.com/CodeNarc/CodeNarc/blob/9a7cec02cb8cbaf845030f2434309e8968f5d7a7/src/main/java/org/codenarc/rule/AbstractRule.java#L210-L213 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/f/EpipolarMinimizeGeometricError.java | EpipolarMinimizeGeometricError.solvePolynomial | public boolean solvePolynomial( double f1, double f2 , double a , Double b , double c , double d ) {
"""
Solves for the roots of an ugly polynomial defined in 12.7 in book [1]
Coefficients found using Sage Math
{@code
a,b,c,d,f1,f2,t = var('a,b,c,d,f1,f2,t')
g = t*((a*t+b)^2 + f2^2*(c*t+d)^2)^2 - (a*d-b*c)... | java | public boolean solvePolynomial( double f1, double f2 , double a , Double b , double c , double d )
{
double f1_2 = f1*f1;
double f1_4 = f1_2*f1_2;
double f2_2 = f2*f2;
double f2_4 = f2_2*f2_2;
double a_2 = a*a;
double b_2 = b*b;
double c_2 = c*c;
double d_2 = d*d;
double b_3 = b_2*b;
double d_3 = d... | [
"public",
"boolean",
"solvePolynomial",
"(",
"double",
"f1",
",",
"double",
"f2",
",",
"double",
"a",
",",
"Double",
"b",
",",
"double",
"c",
",",
"double",
"d",
")",
"{",
"double",
"f1_2",
"=",
"f1",
"*",
"f1",
";",
"double",
"f1_4",
"=",
"f1_2",
... | Solves for the roots of an ugly polynomial defined in 12.7 in book [1]
Coefficients found using Sage Math
{@code
a,b,c,d,f1,f2,t = var('a,b,c,d,f1,f2,t')
g = t*((a*t+b)^2 + f2^2*(c*t+d)^2)^2 - (a*d-b*c)*(1+f1^2*t^2)^2*(a*t+b)*(c*t+d)
g.expand().collect(t)
} | [
"Solves",
"for",
"the",
"roots",
"of",
"an",
"ugly",
"polynomial",
"defined",
"in",
"12",
".",
"7",
"in",
"book",
"[",
"1",
"]"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/f/EpipolarMinimizeGeometricError.java#L165-L191 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.setTimePicker | public void setTimePicker(int index, int hour, int minute) {
"""
Sets the time in a TimePicker matching the specified index.
@param index the index of the {@link TimePicker}. {@code 0} if only one is available
@param hour the hour e.g. 15
@param minute the minute e.g. 30
"""
if(config.commandLogging){
... | java | public void setTimePicker(int index, int hour, int minute) {
if(config.commandLogging){
Log.d(config.commandLoggingTag, "setTimePicker("+index+", "+hour+", "+minute+")");
}
setTimePicker(waiter.waitForAndGetView(index, TimePicker.class), hour, minute);
} | [
"public",
"void",
"setTimePicker",
"(",
"int",
"index",
",",
"int",
"hour",
",",
"int",
"minute",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"setTimePicker(\"",
"+",
"i... | Sets the time in a TimePicker matching the specified index.
@param index the index of the {@link TimePicker}. {@code 0} if only one is available
@param hour the hour e.g. 15
@param minute the minute e.g. 30 | [
"Sets",
"the",
"time",
"in",
"a",
"TimePicker",
"matching",
"the",
"specified",
"index",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L2555-L2561 |
Azure/azure-sdk-for-java | locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java | ManagementLocksInner.createOrUpdateAtResourceGroupLevelAsync | public Observable<ManagementLockObjectInner> createOrUpdateAtResourceGroupLevelAsync(String resourceGroupName, String lockName, ManagementLockObjectInner parameters) {
"""
Creates or updates a management lock at the resource group level.
When you apply a lock at a parent scope, all child resources inherit the sam... | java | public Observable<ManagementLockObjectInner> createOrUpdateAtResourceGroupLevelAsync(String resourceGroupName, String lockName, ManagementLockObjectInner parameters) {
return createOrUpdateAtResourceGroupLevelWithServiceResponseAsync(resourceGroupName, lockName, parameters).map(new Func1<ServiceResponse<Managem... | [
"public",
"Observable",
"<",
"ManagementLockObjectInner",
">",
"createOrUpdateAtResourceGroupLevelAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"lockName",
",",
"ManagementLockObjectInner",
"parameters",
")",
"{",
"return",
"createOrUpdateAtResourceGroupLevelWithServ... | Creates or updates a management lock at the resource group level.
When you apply a lock at a parent scope, all child resources inherit the same lock. To create management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of the built-in roles, only Owner and User Acces... | [
"Creates",
"or",
"updates",
"a",
"management",
"lock",
"at",
"the",
"resource",
"group",
"level",
".",
"When",
"you",
"apply",
"a",
"lock",
"at",
"a",
"parent",
"scope",
"all",
"child",
"resources",
"inherit",
"the",
"same",
"lock",
".",
"To",
"create",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java#L181-L188 |
Azure/azure-sdk-for-java | streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/TransformationsInner.java | TransformationsInner.createOrReplace | public TransformationInner createOrReplace(String resourceGroupName, String jobName, String transformationName, TransformationInner transformation) {
"""
Creates a transformation or replaces an already existing transformation under an existing streaming job.
@param resourceGroupName The name of the resource gro... | java | public TransformationInner createOrReplace(String resourceGroupName, String jobName, String transformationName, TransformationInner transformation) {
return createOrReplaceWithServiceResponseAsync(resourceGroupName, jobName, transformationName, transformation).toBlocking().single().body();
} | [
"public",
"TransformationInner",
"createOrReplace",
"(",
"String",
"resourceGroupName",
",",
"String",
"jobName",
",",
"String",
"transformationName",
",",
"TransformationInner",
"transformation",
")",
"{",
"return",
"createOrReplaceWithServiceResponseAsync",
"(",
"resourceGr... | Creates a transformation or replaces an already existing transformation under an existing streaming job.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param jobName The name of the streaming job.
@param ... | [
"Creates",
"a",
"transformation",
"or",
"replaces",
"an",
"already",
"existing",
"transformation",
"under",
"an",
"existing",
"streaming",
"job",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/TransformationsInner.java#L87-L89 |
CenturyLinkCloud/clc-java-sdk | sdk/src/main/java/com/centurylink/cloud/sdk/core/client/SdkClientBuilder.java | SdkClientBuilder.connectionCheckoutTimeout | public SdkClientBuilder connectionCheckoutTimeout(long timeout, TimeUnit unit) {
"""
If connection pooling is enabled, how long will we wait to get a connection?
@param timeout the timeout
@param unit the units the timeout is in
@return this builder
"""
this.connectionCheckoutTimeoutMs = (int) TimeU... | java | public SdkClientBuilder connectionCheckoutTimeout(long timeout, TimeUnit unit)
{
this.connectionCheckoutTimeoutMs = (int) TimeUnit.MILLISECONDS.convert(timeout, unit);
return this;
} | [
"public",
"SdkClientBuilder",
"connectionCheckoutTimeout",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"this",
".",
"connectionCheckoutTimeoutMs",
"=",
"(",
"int",
")",
"TimeUnit",
".",
"MILLISECONDS",
".",
"convert",
"(",
"timeout",
",",
"unit",
... | If connection pooling is enabled, how long will we wait to get a connection?
@param timeout the timeout
@param unit the units the timeout is in
@return this builder | [
"If",
"connection",
"pooling",
"is",
"enabled",
"how",
"long",
"will",
"we",
"wait",
"to",
"get",
"a",
"connection?"
] | train | https://github.com/CenturyLinkCloud/clc-java-sdk/blob/c026322f077dea71b1acf9f2d665253d79d9bf85/sdk/src/main/java/com/centurylink/cloud/sdk/core/client/SdkClientBuilder.java#L219-L223 |
vlingo/vlingo-actors | src/main/java/io/vlingo/actors/Stage.java | Stage.actorFor | public <T> T actorFor(final Class<T> protocol, final Definition definition, final Address address) {
"""
Answers the {@code T} protocol of the newly created {@code Actor} that implements the {@code protocol} and
that will be assigned the specific {@code address}.
@param <T> the protocol type
@param protocol the... | java | public <T> T actorFor(final Class<T> protocol, final Definition definition, final Address address) {
final Address actorAddress = this.allocateAddress(definition, address);
final Mailbox actorMailbox = this.allocateMailbox(definition, actorAddress, null);
final ActorProtocolActor<T> actor =
acto... | [
"public",
"<",
"T",
">",
"T",
"actorFor",
"(",
"final",
"Class",
"<",
"T",
">",
"protocol",
",",
"final",
"Definition",
"definition",
",",
"final",
"Address",
"address",
")",
"{",
"final",
"Address",
"actorAddress",
"=",
"this",
".",
"allocateAddress",
"("... | Answers the {@code T} protocol of the newly created {@code Actor} that implements the {@code protocol} and
that will be assigned the specific {@code address}.
@param <T> the protocol type
@param protocol the {@code Class<T>} protocol
@param definition the {@code Definition} used to initialize the newly created {@code A... | [
"Answers",
"the",
"{"
] | train | https://github.com/vlingo/vlingo-actors/blob/c7d046fd139c0490cf0fd2588d7dc2f792f13493/src/main/java/io/vlingo/actors/Stage.java#L78-L92 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/TypeRegistry.java | TypeRegistry.instanceFieldInterceptionRequired | @UsedByGeneratedCode
public static boolean instanceFieldInterceptionRequired(int ids, String name) {
"""
Called for a field operation - trying to determine whether a particular field needs special handling.
@param ids packed representation of the registryId (top 16bits) and typeId (bottom 16bits)
@param name ... | java | @UsedByGeneratedCode
public static boolean instanceFieldInterceptionRequired(int ids, String name) {
if (nothingReloaded) {
return false;
}
int registryId = ids >>> 16;
int typeId = ids & 0xffff;
TypeRegistry typeRegistry = registryInstances[registryId].get();
ReloadableType reloadableType = typeRegistr... | [
"@",
"UsedByGeneratedCode",
"public",
"static",
"boolean",
"instanceFieldInterceptionRequired",
"(",
"int",
"ids",
",",
"String",
"name",
")",
"{",
"if",
"(",
"nothingReloaded",
")",
"{",
"return",
"false",
";",
"}",
"int",
"registryId",
"=",
"ids",
">>>",
"16... | Called for a field operation - trying to determine whether a particular field needs special handling.
@param ids packed representation of the registryId (top 16bits) and typeId (bottom 16bits)
@param name the name of the instance field about to be accessed
@return true if the field operation must be intercepted | [
"Called",
"for",
"a",
"field",
"operation",
"-",
"trying",
"to",
"determine",
"whether",
"a",
"particular",
"field",
"needs",
"special",
"handling",
"."
] | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/TypeRegistry.java#L1747-L1763 |
shekhargulati/strman-java | src/main/java/strman/Strman.java | Strman.indexOf | public static int indexOf(final String value, final String needle, int offset, boolean caseSensitive) {
"""
The indexOf() method returns the index within the calling String of the first occurrence of the specified value, starting the search at fromIndex.
Returns -1 if the value is not found.
@param value ... | java | public static int indexOf(final String value, final String needle, int offset, boolean caseSensitive) {
validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
if (caseSensitive) {
return value.indexOf(needle, offset);
}
return value.toLowerCase().indexOf(needle.toL... | [
"public",
"static",
"int",
"indexOf",
"(",
"final",
"String",
"value",
",",
"final",
"String",
"needle",
",",
"int",
"offset",
",",
"boolean",
"caseSensitive",
")",
"{",
"validate",
"(",
"value",
",",
"NULL_STRING_PREDICATE",
",",
"NULL_STRING_MSG_SUPPLIER",
")"... | The indexOf() method returns the index within the calling String of the first occurrence of the specified value, starting the search at fromIndex.
Returns -1 if the value is not found.
@param value The input String
@param needle The search String
@param offset The offset to start searching from.
... | [
"The",
"indexOf",
"()",
"method",
"returns",
"the",
"index",
"within",
"the",
"calling",
"String",
"of",
"the",
"first",
"occurrence",
"of",
"the",
"specified",
"value",
"starting",
"the",
"search",
"at",
"fromIndex",
".",
"Returns",
"-",
"1",
"if",
"the",
... | train | https://github.com/shekhargulati/strman-java/blob/d0c2a10a6273fd6082f084e95156653ca55ce1be/src/main/java/strman/Strman.java#L481-L487 |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java | SessionDriver.initializeServer | private ServerSocket initializeServer(CoronaConf conf) throws IOException {
"""
Start the SessionDriver callback server
@param conf the corona configuration for this session
@return the server socket of the callback server
@throws IOException
"""
// Choose any free port.
ServerSocket sessionServerSo... | java | private ServerSocket initializeServer(CoronaConf conf) throws IOException {
// Choose any free port.
ServerSocket sessionServerSocket =
new ServerSocket(0, 0, getLocalAddress());
TServerSocket tServerSocket = new TServerSocket(sessionServerSocket,
co... | [
"private",
"ServerSocket",
"initializeServer",
"(",
"CoronaConf",
"conf",
")",
"throws",
"IOException",
"{",
"// Choose any free port.",
"ServerSocket",
"sessionServerSocket",
"=",
"new",
"ServerSocket",
"(",
"0",
",",
"0",
",",
"getLocalAddress",
"(",
")",
")",
";"... | Start the SessionDriver callback server
@param conf the corona configuration for this session
@return the server socket of the callback server
@throws IOException | [
"Start",
"the",
"SessionDriver",
"callback",
"server"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java#L226-L242 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsInner.java | InstanceFailoverGroupsInner.failoverAsync | public Observable<InstanceFailoverGroupInner> failoverAsync(String resourceGroupName, String locationName, String failoverGroupName) {
"""
Fails over from the current primary managed instance to this managed instance.
@param resourceGroupName The name of the resource group that contains the resource. You can ob... | java | public Observable<InstanceFailoverGroupInner> failoverAsync(String resourceGroupName, String locationName, String failoverGroupName) {
return failoverWithServiceResponseAsync(resourceGroupName, locationName, failoverGroupName).map(new Func1<ServiceResponse<InstanceFailoverGroupInner>, InstanceFailoverGroupInner... | [
"public",
"Observable",
"<",
"InstanceFailoverGroupInner",
">",
"failoverAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"locationName",
",",
"String",
"failoverGroupName",
")",
"{",
"return",
"failoverWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"... | Fails over from the current primary managed instance to this managed instance.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param locationName The name of the region where the resource is located.
@para... | [
"Fails",
"over",
"from",
"the",
"current",
"primary",
"managed",
"instance",
"to",
"this",
"managed",
"instance",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_10_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_10_01_preview/implementation/InstanceFailoverGroupsInner.java#L721-L728 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java | DataLabelingServiceClient.formatDatasetName | @Deprecated
public static final String formatDatasetName(String project, String dataset) {
"""
Formats a string containing the fully-qualified path to represent a dataset resource.
@deprecated Use the {@link DatasetName} class instead.
"""
return DATASET_PATH_TEMPLATE.instantiate(
"project", p... | java | @Deprecated
public static final String formatDatasetName(String project, String dataset) {
return DATASET_PATH_TEMPLATE.instantiate(
"project", project,
"dataset", dataset);
} | [
"@",
"Deprecated",
"public",
"static",
"final",
"String",
"formatDatasetName",
"(",
"String",
"project",
",",
"String",
"dataset",
")",
"{",
"return",
"DATASET_PATH_TEMPLATE",
".",
"instantiate",
"(",
"\"project\"",
",",
"project",
",",
"\"dataset\"",
",",
"datase... | Formats a string containing the fully-qualified path to represent a dataset resource.
@deprecated Use the {@link DatasetName} class instead. | [
"Formats",
"a",
"string",
"containing",
"the",
"fully",
"-",
"qualified",
"path",
"to",
"represent",
"a",
"dataset",
"resource",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java#L187-L192 |
optimatika/ojAlgo-finance | src/main/java/org/ojalgo/finance/FinanceUtils.java | FinanceUtils.toAnnualReturnFromGrowthFactor | public static double toAnnualReturnFromGrowthFactor(double growthFactor, CalendarDateUnit growthFactorUnit) {
"""
GrowthRate = ln(GrowthFactor)
@param growthFactor A growth factor per unit (day, week, month, year...)
@param growthFactorUnit A growth factor unit
@return Annualised return (percentage per year)
... | java | public static double toAnnualReturnFromGrowthFactor(double growthFactor, CalendarDateUnit growthFactorUnit) {
double tmpGrowthFactorUnitsPerYear = growthFactorUnit.convert(CalendarDateUnit.YEAR);
return PrimitiveMath.POW.invoke(growthFactor, tmpGrowthFactorUnitsPerYear) - PrimitiveMath.ONE;
} | [
"public",
"static",
"double",
"toAnnualReturnFromGrowthFactor",
"(",
"double",
"growthFactor",
",",
"CalendarDateUnit",
"growthFactorUnit",
")",
"{",
"double",
"tmpGrowthFactorUnitsPerYear",
"=",
"growthFactorUnit",
".",
"convert",
"(",
"CalendarDateUnit",
".",
"YEAR",
")... | GrowthRate = ln(GrowthFactor)
@param growthFactor A growth factor per unit (day, week, month, year...)
@param growthFactorUnit A growth factor unit
@return Annualised return (percentage per year) | [
"GrowthRate",
"=",
"ln",
"(",
"GrowthFactor",
")"
] | train | https://github.com/optimatika/ojAlgo-finance/blob/c8d3f7e1894d4263b7334bca3f4c060e466f8b15/src/main/java/org/ojalgo/finance/FinanceUtils.java#L329-L332 |
taskadapter/redmine-java-api | src/main/java/com/taskadapter/redmineapi/IssueManager.java | IssueManager.getSavedQueries | public List<SavedQuery> getSavedQueries(String projectKey) throws RedmineException {
"""
Get "saved queries" for the given project available to the current user.
<p>This REST API feature was added in Redmine 1.3.0. See http://www.redmine.org/issues/5737</p>
"""
Set<NameValuePair> params = new HashSe... | java | public List<SavedQuery> getSavedQueries(String projectKey) throws RedmineException {
Set<NameValuePair> params = new HashSet<>();
if ((projectKey != null) && (projectKey.length() > 0)) {
params.add(new BasicNameValuePair("project_id", projectKey));
}
return transport.getObj... | [
"public",
"List",
"<",
"SavedQuery",
">",
"getSavedQueries",
"(",
"String",
"projectKey",
")",
"throws",
"RedmineException",
"{",
"Set",
"<",
"NameValuePair",
">",
"params",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"if",
"(",
"(",
"projectKey",
"!=",
"n... | Get "saved queries" for the given project available to the current user.
<p>This REST API feature was added in Redmine 1.3.0. See http://www.redmine.org/issues/5737</p> | [
"Get",
"saved",
"queries",
"for",
"the",
"given",
"project",
"available",
"to",
"the",
"current",
"user",
"."
] | train | https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/IssueManager.java#L326-L334 |
lionsoul2014/jcseg | jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java | ASegment.getPairPunctuationText | protected String getPairPunctuationText( int c ) throws IOException {
"""
find pair punctuation of the given punctuation char
the purpose is to get the text between them
@param c
@throws IOException
"""
//StringBuilder isb = new StringBuilder();
isb.clear();
char echar = StringUtil... | java | protected String getPairPunctuationText( int c ) throws IOException
{
//StringBuilder isb = new StringBuilder();
isb.clear();
char echar = StringUtil.getPunctuationPair( (char) c);
boolean matched = false;
int j, ch;
//replaced with IntArrayList at 2013-09-0... | [
"protected",
"String",
"getPairPunctuationText",
"(",
"int",
"c",
")",
"throws",
"IOException",
"{",
"//StringBuilder isb = new StringBuilder();",
"isb",
".",
"clear",
"(",
")",
";",
"char",
"echar",
"=",
"StringUtil",
".",
"getPunctuationPair",
"(",
"(",
"char",
... | find pair punctuation of the given punctuation char
the purpose is to get the text between them
@param c
@throws IOException | [
"find",
"pair",
"punctuation",
"of",
"the",
"given",
"punctuation",
"char",
"the",
"purpose",
"is",
"to",
"get",
"the",
"text",
"between",
"them"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/tokenizer/ASegment.java#L1607-L1653 |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java | BusItinerary.getNearestRoadSegment | @Pure
public RoadSegment getNearestRoadSegment(Point2D<?, ?> point) {
"""
Replies the nearest road segment from this itinerary to the given point.
@param point the point.
@return the nearest road segment or <code>null</code> if none was found.
"""
assert point != null;
double distance = Double.MAX_VAL... | java | @Pure
public RoadSegment getNearestRoadSegment(Point2D<?, ?> point) {
assert point != null;
double distance = Double.MAX_VALUE;
RoadSegment nearestSegment = null;
final Iterator<RoadSegment> iterator = this.roadSegments.roadSegments();
RoadSegment segment;
while (iterator.hasNext()) {
segment = iterator... | [
"@",
"Pure",
"public",
"RoadSegment",
"getNearestRoadSegment",
"(",
"Point2D",
"<",
"?",
",",
"?",
">",
"point",
")",
"{",
"assert",
"point",
"!=",
"null",
";",
"double",
"distance",
"=",
"Double",
".",
"MAX_VALUE",
";",
"RoadSegment",
"nearestSegment",
"=",... | Replies the nearest road segment from this itinerary to the given point.
@param point the point.
@return the nearest road segment or <code>null</code> if none was found. | [
"Replies",
"the",
"nearest",
"road",
"segment",
"from",
"this",
"itinerary",
"to",
"the",
"given",
"point",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusItinerary.java#L1698-L1714 |
uniform-java/uniform | src/main/java/net/uniform/impl/ElementWithOptions.java | ElementWithOptions.addOption | public ElementWithOptions addOption(Object value, String text) {
"""
Adds an option to the default option group of this element.
@param value Unique value in this element
@param text Option text
@return This element
"""
return addOptionToGroup(value, text, null);
} | java | public ElementWithOptions addOption(Object value, String text) {
return addOptionToGroup(value, text, null);
} | [
"public",
"ElementWithOptions",
"addOption",
"(",
"Object",
"value",
",",
"String",
"text",
")",
"{",
"return",
"addOptionToGroup",
"(",
"value",
",",
"text",
",",
"null",
")",
";",
"}"
] | Adds an option to the default option group of this element.
@param value Unique value in this element
@param text Option text
@return This element | [
"Adds",
"an",
"option",
"to",
"the",
"default",
"option",
"group",
"of",
"this",
"element",
"."
] | train | https://github.com/uniform-java/uniform/blob/0b84f0db562253165bc06c69f631e464dca0cb48/src/main/java/net/uniform/impl/ElementWithOptions.java#L84-L86 |
aws/aws-sdk-java | aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/TransferManager.java | TransferManager.uploadDirectory | public MultipleFileUpload uploadDirectory(String bucketName, String virtualDirectoryKeyPrefix, File directory, boolean includeSubdirectories) {
"""
Uploads all files in the directory given to the bucket named, optionally
recursing for all subdirectories.
<p>
S3 will overwrite any existing objects that happen to... | java | public MultipleFileUpload uploadDirectory(String bucketName, String virtualDirectoryKeyPrefix, File directory, boolean includeSubdirectories) {
return uploadDirectory(bucketName, virtualDirectoryKeyPrefix, directory, includeSubdirectories, null);
} | [
"public",
"MultipleFileUpload",
"uploadDirectory",
"(",
"String",
"bucketName",
",",
"String",
"virtualDirectoryKeyPrefix",
",",
"File",
"directory",
",",
"boolean",
"includeSubdirectories",
")",
"{",
"return",
"uploadDirectory",
"(",
"bucketName",
",",
"virtualDirectoryK... | Uploads all files in the directory given to the bucket named, optionally
recursing for all subdirectories.
<p>
S3 will overwrite any existing objects that happen to have the same key,
just as when uploading individual files, so use with caution.
</p>
<p>
If you are uploading <a href="http://aws.amazon.com/kms/">AWS
KMS... | [
"Uploads",
"all",
"files",
"in",
"the",
"directory",
"given",
"to",
"the",
"bucket",
"named",
"optionally",
"recursing",
"for",
"all",
"subdirectories",
".",
"<p",
">",
"S3",
"will",
"overwrite",
"any",
"existing",
"objects",
"that",
"happen",
"to",
"have",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/TransferManager.java#L1478-L1480 |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/model/Paragraph.java | Paragraph.getStyleRangeAtPosition | public IndexRange getStyleRangeAtPosition(int position) {
"""
Returns the range of homogeneous style that includes the given position.
If {@code position} points to a boundary between two styled ranges,
then the range preceding {@code position} is returned.
"""
Position pos = styles.offsetToPosition(... | java | public IndexRange getStyleRangeAtPosition(int position) {
Position pos = styles.offsetToPosition(position, Backward);
int start = position - pos.getMinor();
int end = start + styles.getStyleSpan(pos.getMajor()).getLength();
return new IndexRange(start, end);
} | [
"public",
"IndexRange",
"getStyleRangeAtPosition",
"(",
"int",
"position",
")",
"{",
"Position",
"pos",
"=",
"styles",
".",
"offsetToPosition",
"(",
"position",
",",
"Backward",
")",
";",
"int",
"start",
"=",
"position",
"-",
"pos",
".",
"getMinor",
"(",
")"... | Returns the range of homogeneous style that includes the given position.
If {@code position} points to a boundary between two styled ranges,
then the range preceding {@code position} is returned. | [
"Returns",
"the",
"range",
"of",
"homogeneous",
"style",
"that",
"includes",
"the",
"given",
"position",
".",
"If",
"{"
] | train | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/model/Paragraph.java#L391-L396 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/spec_catalog/FlowCatalog.java | FlowCatalog.put | public Map<String, AddSpecResponse> put(Spec spec, boolean triggerListener) {
"""
Persist {@link Spec} into {@link SpecStore} and notify {@link SpecCatalogListener} if triggerListener
is set to true.
@param spec The Spec to be added
@param triggerListener True if listeners should be notified.
@return
"""... | java | public Map<String, AddSpecResponse> put(Spec spec, boolean triggerListener) {
Map<String, AddSpecResponse> responseMap = new HashMap<>();
try {
Preconditions.checkState(state() == State.RUNNING, String.format("%s is not running.", this.getClass().getName()));
Preconditions.checkNotNull(spec);
... | [
"public",
"Map",
"<",
"String",
",",
"AddSpecResponse",
">",
"put",
"(",
"Spec",
"spec",
",",
"boolean",
"triggerListener",
")",
"{",
"Map",
"<",
"String",
",",
"AddSpecResponse",
">",
"responseMap",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"try",
"{"... | Persist {@link Spec} into {@link SpecStore} and notify {@link SpecCatalogListener} if triggerListener
is set to true.
@param spec The Spec to be added
@param triggerListener True if listeners should be notified.
@return | [
"Persist",
"{",
"@link",
"Spec",
"}",
"into",
"{",
"@link",
"SpecStore",
"}",
"and",
"notify",
"{",
"@link",
"SpecCatalogListener",
"}",
"if",
"triggerListener",
"is",
"set",
"to",
"true",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/spec_catalog/FlowCatalog.java#L267-L288 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/ant/DdlUtilsDataHandling.java | DdlUtilsDataHandling.insertData | public void insertData(Reader input, int batchSize) throws DataTaskException {
"""
Returns the sql necessary to add the data XML contained in the given input stream.
Note that the data is expected to match the repository metadata (not the table schema).
Also note that you should not use the reader after passing ... | java | public void insertData(Reader input, int batchSize) throws DataTaskException
{
try
{
DataSet set = (DataSet)_digester.parse(input);
set.insert(_platform, _dbModel, batchSize);
}
catch (Exception ex)
{
if (ex instanceo... | [
"public",
"void",
"insertData",
"(",
"Reader",
"input",
",",
"int",
"batchSize",
")",
"throws",
"DataTaskException",
"{",
"try",
"{",
"DataSet",
"set",
"=",
"(",
"DataSet",
")",
"_digester",
".",
"parse",
"(",
"input",
")",
";",
"set",
".",
"insert",
"("... | Returns the sql necessary to add the data XML contained in the given input stream.
Note that the data is expected to match the repository metadata (not the table schema).
Also note that you should not use the reader after passing it to this method except closing
it (which is not done automatically).
@param input A... | [
"Returns",
"the",
"sql",
"necessary",
"to",
"add",
"the",
"data",
"XML",
"contained",
"in",
"the",
"given",
"input",
"stream",
".",
"Note",
"that",
"the",
"data",
"is",
"expected",
"to",
"match",
"the",
"repository",
"metadata",
"(",
"not",
"the",
"table",... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/ant/DdlUtilsDataHandling.java#L258-L278 |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java | MarkLogicRepositoryConnection.prepareQuery | @Override
public MarkLogicQuery prepareQuery(QueryLanguage queryLanguage, String queryString, String baseURI)
throws RepositoryException, MalformedQueryException {
"""
base method for prepareQuery
routes to all other query forms (prepareTupleQuery,prepareBooleanQuery,prepareGraphQuery)
@param... | java | @Override
public MarkLogicQuery prepareQuery(QueryLanguage queryLanguage, String queryString, String baseURI)
throws RepositoryException, MalformedQueryException
{
// function routing based on query form
if (SPARQL.equals(queryLanguage)) {
String queryStringWithoutProlog ... | [
"@",
"Override",
"public",
"MarkLogicQuery",
"prepareQuery",
"(",
"QueryLanguage",
"queryLanguage",
",",
"String",
"queryString",
",",
"String",
"baseURI",
")",
"throws",
"RepositoryException",
",",
"MalformedQueryException",
"{",
"// function routing based on query form",
... | base method for prepareQuery
routes to all other query forms (prepareTupleQuery,prepareBooleanQuery,prepareGraphQuery)
@param queryLanguage
@param queryString
@param baseURI
@return MarkLogicQuery
@throws RepositoryException
@throws MalformedQueryException | [
"base",
"method",
"for",
"prepareQuery"
] | train | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/MarkLogicRepositoryConnection.java#L195-L213 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/process/support/ProcessBuilderProcessExecutor.java | ProcessBuilderProcessExecutor.newProcessBuilder | protected ProcessBuilder newProcessBuilder(String[] commandLine, File directory, Environment environment) {
"""
Constructs, configures and initializes a new instance of {@link ProcessBuilder} used to execute and run programs.
The configuration of the {@link ProcessBuilder} is based on this {@link ProcessBuilder... | java | protected ProcessBuilder newProcessBuilder(String[] commandLine, File directory, Environment environment) {
ProcessBuilder processBuilder = new ProcessBuilder(commandLine);
processBuilder.directory(directory);
processBuilder.environment().clear();
processBuilder.environment().putAll(environment.toMap()... | [
"protected",
"ProcessBuilder",
"newProcessBuilder",
"(",
"String",
"[",
"]",
"commandLine",
",",
"File",
"directory",
",",
"Environment",
"environment",
")",
"{",
"ProcessBuilder",
"processBuilder",
"=",
"new",
"ProcessBuilder",
"(",
"commandLine",
")",
";",
"proces... | Constructs, configures and initializes a new instance of {@link ProcessBuilder} used to execute and run programs.
The configuration of the {@link ProcessBuilder} is based on this {@link ProcessBuilderProcessExecutor}.
@param commandLine array of {@link String} values constituting the program and its runtime arguments... | [
"Constructs",
"configures",
"and",
"initializes",
"a",
"new",
"instance",
"of",
"{",
"@link",
"ProcessBuilder",
"}",
"used",
"to",
"execute",
"and",
"run",
"programs",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/process/support/ProcessBuilderProcessExecutor.java#L143-L156 |
haifengl/smile | core/src/main/java/smile/association/ARM.java | ARM.learn | private long learn(PrintStream out, List<AssociationRule> list, int[] itemset, int support, double confidence) {
"""
Generates all association rules for a given item set.
@param itemset the given frequent item set.
@param support the associated support value for the item set.
@param confidence the confidence th... | java | private long learn(PrintStream out, List<AssociationRule> list, int[] itemset, int support, double confidence) {
long n = 0;
// Determine combinations
int[][] combinations = getPowerSet(itemset);
// Loop through combinations
for (int i = 0; i < combinations.length; i++) {
... | [
"private",
"long",
"learn",
"(",
"PrintStream",
"out",
",",
"List",
"<",
"AssociationRule",
">",
"list",
",",
"int",
"[",
"]",
"itemset",
",",
"int",
"support",
",",
"double",
"confidence",
")",
"{",
"long",
"n",
"=",
"0",
";",
"// Determine combinations",... | Generates all association rules for a given item set.
@param itemset the given frequent item set.
@param support the associated support value for the item set.
@param confidence the confidence threshold for association rules. | [
"Generates",
"all",
"association",
"rules",
"for",
"a",
"given",
"item",
"set",
"."
] | train | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/core/src/main/java/smile/association/ARM.java#L171-L200 |
khmarbaise/sapm | src/main/java/com/soebes/subversion/sapm/AccessRule.java | AccessRule.getAccess | public AccessLevel getAccess(String user, String repository, String path) {
"""
Get the {@link AccessLevel} for the user who want's to get access to the path
inside the given repository.
@param user The user who will be checked against the permission rules.
@param repository The repository to which the user t... | java | public AccessLevel getAccess(String user, String repository, String path) {
AccessLevel result = AccessLevel.NOTHING;
if (getRepositoryName() == null) {
Path localRepositoryPath = new Path(getRepositoryPath());
if (localRepositoryPath.contains(path)) {
result... | [
"public",
"AccessLevel",
"getAccess",
"(",
"String",
"user",
",",
"String",
"repository",
",",
"String",
"path",
")",
"{",
"AccessLevel",
"result",
"=",
"AccessLevel",
".",
"NOTHING",
";",
"if",
"(",
"getRepositoryName",
"(",
")",
"==",
"null",
")",
"{",
"... | Get the {@link AccessLevel} for the user who want's to get access to the path
inside the given repository.
@param user The user who will be checked against the permission rules.
@param repository The repository to which the user tries to get access.
@param path The path within the repository.
@return AccessLevel of th... | [
"Get",
"the",
"{",
"@link",
"AccessLevel",
"}",
"for",
"the",
"user",
"who",
"want",
"s",
"to",
"get",
"access",
"to",
"the",
"path",
"inside",
"the",
"given",
"repository",
"."
] | train | https://github.com/khmarbaise/sapm/blob/b5da5b0d8929324f03cb3a4233a3534813f93eea/src/main/java/com/soebes/subversion/sapm/AccessRule.java#L203-L220 |
advantageous/boon | reflekt/src/main/java/io/advantageous/boon/core/Str.java | Str.sputl | public static String sputl(Object... messages) {
"""
like putl but writes to a string.
@param messages the stuff you want to print out.
@return string
"""
CharBuf buf = CharBuf.create(100);
return sputl(buf, messages).toString();
} | java | public static String sputl(Object... messages) {
CharBuf buf = CharBuf.create(100);
return sputl(buf, messages).toString();
} | [
"public",
"static",
"String",
"sputl",
"(",
"Object",
"...",
"messages",
")",
"{",
"CharBuf",
"buf",
"=",
"CharBuf",
".",
"create",
"(",
"100",
")",
";",
"return",
"sputl",
"(",
"buf",
",",
"messages",
")",
".",
"toString",
"(",
")",
";",
"}"
] | like putl but writes to a string.
@param messages the stuff you want to print out.
@return string | [
"like",
"putl",
"but",
"writes",
"to",
"a",
"string",
"."
] | train | https://github.com/advantageous/boon/blob/12712d376761aa3b33223a9f1716720ddb67cb5e/reflekt/src/main/java/io/advantageous/boon/core/Str.java#L917-L920 |
pravega/pravega | controller/src/main/java/io/pravega/controller/server/rpc/auth/RESTAuthHelper.java | RESTAuthHelper.authenticateAuthorize | public void authenticateAuthorize(List<String> authHeader, String resource, AuthHandler.Permissions permission)
throws AuthException {
"""
Ensures that the subject represented by the given {@code authHeader} is authenticated and that the subject is
authorized for the specified {@code permission} on th... | java | public void authenticateAuthorize(List<String> authHeader, String resource, AuthHandler.Permissions permission)
throws AuthException {
if (isAuthEnabled()) {
String credentials = parseCredentials(authHeader);
if (!pravegaAuthManager.authenticateAndAuthorize(resource, credenti... | [
"public",
"void",
"authenticateAuthorize",
"(",
"List",
"<",
"String",
">",
"authHeader",
",",
"String",
"resource",
",",
"AuthHandler",
".",
"Permissions",
"permission",
")",
"throws",
"AuthException",
"{",
"if",
"(",
"isAuthEnabled",
"(",
")",
")",
"{",
"Str... | Ensures that the subject represented by the given {@code authHeader} is authenticated and that the subject is
authorized for the specified {@code permission} on the given {@code resource}.
@param authHeader contents of an HTTP Authorization header
@param resource representation of the resource being accessed
@param ... | [
"Ensures",
"that",
"the",
"subject",
"represented",
"by",
"the",
"given",
"{",
"@code",
"authHeader",
"}",
"is",
"authenticated",
"and",
"that",
"the",
"subject",
"is",
"authorized",
"for",
"the",
"specified",
"{",
"@code",
"permission",
"}",
"on",
"the",
"g... | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/rpc/auth/RESTAuthHelper.java#L104-L114 |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/EndpointResponse.java | EndpointResponse.withAttributes | public EndpointResponse withAttributes(java.util.Map<String, java.util.List<String>> attributes) {
"""
Custom attributes that describe the endpoint by associating a name with an array of values. For example, an
attribute named "interests" might have the following values: ["science", "politics", "travel"]. You can... | java | public EndpointResponse withAttributes(java.util.Map<String, java.util.List<String>> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"EndpointResponse",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
"... | Custom attributes that describe the endpoint by associating a name with an array of values. For example, an
attribute named "interests" might have the following values: ["science", "politics", "travel"]. You can use these
attributes as selection criteria when you create segments.
The Amazon Pinpoint console can't disp... | [
"Custom",
"attributes",
"that",
"describe",
"the",
"endpoint",
"by",
"associating",
"a",
"name",
"with",
"an",
"array",
"of",
"values",
".",
"For",
"example",
"an",
"attribute",
"named",
"interests",
"might",
"have",
"the",
"following",
"values",
":",
"[",
"... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/EndpointResponse.java#L221-L224 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/codec/TIFFDirectory.java | TIFFDirectory.getFieldAsLong | public long getFieldAsLong(int tag, int index) {
"""
Returns the value of a particular index of a given tag as a
long. The caller is responsible for ensuring that the tag is
present and has type TIFF_BYTE, TIFF_SBYTE, TIFF_UNDEFINED,
TIFF_SHORT, TIFF_SSHORT, TIFF_SLONG or TIFF_LONG.
"""
Integer i =... | java | public long getFieldAsLong(int tag, int index) {
Integer i = (Integer)fieldIndex.get(Integer.valueOf(tag));
return fields[i.intValue()].getAsLong(index);
} | [
"public",
"long",
"getFieldAsLong",
"(",
"int",
"tag",
",",
"int",
"index",
")",
"{",
"Integer",
"i",
"=",
"(",
"Integer",
")",
"fieldIndex",
".",
"get",
"(",
"Integer",
".",
"valueOf",
"(",
"tag",
")",
")",
";",
"return",
"fields",
"[",
"i",
".",
... | Returns the value of a particular index of a given tag as a
long. The caller is responsible for ensuring that the tag is
present and has type TIFF_BYTE, TIFF_SBYTE, TIFF_UNDEFINED,
TIFF_SHORT, TIFF_SSHORT, TIFF_SLONG or TIFF_LONG. | [
"Returns",
"the",
"value",
"of",
"a",
"particular",
"index",
"of",
"a",
"given",
"tag",
"as",
"a",
"long",
".",
"The",
"caller",
"is",
"responsible",
"for",
"ensuring",
"that",
"the",
"tag",
"is",
"present",
"and",
"has",
"type",
"TIFF_BYTE",
"TIFF_SBYTE",... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/codec/TIFFDirectory.java#L468-L471 |
cqframework/clinical_quality_language | Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/Cql2ElmVisitor.java | Cql2ElmVisitor.attemptDateRangeOptimization | private boolean attemptDateRangeOptimization(And and, Retrieve retrieve, String alias) {
"""
Test an <code>And</code> expression and determine if it contains any operands (first-level or nested deeper)
than are <code>IncludedIn</code> expressions that can be refactored into a <code>Retrieve</code>. If so,
adjus... | java | private boolean attemptDateRangeOptimization(And and, Retrieve retrieve, String alias) {
if (retrieve.getDateProperty() != null || retrieve.getDateRange() != null) {
return false;
}
for (int i = 0; i < and.getOperand().size(); i++) {
Expression operand = and.getOperand()... | [
"private",
"boolean",
"attemptDateRangeOptimization",
"(",
"And",
"and",
",",
"Retrieve",
"retrieve",
",",
"String",
"alias",
")",
"{",
"if",
"(",
"retrieve",
".",
"getDateProperty",
"(",
")",
"!=",
"null",
"||",
"retrieve",
".",
"getDateRange",
"(",
")",
"!... | Test an <code>And</code> expression and determine if it contains any operands (first-level or nested deeper)
than are <code>IncludedIn</code> expressions that can be refactored into a <code>Retrieve</code>. If so,
adjust the <code>Retrieve</code> accordingly and reset the corresponding operand to a literal
<code>true<... | [
"Test",
"an",
"<code",
">",
"And<",
"/",
"code",
">",
"expression",
"and",
"determine",
"if",
"it",
"contains",
"any",
"operands",
"(",
"first",
"-",
"level",
"or",
"nested",
"deeper",
")",
"than",
"are",
"<code",
">",
"IncludedIn<",
"/",
"code",
">",
... | train | https://github.com/cqframework/clinical_quality_language/blob/67459d1ef453e49db8d7c5c86e87278377ed0a0b/Src/java/cql-to-elm/src/main/java/org/cqframework/cql/cql2elm/Cql2ElmVisitor.java#L3089-L3106 |
OpenTSDB/opentsdb | src/core/Internal.java | Internal.getTimeStampFromNonDP | public static long getTimeStampFromNonDP(final long base_time, byte[] quantifier) {
"""
Get timestamp from base time and quantifier for non datapoints. The returned time
will always be in ms.
@param base_time the base time of the point
@param quantifier the quantifier of the point, it is expected to be either l... | java | public static long getTimeStampFromNonDP(final long base_time, byte[] quantifier) {
long ret = base_time;
if (quantifier.length == 3) {
ret += quantifier[1] << 8 | (quantifier[2] & 0xFF);
ret *= 1000;
} else if (quantifier.length == 5) {
ret *= 1000;
ret += (quantifier[1] & 0xFF) << ... | [
"public",
"static",
"long",
"getTimeStampFromNonDP",
"(",
"final",
"long",
"base_time",
",",
"byte",
"[",
"]",
"quantifier",
")",
"{",
"long",
"ret",
"=",
"base_time",
";",
"if",
"(",
"quantifier",
".",
"length",
"==",
"3",
")",
"{",
"ret",
"+=",
"quanti... | Get timestamp from base time and quantifier for non datapoints. The returned time
will always be in ms.
@param base_time the base time of the point
@param quantifier the quantifier of the point, it is expected to be either length of
3 or length of 5 (the first byte represents the type of the point)
@return The timestam... | [
"Get",
"timestamp",
"from",
"base",
"time",
"and",
"quantifier",
"for",
"non",
"datapoints",
".",
"The",
"returned",
"time",
"will",
"always",
"be",
"in",
"ms",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/Internal.java#L1038-L1053 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/text/codepoint/CodepointHelper.java | CodepointHelper.verifyNot | public static void verifyNot (final ICodepointIterator aIter, final IntPredicate aFilter) {
"""
Verifies a sequence of codepoints using the specified filter
@param aIter
Codepoint iterator
@param aFilter
Filter to use
"""
final CodepointIteratorRestricted rci = aIter.restrict (aFilter, false, true);
... | java | public static void verifyNot (final ICodepointIterator aIter, final IntPredicate aFilter)
{
final CodepointIteratorRestricted rci = aIter.restrict (aFilter, false, true);
while (rci.hasNext ())
rci.next ();
} | [
"public",
"static",
"void",
"verifyNot",
"(",
"final",
"ICodepointIterator",
"aIter",
",",
"final",
"IntPredicate",
"aFilter",
")",
"{",
"final",
"CodepointIteratorRestricted",
"rci",
"=",
"aIter",
".",
"restrict",
"(",
"aFilter",
",",
"false",
",",
"true",
")",... | Verifies a sequence of codepoints using the specified filter
@param aIter
Codepoint iterator
@param aFilter
Filter to use | [
"Verifies",
"a",
"sequence",
"of",
"codepoints",
"using",
"the",
"specified",
"filter"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/text/codepoint/CodepointHelper.java#L803-L808 |
ReactiveX/RxNetty | rxnetty-http/src/main/java/io/reactivex/netty/protocol/http/sse/ServerSentEvent.java | ServerSentEvent.withEventIdAndType | public static ServerSentEvent withEventIdAndType(ByteBuf eventId, ByteBuf eventType, ByteBuf data) {
"""
Creates a {@link ServerSentEvent} instance with an event id and type.
@param eventType Type for the event.
@param eventId Id for the event.
@param data Data for the event.
@return The {@link ServerSentE... | java | public static ServerSentEvent withEventIdAndType(ByteBuf eventId, ByteBuf eventType, ByteBuf data) {
return new ServerSentEvent(eventId, eventType, data);
} | [
"public",
"static",
"ServerSentEvent",
"withEventIdAndType",
"(",
"ByteBuf",
"eventId",
",",
"ByteBuf",
"eventType",
",",
"ByteBuf",
"data",
")",
"{",
"return",
"new",
"ServerSentEvent",
"(",
"eventId",
",",
"eventType",
",",
"data",
")",
";",
"}"
] | Creates a {@link ServerSentEvent} instance with an event id and type.
@param eventType Type for the event.
@param eventId Id for the event.
@param data Data for the event.
@return The {@link ServerSentEvent} instance. | [
"Creates",
"a",
"{",
"@link",
"ServerSentEvent",
"}",
"instance",
"with",
"an",
"event",
"id",
"and",
"type",
"."
] | train | https://github.com/ReactiveX/RxNetty/blob/a7ca9a9c1d544a79c82f7b17036daf6958bf1cd6/rxnetty-http/src/main/java/io/reactivex/netty/protocol/http/sse/ServerSentEvent.java#L277-L279 |
groupon/odo | client/src/main/java/com/groupon/odo/client/Client.java | Client.deleteServerGroup | public List<ServerGroup> deleteServerGroup(int serverGroupId) {
"""
Delete a server group
@param serverGroupId ID of serverGroup
@return Collection of active Server Groups
"""
ArrayList<ServerGroup> groups = new ArrayList<ServerGroup>();
try {
JSONArray serverArray = new JSONArr... | java | public List<ServerGroup> deleteServerGroup(int serverGroupId) {
ArrayList<ServerGroup> groups = new ArrayList<ServerGroup>();
try {
JSONArray serverArray = new JSONArray(doDelete(BASE_SERVERGROUP + "/" + serverGroupId, null));
for (int i = 0; i < serverArray.length(); i++) {
... | [
"public",
"List",
"<",
"ServerGroup",
">",
"deleteServerGroup",
"(",
"int",
"serverGroupId",
")",
"{",
"ArrayList",
"<",
"ServerGroup",
">",
"groups",
"=",
"new",
"ArrayList",
"<",
"ServerGroup",
">",
"(",
")",
";",
"try",
"{",
"JSONArray",
"serverArray",
"=... | Delete a server group
@param serverGroupId ID of serverGroup
@return Collection of active Server Groups | [
"Delete",
"a",
"server",
"group"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L1228-L1242 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/type/AbstractManagedType.java | AbstractManagedType.addPluralAttribute | public void addPluralAttribute(String attributeName, PluralAttribute<X, ?, ?> attribute) {
"""
Adds the plural attribute.
@param attributeName
the attribute name
@param attribute
the attribute
"""
if (declaredPluralAttributes == null)
{
declaredPluralAttributes = new HashMap<S... | java | public void addPluralAttribute(String attributeName, PluralAttribute<X, ?, ?> attribute)
{
if (declaredPluralAttributes == null)
{
declaredPluralAttributes = new HashMap<String, PluralAttribute<X, ?, ?>>();
}
declaredPluralAttributes.put(attributeName, attribute);
... | [
"public",
"void",
"addPluralAttribute",
"(",
"String",
"attributeName",
",",
"PluralAttribute",
"<",
"X",
",",
"?",
",",
"?",
">",
"attribute",
")",
"{",
"if",
"(",
"declaredPluralAttributes",
"==",
"null",
")",
"{",
"declaredPluralAttributes",
"=",
"new",
"Ha... | Adds the plural attribute.
@param attributeName
the attribute name
@param attribute
the attribute | [
"Adds",
"the",
"plural",
"attribute",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/type/AbstractManagedType.java#L841-L853 |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/GV/AbstractHBCIJob.java | AbstractHBCIJob.setParam | public void setParam(String paramName, Integer index, String value) {
"""
<p>Setzen eines Job-Parameters. Für alle Highlevel-Jobs ist in der Package-Beschreibung zum
Package {@link org.kapott.hbci.GV} eine Auflistung aller Jobs und deren Parameter zu finden.
Für alle Lowlevel-Jobs kann eine Liste aller Parameter... | java | public void setParam(String paramName, Integer index, String value) {
String[][] destinations = constraints.get(paramName);
if (destinations == null) {
String msg = HBCIUtils.getLocMsg("EXCMSG_PARAM_NOTNEEDED", new String[]{paramName, getName()});
throw new InvalidUserDataExcept... | [
"public",
"void",
"setParam",
"(",
"String",
"paramName",
",",
"Integer",
"index",
",",
"String",
"value",
")",
"{",
"String",
"[",
"]",
"[",
"]",
"destinations",
"=",
"constraints",
".",
"get",
"(",
"paramName",
")",
";",
"if",
"(",
"destinations",
"=="... | <p>Setzen eines Job-Parameters. Für alle Highlevel-Jobs ist in der Package-Beschreibung zum
Package {@link org.kapott.hbci.GV} eine Auflistung aller Jobs und deren Parameter zu finden.
Für alle Lowlevel-Jobs kann eine Liste aller Parameter entweder mit dem Tool
{@link org.kapott.hbci.tools.ShowLowlevelGVs} ermittelt we... | [
"<p",
">",
"Setzen",
"eines",
"Job",
"-",
"Parameters",
".",
"Für",
"alle",
"Highlevel",
"-",
"Jobs",
"ist",
"in",
"der",
"Package",
"-",
"Beschreibung",
"zum",
"Package",
"{",
"@link",
"org",
".",
"kapott",
".",
"hbci",
".",
"GV",
"}",
"eine",
"Auflis... | train | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/GV/AbstractHBCIJob.java#L522-L549 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/Record.java | Record.getDate | public Date getDate(int field) throws MPXJException {
"""
Accessor method used to retrieve an Date instance representing the
contents of an individual field. If the field does not exist in the
record, null is returned.
@param field the index number of the field to be retrieved
@return the value of the requir... | java | public Date getDate(int field) throws MPXJException
{
try
{
Date result;
if ((field < m_fields.length) && (m_fields[field].length() != 0))
{
result = m_formats.getDateFormat().parse(m_fields[field]);
}
else
{
result = null;
... | [
"public",
"Date",
"getDate",
"(",
"int",
"field",
")",
"throws",
"MPXJException",
"{",
"try",
"{",
"Date",
"result",
";",
"if",
"(",
"(",
"field",
"<",
"m_fields",
".",
"length",
")",
"&&",
"(",
"m_fields",
"[",
"field",
"]",
".",
"length",
"(",
")",... | Accessor method used to retrieve an Date instance representing the
contents of an individual field. If the field does not exist in the
record, null is returned.
@param field the index number of the field to be retrieved
@return the value of the required field
@throws MPXJException normally thrown when parsing fails | [
"Accessor",
"method",
"used",
"to",
"retrieve",
"an",
"Date",
"instance",
"representing",
"the",
"contents",
"of",
"an",
"individual",
"field",
".",
"If",
"the",
"field",
"does",
"not",
"exist",
"in",
"the",
"record",
"null",
"is",
"returned",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/Record.java#L283-L305 |
rzwitserloot/lombok | src/core/lombok/bytecode/ClassFileMetaData.java | ClassFileMetaData.usesMethod | public boolean usesMethod(String className, String methodName) {
"""
Checks if the constant pool contains a reference to a given method, with any signature (return type and parameter types).
@param className must be provided JVM-style, such as {@code java/lang/String}
"""
int classIndex = findClass(classN... | java | public boolean usesMethod(String className, String methodName) {
int classIndex = findClass(className);
if (classIndex == NOT_FOUND) return false;
int methodNameIndex = findUtf8(methodName);
if (methodNameIndex == NOT_FOUND) return false;
for (int i = 1; i < maxPoolSize; i++) {
if (isMethod(i) && readVa... | [
"public",
"boolean",
"usesMethod",
"(",
"String",
"className",
",",
"String",
"methodName",
")",
"{",
"int",
"classIndex",
"=",
"findClass",
"(",
"className",
")",
";",
"if",
"(",
"classIndex",
"==",
"NOT_FOUND",
")",
"return",
"false",
";",
"int",
"methodNa... | Checks if the constant pool contains a reference to a given method, with any signature (return type and parameter types).
@param className must be provided JVM-style, such as {@code java/lang/String} | [
"Checks",
"if",
"the",
"constant",
"pool",
"contains",
"a",
"reference",
"to",
"a",
"given",
"method",
"with",
"any",
"signature",
"(",
"return",
"type",
"and",
"parameter",
"types",
")",
"."
] | train | https://github.com/rzwitserloot/lombok/blob/75601240760bd81ff95fcde7a1b8185769ce64e8/src/core/lombok/bytecode/ClassFileMetaData.java#L184-L197 |
cycorp/api-suite | core-api/src/main/java/com/cyc/query/exception/ProofViewException.java | ProofViewException.fromThrowable | public static ProofViewException fromThrowable(String message, Throwable cause) {
"""
Converts a Throwable to a ProofViewException with the specified detail message. If the
Throwable is a ProofViewException and if the Throwable's message is identical to the
one supplied, the Throwable will be passed through unmo... | java | public static ProofViewException fromThrowable(String message, Throwable cause) {
return (cause instanceof ProofViewException && Objects.equals(message, cause.getMessage()))
? (ProofViewException) cause
: new ProofViewException(message, cause);
} | [
"public",
"static",
"ProofViewException",
"fromThrowable",
"(",
"String",
"message",
",",
"Throwable",
"cause",
")",
"{",
"return",
"(",
"cause",
"instanceof",
"ProofViewException",
"&&",
"Objects",
".",
"equals",
"(",
"message",
",",
"cause",
".",
"getMessage",
... | Converts a Throwable to a ProofViewException with the specified detail message. If the
Throwable is a ProofViewException and if the Throwable's message is identical to the
one supplied, the Throwable will be passed through unmodified; otherwise, it will be wrapped in
a new ProofViewException with the detail message.
@... | [
"Converts",
"a",
"Throwable",
"to",
"a",
"ProofViewException",
"with",
"the",
"specified",
"detail",
"message",
".",
"If",
"the",
"Throwable",
"is",
"a",
"ProofViewException",
"and",
"if",
"the",
"Throwable",
"s",
"message",
"is",
"identical",
"to",
"the",
"on... | train | https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/query/exception/ProofViewException.java#L61-L65 |
scalecube/scalecube-services | services-api/src/main/java/io/scalecube/services/ServiceEndpoint.java | ServiceEndpoint.serviceReferences | public Collection<ServiceReference> serviceReferences() {
"""
Creates collection of service references from this service endpoint.
@return collection of {@link ServiceReference}
"""
return serviceRegistrations.stream()
.flatMap(sr -> sr.methods().stream().map(sm -> new ServiceReference(sm, sr, t... | java | public Collection<ServiceReference> serviceReferences() {
return serviceRegistrations.stream()
.flatMap(sr -> sr.methods().stream().map(sm -> new ServiceReference(sm, sr, this)))
.collect(Collectors.toList());
} | [
"public",
"Collection",
"<",
"ServiceReference",
">",
"serviceReferences",
"(",
")",
"{",
"return",
"serviceRegistrations",
".",
"stream",
"(",
")",
".",
"flatMap",
"(",
"sr",
"->",
"sr",
".",
"methods",
"(",
")",
".",
"stream",
"(",
")",
".",
"map",
"("... | Creates collection of service references from this service endpoint.
@return collection of {@link ServiceReference} | [
"Creates",
"collection",
"of",
"service",
"references",
"from",
"this",
"service",
"endpoint",
"."
] | train | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/ServiceEndpoint.java#L75-L79 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/MetadataCache.java | MetadataCache.addCacheFormatEntry | private static void addCacheFormatEntry(List<Message> trackListEntries, int playlistId, ZipOutputStream zos) throws IOException {
"""
Add a marker so we can recognize this as a metadata archive. I would use the ZipFile comment, but
that is not available until Java 7, and Beat Link is supposed to be backwards comp... | java | private static void addCacheFormatEntry(List<Message> trackListEntries, int playlistId, ZipOutputStream zos) throws IOException {
// Add a marker so we can recognize this as a metadata archive. I would use the ZipFile comment, but
// that is not available until Java 7, and Beat Link is supposed to be ba... | [
"private",
"static",
"void",
"addCacheFormatEntry",
"(",
"List",
"<",
"Message",
">",
"trackListEntries",
",",
"int",
"playlistId",
",",
"ZipOutputStream",
"zos",
")",
"throws",
"IOException",
"{",
"// Add a marker so we can recognize this as a metadata archive. I would use t... | Add a marker so we can recognize this as a metadata archive. I would use the ZipFile comment, but
that is not available until Java 7, and Beat Link is supposed to be backwards compatible with Java 6.
Since we are doing this anyway, we can also provide information about the nature of the cache, and
how many metadata ent... | [
"Add",
"a",
"marker",
"so",
"we",
"can",
"recognize",
"this",
"as",
"a",
"metadata",
"archive",
".",
"I",
"would",
"use",
"the",
"ZipFile",
"comment",
"but",
"that",
"is",
"not",
"available",
"until",
"Java",
"7",
"and",
"Beat",
"Link",
"is",
"supposed",... | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/MetadataCache.java#L344-L352 |
stevespringett/Alpine | alpine/src/main/java/alpine/util/ByteUtil.java | ByteUtil.toBytes | public static byte[] toBytes(char[] chars) {
"""
Converts a char array to a byte array without the use of Strings.
http://stackoverflow.com/questions/5513144/converting-char-to-byte
@param chars the characters to convert
@return a byte array of the converted characters
@since 1.0.0
"""
final Ch... | java | public static byte[] toBytes(char[] chars) {
final CharBuffer charBuffer = CharBuffer.wrap(chars);
final ByteBuffer byteBuffer = Charset.forName("UTF-8").encode(charBuffer);
final byte[] bytes = Arrays.copyOfRange(byteBuffer.array(), byteBuffer.position(), byteBuffer.limit());
Arrays.fil... | [
"public",
"static",
"byte",
"[",
"]",
"toBytes",
"(",
"char",
"[",
"]",
"chars",
")",
"{",
"final",
"CharBuffer",
"charBuffer",
"=",
"CharBuffer",
".",
"wrap",
"(",
"chars",
")",
";",
"final",
"ByteBuffer",
"byteBuffer",
"=",
"Charset",
".",
"forName",
"... | Converts a char array to a byte array without the use of Strings.
http://stackoverflow.com/questions/5513144/converting-char-to-byte
@param chars the characters to convert
@return a byte array of the converted characters
@since 1.0.0 | [
"Converts",
"a",
"char",
"array",
"to",
"a",
"byte",
"array",
"without",
"the",
"use",
"of",
"Strings",
"."
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/util/ByteUtil.java#L47-L54 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java | AjaxHelper.registerComponent | public static AjaxOperation registerComponent(final String targetId, final String triggerId) {
"""
Registers a single component as being AJAX capable.
@param targetId the component to register. The component will be re-painted when the trigger occurs.
@param triggerId the id of the trigger that will cause the ... | java | public static AjaxOperation registerComponent(final String targetId, final String triggerId) {
AjaxOperation operation = new AjaxOperation(triggerId, targetId);
registerAjaxOperation(operation);
return operation;
} | [
"public",
"static",
"AjaxOperation",
"registerComponent",
"(",
"final",
"String",
"targetId",
",",
"final",
"String",
"triggerId",
")",
"{",
"AjaxOperation",
"operation",
"=",
"new",
"AjaxOperation",
"(",
"triggerId",
",",
"targetId",
")",
";",
"registerAjaxOperatio... | Registers a single component as being AJAX capable.
@param targetId the component to register. The component will be re-painted when the trigger occurs.
@param triggerId the id of the trigger that will cause the component to be painted.
@return the AjaxOperation control configuration object. | [
"Registers",
"a",
"single",
"component",
"as",
"being",
"AJAX",
"capable",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AjaxHelper.java#L113-L117 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.