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 |
|---|---|---|---|---|---|---|---|---|---|---|
belaban/JGroups | src/org/jgroups/util/CondVar.java | CondVar.waitFor | public boolean waitFor(Condition condition, long timeout, TimeUnit unit) {
"""
Blocks until condition is true or the time elapsed
@param condition The condition
@param timeout The timeout to wait. A value <= 0 causes immediate return
@param unit TimeUnit
@return The condition's status
"""
boolean ... | java | public boolean waitFor(Condition condition, long timeout, TimeUnit unit) {
boolean intr=false;
final long timeout_ns=TimeUnit.NANOSECONDS.convert(timeout, unit);
lock.lock();
try {
for(long wait_time=timeout_ns, start=System.nanoTime(); wait_time > 0 && !condition.isMet();... | [
"public",
"boolean",
"waitFor",
"(",
"Condition",
"condition",
",",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"boolean",
"intr",
"=",
"false",
";",
"final",
"long",
"timeout_ns",
"=",
"TimeUnit",
".",
"NANOSECONDS",
".",
"convert",
"(",
"timeout"... | Blocks until condition is true or the time elapsed
@param condition The condition
@param timeout The timeout to wait. A value <= 0 causes immediate return
@param unit TimeUnit
@return The condition's status | [
"Blocks",
"until",
"condition",
"is",
"true",
"or",
"the",
"time",
"elapsed"
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/util/CondVar.java#L56-L76 |
steveohara/j2mod | src/main/java/com/ghgande/j2mod/modbus/io/ModbusASCIITransport.java | ModbusASCIITransport.calculateLRC | private static byte calculateLRC(byte[] data, int off, int length, int tailskip) {
"""
Calculates a LRC checksum
@param data Data to use
@param off Offset into byte array
@param length Number of bytes to use
@param tailskip Bytes to skip at tail
@return Checksum
"""
int lrc = 0;
... | java | private static byte calculateLRC(byte[] data, int off, int length, int tailskip) {
int lrc = 0;
for (int i = off; i < length - tailskip; i++) {
lrc += ((int) data[i]) & 0xFF;
}
return (byte) ((-lrc) & 0xff);
} | [
"private",
"static",
"byte",
"calculateLRC",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"off",
",",
"int",
"length",
",",
"int",
"tailskip",
")",
"{",
"int",
"lrc",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"off",
";",
"i",
"<",
"length",
"-",
... | Calculates a LRC checksum
@param data Data to use
@param off Offset into byte array
@param length Number of bytes to use
@param tailskip Bytes to skip at tail
@return Checksum | [
"Calculates",
"a",
"LRC",
"checksum"
] | train | https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/io/ModbusASCIITransport.java#L211-L217 |
PistoiaHELM/HELM2NotationToolkit | src/main/java/org/helm/notation2/tools/HELM2NotationUtils.java | HELM2NotationUtils.section3 | private static void section3(List<GroupingNotation> groupings, Map<String, String> mapIds) throws NotationException {
"""
method to add groupings to the existent grouping section
@param groupings new GroupingNotations
@param mapIds map of old and new Ids
@throws NotationException if notation is not valid
... | java | private static void section3(List<GroupingNotation> groupings, Map<String, String> mapIds) throws NotationException {
for (GroupingNotation grouping : groupings) {
GroupEntity groupID = grouping.getGroupID();
if (mapIds.containsKey(groupID.getId())) {
groupID = new GroupingNotation(mapIds.... | [
"private",
"static",
"void",
"section3",
"(",
"List",
"<",
"GroupingNotation",
">",
"groupings",
",",
"Map",
"<",
"String",
",",
"String",
">",
"mapIds",
")",
"throws",
"NotationException",
"{",
"for",
"(",
"GroupingNotation",
"grouping",
":",
"groupings",
")"... | method to add groupings to the existent grouping section
@param groupings new GroupingNotations
@param mapIds map of old and new Ids
@throws NotationException if notation is not valid | [
"method",
"to",
"add",
"groupings",
"to",
"the",
"existent",
"grouping",
"section"
] | train | https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/HELM2NotationUtils.java#L305-L318 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/validation/OpValidation.java | OpValidation.excludedFromGradientCheckCoverage | private static Set<Class> excludedFromGradientCheckCoverage() {
"""
Returns a list of classes that are not gradient checkable.
An operation may not be gradient checkable due to, for example:
(a) Having no real-valued arguments<br>
(b) Having random output (dropout, for example)<br>
<p>
Note that hawving non-r... | java | private static Set<Class> excludedFromGradientCheckCoverage() {
List list = Arrays.asList(
//Exclude misc
DynamicCustomOp.class,
EqualsWithEps.class,
ConfusionMatrix.class,
Eye.class,
OneHot.class,
Bi... | [
"private",
"static",
"Set",
"<",
"Class",
">",
"excludedFromGradientCheckCoverage",
"(",
")",
"{",
"List",
"list",
"=",
"Arrays",
".",
"asList",
"(",
"//Exclude misc",
"DynamicCustomOp",
".",
"class",
",",
"EqualsWithEps",
".",
"class",
",",
"ConfusionMatrix",
"... | Returns a list of classes that are not gradient checkable.
An operation may not be gradient checkable due to, for example:
(a) Having no real-valued arguments<br>
(b) Having random output (dropout, for example)<br>
<p>
Note that hawving non-real-valued output is OK - we still want to test these, as they
should pass bac... | [
"Returns",
"a",
"list",
"of",
"classes",
"that",
"are",
"not",
"gradient",
"checkable",
".",
"An",
"operation",
"may",
"not",
"be",
"gradient",
"checkable",
"due",
"to",
"for",
"example",
":",
"(",
"a",
")",
"Having",
"no",
"real",
"-",
"valued",
"argume... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/validation/OpValidation.java#L874-L934 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java | EscapedFunctions2.sqlcurtime | public static void sqlcurtime(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
"""
curtime to current_time translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens
"""
zeroArgumentFunctionCall(buf, "cu... | java | public static void sqlcurtime(StringBuilder buf, List<? extends CharSequence> parsedArgs) throws SQLException {
zeroArgumentFunctionCall(buf, "current_time", "curtime", parsedArgs);
} | [
"public",
"static",
"void",
"sqlcurtime",
"(",
"StringBuilder",
"buf",
",",
"List",
"<",
"?",
"extends",
"CharSequence",
">",
"parsedArgs",
")",
"throws",
"SQLException",
"{",
"zeroArgumentFunctionCall",
"(",
"buf",
",",
"\"current_time\"",
",",
"\"curtime\"",
","... | curtime to current_time translation
@param buf The buffer to append into
@param parsedArgs arguments
@throws SQLException if something wrong happens | [
"curtime",
"to",
"current_time",
"translation"
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L342-L344 |
apache/incubator-gobblin | gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/KafkaUtils.java | KafkaUtils.getPartitionAvgRecordSize | public static long getPartitionAvgRecordSize(State state, KafkaPartition partition) {
"""
Get the average record size of a partition, which is stored in property "[topicname].[partitionid].avg.record.size".
If state doesn't contain this property, it returns defaultSize.
"""
return state.getPropAsLong(
... | java | public static long getPartitionAvgRecordSize(State state, KafkaPartition partition) {
return state.getPropAsLong(
getPartitionPropName(partition.getTopicName(), partition.getId()) + "." + KafkaSource.AVG_RECORD_SIZE);
} | [
"public",
"static",
"long",
"getPartitionAvgRecordSize",
"(",
"State",
"state",
",",
"KafkaPartition",
"partition",
")",
"{",
"return",
"state",
".",
"getPropAsLong",
"(",
"getPartitionPropName",
"(",
"partition",
".",
"getTopicName",
"(",
")",
",",
"partition",
"... | Get the average record size of a partition, which is stored in property "[topicname].[partitionid].avg.record.size".
If state doesn't contain this property, it returns defaultSize. | [
"Get",
"the",
"average",
"record",
"size",
"of",
"a",
"partition",
"which",
"is",
"stored",
"in",
"property",
"[",
"topicname",
"]",
".",
"[",
"partitionid",
"]",
".",
"avg",
".",
"record",
".",
"size",
".",
"If",
"state",
"doesn",
"t",
"contain",
"thi... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/KafkaUtils.java#L120-L123 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/utils/BsfUtils.java | BsfUtils.selectMomentJSDateTimeFormat | public static String selectMomentJSDateTimeFormat(Locale locale, String momentJSFormat, boolean withDate, boolean withTime) {
"""
Selects the Date Pattern to use based on the given Locale if the input
format is null
@param locale
Locale (may be the result of a call to selectLocale)
@param momentJSFormat
Inp... | java | public static String selectMomentJSDateTimeFormat(Locale locale, String momentJSFormat, boolean withDate, boolean withTime) {
if (momentJSFormat == null) {
String dateFormat = "";
if (withDate) {
dateFormat = ((SimpleDateFormat) DateFormat.getDateInstance(DateFormat.SHORT, locale)).toPattern();
}
Stri... | [
"public",
"static",
"String",
"selectMomentJSDateTimeFormat",
"(",
"Locale",
"locale",
",",
"String",
"momentJSFormat",
",",
"boolean",
"withDate",
",",
"boolean",
"withTime",
")",
"{",
"if",
"(",
"momentJSFormat",
"==",
"null",
")",
"{",
"String",
"dateFormat",
... | Selects the Date Pattern to use based on the given Locale if the input
format is null
@param locale
Locale (may be the result of a call to selectLocale)
@param momentJSFormat
Input format String
@return moment.js Date Pattern eg. DD/MM/YYYY | [
"Selects",
"the",
"Date",
"Pattern",
"to",
"use",
"based",
"on",
"the",
"given",
"Locale",
"if",
"the",
"input",
"format",
"is",
"null"
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/utils/BsfUtils.java#L570-L593 |
samskivert/pythagoras | src/main/java/pythagoras/d/Matrix4.java | Matrix4.setToSkew | public Matrix4 setToSkew (double a, double b, double c, double d, double x, double y, double z) {
"""
Sets this to a skew by the specified amount relative to the given plane.
@return a reference to this matrix, for chaining.
"""
return set(1f + a*x, b*x, c*x, d*x,
a*y, 1f + b*y, c... | java | public Matrix4 setToSkew (double a, double b, double c, double d, double x, double y, double z) {
return set(1f + a*x, b*x, c*x, d*x,
a*y, 1f + b*y, c*y, d*y,
a*z, b*z, 1f + c*z, d*z,
0f, 0f, 0f, 1f);
} | [
"public",
"Matrix4",
"setToSkew",
"(",
"double",
"a",
",",
"double",
"b",
",",
"double",
"c",
",",
"double",
"d",
",",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"return",
"set",
"(",
"1f",
"+",
"a",
"*",
"x",
",",
"b",
"*... | Sets this to a skew by the specified amount relative to the given plane.
@return a reference to this matrix, for chaining. | [
"Sets",
"this",
"to",
"a",
"skew",
"by",
"the",
"specified",
"amount",
"relative",
"to",
"the",
"given",
"plane",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Matrix4.java#L360-L365 |
profesorfalken/jPowerShell | src/main/java/com/profesorfalken/jpowershell/PowerShell.java | PowerShell.executeCommandAndChain | public PowerShell executeCommandAndChain(String command, PowerShellResponseHandler... response) {
"""
Allows to chain command executions providing a more fluent API.<p>
<p>
This method allows also to optionally handle the response in a closure
@param command the command to execute
@param response optionally... | java | public PowerShell executeCommandAndChain(String command, PowerShellResponseHandler... response) {
PowerShellResponse powerShellResponse = executeCommand(command);
if (response.length > 0) {
handleResponse(response[0], powerShellResponse);
}
return this;
} | [
"public",
"PowerShell",
"executeCommandAndChain",
"(",
"String",
"command",
",",
"PowerShellResponseHandler",
"...",
"response",
")",
"{",
"PowerShellResponse",
"powerShellResponse",
"=",
"executeCommand",
"(",
"command",
")",
";",
"if",
"(",
"response",
".",
"length"... | Allows to chain command executions providing a more fluent API.<p>
<p>
This method allows also to optionally handle the response in a closure
@param command the command to execute
@param response optionally, the response can be handled in a closure
@return The {@link PowerShell} instance | [
"Allows",
"to",
"chain",
"command",
"executions",
"providing",
"a",
"more",
"fluent",
"API",
".",
"<p",
">",
"<p",
">",
"This",
"method",
"allows",
"also",
"to",
"optionally",
"handle",
"the",
"response",
"in",
"a",
"closure"
] | train | https://github.com/profesorfalken/jPowerShell/blob/a0fb9d3b9db12dd5635de810e6366e17b932ee10/src/main/java/com/profesorfalken/jpowershell/PowerShell.java#L251-L259 |
bThink-BGU/BPjs | src/main/java/il/ac/bgu/cs/bp/bpjs/model/BProgramSyncSnapshot.java | BProgramSyncSnapshot.executeAllAddedBThreads | private void executeAllAddedBThreads(Set<BThreadSyncSnapshot> nextRound, ExecutorService exSvc, BPEngineTask.Listener listener) throws InterruptedException {
"""
Executes and adds all newly registered b-threads, until no more new b-threads
are registered.
@param nextRound the set of b-threads that will participa... | java | private void executeAllAddedBThreads(Set<BThreadSyncSnapshot> nextRound, ExecutorService exSvc, BPEngineTask.Listener listener) throws InterruptedException {
// if any new bthreads are added, run and add their result
Set<BThreadSyncSnapshot> addedBThreads = bprog.drainRecentlyRegisteredBthreads();
... | [
"private",
"void",
"executeAllAddedBThreads",
"(",
"Set",
"<",
"BThreadSyncSnapshot",
">",
"nextRound",
",",
"ExecutorService",
"exSvc",
",",
"BPEngineTask",
".",
"Listener",
"listener",
")",
"throws",
"InterruptedException",
"{",
"// if any new bthreads are added, run and ... | Executes and adds all newly registered b-threads, until no more new b-threads
are registered.
@param nextRound the set of b-threads that will participate in the next round
@param exSvc The executor service to run the b-threads
@param listener handling assertion failures, if they happen.
@throws InterruptedException | [
"Executes",
"and",
"adds",
"all",
"newly",
"registered",
"b",
"-",
"threads",
"until",
"no",
"more",
"new",
"b",
"-",
"threads",
"are",
"registered",
"."
] | train | https://github.com/bThink-BGU/BPjs/blob/2d388365a27ad79ded108eaf98a35a7ef292ae1f/src/main/java/il/ac/bgu/cs/bp/bpjs/model/BProgramSyncSnapshot.java#L284-L299 |
bwkimmel/java-util | src/main/java/ca/eandb/util/progress/ProgressDialog.java | ProgressDialog.setProgressBarValue | private void setProgressBarValue(int value, int maximum) {
"""
Updates the progress bar on this dialog.
@param value The number of parts of the operation that have been
completed.
@param maximum The number of parts that compose the operation.
"""
this.progressBar.setIndeterminate(false);
if (this.... | java | private void setProgressBarValue(int value, int maximum) {
this.progressBar.setIndeterminate(false);
if (this.progressBar.getMaximum() != maximum) {
this.progressBar.setMaximum(maximum);
}
this.progressBar.setValue(value);
} | [
"private",
"void",
"setProgressBarValue",
"(",
"int",
"value",
",",
"int",
"maximum",
")",
"{",
"this",
".",
"progressBar",
".",
"setIndeterminate",
"(",
"false",
")",
";",
"if",
"(",
"this",
".",
"progressBar",
".",
"getMaximum",
"(",
")",
"!=",
"maximum"... | Updates the progress bar on this dialog.
@param value The number of parts of the operation that have been
completed.
@param maximum The number of parts that compose the operation. | [
"Updates",
"the",
"progress",
"bar",
"on",
"this",
"dialog",
"."
] | train | https://github.com/bwkimmel/java-util/blob/0c03664d42f0e6b111f64447f222aa73c2819e5c/src/main/java/ca/eandb/util/progress/ProgressDialog.java#L184-L194 |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/api/common/operators/SingleInputSemanticProperties.java | SingleInputSemanticProperties.addForwardedField | public void addForwardedField(int sourceField, FieldSet destinationFields) {
"""
Adds, to the existing information, a field that is forwarded directly
from the source record(s) to multiple fields in the destination
record(s).
@param sourceField the position in the source record(s)
@param destinationFields th... | java | public void addForwardedField(int sourceField, FieldSet destinationFields) {
FieldSet fs;
if((fs = this.forwardedFields.get(sourceField)) != null) {
fs.addAll(destinationFields);
} else {
fs = new FieldSet(destinationFields);
this.forwardedFields.put(sourceField, fs);
}
} | [
"public",
"void",
"addForwardedField",
"(",
"int",
"sourceField",
",",
"FieldSet",
"destinationFields",
")",
"{",
"FieldSet",
"fs",
";",
"if",
"(",
"(",
"fs",
"=",
"this",
".",
"forwardedFields",
".",
"get",
"(",
"sourceField",
")",
")",
"!=",
"null",
")",... | Adds, to the existing information, a field that is forwarded directly
from the source record(s) to multiple fields in the destination
record(s).
@param sourceField the position in the source record(s)
@param destinationFields the position in the destination record(s) | [
"Adds",
"to",
"the",
"existing",
"information",
"a",
"field",
"that",
"is",
"forwarded",
"directly",
"from",
"the",
"source",
"record",
"(",
"s",
")",
"to",
"multiple",
"fields",
"in",
"the",
"destination",
"record",
"(",
"s",
")",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/api/common/operators/SingleInputSemanticProperties.java#L69-L77 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/heartbeat/HeartbeatServices.java | HeartbeatServices.fromConfiguration | public static HeartbeatServices fromConfiguration(Configuration configuration) {
"""
Creates an HeartbeatServices instance from a {@link Configuration}.
@param configuration Configuration to be used for the HeartbeatServices creation
@return An HeartbeatServices instance created from the given configuration
... | java | public static HeartbeatServices fromConfiguration(Configuration configuration) {
long heartbeatInterval = configuration.getLong(HeartbeatManagerOptions.HEARTBEAT_INTERVAL);
long heartbeatTimeout = configuration.getLong(HeartbeatManagerOptions.HEARTBEAT_TIMEOUT);
return new HeartbeatServices(heartbeatInterval, h... | [
"public",
"static",
"HeartbeatServices",
"fromConfiguration",
"(",
"Configuration",
"configuration",
")",
"{",
"long",
"heartbeatInterval",
"=",
"configuration",
".",
"getLong",
"(",
"HeartbeatManagerOptions",
".",
"HEARTBEAT_INTERVAL",
")",
";",
"long",
"heartbeatTimeout... | Creates an HeartbeatServices instance from a {@link Configuration}.
@param configuration Configuration to be used for the HeartbeatServices creation
@return An HeartbeatServices instance created from the given configuration | [
"Creates",
"an",
"HeartbeatServices",
"instance",
"from",
"a",
"{",
"@link",
"Configuration",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/heartbeat/HeartbeatServices.java#L110-L116 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/disco/ServiceDiscoveryManager.java | ServiceDiscoveryManager.discoverInfo | public DiscoverInfo discoverInfo(Jid entityID, String node) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Returns the discovered information of a given XMPP entity addressed by its JID and
note attribute. Use this message only when trying to query information wh... | java | public DiscoverInfo discoverInfo(Jid entityID, String node) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
// Discover the entity's info
DiscoverInfo disco = new DiscoverInfo();
disco.setType(IQ.Type.get);
disco.setTo(entityID);
disc... | [
"public",
"DiscoverInfo",
"discoverInfo",
"(",
"Jid",
"entityID",
",",
"String",
"node",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"// Discover the entity's info",
"DiscoverInfo",
"disco"... | Returns the discovered information of a given XMPP entity addressed by its JID and
note attribute. Use this message only when trying to query information which is not
directly addressable.
@see <a href="http://xmpp.org/extensions/xep-0030.html#info-basic">XEP-30 Basic Protocol</a>
@see <a href="http://xmpp.org/extensi... | [
"Returns",
"the",
"discovered",
"information",
"of",
"a",
"given",
"XMPP",
"entity",
"addressed",
"by",
"its",
"JID",
"and",
"note",
"attribute",
".",
"Use",
"this",
"message",
"only",
"when",
"trying",
"to",
"query",
"information",
"which",
"is",
"not",
"di... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/disco/ServiceDiscoveryManager.java#L524-L534 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/BaseUpdateableClassifier.java | BaseUpdateableClassifier.trainEpochs | public static void trainEpochs(ClassificationDataSet dataSet, UpdateableClassifier toTrain, int epochs) {
"""
Performs training on an updateable classifier by going over the whole
data set in random order one observation at a time, multiple times.
@param dataSet the data set to train from
@param toTrain the c... | java | public static void trainEpochs(ClassificationDataSet dataSet, UpdateableClassifier toTrain, int epochs)
{
if(epochs < 1)
throw new IllegalArgumentException("epochs must be positive");
toTrain.setUp(dataSet.getCategories(), dataSet.getNumNumericalVars(),
dataSet.getPredic... | [
"public",
"static",
"void",
"trainEpochs",
"(",
"ClassificationDataSet",
"dataSet",
",",
"UpdateableClassifier",
"toTrain",
",",
"int",
"epochs",
")",
"{",
"if",
"(",
"epochs",
"<",
"1",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"epochs must be positiv... | Performs training on an updateable classifier by going over the whole
data set in random order one observation at a time, multiple times.
@param dataSet the data set to train from
@param toTrain the classifier to train
@param epochs the number of passes through the data set | [
"Performs",
"training",
"on",
"an",
"updateable",
"classifier",
"by",
"going",
"over",
"the",
"whole",
"data",
"set",
"in",
"random",
"order",
"one",
"observation",
"at",
"a",
"time",
"multiple",
"times",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/BaseUpdateableClassifier.java#L82-L96 |
pressgang-ccms/PressGangCCMSQuery | src/main/java/org/jboss/pressgang/ccms/filter/base/BaseFilterQueryBuilder.java | BaseFilterQueryBuilder.addSizeGreaterThanOrEqualToCondition | protected void addSizeGreaterThanOrEqualToCondition(final String propertyName, final Integer size) {
"""
Add a Field Search Condition that will check if the size of a collection in an entity is greater than or equal to the
specified size.
@param propertyName The name of the collection as defined in the Entity ... | java | protected void addSizeGreaterThanOrEqualToCondition(final String propertyName, final Integer size) {
final Expression<Integer> propertySizeExpression = getCriteriaBuilder().size(getRootPath().get(propertyName).as(Set.class));
fieldConditions.add(getCriteriaBuilder().ge(propertySizeExpression, size));
... | [
"protected",
"void",
"addSizeGreaterThanOrEqualToCondition",
"(",
"final",
"String",
"propertyName",
",",
"final",
"Integer",
"size",
")",
"{",
"final",
"Expression",
"<",
"Integer",
">",
"propertySizeExpression",
"=",
"getCriteriaBuilder",
"(",
")",
".",
"size",
"(... | Add a Field Search Condition that will check if the size of a collection in an entity is greater than or equal to the
specified size.
@param propertyName The name of the collection as defined in the Entity mapping class.
@param size The size that the collection should be greater than or equal to. | [
"Add",
"a",
"Field",
"Search",
"Condition",
"that",
"will",
"check",
"if",
"the",
"size",
"of",
"a",
"collection",
"in",
"an",
"entity",
"is",
"greater",
"than",
"or",
"equal",
"to",
"the",
"specified",
"size",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSQuery/blob/2bb23430adab956737d0301cd2ea933f986dd85b/src/main/java/org/jboss/pressgang/ccms/filter/base/BaseFilterQueryBuilder.java#L247-L250 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/data/conversion/converters/NumberConverter.java | NumberConverter.canConvert | @Override
public boolean canConvert(Class<?> fromType, Class<?> toType) {
"""
Determines whether this {@link Converter} can convert {@link Object Objects}
{@link Class from type} {@link Class to type}.
@param fromType {@link Class type} to convert from.
@param toType {@link Class type} to convert to.
@retu... | java | @Override
public boolean canConvert(Class<?> fromType, Class<?> toType) {
return fromType != null && isAssignableTo(fromType, Number.class, String.class)
&& toType != null && Number.class.isAssignableFrom(toType);
} | [
"@",
"Override",
"public",
"boolean",
"canConvert",
"(",
"Class",
"<",
"?",
">",
"fromType",
",",
"Class",
"<",
"?",
">",
"toType",
")",
"{",
"return",
"fromType",
"!=",
"null",
"&&",
"isAssignableTo",
"(",
"fromType",
",",
"Number",
".",
"class",
",",
... | Determines whether this {@link Converter} can convert {@link Object Objects}
{@link Class from type} {@link Class to type}.
@param fromType {@link Class type} to convert from.
@param toType {@link Class type} to convert to.
@return a boolean indicating whether this {@link Converter} can convert {@link Object Objects}
... | [
"Determines",
"whether",
"this",
"{",
"@link",
"Converter",
"}",
"can",
"convert",
"{",
"@link",
"Object",
"Objects",
"}",
"{",
"@link",
"Class",
"from",
"type",
"}",
"{",
"@link",
"Class",
"to",
"type",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/data/conversion/converters/NumberConverter.java#L135-L139 |
terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/naming/PhysicalNamingStrategyShogunCore.java | PhysicalNamingStrategyShogunCore.convertToLimitedLowerCase | protected Identifier convertToLimitedLowerCase(JdbcEnvironment context, Identifier identifier, String prefix) {
"""
Converts a given {@link Identifier} to the lower case representation. If
the given context has a character limit for identifiers, this will be
respected.
@param context The JDBC context
@par... | java | protected Identifier convertToLimitedLowerCase(JdbcEnvironment context, Identifier identifier, String prefix) {
String identifierText = identifier.getText();
if (prefix != null) {
identifierText = prefix + identifierText;
}
// always convert to lowercase
identifierT... | [
"protected",
"Identifier",
"convertToLimitedLowerCase",
"(",
"JdbcEnvironment",
"context",
",",
"Identifier",
"identifier",
",",
"String",
"prefix",
")",
"{",
"String",
"identifierText",
"=",
"identifier",
".",
"getText",
"(",
")",
";",
"if",
"(",
"prefix",
"!=",
... | Converts a given {@link Identifier} to the lower case representation. If
the given context has a character limit for identifiers, this will be
respected.
@param context The JDBC context
@param identifier The identifier
@param prefix Optional prefix to use for the idenifiert. Will be ignored, if
null
@return | [
"Converts",
"a",
"given",
"{",
"@link",
"Identifier",
"}",
"to",
"the",
"lower",
"case",
"representation",
".",
"If",
"the",
"given",
"context",
"has",
"a",
"character",
"limit",
"for",
"identifiers",
"this",
"will",
"be",
"respected",
"."
] | train | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/naming/PhysicalNamingStrategyShogunCore.java#L72-L91 |
centic9/commons-dost | src/main/java/org/dstadler/commons/metrics/MetricsUtils.java | MetricsUtils.sendMetric | public static void sendMetric(String metric, int value, long ts, CloseableHttpClient httpClient, String url) throws IOException {
"""
Send the given value for the given metric and timestamp.
Authentication can be provided via the configured {@link HttpClient} instance.
@param metric The key of the metric
@p... | java | public static void sendMetric(String metric, int value, long ts, CloseableHttpClient httpClient, String url) throws IOException {
sendMetric(null, metric, value, ts, httpClient, url);
} | [
"public",
"static",
"void",
"sendMetric",
"(",
"String",
"metric",
",",
"int",
"value",
",",
"long",
"ts",
",",
"CloseableHttpClient",
"httpClient",
",",
"String",
"url",
")",
"throws",
"IOException",
"{",
"sendMetric",
"(",
"null",
",",
"metric",
",",
"valu... | Send the given value for the given metric and timestamp.
Authentication can be provided via the configured {@link HttpClient} instance.
@param metric The key of the metric
@param value The value of the measurement
@param ts The timestamp of the measurement
@param httpClient The HTTP Client that can be used to send me... | [
"Send",
"the",
"given",
"value",
"for",
"the",
"given",
"metric",
"and",
"timestamp",
"."
] | train | https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/metrics/MetricsUtils.java#L59-L61 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/plugins/BaseScriptPlugin.java | BaseScriptPlugin.createStepItemDataContext | protected Map<String, Map<String, String>> createStepItemDataContext(final Framework framework,
final String project,
final Map<String, Map<String, String>> context,
... | java | protected Map<String, Map<String, String>> createStepItemDataContext(final Framework framework,
final String project,
final Map<String, Map<String, String>> context,
... | [
"protected",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"String",
">",
">",
"createStepItemDataContext",
"(",
"final",
"Framework",
"framework",
",",
"final",
"String",
"project",
",",
"final",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",... | Create a data context containing the plugin values "file","scriptfile" and "base", as well as all config values.
@param framework fwk
@param project project name
@param context data context
@param configuration configuration
@return data context | [
"Create",
"a",
"data",
"context",
"containing",
"the",
"plugin",
"values",
"file",
"scriptfile",
"and",
"base",
"as",
"well",
"as",
"all",
"config",
"values",
"."
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/plugins/BaseScriptPlugin.java#L129-L143 |
ragnor/simple-spring-memcached | simple-spring-memcached/src/main/java/com/google/code/ssm/json/ClassAliasTypeResolverBuilder.java | ClassAliasTypeResolverBuilder.setClassToId | public void setClassToId(final Map<Class<?>, String> classToId) {
"""
Registers mappings between classes and aliases (ids).
@param classToId
"""
Map<String, Class<?>> reverseMap = new HashMap<String, Class<?>>();
for (Map.Entry<Class<?>, String> entry : classToId.entrySet()) {
A... | java | public void setClassToId(final Map<Class<?>, String> classToId) {
Map<String, Class<?>> reverseMap = new HashMap<String, Class<?>>();
for (Map.Entry<Class<?>, String> entry : classToId.entrySet()) {
Assert.notNull(entry.getKey(), "Class cannot be null: " + entry);
Assert.hasText... | [
"public",
"void",
"setClassToId",
"(",
"final",
"Map",
"<",
"Class",
"<",
"?",
">",
",",
"String",
">",
"classToId",
")",
"{",
"Map",
"<",
"String",
",",
"Class",
"<",
"?",
">",
">",
"reverseMap",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Class",
... | Registers mappings between classes and aliases (ids).
@param classToId | [
"Registers",
"mappings",
"between",
"classes",
"and",
"aliases",
"(",
"ids",
")",
"."
] | train | https://github.com/ragnor/simple-spring-memcached/blob/83db68aa1af219397e132426e377d45f397d31e7/simple-spring-memcached/src/main/java/com/google/code/ssm/json/ClassAliasTypeResolverBuilder.java#L63-L77 |
gwtbootstrap3/gwtbootstrap3-extras | src/main/java/org/gwtbootstrap3/extras/typeahead/client/ui/Typeahead.java | Typeahead.onSelected | private void onSelected(final Event event, final Suggestion<T> suggestion) {
"""
Triggered when a suggestion from the dropdown menu is selected.
@param event the event
@param suggestion the suggestion object
"""
TypeaheadSelectedEvent.fire(this, suggestion, event);
} | java | private void onSelected(final Event event, final Suggestion<T> suggestion) {
TypeaheadSelectedEvent.fire(this, suggestion, event);
} | [
"private",
"void",
"onSelected",
"(",
"final",
"Event",
"event",
",",
"final",
"Suggestion",
"<",
"T",
">",
"suggestion",
")",
"{",
"TypeaheadSelectedEvent",
".",
"fire",
"(",
"this",
",",
"suggestion",
",",
"event",
")",
";",
"}"
] | Triggered when a suggestion from the dropdown menu is selected.
@param event the event
@param suggestion the suggestion object | [
"Triggered",
"when",
"a",
"suggestion",
"from",
"the",
"dropdown",
"menu",
"is",
"selected",
"."
] | train | https://github.com/gwtbootstrap3/gwtbootstrap3-extras/blob/8e42aaffd2a082e9cb23a14c37a3c87b7cbdfa94/src/main/java/org/gwtbootstrap3/extras/typeahead/client/ui/Typeahead.java#L200-L202 |
BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/abbvGapsHmm/AbbvGapsHmmForwardEvaluator.java | AbbvGapsHmmForwardEvaluator.getPartialEndedWord | protected static String getPartialEndedWord(String str, int pos) {
"""
If pos is ending a word in str: returns this word.
Else: returns null;
"""
assert(pos < str.length() && pos >= 0);
if( posIsAtWord(str, pos) ){
int prevSpace = findLastNonLetterOrDigit(str, pos);
return str.substring(prevSpace+... | java | protected static String getPartialEndedWord(String str, int pos){
assert(pos < str.length() && pos >= 0);
if( posIsAtWord(str, pos) ){
int prevSpace = findLastNonLetterOrDigit(str, pos);
return str.substring(prevSpace+1, pos+1);
}
return null;
} | [
"protected",
"static",
"String",
"getPartialEndedWord",
"(",
"String",
"str",
",",
"int",
"pos",
")",
"{",
"assert",
"(",
"pos",
"<",
"str",
".",
"length",
"(",
")",
"&&",
"pos",
">=",
"0",
")",
";",
"if",
"(",
"posIsAtWord",
"(",
"str",
",",
"pos",
... | If pos is ending a word in str: returns this word.
Else: returns null; | [
"If",
"pos",
"is",
"ending",
"a",
"word",
"in",
"str",
":",
"returns",
"this",
"word",
".",
"Else",
":",
"returns",
"null",
";"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/abbvGapsHmm/AbbvGapsHmmForwardEvaluator.java#L129-L138 |
mapsforge/mapsforge | mapsforge-map-android/src/main/java/org/mapsforge/map/android/util/AndroidUtil.java | AndroidUtil.createExternalStorageTileCache | public static TileCache createExternalStorageTileCache(Context c, String id, int firstLevelSize, int tileSize) {
"""
Utility function to create a two-level tile cache along with its backends.
This is the compatibility version that by default creates a non-persistent cache.
@param c the Android con... | java | public static TileCache createExternalStorageTileCache(Context c, String id, int firstLevelSize, int tileSize) {
return createExternalStorageTileCache(c, id, firstLevelSize, tileSize, false);
} | [
"public",
"static",
"TileCache",
"createExternalStorageTileCache",
"(",
"Context",
"c",
",",
"String",
"id",
",",
"int",
"firstLevelSize",
",",
"int",
"tileSize",
")",
"{",
"return",
"createExternalStorageTileCache",
"(",
"c",
",",
"id",
",",
"firstLevelSize",
","... | Utility function to create a two-level tile cache along with its backends.
This is the compatibility version that by default creates a non-persistent cache.
@param c the Android context
@param id name for the directory, which will be created as a subdirectory of the default cache directory (as... | [
"Utility",
"function",
"to",
"create",
"a",
"two",
"-",
"level",
"tile",
"cache",
"along",
"with",
"its",
"backends",
".",
"This",
"is",
"the",
"compatibility",
"version",
"that",
"by",
"default",
"creates",
"a",
"non",
"-",
"persistent",
"cache",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-android/src/main/java/org/mapsforge/map/android/util/AndroidUtil.java#L66-L68 |
craftercms/commons | utilities/src/main/java/org/craftercms/commons/http/HttpUtils.java | HttpUtils.addValues | public static void addValues(String key, Collection<String> values, MultiValueMap<String, String> params) {
"""
Adds a collection of param values to a params map. If the collection is null, nothing is done.
@param key the param key
@param values the collection of param values
@param params the params map
... | java | public static void addValues(String key, Collection<String> values, MultiValueMap<String, String> params) {
if (values != null) {
for (String value : values) {
params.add(key, value);
}
}
} | [
"public",
"static",
"void",
"addValues",
"(",
"String",
"key",
",",
"Collection",
"<",
"String",
">",
"values",
",",
"MultiValueMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"{",
"if",
"(",
"values",
"!=",
"null",
")",
"{",
"for",
"(",
"Strin... | Adds a collection of param values to a params map. If the collection is null, nothing is done.
@param key the param key
@param values the collection of param values
@param params the params map | [
"Adds",
"a",
"collection",
"of",
"param",
"values",
"to",
"a",
"params",
"map",
".",
"If",
"the",
"collection",
"is",
"null",
"nothing",
"is",
"done",
"."
] | train | https://github.com/craftercms/commons/blob/3074fe49e56c2a4aae0832f40b17ae563335dc83/utilities/src/main/java/org/craftercms/commons/http/HttpUtils.java#L198-L204 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSRdbManagedConnectionImpl.java | WSRdbManagedConnectionImpl.setTypeMap | public final void setTypeMap(Map<String, Class<?>> typeMap) throws SQLException {
"""
Updates the value of the typeMap property.
@param typeMap the new type map.
"""
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(this, tc, "Set TypeMap to " + typeMap);
... | java | public final void setTypeMap(Map<String, Class<?>> typeMap) throws SQLException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(this, tc, "Set TypeMap to " + typeMap);
try{
sqlConn.setTypeMap(typeMap);
} catch(SQLFeatureNotSupportedExcept... | [
"public",
"final",
"void",
"setTypeMap",
"(",
"Map",
"<",
"String",
",",
"Class",
"<",
"?",
">",
">",
"typeMap",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
... | Updates the value of the typeMap property.
@param typeMap the new type map. | [
"Updates",
"the",
"value",
"of",
"the",
"typeMap",
"property",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/WSRdbManagedConnectionImpl.java#L4174-L4192 |
lucee/Lucee | core/src/main/java/lucee/runtime/converter/ScriptConverter.java | ScriptConverter._serializeQuery | private void _serializeQuery(Query query, StringBuilder sb, Set<Object> done) throws ConverterException {
"""
serialize a Query
@param query Query to serialize
@param sb
@param done
@throws ConverterException
"""
// Collection.Key[] keys = query.keys();
Iterator<Key> it = query.keyIterator();
Key k;
... | java | private void _serializeQuery(Query query, StringBuilder sb, Set<Object> done) throws ConverterException {
// Collection.Key[] keys = query.keys();
Iterator<Key> it = query.keyIterator();
Key k;
sb.append(goIn());
sb.append("query(");
deep++;
boolean oDoIt = false;
int len = query.getRecordcount();
while (it.... | [
"private",
"void",
"_serializeQuery",
"(",
"Query",
"query",
",",
"StringBuilder",
"sb",
",",
"Set",
"<",
"Object",
">",
"done",
")",
"throws",
"ConverterException",
"{",
"// Collection.Key[] keys = query.keys();",
"Iterator",
"<",
"Key",
">",
"it",
"=",
"query",
... | serialize a Query
@param query Query to serialize
@param sb
@param done
@throws ConverterException | [
"serialize",
"a",
"Query"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/converter/ScriptConverter.java#L365-L402 |
phax/ph-datetime | ph-holiday/src/main/java/com/helger/holiday/mgr/XMLHolidayManager.java | XMLHolidayManager._createConfigurationHierarchy | @Nonnull
private static CalendarHierarchy _createConfigurationHierarchy (@Nonnull final Configuration aConfig,
@Nullable final CalendarHierarchy aParent) {
"""
Creates the configuration hierarchy for the provided configuration.
@param aConfig
... | java | @Nonnull
private static CalendarHierarchy _createConfigurationHierarchy (@Nonnull final Configuration aConfig,
@Nullable final CalendarHierarchy aParent)
{
final ECountry eCountry = ECountry.getFromIDOrNull (aConfig.getHierarchy ());
final Ca... | [
"@",
"Nonnull",
"private",
"static",
"CalendarHierarchy",
"_createConfigurationHierarchy",
"(",
"@",
"Nonnull",
"final",
"Configuration",
"aConfig",
",",
"@",
"Nullable",
"final",
"CalendarHierarchy",
"aParent",
")",
"{",
"final",
"ECountry",
"eCountry",
"=",
"ECountr... | Creates the configuration hierarchy for the provided configuration.
@param aConfig
@return configuration hierarchy | [
"Creates",
"the",
"configuration",
"hierarchy",
"for",
"the",
"provided",
"configuration",
"."
] | train | https://github.com/phax/ph-datetime/blob/cfaff01cb76d9affb934800ff55734b5a7d8983e/ph-holiday/src/main/java/com/helger/holiday/mgr/XMLHolidayManager.java#L248-L260 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java | TransformerImpl.getOutputProperty | public String getOutputProperty(String qnameString)
throws IllegalArgumentException {
"""
Get an output property that is in effect for the
transformation. The property specified may be a property
that was set with setOutputProperty, or it may be a
property specified in the stylesheet.
NEEDSDOC @pa... | java | public String getOutputProperty(String qnameString)
throws IllegalArgumentException
{
String value = null;
OutputProperties props = getOutputFormat();
value = props.getProperty(qnameString);
if (null == value)
{
if (!OutputProperties.isLegalPropertyKey(qnameString))
thro... | [
"public",
"String",
"getOutputProperty",
"(",
"String",
"qnameString",
")",
"throws",
"IllegalArgumentException",
"{",
"String",
"value",
"=",
"null",
";",
"OutputProperties",
"props",
"=",
"getOutputFormat",
"(",
")",
";",
"value",
"=",
"props",
".",
"getProperty... | Get an output property that is in effect for the
transformation. The property specified may be a property
that was set with setOutputProperty, or it may be a
property specified in the stylesheet.
NEEDSDOC @param qnameString
@return The string value of the output property, or null
if no property was found.
@throws I... | [
"Get",
"an",
"output",
"property",
"that",
"is",
"in",
"effect",
"for",
"the",
"transformation",
".",
"The",
"property",
"specified",
"may",
"be",
"a",
"property",
"that",
"was",
"set",
"with",
"setOutputProperty",
"or",
"it",
"may",
"be",
"a",
"property",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L720-L737 |
biouno/pbs-java-api | src/main/java/com/tupilabs/pbs/PBS.java | PBS.traceJob | public static CommandOutput traceJob(String jobId, int numberOfDays, boolean quiet) {
"""
PBS tracejob command.
<p>
Equivalent to tracejob -n [numberOfDays] [jobId]
@param jobId job id
@param numberOfDays number of days to look for the job
@param quiet quiet mode flag
@return tracejob output
"""
... | java | public static CommandOutput traceJob(String jobId, int numberOfDays, boolean quiet) {
final CommandLine cmdLine = new CommandLine(COMMAND_TRACEJOB);
cmdLine.addArgument(PARAMETER_NUMBER_OF_DAYS);
cmdLine.addArgument(Integer.toString(numberOfDays));
if (quiet) {
cmdLine.addArg... | [
"public",
"static",
"CommandOutput",
"traceJob",
"(",
"String",
"jobId",
",",
"int",
"numberOfDays",
",",
"boolean",
"quiet",
")",
"{",
"final",
"CommandLine",
"cmdLine",
"=",
"new",
"CommandLine",
"(",
"COMMAND_TRACEJOB",
")",
";",
"cmdLine",
".",
"addArgument"... | PBS tracejob command.
<p>
Equivalent to tracejob -n [numberOfDays] [jobId]
@param jobId job id
@param numberOfDays number of days to look for the job
@param quiet quiet mode flag
@return tracejob output | [
"PBS",
"tracejob",
"command",
".",
"<p",
">",
"Equivalent",
"to",
"tracejob",
"-",
"n",
"[",
"numberOfDays",
"]",
"[",
"jobId",
"]"
] | train | https://github.com/biouno/pbs-java-api/blob/f6dd96ab59ff5ac394e193a2bbc224cc611b92cb/src/main/java/com/tupilabs/pbs/PBS.java#L658-L687 |
wildfly-swarm-archive/ARCHIVE-wildfly-swarm | batch-jberet/api/src/main/java/org/wildfly/swarm/batch/jberet/BatchFraction.java | BatchFraction.defaultJobRepository | public BatchFraction defaultJobRepository(final String name, final DatasourcesFraction datasource) {
"""
Adds a new JDBC job repository and sets it as the default job repository.
@param name the name for the JDBC job repository
@param datasource the datasource to use to connect to the database
@return t... | java | public BatchFraction defaultJobRepository(final String name, final DatasourcesFraction datasource) {
jdbcJobRepository(name, datasource);
return defaultJobRepository(name);
} | [
"public",
"BatchFraction",
"defaultJobRepository",
"(",
"final",
"String",
"name",
",",
"final",
"DatasourcesFraction",
"datasource",
")",
"{",
"jdbcJobRepository",
"(",
"name",
",",
"datasource",
")",
";",
"return",
"defaultJobRepository",
"(",
"name",
")",
";",
... | Adds a new JDBC job repository and sets it as the default job repository.
@param name the name for the JDBC job repository
@param datasource the datasource to use to connect to the database
@return this fraction | [
"Adds",
"a",
"new",
"JDBC",
"job",
"repository",
"and",
"sets",
"it",
"as",
"the",
"default",
"job",
"repository",
"."
] | train | https://github.com/wildfly-swarm-archive/ARCHIVE-wildfly-swarm/blob/28ef71bcfa743a7267666e0ed2919c37b356c09b/batch-jberet/api/src/main/java/org/wildfly/swarm/batch/jberet/BatchFraction.java#L108-L111 |
ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/process/ProcessListenerEx.java | ProcessListenerEx.asUnsigned | public short asUnsigned(ProcessEvent e, String scale) throws KNXFormatException {
"""
Returns the ASDU of the received process event as unsigned 8 Bit datapoint value.
<p>
This method has to be invoked manually by the user (either in
{@link #groupReadResponse(ProcessEvent)} or
{@link ProcessListener#groupWrite... | java | public short asUnsigned(ProcessEvent e, String scale) throws KNXFormatException
{
final DPTXlator8BitUnsigned t = new DPTXlator8BitUnsigned(scale);
t.setData(e.getASDU());
return t.getValueUnsigned();
} | [
"public",
"short",
"asUnsigned",
"(",
"ProcessEvent",
"e",
",",
"String",
"scale",
")",
"throws",
"KNXFormatException",
"{",
"final",
"DPTXlator8BitUnsigned",
"t",
"=",
"new",
"DPTXlator8BitUnsigned",
"(",
"scale",
")",
";",
"t",
".",
"setData",
"(",
"e",
".",... | Returns the ASDU of the received process event as unsigned 8 Bit datapoint value.
<p>
This method has to be invoked manually by the user (either in
{@link #groupReadResponse(ProcessEvent)} or
{@link ProcessListener#groupWrite(ProcessEvent)}), depending on the received
datapoint type.
@param e the process event with th... | [
"Returns",
"the",
"ASDU",
"of",
"the",
"received",
"process",
"event",
"as",
"unsigned",
"8",
"Bit",
"datapoint",
"value",
".",
"<p",
">",
"This",
"method",
"has",
"to",
"be",
"invoked",
"manually",
"by",
"the",
"user",
"(",
"either",
"in",
"{",
"@link",... | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/process/ProcessListenerEx.java#L149-L154 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLBuilder.java | JQLBuilder.defineWhereStatement | private static <L extends Annotation> String defineWhereStatement(final SQLiteModelMethod method, final JQL jql, Class<L> annotation, Map<JQLDynamicStatementType, String> dynamicReplace) {
"""
Define WHERE statement.
@param <L>
the generic type
@param method
the method
@param jql
the jql
@param annotation... | java | private static <L extends Annotation> String defineWhereStatement(final SQLiteModelMethod method, final JQL jql, Class<L> annotation, Map<JQLDynamicStatementType, String> dynamicReplace) {
StringBuilder builder = new StringBuilder();
String where = AnnotationUtility.extractAsString(method.getElement(), annotation,... | [
"private",
"static",
"<",
"L",
"extends",
"Annotation",
">",
"String",
"defineWhereStatement",
"(",
"final",
"SQLiteModelMethod",
"method",
",",
"final",
"JQL",
"jql",
",",
"Class",
"<",
"L",
">",
"annotation",
",",
"Map",
"<",
"JQLDynamicStatementType",
",",
... | Define WHERE statement.
@param <L>
the generic type
@param method
the method
@param jql
the jql
@param annotation
the annotation
@param dynamicReplace
the dynamic replace
@return the string | [
"Define",
"WHERE",
"statement",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/grammars/jql/JQLBuilder.java#L1033-L1060 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/json/JsonParser.java | JsonParser.parseArrayAndClose | @Beta
public final <T> Collection<T> parseArrayAndClose(
Class<?> destinationCollectionClass,
Class<T> destinationItemClass,
CustomizeJsonParser customizeParser)
throws IOException {
"""
{@link Beta} <br>
Parse a JSON Array from the given JSON parser (which is closed after parsing comple... | java | @Beta
public final <T> Collection<T> parseArrayAndClose(
Class<?> destinationCollectionClass,
Class<T> destinationItemClass,
CustomizeJsonParser customizeParser)
throws IOException {
try {
return parseArray(destinationCollectionClass, destinationItemClass, customizeParser);
} fin... | [
"@",
"Beta",
"public",
"final",
"<",
"T",
">",
"Collection",
"<",
"T",
">",
"parseArrayAndClose",
"(",
"Class",
"<",
"?",
">",
"destinationCollectionClass",
",",
"Class",
"<",
"T",
">",
"destinationItemClass",
",",
"CustomizeJsonParser",
"customizeParser",
")",
... | {@link Beta} <br>
Parse a JSON Array from the given JSON parser (which is closed after parsing completes) into
the given destination collection, optionally using the given parser customizer.
@param destinationCollectionClass class of destination collection (must have a public default
constructor)
@param destinationIte... | [
"{",
"@link",
"Beta",
"}",
"<br",
">",
"Parse",
"a",
"JSON",
"Array",
"from",
"the",
"given",
"JSON",
"parser",
"(",
"which",
"is",
"closed",
"after",
"parsing",
"completes",
")",
"into",
"the",
"given",
"destination",
"collection",
"optionally",
"using",
... | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java#L498-L509 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/LibraryLoader.java | LibraryLoader.findLibraryURL | @Pure
public static URL findLibraryURL(String libName) {
"""
Replies the URL for the specified library.
@param libName is the name of the library
@return the URL where the specified library was located.
"""
return findLibraryURL(null, libName, null, null);
} | java | @Pure
public static URL findLibraryURL(String libName) {
return findLibraryURL(null, libName, null, null);
} | [
"@",
"Pure",
"public",
"static",
"URL",
"findLibraryURL",
"(",
"String",
"libName",
")",
"{",
"return",
"findLibraryURL",
"(",
"null",
",",
"libName",
",",
"null",
",",
"null",
")",
";",
"}"
] | Replies the URL for the specified library.
@param libName is the name of the library
@return the URL where the specified library was located. | [
"Replies",
"the",
"URL",
"for",
"the",
"specified",
"library",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/LibraryLoader.java#L233-L236 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/settings/checkout/PaymentSettingsUrl.java | PaymentSettingsUrl.getThirdPartyPaymentWorkflowWithValuesUrl | public static MozuUrl getThirdPartyPaymentWorkflowWithValuesUrl(String fullyQualifiedName, String responseFields) {
"""
Get Resource Url for GetThirdPartyPaymentWorkflowWithValues
@param fullyQualifiedName Fully qualified name of the attribute for the third-party payment workflow.
@param responseFields Filtering... | java | public static MozuUrl getThirdPartyPaymentWorkflowWithValuesUrl(String fullyQualifiedName, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/settings/checkout/paymentsettings/thirdpartyworkflow/{fullyQualifiedName}?responseFields={responseFields}");
formatter.formatUrl("fullyQual... | [
"public",
"static",
"MozuUrl",
"getThirdPartyPaymentWorkflowWithValuesUrl",
"(",
"String",
"fullyQualifiedName",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/settings/checkout/paymentsettings/thirdpartyw... | Get Resource Url for GetThirdPartyPaymentWorkflowWithValues
@param fullyQualifiedName Fully qualified name of the attribute for the third-party payment workflow.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should... | [
"Get",
"Resource",
"Url",
"for",
"GetThirdPartyPaymentWorkflowWithValues"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/settings/checkout/PaymentSettingsUrl.java#L22-L28 |
groupe-sii/ogham | ogham-sms-ovh/src/main/java/fr/sii/ogham/sms/sender/impl/OvhSmsSender.java | OvhSmsSender.handleResponse | private void handleResponse(Sms message, Response response) throws IOException, JsonProcessingException, MessageNotSentException {
"""
Handle OVH response. If status provided in response is less than 200,
then the message has been sent. Otherwise, the message has not been sent.
@param message
the SMS to send
... | java | private void handleResponse(Sms message, Response response) throws IOException, JsonProcessingException, MessageNotSentException {
if (response.getStatus().isSuccess()) {
JsonNode json = mapper.readTree(response.getBody());
int ovhStatus = json.get("status").asInt();
// 100 <= ovh status < 200 ====> OK -> ju... | [
"private",
"void",
"handleResponse",
"(",
"Sms",
"message",
",",
"Response",
"response",
")",
"throws",
"IOException",
",",
"JsonProcessingException",
",",
"MessageNotSentException",
"{",
"if",
"(",
"response",
".",
"getStatus",
"(",
")",
".",
"isSuccess",
"(",
... | Handle OVH response. If status provided in response is less than 200,
then the message has been sent. Otherwise, the message has not been sent.
@param message
the SMS to send
@param response
the received response from OVH API
@throws IOException
when the response couldn't be read
@throws JsonProcessingException
when t... | [
"Handle",
"OVH",
"response",
".",
"If",
"status",
"provided",
"in",
"response",
"is",
"less",
"than",
"200",
"then",
"the",
"message",
"has",
"been",
"sent",
".",
"Otherwise",
"the",
"message",
"has",
"not",
"been",
"sent",
"."
] | train | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-sms-ovh/src/main/java/fr/sii/ogham/sms/sender/impl/OvhSmsSender.java#L125-L147 |
SG-O/miIO | src/main/java/de/sg_o/app/miio/vacuum/Vacuum.java | Vacuum.goTo | public boolean goTo(int[] p) throws CommandExecutionException {
"""
Go to the specified position on the map.
@param p The position to move to in millimeters. 25600 millimeter both in x and y is the center of the map. The origin of the map is 0 millimeters in x and y.
@return True if the command has been received... | java | public boolean goTo(int[] p) throws CommandExecutionException {
if (p == null) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS);
if (p.length != 2) throw new CommandExecutionException(CommandExecutionException.Error.INVALID_PARAMETERS);
JSONArray payload = ... | [
"public",
"boolean",
"goTo",
"(",
"int",
"[",
"]",
"p",
")",
"throws",
"CommandExecutionException",
"{",
"if",
"(",
"p",
"==",
"null",
")",
"throw",
"new",
"CommandExecutionException",
"(",
"CommandExecutionException",
".",
"Error",
".",
"INVALID_PARAMETERS",
")... | Go to the specified position on the map.
@param p The position to move to in millimeters. 25600 millimeter both in x and y is the center of the map. The origin of the map is 0 millimeters in x and y.
@return True if the command has been received correctly.
@throws CommandExecutionException When there has been a error d... | [
"Go",
"to",
"the",
"specified",
"position",
"on",
"the",
"map",
"."
] | train | https://github.com/SG-O/miIO/blob/f352dbd2a699d2cdb1b412ca5e6cbb0c38ca779b/src/main/java/de/sg_o/app/miio/vacuum/Vacuum.java#L301-L308 |
SonarSource/sonarqube | sonar-plugin-api/src/main/java/org/sonar/api/utils/text/JsonWriter.java | JsonWriter.propDate | public JsonWriter propDate(String name, @Nullable Date value) {
"""
Encodes the property name and date value (ISO format).
Output is for example <code>"theDate":"2013-01-24"</code>.
@throws org.sonar.api.utils.text.WriterException on any failure
"""
return name(name).valueDate(value);
} | java | public JsonWriter propDate(String name, @Nullable Date value) {
return name(name).valueDate(value);
} | [
"public",
"JsonWriter",
"propDate",
"(",
"String",
"name",
",",
"@",
"Nullable",
"Date",
"value",
")",
"{",
"return",
"name",
"(",
"name",
")",
".",
"valueDate",
"(",
"value",
")",
";",
"}"
] | Encodes the property name and date value (ISO format).
Output is for example <code>"theDate":"2013-01-24"</code>.
@throws org.sonar.api.utils.text.WriterException on any failure | [
"Encodes",
"the",
"property",
"name",
"and",
"date",
"value",
"(",
"ISO",
"format",
")",
".",
"Output",
"is",
"for",
"example",
"<code",
">",
"theDate",
":",
"2013",
"-",
"01",
"-",
"24",
"<",
"/",
"code",
">",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-plugin-api/src/main/java/org/sonar/api/utils/text/JsonWriter.java#L341-L343 |
xwiki/xwiki-rendering | xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XMLWikiPrinter.java | XMLWikiPrinter.printXMLElement | public void printXMLElement(String name, String[][] attributes) {
"""
Print the xml element. In the form {@code <name att1="value1" att2="value2"/>}.
@param name the xml element to print
@param attributes the xml attributes of the element to print
"""
Element element = new DefaultElement(name);
... | java | public void printXMLElement(String name, String[][] attributes)
{
Element element = new DefaultElement(name);
if (attributes != null && attributes.length > 0) {
for (String[] entry : attributes) {
element.addAttribute(entry[0], entry[1]);
}
}
... | [
"public",
"void",
"printXMLElement",
"(",
"String",
"name",
",",
"String",
"[",
"]",
"[",
"]",
"attributes",
")",
"{",
"Element",
"element",
"=",
"new",
"DefaultElement",
"(",
"name",
")",
";",
"if",
"(",
"attributes",
"!=",
"null",
"&&",
"attributes",
"... | Print the xml element. In the form {@code <name att1="value1" att2="value2"/>}.
@param name the xml element to print
@param attributes the xml attributes of the element to print | [
"Print",
"the",
"xml",
"element",
".",
"In",
"the",
"form",
"{",
"@code",
"<name",
"att1",
"=",
"value1",
"att2",
"=",
"value2",
"/",
">",
"}",
"."
] | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-xml/src/main/java/org/xwiki/rendering/renderer/printer/XMLWikiPrinter.java#L99-L114 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/config/xml/MessageValidatorRegistryParser.java | MessageValidatorRegistryParser.parseValidators | private void parseValidators(BeanDefinitionBuilder builder, Element element) {
"""
Parses all variable definitions and adds those to the bean definition
builder as property value.
@param builder the target bean definition builder.
@param element the source element.
"""
ManagedList validators = new M... | java | private void parseValidators(BeanDefinitionBuilder builder, Element element) {
ManagedList validators = new ManagedList();
for (Element validator : DomUtils.getChildElementsByTagName(element, "validator")) {
if (validator.hasAttribute("ref")) {
validators.add(new RuntimeBean... | [
"private",
"void",
"parseValidators",
"(",
"BeanDefinitionBuilder",
"builder",
",",
"Element",
"element",
")",
"{",
"ManagedList",
"validators",
"=",
"new",
"ManagedList",
"(",
")",
";",
"for",
"(",
"Element",
"validator",
":",
"DomUtils",
".",
"getChildElementsBy... | Parses all variable definitions and adds those to the bean definition
builder as property value.
@param builder the target bean definition builder.
@param element the source element. | [
"Parses",
"all",
"variable",
"definitions",
"and",
"adds",
"those",
"to",
"the",
"bean",
"definition",
"builder",
"as",
"property",
"value",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/MessageValidatorRegistryParser.java#L51-L65 |
Nordstrom/JUnit-Foundation | src/main/java/com/nordstrom/automation/junit/LifecycleHooks.java | LifecycleHooks.installTransformer | public static ClassFileTransformer installTransformer(Instrumentation instrumentation) {
"""
Install the {@code Byte Buddy} byte code transformations that provide test fine-grained test lifecycle hooks.
@param instrumentation {@link Instrumentation} object used to transform JUnit core classes
@return The insta... | java | public static ClassFileTransformer installTransformer(Instrumentation instrumentation) {
final TypeDescription runReflectiveCall = TypePool.Default.ofSystemLoader().describe("com.nordstrom.automation.junit.RunReflectiveCall").resolve();
final TypeDescription finished = TypePool.Default.ofSystemLoader(... | [
"public",
"static",
"ClassFileTransformer",
"installTransformer",
"(",
"Instrumentation",
"instrumentation",
")",
"{",
"final",
"TypeDescription",
"runReflectiveCall",
"=",
"TypePool",
".",
"Default",
".",
"ofSystemLoader",
"(",
")",
".",
"describe",
"(",
"\"com.nordstr... | Install the {@code Byte Buddy} byte code transformations that provide test fine-grained test lifecycle hooks.
@param instrumentation {@link Instrumentation} object used to transform JUnit core classes
@return The installed class file transformer | [
"Install",
"the",
"{",
"@code",
"Byte",
"Buddy",
"}",
"byte",
"code",
"transformations",
"that",
"provide",
"test",
"fine",
"-",
"grained",
"test",
"lifecycle",
"hooks",
"."
] | train | https://github.com/Nordstrom/JUnit-Foundation/blob/f24d91f8677d262c27d18ef29ed633eaac717be5/src/main/java/com/nordstrom/automation/junit/LifecycleHooks.java#L71-L112 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.SymmetricChiSquareDivergence | public static double SymmetricChiSquareDivergence(double[] p, double[] q) {
"""
Gets the Symmetric Chi-square divergence.
@param p P vector.
@param q Q vector.
@return The Symmetric chi-square divergence between p and q.
"""
double r = 0;
for (int i = 0; i < p.length; i++) {
do... | java | public static double SymmetricChiSquareDivergence(double[] p, double[] q) {
double r = 0;
for (int i = 0; i < p.length; i++) {
double den = p[i] * q[i];
if (den != 0) {
double p1 = p[i] - q[i];
double p2 = p[i] + q[i];
r += (p1 * p1... | [
"public",
"static",
"double",
"SymmetricChiSquareDivergence",
"(",
"double",
"[",
"]",
"p",
",",
"double",
"[",
"]",
"q",
")",
"{",
"double",
"r",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"p",
".",
"length",
";",
"i",
"++",... | Gets the Symmetric Chi-square divergence.
@param p P vector.
@param q Q vector.
@return The Symmetric chi-square divergence between p and q. | [
"Gets",
"the",
"Symmetric",
"Chi",
"-",
"square",
"divergence",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L851-L863 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/activerecord/dialect/Dialect.java | Dialect.processGeneratedBigIntegerKey | protected void processGeneratedBigIntegerKey(Model<?> model, String pKey, Object v) {
"""
mysql 数据库的 bigint unsigned 对应的 java 类型为 BigInteger
但是 rs.getObject(1) 返回值为 Long 型,造成 model.save() 以后
model.getId() 时的类型转换异常
"""
if (v instanceof BigInteger) {
model.set(pKey, (BigInteger)v);
} else if (v inst... | java | protected void processGeneratedBigIntegerKey(Model<?> model, String pKey, Object v) {
if (v instanceof BigInteger) {
model.set(pKey, (BigInteger)v);
} else if (v instanceof Number) {
Number n = (Number)v;
model.set(pKey, BigInteger.valueOf(n.longValue()));
} else {
model.set(pKey, v);
}
} | [
"protected",
"void",
"processGeneratedBigIntegerKey",
"(",
"Model",
"<",
"?",
">",
"model",
",",
"String",
"pKey",
",",
"Object",
"v",
")",
"{",
"if",
"(",
"v",
"instanceof",
"BigInteger",
")",
"{",
"model",
".",
"set",
"(",
"pKey",
",",
"(",
"BigInteger... | mysql 数据库的 bigint unsigned 对应的 java 类型为 BigInteger
但是 rs.getObject(1) 返回值为 Long 型,造成 model.save() 以后
model.getId() 时的类型转换异常 | [
"mysql",
"数据库的",
"bigint",
"unsigned",
"对应的",
"java",
"类型为",
"BigInteger",
"但是",
"rs",
".",
"getObject",
"(",
"1",
")",
"返回值为",
"Long",
"型,造成",
"model",
".",
"save",
"()",
"以后",
"model",
".",
"getId",
"()",
"时的类型转换异常"
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/dialect/Dialect.java#L174-L183 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.getQualifiedClassLink | public Content getQualifiedClassLink(LinkInfoImpl.Kind context, Element element) {
"""
Get the class link.
@param context the id of the context where the link will be added
@param element to link to
@return a content tree for the link
"""
LinkInfoImpl linkInfoImpl = new LinkInfoImpl(configuration,... | java | public Content getQualifiedClassLink(LinkInfoImpl.Kind context, Element element) {
LinkInfoImpl linkInfoImpl = new LinkInfoImpl(configuration, context, (TypeElement)element);
return getLink(linkInfoImpl.label(utils.getFullyQualifiedName(element)));
} | [
"public",
"Content",
"getQualifiedClassLink",
"(",
"LinkInfoImpl",
".",
"Kind",
"context",
",",
"Element",
"element",
")",
"{",
"LinkInfoImpl",
"linkInfoImpl",
"=",
"new",
"LinkInfoImpl",
"(",
"configuration",
",",
"context",
",",
"(",
"TypeElement",
")",
"element... | Get the class link.
@param context the id of the context where the link will be added
@param element to link to
@return a content tree for the link | [
"Get",
"the",
"class",
"link",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java#L1271-L1274 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java | ContextManager.initItem | private void initItem(IManagedContext<?> item, ISurveyCallback callback) {
"""
Initializes the managed context.
@param item Managed context to initialize.
@param callback Callback to report subscriber responses.
"""
try {
localChangeBegin(item);
if (hasSubject(item.getConte... | java | private void initItem(IManagedContext<?> item, ISurveyCallback callback) {
try {
localChangeBegin(item);
if (hasSubject(item.getContextName())) {
item.setContextItems(contextItems);
} else {
item.init();
}
localChangeE... | [
"private",
"void",
"initItem",
"(",
"IManagedContext",
"<",
"?",
">",
"item",
",",
"ISurveyCallback",
"callback",
")",
"{",
"try",
"{",
"localChangeBegin",
"(",
"item",
")",
";",
"if",
"(",
"hasSubject",
"(",
"item",
".",
"getContextName",
"(",
")",
")",
... | Initializes the managed context.
@param item Managed context to initialize.
@param callback Callback to report subscriber responses. | [
"Initializes",
"the",
"managed",
"context",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/context/ContextManager.java#L223-L238 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/DigestUtils.java | DigestUtils.shaBase32 | public static String shaBase32(final String salt, final String data, final String separator, final boolean chunked) {
"""
Sha base 32 string.
@param salt the salt
@param data the data
@param separator a string separator, if any
@param chunked the chunked
@return the string
"""
val re... | java | public static String shaBase32(final String salt, final String data, final String separator, final boolean chunked) {
val result = rawDigest(MessageDigestAlgorithms.SHA_1, salt, separator == null ? data : data + separator);
return EncodingUtils.encodeBase32(result, chunked);
} | [
"public",
"static",
"String",
"shaBase32",
"(",
"final",
"String",
"salt",
",",
"final",
"String",
"data",
",",
"final",
"String",
"separator",
",",
"final",
"boolean",
"chunked",
")",
"{",
"val",
"result",
"=",
"rawDigest",
"(",
"MessageDigestAlgorithms",
"."... | Sha base 32 string.
@param salt the salt
@param data the data
@param separator a string separator, if any
@param chunked the chunked
@return the string | [
"Sha",
"base",
"32",
"string",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/DigestUtils.java#L111-L114 |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.updateEntity | public EntityResult updateEntity(String guid, Referenceable entity) throws AtlasServiceException {
"""
Supports Partial updates
Updates properties set in the definition for the entity corresponding to guid
@param guid guid
@param entity entity definition
"""
String entityJson = InstanceSerializ... | java | public EntityResult updateEntity(String guid, Referenceable entity) throws AtlasServiceException {
String entityJson = InstanceSerialization.toJson(entity, true);
LOG.debug("Updating entity id {} with {}", guid, entityJson);
JSONObject response = callAPIWithBodyAndParams(API.UPDATE_ENTITY_PARTIA... | [
"public",
"EntityResult",
"updateEntity",
"(",
"String",
"guid",
",",
"Referenceable",
"entity",
")",
"throws",
"AtlasServiceException",
"{",
"String",
"entityJson",
"=",
"InstanceSerialization",
".",
"toJson",
"(",
"entity",
",",
"true",
")",
";",
"LOG",
".",
"... | Supports Partial updates
Updates properties set in the definition for the entity corresponding to guid
@param guid guid
@param entity entity definition | [
"Supports",
"Partial",
"updates",
"Updates",
"properties",
"set",
"in",
"the",
"definition",
"for",
"the",
"entity",
"corresponding",
"to",
"guid"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L517-L522 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/XSLTAttributeDef.java | XSLTAttributeDef.processQNAME | Object processQNAME(
StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner)
throws org.xml.sax.SAXException {
"""
Process an attribute string of type T_QNAME into a QName value.
@param handler non-null reference to current StylesheetHan... | java | Object processQNAME(
StylesheetHandler handler, String uri, String name, String rawName, String value, ElemTemplateElement owner)
throws org.xml.sax.SAXException
{
try
{
QName qname = new QName(value, handler, true);
return qname;
}
catch (Ille... | [
"Object",
"processQNAME",
"(",
"StylesheetHandler",
"handler",
",",
"String",
"uri",
",",
"String",
"name",
",",
"String",
"rawName",
",",
"String",
"value",
",",
"ElemTemplateElement",
"owner",
")",
"throws",
"org",
".",
"xml",
".",
"sax",
".",
"SAXException"... | Process an attribute string of type T_QNAME into a QName value.
@param handler non-null reference to current StylesheetHandler that is constructing the Templates.
@param uri The Namespace URI, or an empty string.
@param name The local name (without prefix), or empty string if not namespace processing.
@param rawName T... | [
"Process",
"an",
"attribute",
"string",
"of",
"type",
"T_QNAME",
"into",
"a",
"QName",
"value",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/XSLTAttributeDef.java#L930-L951 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/info/StorablePropertyAdapter.java | StorablePropertyAdapter.findAdaptMethod | @SuppressWarnings("unchecked")
public Method findAdaptMethod(Class from, Class to) {
"""
Returns an adapt method that supports the given conversion, or null if
none.
"""
Method[] methods = mAdaptMethods;
List<Method> candidates = new ArrayList<Method>(methods.length);
for (int ... | java | @SuppressWarnings("unchecked")
public Method findAdaptMethod(Class from, Class to) {
Method[] methods = mAdaptMethods;
List<Method> candidates = new ArrayList<Method>(methods.length);
for (int i=methods.length; --i>=0; ) {
Method method = methods[i];
if (to.isAs... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Method",
"findAdaptMethod",
"(",
"Class",
"from",
",",
"Class",
"to",
")",
"{",
"Method",
"[",
"]",
"methods",
"=",
"mAdaptMethods",
";",
"List",
"<",
"Method",
">",
"candidates",
"=",
"new",
"... | Returns an adapt method that supports the given conversion, or null if
none. | [
"Returns",
"an",
"adapt",
"method",
"that",
"supports",
"the",
"given",
"conversion",
"or",
"null",
"if",
"none",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/info/StorablePropertyAdapter.java#L264-L280 |
javamelody/javamelody | javamelody-swing/src/main/java/net/bull/javamelody/swing/ImageFileChooser.java | ImageFileChooser.chooseImage | public static File chooseImage(Component parent, boolean openOrSave, String fileName) {
"""
Ouvre la boîte de dialogue de choix de fichier image.
<br>Retourne le fichier choisi, ou null si annulé.
@param parent Component
@param openOrSave boolean
@param fileName String
@return File
"""
final int result... | java | public static File chooseImage(Component parent, boolean openOrSave, String fileName) {
final int result;
if (fileName != null) {
IMAGE_FILE_CHOOSER.setSelectedFile(new File(fileName));
}
if (openOrSave) {
result = IMAGE_FILE_CHOOSER.showOpenDialog(parent);
} else {
result = IMAGE_FILE_CHOOSE... | [
"public",
"static",
"File",
"chooseImage",
"(",
"Component",
"parent",
",",
"boolean",
"openOrSave",
",",
"String",
"fileName",
")",
"{",
"final",
"int",
"result",
";",
"if",
"(",
"fileName",
"!=",
"null",
")",
"{",
"IMAGE_FILE_CHOOSER",
".",
"setSelectedFile"... | Ouvre la boîte de dialogue de choix de fichier image.
<br>Retourne le fichier choisi, ou null si annulé.
@param parent Component
@param openOrSave boolean
@param fileName String
@return File | [
"Ouvre",
"la",
"boîte",
"de",
"dialogue",
"de",
"choix",
"de",
"fichier",
"image",
".",
"<br",
">",
"Retourne",
"le",
"fichier",
"choisi",
"ou",
"null",
"si",
"annulé",
"."
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-swing/src/main/java/net/bull/javamelody/swing/ImageFileChooser.java#L70-L86 |
nutzam/nutzboot | nutzboot-starter/nutzboot-starter-tio-websocket/src/main/java/org/nutz/boot/starter/tio/websocketbean/TioWebsocketMsgHandler.java | TioWebsocketMsgHandler.onText | @Override
public Object onText(WsRequest wsRequest, String text, ChannelContext channelContext) throws Exception {
"""
receive text
@param wsRequest wsRequest
@param text String
@param channelContext channelContext
@return AnyObject
@throws Exception e
"""
log.debug("onText");
TioWebso... | java | @Override
public Object onText(WsRequest wsRequest, String text, ChannelContext channelContext) throws Exception {
log.debug("onText");
TioWebsocketMethodMapper onText = methods.getOnText();
if (onText != null) {
onText.getMethod().invoke(onText.getInstance(), channelContext, tex... | [
"@",
"Override",
"public",
"Object",
"onText",
"(",
"WsRequest",
"wsRequest",
",",
"String",
"text",
",",
"ChannelContext",
"channelContext",
")",
"throws",
"Exception",
"{",
"log",
".",
"debug",
"(",
"\"onText\"",
")",
";",
"TioWebsocketMethodMapper",
"onText",
... | receive text
@param wsRequest wsRequest
@param text String
@param channelContext channelContext
@return AnyObject
@throws Exception e | [
"receive",
"text"
] | train | https://github.com/nutzam/nutzboot/blob/fd33fd4fdce058eab594f28e4d3202f997e3c66a/nutzboot-starter/nutzboot-starter-tio-websocket/src/main/java/org/nutz/boot/starter/tio/websocketbean/TioWebsocketMsgHandler.java#L116-L130 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepsInner.java | BuildStepsInner.beginCreate | public BuildStepInner beginCreate(String resourceGroupName, String registryName, String buildTaskName, String stepName, BuildStepProperties properties) {
"""
Creates a build step for a build task.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryNa... | java | public BuildStepInner beginCreate(String resourceGroupName, String registryName, String buildTaskName, String stepName, BuildStepProperties properties) {
return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName, properties).toBlocking().single().body();
} | [
"public",
"BuildStepInner",
"beginCreate",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"buildTaskName",
",",
"String",
"stepName",
",",
"BuildStepProperties",
"properties",
")",
"{",
"return",
"beginCreateWithServiceResponseAsync",
"(... | Creates a build step for a build task.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param buildTaskName The name of the container registry build task.
@param stepName The name of a build step for a container re... | [
"Creates",
"a",
"build",
"step",
"for",
"a",
"build",
"task",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepsInner.java#L619-L621 |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/MutableBigInteger.java | MutableBigInteger.mulsub | private int mulsub(int[] q, int[] a, int x, int len, int offset) {
"""
This method is used for division. It multiplies an n word input a by one
word input x, and subtracts the n word product from q. This is needed
when subtracting qhat*divisor from dividend.
"""
long xLong = x & LONG_MASK;
lo... | java | private int mulsub(int[] q, int[] a, int x, int len, int offset) {
long xLong = x & LONG_MASK;
long carry = 0;
offset += len;
for (int j=len-1; j >= 0; j--) {
long product = (a[j] & LONG_MASK) * xLong + carry;
long difference = q[offset] - product;
q[... | [
"private",
"int",
"mulsub",
"(",
"int",
"[",
"]",
"q",
",",
"int",
"[",
"]",
"a",
",",
"int",
"x",
",",
"int",
"len",
",",
"int",
"offset",
")",
"{",
"long",
"xLong",
"=",
"x",
"&",
"LONG_MASK",
";",
"long",
"carry",
"=",
"0",
";",
"offset",
... | This method is used for division. It multiplies an n word input a by one
word input x, and subtracts the n word product from q. This is needed
when subtracting qhat*divisor from dividend. | [
"This",
"method",
"is",
"used",
"for",
"division",
".",
"It",
"multiplies",
"an",
"n",
"word",
"input",
"a",
"by",
"one",
"word",
"input",
"x",
"and",
"subtracts",
"the",
"n",
"word",
"product",
"from",
"q",
".",
"This",
"is",
"needed",
"when",
"subtra... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/MutableBigInteger.java#L637-L651 |
auth0/auth0-spring-security-api | lib/src/main/java/com/auth0/spring/security/api/JwtWebSecurityConfigurer.java | JwtWebSecurityConfigurer.forRS256 | @SuppressWarnings( {
"""
Configures application authorization for JWT signed with RS256.
Will try to validate the token using the public key downloaded from "$issuer/.well-known/jwks.json"
and matched by the value of {@code kid} of the JWT header
@param audience identifier of the API and must match the {@code a... | java | @SuppressWarnings({"WeakerAccess", "SameParameterValue"})
public static JwtWebSecurityConfigurer forRS256(String audience, String issuer) {
final JwkProvider jwkProvider = new JwkProviderBuilder(issuer).build();
return new JwtWebSecurityConfigurer(audience, issuer, new JwtAuthenticationProvider(jwkP... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"SameParameterValue\"",
"}",
")",
"public",
"static",
"JwtWebSecurityConfigurer",
"forRS256",
"(",
"String",
"audience",
",",
"String",
"issuer",
")",
"{",
"final",
"JwkProvider",
"jwkProvider",
"=",
"new... | Configures application authorization for JWT signed with RS256.
Will try to validate the token using the public key downloaded from "$issuer/.well-known/jwks.json"
and matched by the value of {@code kid} of the JWT header
@param audience identifier of the API and must match the {@code aud} value in the token
@param iss... | [
"Configures",
"application",
"authorization",
"for",
"JWT",
"signed",
"with",
"RS256",
".",
"Will",
"try",
"to",
"validate",
"the",
"token",
"using",
"the",
"public",
"key",
"downloaded",
"from",
"$issuer",
"/",
".",
"well",
"-",
"known",
"/",
"jwks",
".",
... | train | https://github.com/auth0/auth0-spring-security-api/blob/cebd4daa0125efd4da9e651cf29aa5ebdb147e2b/lib/src/main/java/com/auth0/spring/security/api/JwtWebSecurityConfigurer.java#L33-L37 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/DTDElement.java | DTDElement.createPlaceholder | public static DTDElement createPlaceholder(ReaderConfig cfg, Location loc, PrefixedName name) {
"""
Method called to create a "placeholder" element definition, needed to
contain attribute definitions.
"""
return new DTDElement(loc, name, null, XMLValidator.CONTENT_ALLOW_UNDEFINED,
... | java | public static DTDElement createPlaceholder(ReaderConfig cfg, Location loc, PrefixedName name)
{
return new DTDElement(loc, name, null, XMLValidator.CONTENT_ALLOW_UNDEFINED,
cfg.willSupportNamespaces(), cfg.isXml11());
} | [
"public",
"static",
"DTDElement",
"createPlaceholder",
"(",
"ReaderConfig",
"cfg",
",",
"Location",
"loc",
",",
"PrefixedName",
"name",
")",
"{",
"return",
"new",
"DTDElement",
"(",
"loc",
",",
"name",
",",
"null",
",",
"XMLValidator",
".",
"CONTENT_ALLOW_UNDEFI... | Method called to create a "placeholder" element definition, needed to
contain attribute definitions. | [
"Method",
"called",
"to",
"create",
"a",
"placeholder",
"element",
"definition",
"needed",
"to",
"contain",
"attribute",
"definitions",
"."
] | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/DTDElement.java#L172-L176 |
apache/flink | flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java | FieldParser.nextStringLength | protected static final int nextStringLength(byte[] bytes, int startPos, int length, char delimiter) {
"""
Returns the length of a string. Throws an exception if the column is empty.
@return the length of the string
"""
if (length <= 0) {
throw new IllegalArgumentException("Invalid input: Empty string")... | java | protected static final int nextStringLength(byte[] bytes, int startPos, int length, char delimiter) {
if (length <= 0) {
throw new IllegalArgumentException("Invalid input: Empty string");
}
int limitedLength = 0;
final byte delByte = (byte) delimiter;
while (limitedLength < length && bytes[startPos + limi... | [
"protected",
"static",
"final",
"int",
"nextStringLength",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"startPos",
",",
"int",
"length",
",",
"char",
"delimiter",
")",
"{",
"if",
"(",
"length",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException... | Returns the length of a string. Throws an exception if the column is empty.
@return the length of the string | [
"Returns",
"the",
"length",
"of",
"a",
"string",
".",
"Throws",
"an",
"exception",
"if",
"the",
"column",
"is",
"empty",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/parser/FieldParser.java#L230-L242 |
datumbox/lpsolve | src/main/java/lpsolve/LpSolve.java | LpSolve.putMsgfunc | public void putMsgfunc(MsgListener listener, Object userhandle, int mask) throws LpSolveException {
"""
Register an <code>MsgListener</code> for callback.
@param listener the listener that should be called by lp_solve
@param userhandle an arbitrary object that is passed to the listener on call
"""
msgLi... | java | public void putMsgfunc(MsgListener listener, Object userhandle, int mask) throws LpSolveException {
msgListener = listener;
msgUserhandle = (listener != null) ? userhandle : null;
addLp(this);
registerMsgfunc(mask);
} | [
"public",
"void",
"putMsgfunc",
"(",
"MsgListener",
"listener",
",",
"Object",
"userhandle",
",",
"int",
"mask",
")",
"throws",
"LpSolveException",
"{",
"msgListener",
"=",
"listener",
";",
"msgUserhandle",
"=",
"(",
"listener",
"!=",
"null",
")",
"?",
"userha... | Register an <code>MsgListener</code> for callback.
@param listener the listener that should be called by lp_solve
@param userhandle an arbitrary object that is passed to the listener on call | [
"Register",
"an",
"<code",
">",
"MsgListener<",
"/",
"code",
">",
"for",
"callback",
"."
] | train | https://github.com/datumbox/lpsolve/blob/201b3e99153d907bb99c189e5647bc71a3a1add6/src/main/java/lpsolve/LpSolve.java#L1631-L1636 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/reflection/GobblinConstructorUtils.java | GobblinConstructorUtils.invokeLongestConstructor | public static <T> T invokeLongestConstructor(Class<T> cls, Object... args) throws ReflectiveOperationException {
"""
Returns a new instance of the <code>cls</code> based on a set of arguments. The method will search for a
constructor accepting the first k arguments in <code>args</code> for every k from args.lengt... | java | public static <T> T invokeLongestConstructor(Class<T> cls, Object... args) throws ReflectiveOperationException {
Class<?>[] parameterTypes = new Class[args.length];
for (int i = 0; i < args.length; i++) {
parameterTypes[i] = args[i].getClass();
}
for (int i = args.length; i >= 0; i--) {
if... | [
"public",
"static",
"<",
"T",
">",
"T",
"invokeLongestConstructor",
"(",
"Class",
"<",
"T",
">",
"cls",
",",
"Object",
"...",
"args",
")",
"throws",
"ReflectiveOperationException",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
"=",
"new",
"Class... | Returns a new instance of the <code>cls</code> based on a set of arguments. The method will search for a
constructor accepting the first k arguments in <code>args</code> for every k from args.length to 0, and will
invoke the first constructor found.
For example, {@link #invokeLongestConstructor}(cls, myString, myInt) ... | [
"Returns",
"a",
"new",
"instance",
"of",
"the",
"<code",
">",
"cls<",
"/",
"code",
">",
"based",
"on",
"a",
"set",
"of",
"arguments",
".",
"The",
"method",
"will",
"search",
"for",
"a",
"constructor",
"accepting",
"the",
"first",
"k",
"arguments",
"in",
... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/reflection/GobblinConstructorUtils.java#L77-L94 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/storage/service/WSDLParser.java | WSDLParser.doMessageToTypeJoin | private Message doMessageToTypeJoin(Message msg) throws SAXException {
"""
For each Message, iterate through Message Parts. For each MessagePart,
get partTypeName and break into ns/localName. Lookup to wsdlTypeTbl to
get type info for parts.
"""
for (int i = 0; i < msg.messageParts.length; i++) {
... | java | private Message doMessageToTypeJoin(Message msg) throws SAXException {
for (int i = 0; i < msg.messageParts.length; i++) {
Type schemaType = null;
String nsprefix = null;
String partTypeLocalName = null;
StringTokenizer st =
new StringTokenizer... | [
"private",
"Message",
"doMessageToTypeJoin",
"(",
"Message",
"msg",
")",
"throws",
"SAXException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"msg",
".",
"messageParts",
".",
"length",
";",
"i",
"++",
")",
"{",
"Type",
"schemaType",
"=",
"nu... | For each Message, iterate through Message Parts. For each MessagePart,
get partTypeName and break into ns/localName. Lookup to wsdlTypeTbl to
get type info for parts. | [
"For",
"each",
"Message",
"iterate",
"through",
"Message",
"Parts",
".",
"For",
"each",
"MessagePart",
"get",
"partTypeName",
"and",
"break",
"into",
"ns",
"/",
"localName",
".",
"Lookup",
"to",
"wsdlTypeTbl",
"to",
"get",
"type",
"info",
"for",
"parts",
"."... | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/storage/service/WSDLParser.java#L691-L736 |
ontop/ontop | binding/rdf4j/src/main/java/it/unibz/inf/ontop/rdf4j/repository/impl/OntopVirtualRepository.java | OntopVirtualRepository.getConnection | @Override
public RepositoryConnection getConnection() throws RepositoryException {
"""
Returns a new RepositoryConnection.
(No repository connection sharing for the sake
of thread-safeness)
"""
try {
return new OntopRepositoryConnection(this, getOntopConnection(), inputQueryFactory);
} catch (Excep... | java | @Override
public RepositoryConnection getConnection() throws RepositoryException {
try {
return new OntopRepositoryConnection(this, getOntopConnection(), inputQueryFactory);
} catch (Exception e) {
logger.error("Error creating repo connection: " + e.getMessage());
throw new RepositoryException(e);
}
} | [
"@",
"Override",
"public",
"RepositoryConnection",
"getConnection",
"(",
")",
"throws",
"RepositoryException",
"{",
"try",
"{",
"return",
"new",
"OntopRepositoryConnection",
"(",
"this",
",",
"getOntopConnection",
"(",
")",
",",
"inputQueryFactory",
")",
";",
"}",
... | Returns a new RepositoryConnection.
(No repository connection sharing for the sake
of thread-safeness) | [
"Returns",
"a",
"new",
"RepositoryConnection",
"."
] | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/binding/rdf4j/src/main/java/it/unibz/inf/ontop/rdf4j/repository/impl/OntopVirtualRepository.java#L63-L71 |
alkacon/opencms-core | src/org/opencms/site/CmsSiteManagerImpl.java | CmsSiteManagerImpl.removeSite | public void removeSite(CmsObject cms, CmsSite site) throws CmsException {
"""
Removes a site from the list of configured sites.<p>
@param cms the cms object
@param site the site to remove
@throws CmsException if something goes wrong
"""
// check permissions
if (OpenCms.getRunLevel() > O... | java | public void removeSite(CmsObject cms, CmsSite site) throws CmsException {
// check permissions
if (OpenCms.getRunLevel() > OpenCms.RUNLEVEL_1_CORE_OBJECT) {
// simple unit tests will have runlevel 1 and no CmsObject
OpenCms.getRoleManager().checkRole(cms, CmsRole.DATABASE_MANAGE... | [
"public",
"void",
"removeSite",
"(",
"CmsObject",
"cms",
",",
"CmsSite",
"site",
")",
"throws",
"CmsException",
"{",
"// check permissions",
"if",
"(",
"OpenCms",
".",
"getRunLevel",
"(",
")",
">",
"OpenCms",
".",
"RUNLEVEL_1_CORE_OBJECT",
")",
"{",
"// simple u... | Removes a site from the list of configured sites.<p>
@param cms the cms object
@param site the site to remove
@throws CmsException if something goes wrong | [
"Removes",
"a",
"site",
"from",
"the",
"list",
"of",
"configured",
"sites",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/site/CmsSiteManagerImpl.java#L1404-L1434 |
the-fascinator/plugin-indexer-solr | src/main/java/com/googlecode/fascinator/indexer/SolrIndexer.java | SolrIndexer.sendIndexToBuffer | public void sendIndexToBuffer(String index, Map<String, List<String>> fields) {
"""
Send the document to buffer directly
@param index
@param fields
"""
String doc = pyUtils.solrDocument(fields);
addToBuffer(index, doc);
} | java | public void sendIndexToBuffer(String index, Map<String, List<String>> fields) {
String doc = pyUtils.solrDocument(fields);
addToBuffer(index, doc);
} | [
"public",
"void",
"sendIndexToBuffer",
"(",
"String",
"index",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"fields",
")",
"{",
"String",
"doc",
"=",
"pyUtils",
".",
"solrDocument",
"(",
"fields",
")",
";",
"addToBuffer",
"(",
"index"... | Send the document to buffer directly
@param index
@param fields | [
"Send",
"the",
"document",
"to",
"buffer",
"directly"
] | train | https://github.com/the-fascinator/plugin-indexer-solr/blob/001159b18b78a87daa5d8b2a17ced28694bae156/src/main/java/com/googlecode/fascinator/indexer/SolrIndexer.java#L829-L832 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/graph/SparkComputationGraph.java | SparkComputationGraph.calculateScoreMultiDataSet | public double calculateScoreMultiDataSet(JavaRDD<MultiDataSet> data, boolean average, int minibatchSize) {
"""
Calculate the score for all examples in the provided {@code JavaRDD<MultiDataSet>}, either by summing
or averaging over the entire data set.
*
@param data Data to score
@param average W... | java | public double calculateScoreMultiDataSet(JavaRDD<MultiDataSet> data, boolean average, int minibatchSize) {
JavaRDD<Tuple2<Integer, Double>> rdd = data.mapPartitions(new ScoreFlatMapFunctionCGMultiDataSet(conf.toJson(),
sc.broadcast(network.params(false)), minibatchSize));
//Reduc... | [
"public",
"double",
"calculateScoreMultiDataSet",
"(",
"JavaRDD",
"<",
"MultiDataSet",
">",
"data",
",",
"boolean",
"average",
",",
"int",
"minibatchSize",
")",
"{",
"JavaRDD",
"<",
"Tuple2",
"<",
"Integer",
",",
"Double",
">",
">",
"rdd",
"=",
"data",
".",
... | Calculate the score for all examples in the provided {@code JavaRDD<MultiDataSet>}, either by summing
or averaging over the entire data set.
*
@param data Data to score
@param average Whether to sum the scores, or average them
@param minibatchSize The number of examples to use in each minibatch when scor... | [
"Calculate",
"the",
"score",
"for",
"all",
"examples",
"in",
"the",
"provided",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/graph/SparkComputationGraph.java#L411-L421 |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java | SARLRuntime.fireDefaultSREChanged | private static void fireDefaultSREChanged(ISREInstall previous, ISREInstall current) {
"""
Notifies registered listeners that the default SRE has changed.
@param previous the previous SRE
@param current the new current default SRE
"""
for (final Object listener : SRE_LISTENERS.getListeners()) {
((ISRE... | java | private static void fireDefaultSREChanged(ISREInstall previous, ISREInstall current) {
for (final Object listener : SRE_LISTENERS.getListeners()) {
((ISREInstallChangedListener) listener).defaultSREInstallChanged(previous, current);
}
} | [
"private",
"static",
"void",
"fireDefaultSREChanged",
"(",
"ISREInstall",
"previous",
",",
"ISREInstall",
"current",
")",
"{",
"for",
"(",
"final",
"Object",
"listener",
":",
"SRE_LISTENERS",
".",
"getListeners",
"(",
")",
")",
"{",
"(",
"(",
"ISREInstallChanged... | Notifies registered listeners that the default SRE has changed.
@param previous the previous SRE
@param current the new current default SRE | [
"Notifies",
"registered",
"listeners",
"that",
"the",
"default",
"SRE",
"has",
"changed",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/SARLRuntime.java#L391-L395 |
apache/flink | flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricConfig.java | MetricConfig.getLong | public long getLong(String key, long defaultValue) {
"""
Searches for the property with the specified key in this property list.
If the key is not found in this property list, the default property list,
and its defaults, recursively, are then checked. The method returns the
default value argument if the propert... | java | public long getLong(String key, long defaultValue) {
String argument = getProperty(key, null);
return argument == null
? defaultValue
: Long.parseLong(argument);
} | [
"public",
"long",
"getLong",
"(",
"String",
"key",
",",
"long",
"defaultValue",
")",
"{",
"String",
"argument",
"=",
"getProperty",
"(",
"key",
",",
"null",
")",
";",
"return",
"argument",
"==",
"null",
"?",
"defaultValue",
":",
"Long",
".",
"parseLong",
... | Searches for the property with the specified key in this property list.
If the key is not found in this property list, the default property list,
and its defaults, recursively, are then checked. The method returns the
default value argument if the property is not found.
@param key the hashtable key.
@param de... | [
"Searches",
"for",
"the",
"property",
"with",
"the",
"specified",
"key",
"in",
"this",
"property",
"list",
".",
"If",
"the",
"key",
"is",
"not",
"found",
"in",
"this",
"property",
"list",
"the",
"default",
"property",
"list",
"and",
"its",
"defaults",
"rec... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricConfig.java#L59-L64 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/odmg/locking/RemoteLockMapImpl.java | RemoteLockMapImpl.hasReadLock | public boolean hasReadLock(TransactionImpl tx, Object obj) {
"""
check if there is a reader lock entry for transaction tx on object obj
in the persistent storage.
"""
try
{
LockEntry lock = new LockEntry(new Identity(obj,getBroker()).toString(), tx.getGUID());
boolean result = hasReadLockRemote(... | java | public boolean hasReadLock(TransactionImpl tx, Object obj)
{
try
{
LockEntry lock = new LockEntry(new Identity(obj,getBroker()).toString(), tx.getGUID());
boolean result = hasReadLockRemote(lock);
return result;
}
catch (Throwable t)
{
log.error("Cannot check read lock for object " +... | [
"public",
"boolean",
"hasReadLock",
"(",
"TransactionImpl",
"tx",
",",
"Object",
"obj",
")",
"{",
"try",
"{",
"LockEntry",
"lock",
"=",
"new",
"LockEntry",
"(",
"new",
"Identity",
"(",
"obj",
",",
"getBroker",
"(",
")",
")",
".",
"toString",
"(",
")",
... | check if there is a reader lock entry for transaction tx on object obj
in the persistent storage. | [
"check",
"if",
"there",
"is",
"a",
"reader",
"lock",
"entry",
"for",
"transaction",
"tx",
"on",
"object",
"obj",
"in",
"the",
"persistent",
"storage",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/odmg/locking/RemoteLockMapImpl.java#L433-L446 |
Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journal/JournalUtils.java | JournalUtils.writeJournalEntryCheckpoint | public static void writeJournalEntryCheckpoint(OutputStream output, JournalEntryIterable iterable)
throws IOException, InterruptedException {
"""
Writes a checkpoint of the entries in the given iterable.
This is the complement of
{@link #restoreJournalEntryCheckpoint(CheckpointInputStream, Journaled)}.
... | java | public static void writeJournalEntryCheckpoint(OutputStream output, JournalEntryIterable iterable)
throws IOException, InterruptedException {
output = new CheckpointOutputStream(output, CheckpointType.JOURNAL_ENTRY);
Iterator<JournalEntry> it = iterable.getJournalEntryIterator();
LOG.info("Write journ... | [
"public",
"static",
"void",
"writeJournalEntryCheckpoint",
"(",
"OutputStream",
"output",
",",
"JournalEntryIterable",
"iterable",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"output",
"=",
"new",
"CheckpointOutputStream",
"(",
"output",
",",
"Checkp... | Writes a checkpoint of the entries in the given iterable.
This is the complement of
{@link #restoreJournalEntryCheckpoint(CheckpointInputStream, Journaled)}.
@param output the stream to write to
@param iterable the iterable for fetching journal entries | [
"Writes",
"a",
"checkpoint",
"of",
"the",
"entries",
"in",
"the",
"given",
"iterable",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/JournalUtils.java#L74-L86 |
wisdom-framework/wisdom | extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/mojo/AbstractWisdomSourceWatcherMojo.java | AbstractWisdomSourceWatcherMojo.parseController | public void parseController(File file) throws WatchingException {
"""
Parse the source file of a wisdom Controller and create a model from it.
Call {@link #controllerParsed(File, ControllerModel)}.
@param file the controller source file.
@throws WatchingException
"""
ControllerModel<T> controllerM... | java | public void parseController(File file) throws WatchingException{
ControllerModel<T> controllerModel = new ControllerModel<>();
//Populate the controller model by visiting the File
try {
JavaParser.parse(file).accept(CONTROLLER_VISITOR,controllerModel);
} catch (ParseExceptio... | [
"public",
"void",
"parseController",
"(",
"File",
"file",
")",
"throws",
"WatchingException",
"{",
"ControllerModel",
"<",
"T",
">",
"controllerModel",
"=",
"new",
"ControllerModel",
"<>",
"(",
")",
";",
"//Populate the controller model by visiting the File",
"try",
"... | Parse the source file of a wisdom Controller and create a model from it.
Call {@link #controllerParsed(File, ControllerModel)}.
@param file the controller source file.
@throws WatchingException | [
"Parse",
"the",
"source",
"file",
"of",
"a",
"wisdom",
"Controller",
"and",
"create",
"a",
"model",
"from",
"it",
".",
"Call",
"{",
"@link",
"#controllerParsed",
"(",
"File",
"ControllerModel",
")",
"}",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/mojo/AbstractWisdomSourceWatcherMojo.java#L93-L105 |
gresrun/jesque | src/main/java/net/greghaines/jesque/admin/AdminPoolImpl.java | AdminPoolImpl.recoverFromException | protected void recoverFromException(final String channel, final Exception e) {
"""
Handle an exception that was thrown from inside
{@link PubSubListener#onMessage(String,String)}.
@param channel
the name of the channel that was being processed when the
exception was thrown
@param e
the exception that was t... | java | protected void recoverFromException(final String channel, final Exception e) {
final RecoveryStrategy recoveryStrategy = this.exceptionHandlerRef.get().onException(this, e, channel);
switch (recoveryStrategy) {
case RECONNECT:
LOG.info("Ignoring RECONNECT strategy in response to exce... | [
"protected",
"void",
"recoverFromException",
"(",
"final",
"String",
"channel",
",",
"final",
"Exception",
"e",
")",
"{",
"final",
"RecoveryStrategy",
"recoveryStrategy",
"=",
"this",
".",
"exceptionHandlerRef",
".",
"get",
"(",
")",
".",
"onException",
"(",
"th... | Handle an exception that was thrown from inside
{@link PubSubListener#onMessage(String,String)}.
@param channel
the name of the channel that was being processed when the
exception was thrown
@param e
the exception that was thrown | [
"Handle",
"an",
"exception",
"that",
"was",
"thrown",
"from",
"inside",
"{",
"@link",
"PubSubListener#onMessage",
"(",
"String",
"String",
")",
"}",
"."
] | train | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/admin/AdminPoolImpl.java#L351-L368 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTableRowRenderer.java | WTableRowRenderer.addColumn | void addColumn(final WTableColumn column, final int columnIndex) {
"""
Adds a column to the renderer. This method is called by {@link WTable} to keep the renderer's and table's columns
in sync.
@param column the column to add.
@param columnIndex the index of the column. Zero based.
"""
WComponent render... | java | void addColumn(final WTableColumn column, final int columnIndex) {
WComponent renderer = column.getRenderer();
if (renderer == null) {
Class<? extends WComponent> rendererClass = column.getRendererClass();
if (!(BeanProviderBound.class.isAssignableFrom(rendererClass))
&& !(BeanBound.class.isAssignableF... | [
"void",
"addColumn",
"(",
"final",
"WTableColumn",
"column",
",",
"final",
"int",
"columnIndex",
")",
"{",
"WComponent",
"renderer",
"=",
"column",
".",
"getRenderer",
"(",
")",
";",
"if",
"(",
"renderer",
"==",
"null",
")",
"{",
"Class",
"<",
"?",
"exte... | Adds a column to the renderer. This method is called by {@link WTable} to keep the renderer's and table's columns
in sync.
@param column the column to add.
@param columnIndex the index of the column. Zero based. | [
"Adds",
"a",
"column",
"to",
"the",
"renderer",
".",
"This",
"method",
"is",
"called",
"by",
"{",
"@link",
"WTable",
"}",
"to",
"keep",
"the",
"renderer",
"s",
"and",
"table",
"s",
"columns",
"in",
"sync",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTableRowRenderer.java#L319-L342 |
johnkil/Android-RobotoTextView | robototextview/src/main/java/com/devspark/robototextview/RobotoTypefaces.java | RobotoTypefaces.setUpTypeface | public static void setUpTypeface(@NonNull TextView textView, @RobotoTypeface int typeface) {
"""
Set up typeface for TextView.
@param textView The text view
@param typeface The value of "robotoTypeface" attribute
"""
setUpTypeface(textView, obtainTypeface(textView.getContext(), typeface));
} | java | public static void setUpTypeface(@NonNull TextView textView, @RobotoTypeface int typeface) {
setUpTypeface(textView, obtainTypeface(textView.getContext(), typeface));
} | [
"public",
"static",
"void",
"setUpTypeface",
"(",
"@",
"NonNull",
"TextView",
"textView",
",",
"@",
"RobotoTypeface",
"int",
"typeface",
")",
"{",
"setUpTypeface",
"(",
"textView",
",",
"obtainTypeface",
"(",
"textView",
".",
"getContext",
"(",
")",
",",
"type... | Set up typeface for TextView.
@param textView The text view
@param typeface The value of "robotoTypeface" attribute | [
"Set",
"up",
"typeface",
"for",
"TextView",
"."
] | train | https://github.com/johnkil/Android-RobotoTextView/blob/1341602f16c08057dddd193411e7dab96f963b77/robototextview/src/main/java/com/devspark/robototextview/RobotoTypefaces.java#L525-L527 |
jbundle/webapp | proxy/src/main/java/org/jbundle/util/webapp/proxy/ProxyServlet.java | ProxyServlet.getDataFromClient | public void getDataFromClient(HttpRequestBase httpget, OutputStream streamOut) throws ClientProtocolException, IOException {
"""
Get the data from the proxy and send it to the client.
@param httpget
@param streamOut
@throws IOException
@throws ClientProtocolException
"""
HttpClient httpclient = new De... | java | public void getDataFromClient(HttpRequestBase httpget, OutputStream streamOut) throws ClientProtocolException, IOException
{
HttpClient httpclient = new DefaultHttpClient();
// Execute the request
HttpResponse response = httpclient.execute(httpget);
// Get the response ent... | [
"public",
"void",
"getDataFromClient",
"(",
"HttpRequestBase",
"httpget",
",",
"OutputStream",
"streamOut",
")",
"throws",
"ClientProtocolException",
",",
"IOException",
"{",
"HttpClient",
"httpclient",
"=",
"new",
"DefaultHttpClient",
"(",
")",
";",
"// Execute the req... | Get the data from the proxy and send it to the client.
@param httpget
@param streamOut
@throws IOException
@throws ClientProtocolException | [
"Get",
"the",
"data",
"from",
"the",
"proxy",
"and",
"send",
"it",
"to",
"the",
"client",
"."
] | train | https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/proxy/src/main/java/org/jbundle/util/webapp/proxy/ProxyServlet.java#L194-L216 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java | ResourcesInner.checkExistenceById | public boolean checkExistenceById(String resourceId, String apiVersion) {
"""
Checks by ID whether a resource exists.
@param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-prov... | java | public boolean checkExistenceById(String resourceId, String apiVersion) {
return checkExistenceByIdWithServiceResponseAsync(resourceId, apiVersion).toBlocking().single().body();
} | [
"public",
"boolean",
"checkExistenceById",
"(",
"String",
"resourceId",
",",
"String",
"apiVersion",
")",
"{",
"return",
"checkExistenceByIdWithServiceResponseAsync",
"(",
"resourceId",
",",
"apiVersion",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")",
... | Checks by ID whether a resource exists.
@param resourceId The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
@param apiVersion The API version to ... | [
"Checks",
"by",
"ID",
"whether",
"a",
"resource",
"exists",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java#L1845-L1847 |
xbib/marc | src/main/java/org/xbib/marc/xml/MarcContentHandler.java | MarcContentHandler.setMarcListener | public MarcContentHandler setMarcListener(String type, MarcListener listener) {
"""
Set MARC listener for a specific record type.
@param type the record type
@param listener the MARC listener
@return this handler
"""
this.listeners.put(type, listener);
return this;
} | java | public MarcContentHandler setMarcListener(String type, MarcListener listener) {
this.listeners.put(type, listener);
return this;
} | [
"public",
"MarcContentHandler",
"setMarcListener",
"(",
"String",
"type",
",",
"MarcListener",
"listener",
")",
"{",
"this",
".",
"listeners",
".",
"put",
"(",
"type",
",",
"listener",
")",
";",
"return",
"this",
";",
"}"
] | Set MARC listener for a specific record type.
@param type the record type
@param listener the MARC listener
@return this handler | [
"Set",
"MARC",
"listener",
"for",
"a",
"specific",
"record",
"type",
"."
] | train | https://github.com/xbib/marc/blob/d8426fcfc686507cab59b3d8181b08f83718418c/src/main/java/org/xbib/marc/xml/MarcContentHandler.java#L101-L104 |
leancloud/java-sdk-all | android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/game/FloatWindowApi.java | FloatWindowApi.onConnect | @Override
public void onConnect(int rst, HuaweiApiClient client) {
"""
HuaweiApiClient 连接结果回调
@param rst 结果码
@param client HuaweiApiClient 实例
"""
if (isCurFloatShow && client != null) {
showFinal(true, null, client);
}
} | java | @Override
public void onConnect(int rst, HuaweiApiClient client) {
if (isCurFloatShow && client != null) {
showFinal(true, null, client);
}
} | [
"@",
"Override",
"public",
"void",
"onConnect",
"(",
"int",
"rst",
",",
"HuaweiApiClient",
"client",
")",
"{",
"if",
"(",
"isCurFloatShow",
"&&",
"client",
"!=",
"null",
")",
"{",
"showFinal",
"(",
"true",
",",
"null",
",",
"client",
")",
";",
"}",
"}"... | HuaweiApiClient 连接结果回调
@param rst 结果码
@param client HuaweiApiClient 实例 | [
"HuaweiApiClient",
"连接结果回调"
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/android-sdk/huawei-hmsagent/src/main/java/com/huawei/android/hms/agent/game/FloatWindowApi.java#L46-L51 |
CenturyLinkCloud/mdw | mdw-common/src/com/centurylink/mdw/xml/XmlBeanAssert.java | XmlBeanAssert.assertEquals | public static void assertEquals(XmlObject expected, XmlObject actual) {
"""
Asserts that two XmlBeans are equivalent based on a deep compare (ignoring
whitespace and ordering of element attributes). If the two XmlBeans are
not equivalent, an AssertionFailedError is thrown, failing the test case.
Note: we can'... | java | public static void assertEquals(XmlObject expected, XmlObject actual)
{
assertEquals(null, expected.newCursor(), actual.newCursor());
} | [
"public",
"static",
"void",
"assertEquals",
"(",
"XmlObject",
"expected",
",",
"XmlObject",
"actual",
")",
"{",
"assertEquals",
"(",
"null",
",",
"expected",
".",
"newCursor",
"(",
")",
",",
"actual",
".",
"newCursor",
"(",
")",
")",
";",
"}"
] | Asserts that two XmlBeans are equivalent based on a deep compare (ignoring
whitespace and ordering of element attributes). If the two XmlBeans are
not equivalent, an AssertionFailedError is thrown, failing the test case.
Note: we can't provide line numbers since XmlBeans only makes these available
if we're using the P... | [
"Asserts",
"that",
"two",
"XmlBeans",
"are",
"equivalent",
"based",
"on",
"a",
"deep",
"compare",
"(",
"ignoring",
"whitespace",
"and",
"ordering",
"of",
"element",
"attributes",
")",
".",
"If",
"the",
"two",
"XmlBeans",
"are",
"not",
"equivalent",
"an",
"As... | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/xml/XmlBeanAssert.java#L49-L52 |
google/closure-templates | java/src/com/google/template/soy/internal/i18n/BidiFormatter.java | BidiFormatter.spanWrap | public String spanWrap(@Nullable Dir dir, String str, boolean isHtml) {
"""
Formats a string of given directionality for use in HTML output of the context directionality,
so an opposite-directionality string is neither garbled nor garbles its surroundings.
<p>The algorithm: In case the given directionality doe... | java | public String spanWrap(@Nullable Dir dir, String str, boolean isHtml) {
BidiWrappingText wrappingText = spanWrappingText(dir, str, isHtml);
if (!isHtml) {
str = HtmlEscapers.htmlEscaper().escape(str);
}
return wrappingText.beforeText() + str + wrappingText.afterText();
} | [
"public",
"String",
"spanWrap",
"(",
"@",
"Nullable",
"Dir",
"dir",
",",
"String",
"str",
",",
"boolean",
"isHtml",
")",
"{",
"BidiWrappingText",
"wrappingText",
"=",
"spanWrappingText",
"(",
"dir",
",",
"str",
",",
"isHtml",
")",
";",
"if",
"(",
"!",
"i... | Formats a string of given directionality for use in HTML output of the context directionality,
so an opposite-directionality string is neither garbled nor garbles its surroundings.
<p>The algorithm: In case the given directionality doesn't match the context directionality,
wraps the string with a 'span' element and ad... | [
"Formats",
"a",
"string",
"of",
"given",
"directionality",
"for",
"use",
"in",
"HTML",
"output",
"of",
"the",
"context",
"directionality",
"so",
"an",
"opposite",
"-",
"directionality",
"string",
"is",
"neither",
"garbled",
"nor",
"garbles",
"its",
"surroundings... | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/internal/i18n/BidiFormatter.java#L124-L130 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java | WorkflowsInner.generateUpgradedDefinition | public Object generateUpgradedDefinition(String resourceGroupName, String workflowName, String targetSchemaVersion) {
"""
Generates the upgraded definition for a workflow.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param targetSchemaVersion The target schema vers... | java | public Object generateUpgradedDefinition(String resourceGroupName, String workflowName, String targetSchemaVersion) {
return generateUpgradedDefinitionWithServiceResponseAsync(resourceGroupName, workflowName, targetSchemaVersion).toBlocking().single().body();
} | [
"public",
"Object",
"generateUpgradedDefinition",
"(",
"String",
"resourceGroupName",
",",
"String",
"workflowName",
",",
"String",
"targetSchemaVersion",
")",
"{",
"return",
"generateUpgradedDefinitionWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"workflowName",
... | Generates the upgraded definition for a workflow.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param targetSchemaVersion The target schema version.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is reje... | [
"Generates",
"the",
"upgraded",
"definition",
"for",
"a",
"workflow",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowsInner.java#L1221-L1223 |
jenkinsci/jenkins | core/src/main/java/hudson/model/View.java | View.updateByXml | public void updateByXml(Source source) throws IOException {
"""
Updates the View with the new XML definition.
@param source source of the Item's new definition.
The source should be either a <code>StreamSource</code> or <code>SAXSource</code>, other sources
may not be handled.
"""
checkPermission(CO... | java | public void updateByXml(Source source) throws IOException {
checkPermission(CONFIGURE);
StringWriter out = new StringWriter();
try {
// this allows us to use UTF-8 for storing data,
// plus it checks any well-formedness issue in the submitted
// data
... | [
"public",
"void",
"updateByXml",
"(",
"Source",
"source",
")",
"throws",
"IOException",
"{",
"checkPermission",
"(",
"CONFIGURE",
")",
";",
"StringWriter",
"out",
"=",
"new",
"StringWriter",
"(",
")",
";",
"try",
"{",
"// this allows us to use UTF-8 for storing data... | Updates the View with the new XML definition.
@param source source of the Item's new definition.
The source should be either a <code>StreamSource</code> or <code>SAXSource</code>, other sources
may not be handled. | [
"Updates",
"the",
"View",
"with",
"the",
"new",
"XML",
"definition",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/View.java#L1196-L1229 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java | Calendar.computeZoneOffset | protected int computeZoneOffset(long millis, int millisInDay) {
"""
This method can assume EXTENDED_YEAR has been set.
@param millis milliseconds of the date fields (local midnight millis)
@param millisInDay milliseconds of the time fields; may be out
or range.
@return total zone offset (raw + DST) for the giv... | java | protected int computeZoneOffset(long millis, int millisInDay) {
int[] offsets = new int[2];
long wall = millis + millisInDay;
if (zone instanceof BasicTimeZone) {
int duplicatedTimeOpt = (repeatedWallTime == WALLTIME_FIRST) ? BasicTimeZone.LOCAL_FORMER : BasicTimeZone.LOCAL_LATTER;
... | [
"protected",
"int",
"computeZoneOffset",
"(",
"long",
"millis",
",",
"int",
"millisInDay",
")",
"{",
"int",
"[",
"]",
"offsets",
"=",
"new",
"int",
"[",
"2",
"]",
";",
"long",
"wall",
"=",
"millis",
"+",
"millisInDay",
";",
"if",
"(",
"zone",
"instance... | This method can assume EXTENDED_YEAR has been set.
@param millis milliseconds of the date fields (local midnight millis)
@param millisInDay milliseconds of the time fields; may be out
or range.
@return total zone offset (raw + DST) for the given moment
@deprecated This method suffers from a potential integer overflow a... | [
"This",
"method",
"can",
"assume",
"EXTENDED_YEAR",
"has",
"been",
"set",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Calendar.java#L5531-L5573 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/factory/background/FactoryBackgroundModel.java | FactoryBackgroundModel.stationaryGaussian | public static <T extends ImageBase<T>>
BackgroundStationaryGaussian<T> stationaryGaussian(@Nonnull ConfigBackgroundGaussian config , ImageType<T> imageType ) {
"""
Creates an instance of {@link BackgroundStationaryGaussian}.
@param config Configures the background model
@param imageType Type of input image
@... | java | public static <T extends ImageBase<T>>
BackgroundStationaryGaussian<T> stationaryGaussian(@Nonnull ConfigBackgroundGaussian config , ImageType<T> imageType ) {
config.checkValidity();
BackgroundStationaryGaussian<T> ret;
switch( imageType.getFamily() ) {
case GRAY:
ret = new BackgroundStationaryGaussia... | [
"public",
"static",
"<",
"T",
"extends",
"ImageBase",
"<",
"T",
">",
">",
"BackgroundStationaryGaussian",
"<",
"T",
">",
"stationaryGaussian",
"(",
"@",
"Nonnull",
"ConfigBackgroundGaussian",
"config",
",",
"ImageType",
"<",
"T",
">",
"imageType",
")",
"{",
"c... | Creates an instance of {@link BackgroundStationaryGaussian}.
@param config Configures the background model
@param imageType Type of input image
@return new instance of the background model | [
"Creates",
"an",
"instance",
"of",
"{",
"@link",
"BackgroundStationaryGaussian",
"}",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/factory/background/FactoryBackgroundModel.java#L112-L141 |
sksamuel/scrimage | scrimage-core/src/main/java/com/sksamuel/scrimage/PixelTools.java | PixelTools.colorMatches | public static boolean colorMatches(Color color, int tolerance, Pixel[] pixels) {
"""
Returns true if the colors of all pixels in the array are within the given tolerance
compared to the referenced color
"""
if (tolerance < 0 || tolerance > 255)
throw new RuntimeException("Tolerance value m... | java | public static boolean colorMatches(Color color, int tolerance, Pixel[] pixels) {
if (tolerance < 0 || tolerance > 255)
throw new RuntimeException("Tolerance value must be between 0 and 255 inclusive");
if (tolerance == 0)
return uniform(color, pixels);
else
re... | [
"public",
"static",
"boolean",
"colorMatches",
"(",
"Color",
"color",
",",
"int",
"tolerance",
",",
"Pixel",
"[",
"]",
"pixels",
")",
"{",
"if",
"(",
"tolerance",
"<",
"0",
"||",
"tolerance",
">",
"255",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"T... | Returns true if the colors of all pixels in the array are within the given tolerance
compared to the referenced color | [
"Returns",
"true",
"if",
"the",
"colors",
"of",
"all",
"pixels",
"in",
"the",
"array",
"are",
"within",
"the",
"given",
"tolerance",
"compared",
"to",
"the",
"referenced",
"color"
] | train | https://github.com/sksamuel/scrimage/blob/52dab448136e6657a71951b0e6b7d5e64dc979ac/scrimage-core/src/main/java/com/sksamuel/scrimage/PixelTools.java#L118-L125 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security/src/com/ibm/ws/security/krb5/Krb5Common.java | Krb5Common.setPropertyAsNeeded | @SuppressWarnings( {
"""
This method set the system property if the property is null or property value is not the same with the new value
@param propName
@param propValue
@return
""" "unchecked", "rawtypes" })
public static String setPropertyAsNeeded(final String propName, final String propValue) {
... | java | @SuppressWarnings({ "unchecked", "rawtypes" })
public static String setPropertyAsNeeded(final String propName, final String propValue) {
String previousPropValue = (String) java.security.AccessController.doPrivileged(new java.security.PrivilegedAction() {
@Override
public String run... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"public",
"static",
"String",
"setPropertyAsNeeded",
"(",
"final",
"String",
"propName",
",",
"final",
"String",
"propValue",
")",
"{",
"String",
"previousPropValue",
"=",
"(",
"S... | This method set the system property if the property is null or property value is not the same with the new value
@param propName
@param propValue
@return | [
"This",
"method",
"set",
"the",
"system",
"property",
"if",
"the",
"property",
"is",
"null",
"or",
"property",
"value",
"is",
"not",
"the",
"same",
"with",
"the",
"new",
"value"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security/src/com/ibm/ws/security/krb5/Krb5Common.java#L76-L95 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/logging/MyfacesLogger.java | MyfacesLogger.entering | public void entering(String sourceClass, String sourceMethod, Object param1) {
"""
Log a method entry, with one parameter.
<p>
This is a convenience method that can be used to log entry
to a method. A LogRecord with message "ENTRY {0}", log level
FINER, and the given sourceMethod, sourceClass, and parameter
... | java | public void entering(String sourceClass, String sourceMethod, Object param1)
{
_log.entering(sourceClass, sourceMethod, param1);
} | [
"public",
"void",
"entering",
"(",
"String",
"sourceClass",
",",
"String",
"sourceMethod",
",",
"Object",
"param1",
")",
"{",
"_log",
".",
"entering",
"(",
"sourceClass",
",",
"sourceMethod",
",",
"param1",
")",
";",
"}"
] | Log a method entry, with one parameter.
<p>
This is a convenience method that can be used to log entry
to a method. A LogRecord with message "ENTRY {0}", log level
FINER, and the given sourceMethod, sourceClass, and parameter
is logged.
<p>
@param sourceClass name of class that issued the logging request
@param ... | [
"Log",
"a",
"method",
"entry",
"with",
"one",
"parameter",
".",
"<p",
">",
"This",
"is",
"a",
"convenience",
"method",
"that",
"can",
"be",
"used",
"to",
"log",
"entry",
"to",
"a",
"method",
".",
"A",
"LogRecord",
"with",
"message",
"ENTRY",
"{",
"0",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/logging/MyfacesLogger.java#L723-L726 |
grpc/grpc-java | alts/src/main/java/io/grpc/alts/internal/AltsHandshakerClient.java | AltsHandshakerClient.setStartServerFields | private void setStartServerFields(HandshakerReq.Builder req, ByteBuffer inBytes) {
"""
Sets the start server fields for the passed handshake request.
"""
ServerHandshakeParameters serverParameters =
ServerHandshakeParameters.newBuilder().addRecordProtocols(RECORD_PROTOCOL).build();
StartServerH... | java | private void setStartServerFields(HandshakerReq.Builder req, ByteBuffer inBytes) {
ServerHandshakeParameters serverParameters =
ServerHandshakeParameters.newBuilder().addRecordProtocols(RECORD_PROTOCOL).build();
StartServerHandshakeReq.Builder startServerReq =
StartServerHandshakeReq.newBuilder(... | [
"private",
"void",
"setStartServerFields",
"(",
"HandshakerReq",
".",
"Builder",
"req",
",",
"ByteBuffer",
"inBytes",
")",
"{",
"ServerHandshakeParameters",
"serverParameters",
"=",
"ServerHandshakeParameters",
".",
"newBuilder",
"(",
")",
".",
"addRecordProtocols",
"("... | Sets the start server fields for the passed handshake request. | [
"Sets",
"the",
"start",
"server",
"fields",
"for",
"the",
"passed",
"handshake",
"request",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/alts/src/main/java/io/grpc/alts/internal/AltsHandshakerClient.java#L89-L101 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/codec/Base64.java | Base64.decodeToStream | public static void decodeToStream(String base64, OutputStream out, boolean isCloseOut) {
"""
base64解码
@param base64 被解码的base64字符串
@param out 写出到的流
@param isCloseOut 是否关闭输出流
@since 4.0.9
"""
IoUtil.write(out, isCloseOut, Base64Decoder.decode(base64));
} | java | public static void decodeToStream(String base64, OutputStream out, boolean isCloseOut) {
IoUtil.write(out, isCloseOut, Base64Decoder.decode(base64));
} | [
"public",
"static",
"void",
"decodeToStream",
"(",
"String",
"base64",
",",
"OutputStream",
"out",
",",
"boolean",
"isCloseOut",
")",
"{",
"IoUtil",
".",
"write",
"(",
"out",
",",
"isCloseOut",
",",
"Base64Decoder",
".",
"decode",
"(",
"base64",
")",
")",
... | base64解码
@param base64 被解码的base64字符串
@param out 写出到的流
@param isCloseOut 是否关闭输出流
@since 4.0.9 | [
"base64解码"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/codec/Base64.java#L301-L303 |
jqm4gwt/jqm4gwt | library/src/main/java/com/sksamuel/jqm4gwt/toolbar/JQMHeader.java | JQMHeader.setLeftButton | public JQMButton setLeftButton(String text, String url) {
"""
Creates a new {@link JQMButton} with the given text and linking to the
given url and then sets that button in the left slot. Any existing
right button will be replaced.
@param text
the text for the button
@param url
the optional url for the butt... | java | public JQMButton setLeftButton(String text, String url) {
return setLeftButton(text, url, null);
} | [
"public",
"JQMButton",
"setLeftButton",
"(",
"String",
"text",
",",
"String",
"url",
")",
"{",
"return",
"setLeftButton",
"(",
"text",
",",
"url",
",",
"null",
")",
";",
"}"
] | Creates a new {@link JQMButton} with the given text and linking to the
given url and then sets that button in the left slot. Any existing
right button will be replaced.
@param text
the text for the button
@param url
the optional url for the button, if null then this button
does not navigate by default
@return the cre... | [
"Creates",
"a",
"new",
"{",
"@link",
"JQMButton",
"}",
"with",
"the",
"given",
"text",
"and",
"linking",
"to",
"the",
"given",
"url",
"and",
"then",
"sets",
"that",
"button",
"in",
"the",
"left",
"slot",
".",
"Any",
"existing",
"right",
"button",
"will",... | train | https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/library/src/main/java/com/sksamuel/jqm4gwt/toolbar/JQMHeader.java#L222-L224 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.findResult | public static <T, U extends T, V extends T,A,B> T findResult(Map<A, B> self, U defaultResult, @ClosureParams(MapEntryOrKeyValue.class) Closure<V> closure) {
"""
Returns the first non-null closure result found by passing each map entry to the closure, otherwise the defaultResult is returned.
If the closure takes t... | java | public static <T, U extends T, V extends T,A,B> T findResult(Map<A, B> self, U defaultResult, @ClosureParams(MapEntryOrKeyValue.class) Closure<V> closure) {
T result = findResult(self, closure);
if (result == null) return defaultResult;
return result;
} | [
"public",
"static",
"<",
"T",
",",
"U",
"extends",
"T",
",",
"V",
"extends",
"T",
",",
"A",
",",
"B",
">",
"T",
"findResult",
"(",
"Map",
"<",
"A",
",",
"B",
">",
"self",
",",
"U",
"defaultResult",
",",
"@",
"ClosureParams",
"(",
"MapEntryOrKeyValu... | Returns the first non-null closure result found by passing each map entry to the closure, otherwise the defaultResult is returned.
If the closure takes two parameters, the entry key and value are passed.
If the closure takes one parameter, the Map.Entry object is passed.
<pre class="groovyTestCase">
assert "Found b:3" ... | [
"Returns",
"the",
"first",
"non",
"-",
"null",
"closure",
"result",
"found",
"by",
"passing",
"each",
"map",
"entry",
"to",
"the",
"closure",
"otherwise",
"the",
"defaultResult",
"is",
"returned",
".",
"If",
"the",
"closure",
"takes",
"two",
"parameters",
"t... | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L4084-L4088 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/ModuleUtils.java | ModuleUtils.instantiateModule | public static Module instantiateModule(final Class<? extends Module> clazz,
final Parameters params)
throws IllegalAccessException, InvocationTargetException, InstantiationException {
"""
Instantiates the given module class {@code clazz}. First this looks for a constructor taking
{@link Parameters} a... | java | public static Module instantiateModule(final Class<? extends Module> clazz,
final Parameters params)
throws IllegalAccessException, InvocationTargetException, InstantiationException {
return instantiateModule(clazz, params, Optional.<Class<? extends Annotation>>absent());
} | [
"public",
"static",
"Module",
"instantiateModule",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Module",
">",
"clazz",
",",
"final",
"Parameters",
"params",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
",",
"InstantiationException",
"{",
... | Instantiates the given module class {@code clazz}. First this looks for a constructor taking
{@link Parameters} as its only argument and uses it with the supplied {@code params} if
possible. Otherwise attempts to find and use a zero-arg constructor. Otherwise throws
a {@link RuntimeException}. | [
"Instantiates",
"the",
"given",
"module",
"class",
"{"
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/ModuleUtils.java#L88-L92 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java | ZooKeeperUtils.createLeaderElectionService | public static ZooKeeperLeaderElectionService createLeaderElectionService(
final CuratorFramework client,
final Configuration configuration,
final String pathSuffix) {
"""
Creates a {@link ZooKeeperLeaderElectionService} instance.
@param client The {@link CuratorFramework} ZooKeeper client to use... | java | public static ZooKeeperLeaderElectionService createLeaderElectionService(
final CuratorFramework client,
final Configuration configuration,
final String pathSuffix) {
final String latchPath = configuration.getString(
HighAvailabilityOptions.HA_ZOOKEEPER_LATCH_PATH) + pathSuffix;
final String leaderPath ... | [
"public",
"static",
"ZooKeeperLeaderElectionService",
"createLeaderElectionService",
"(",
"final",
"CuratorFramework",
"client",
",",
"final",
"Configuration",
"configuration",
",",
"final",
"String",
"pathSuffix",
")",
"{",
"final",
"String",
"latchPath",
"=",
"configura... | Creates a {@link ZooKeeperLeaderElectionService} instance.
@param client The {@link CuratorFramework} ZooKeeper client to use
@param configuration {@link Configuration} object containing the configuration values
@param pathSuffix The path suffix which we want to append
@return {@link ZooKeeperLeaderElectionS... | [
"Creates",
"a",
"{",
"@link",
"ZooKeeperLeaderElectionService",
"}",
"instance",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java#L217-L227 |
mgormley/prim | src/main/java_generated/edu/jhu/prim/vector/IntFloatDenseVector.java | IntFloatDenseVector.lookupIndex | public int lookupIndex(float value, float delta) {
"""
Gets the index of the first element in this vector with the specified
value, or -1 if it is not present.
@param value The value to search for.
@param delta The delta with which to evaluate equality.
@return The index or -1 if not present.
"""
... | java | public int lookupIndex(float value, float delta) {
for (int i=0; i<elements.length; i++) {
if (Primitives.equals(elements[i], value, delta)) {
return i;
}
}
return -1;
} | [
"public",
"int",
"lookupIndex",
"(",
"float",
"value",
",",
"float",
"delta",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"elements",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"Primitives",
".",
"equals",
"(",
"elements",
... | Gets the index of the first element in this vector with the specified
value, or -1 if it is not present.
@param value The value to search for.
@param delta The delta with which to evaluate equality.
@return The index or -1 if not present. | [
"Gets",
"the",
"index",
"of",
"the",
"first",
"element",
"in",
"this",
"vector",
"with",
"the",
"specified",
"value",
"or",
"-",
"1",
"if",
"it",
"is",
"not",
"present",
"."
] | train | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java_generated/edu/jhu/prim/vector/IntFloatDenseVector.java#L184-L191 |
molgenis/molgenis | molgenis-ontology-core/src/main/java/org/molgenis/ontology/core/repository/OntologyTermRepository.java | OntologyTermRepository.getOntologyTermDistance | public int getOntologyTermDistance(OntologyTerm ontologyTerm1, OntologyTerm ontologyTerm2) {
"""
Calculate the distance between any two ontology terms in the ontology tree structure by
calculating the difference in nodePaths.
@return the distance between two ontology terms
"""
String nodePath1 = getOnt... | java | public int getOntologyTermDistance(OntologyTerm ontologyTerm1, OntologyTerm ontologyTerm2) {
String nodePath1 = getOntologyTermNodePath(ontologyTerm1);
String nodePath2 = getOntologyTermNodePath(ontologyTerm2);
if (StringUtils.isEmpty(nodePath1)) {
throw new MolgenisDataAccessException(
"Th... | [
"public",
"int",
"getOntologyTermDistance",
"(",
"OntologyTerm",
"ontologyTerm1",
",",
"OntologyTerm",
"ontologyTerm2",
")",
"{",
"String",
"nodePath1",
"=",
"getOntologyTermNodePath",
"(",
"ontologyTerm1",
")",
";",
"String",
"nodePath2",
"=",
"getOntologyTermNodePath",
... | Calculate the distance between any two ontology terms in the ontology tree structure by
calculating the difference in nodePaths.
@return the distance between two ontology terms | [
"Calculate",
"the",
"distance",
"between",
"any",
"two",
"ontology",
"terms",
"in",
"the",
"ontology",
"tree",
"structure",
"by",
"calculating",
"the",
"difference",
"in",
"nodePaths",
"."
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-ontology-core/src/main/java/org/molgenis/ontology/core/repository/OntologyTermRepository.java#L175-L190 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/selector/Hud.java | Hud.generateCancel | private void generateCancel(final ActionRef action, Featurable menu) {
"""
Generate cancel to go back.
@param action The associated action.
@param menu The current menu to check.
"""
menu.getFeature(Actionable.class).setAction(() ->
{
clearMenus();
final Collecti... | java | private void generateCancel(final ActionRef action, Featurable menu)
{
menu.getFeature(Actionable.class).setAction(() ->
{
clearMenus();
final Collection<ActionRef> parents = previous.get(action);
createMenus(parents, parents);
});
} | [
"private",
"void",
"generateCancel",
"(",
"final",
"ActionRef",
"action",
",",
"Featurable",
"menu",
")",
"{",
"menu",
".",
"getFeature",
"(",
"Actionable",
".",
"class",
")",
".",
"setAction",
"(",
"(",
")",
"->",
"{",
"clearMenus",
"(",
")",
";",
"fina... | Generate cancel to go back.
@param action The associated action.
@param menu The current menu to check. | [
"Generate",
"cancel",
"to",
"go",
"back",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/selector/Hud.java#L250-L258 |
authlete/authlete-java-common | src/main/java/com/authlete/common/dto/AuthorizationRequest.java | AuthorizationRequest.setParameters | public AuthorizationRequest setParameters(Map<String, String[]> parameters) {
"""
Set the value of {@code parameters} which are the request
parameters that the OAuth 2.0 authorization endpoint of the
service implementation received from the client application.
<p>
This method converts the given map into a st... | java | public AuthorizationRequest setParameters(Map<String, String[]> parameters)
{
return setParameters(URLCoder.formUrlEncode(parameters));
} | [
"public",
"AuthorizationRequest",
"setParameters",
"(",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"parameters",
")",
"{",
"return",
"setParameters",
"(",
"URLCoder",
".",
"formUrlEncode",
"(",
"parameters",
")",
")",
";",
"}"
] | Set the value of {@code parameters} which are the request
parameters that the OAuth 2.0 authorization endpoint of the
service implementation received from the client application.
<p>
This method converts the given map into a string in {@code
x-www-form-urlencoded} format and passes it to {@link
#setParameters(String)}... | [
"Set",
"the",
"value",
"of",
"{",
"@code",
"parameters",
"}",
"which",
"are",
"the",
"request",
"parameters",
"that",
"the",
"OAuth",
"2",
".",
"0",
"authorization",
"endpoint",
"of",
"the",
"service",
"implementation",
"received",
"from",
"the",
"client",
"... | train | https://github.com/authlete/authlete-java-common/blob/49c94c483713cbf5a04d805ff7dbd83766c9c964/src/main/java/com/authlete/common/dto/AuthorizationRequest.java#L116-L119 |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/adaptor/ESAAdaptor.java | ESAAdaptor.requiredByPlatformFeature | private static boolean requiredByPlatformFeature(File baseDir, File testFile) {
"""
Determine there is another platform feature requires this resource
"""
try {
Map<String, ProvisioningFeatureDefinition> features = new Product(baseDir).getFeatureDefinitions();
for (ProvisioningF... | java | private static boolean requiredByPlatformFeature(File baseDir, File testFile) {
try {
Map<String, ProvisioningFeatureDefinition> features = new Product(baseDir).getFeatureDefinitions();
for (ProvisioningFeatureDefinition fd : features.values()) {
if (fd.isKernel()) {
... | [
"private",
"static",
"boolean",
"requiredByPlatformFeature",
"(",
"File",
"baseDir",
",",
"File",
"testFile",
")",
"{",
"try",
"{",
"Map",
"<",
"String",
",",
"ProvisioningFeatureDefinition",
">",
"features",
"=",
"new",
"Product",
"(",
"baseDir",
")",
".",
"g... | Determine there is another platform feature requires this resource | [
"Determine",
"there",
"is",
"another",
"platform",
"feature",
"requires",
"this",
"resource"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/adaptor/ESAAdaptor.java#L503-L515 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/MetricServiceClient.java | MetricServiceClient.createTimeSeries | public final void createTimeSeries(ProjectName name, List<TimeSeries> timeSeries) {
"""
Creates or adds data to one or more time series. The response is empty if all time series in
the request were written. If any time series could not be written, a corresponding failure
message is included in the error response... | java | public final void createTimeSeries(ProjectName name, List<TimeSeries> timeSeries) {
CreateTimeSeriesRequest request =
CreateTimeSeriesRequest.newBuilder()
.setName(name == null ? null : name.toString())
.addAllTimeSeries(timeSeries)
.build();
createTimeSeries(request... | [
"public",
"final",
"void",
"createTimeSeries",
"(",
"ProjectName",
"name",
",",
"List",
"<",
"TimeSeries",
">",
"timeSeries",
")",
"{",
"CreateTimeSeriesRequest",
"request",
"=",
"CreateTimeSeriesRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"name",
... | Creates or adds data to one or more time series. The response is empty if all time series in
the request were written. If any time series could not be written, a corresponding failure
message is included in the error response.
<p>Sample code:
<pre><code>
try (MetricServiceClient metricServiceClient = MetricServiceCli... | [
"Creates",
"or",
"adds",
"data",
"to",
"one",
"or",
"more",
"time",
"series",
".",
"The",
"response",
"is",
"empty",
"if",
"all",
"time",
"series",
"in",
"the",
"request",
"were",
"written",
".",
"If",
"any",
"time",
"series",
"could",
"not",
"be",
"wr... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/MetricServiceClient.java#L1091-L1099 |
alkacon/opencms-core | src/org/opencms/staticexport/CmsLinkManager.java | CmsLinkManager.getRootPath | public String getRootPath(CmsObject cms, String targetUri, String basePath) {
"""
Returns the resource root path in the OpenCms VFS for the given target URI link, or <code>null</code> in
case the link points to an external site.<p>
The default implementation applies the following transformations to the link:<u... | java | public String getRootPath(CmsObject cms, String targetUri, String basePath) {
return m_linkSubstitutionHandler.getRootPath(cms, targetUri, basePath);
} | [
"public",
"String",
"getRootPath",
"(",
"CmsObject",
"cms",
",",
"String",
"targetUri",
",",
"String",
"basePath",
")",
"{",
"return",
"m_linkSubstitutionHandler",
".",
"getRootPath",
"(",
"cms",
",",
"targetUri",
",",
"basePath",
")",
";",
"}"
] | Returns the resource root path in the OpenCms VFS for the given target URI link, or <code>null</code> in
case the link points to an external site.<p>
The default implementation applies the following transformations to the link:<ul>
<li>In case the link starts with a VFS prefix (for example <code>/opencms/opencms</code... | [
"Returns",
"the",
"resource",
"root",
"path",
"in",
"the",
"OpenCms",
"VFS",
"for",
"the",
"given",
"target",
"URI",
"link",
"or",
"<code",
">",
"null<",
"/",
"code",
">",
"in",
"case",
"the",
"link",
"points",
"to",
"an",
"external",
"site",
".",
"<p"... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsLinkManager.java#L541-L544 |
Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java | TvdbParser.getEpisodeValue | private static int getEpisodeValue(Element eEpisode, String key) {
"""
Process the "key" from the element into an integer.
@param eEpisode
@param key
@return the value, 0 if not found or an error.
"""
int episodeValue;
try {
String value = DOMHelper.getValueFromElement(eEpisode... | java | private static int getEpisodeValue(Element eEpisode, String key) {
int episodeValue;
try {
String value = DOMHelper.getValueFromElement(eEpisode, key);
episodeValue = NumberUtils.toInt(value, 0);
} catch (WebServiceException ex) {
LOG.trace("Failed to read epi... | [
"private",
"static",
"int",
"getEpisodeValue",
"(",
"Element",
"eEpisode",
",",
"String",
"key",
")",
"{",
"int",
"episodeValue",
";",
"try",
"{",
"String",
"value",
"=",
"DOMHelper",
".",
"getValueFromElement",
"(",
"eEpisode",
",",
"key",
")",
";",
"episod... | Process the "key" from the element into an integer.
@param eEpisode
@param key
@return the value, 0 if not found or an error. | [
"Process",
"the",
"key",
"from",
"the",
"element",
"into",
"an",
"integer",
"."
] | train | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java#L534-L545 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/CFFFontSubset.java | CFFFontSubset.CreateNonCIDPrivate | void CreateNonCIDPrivate(int Font,OffsetItem Subr) {
"""
The function creates a private dict for a font that was not CID
All the keys are copied as is except for the subrs key
@param Font the font
@param Subr The OffsetItem for the subrs of the private
"""
// Go to the beginning of the private dict and re... | java | void CreateNonCIDPrivate(int Font,OffsetItem Subr)
{
// Go to the beginning of the private dict and read until the end
seek(fonts[Font].privateOffset);
while (getPosition() < fonts[Font].privateOffset+fonts[Font].privateLength)
{
int p1 = getPosition();
getDictItem();
int... | [
"void",
"CreateNonCIDPrivate",
"(",
"int",
"Font",
",",
"OffsetItem",
"Subr",
")",
"{",
"// Go to the beginning of the private dict and read until the end",
"seek",
"(",
"fonts",
"[",
"Font",
"]",
".",
"privateOffset",
")",
";",
"while",
"(",
"getPosition",
"(",
")"... | The function creates a private dict for a font that was not CID
All the keys are copied as is except for the subrs key
@param Font the font
@param Subr The OffsetItem for the subrs of the private | [
"The",
"function",
"creates",
"a",
"private",
"dict",
"for",
"a",
"font",
"that",
"was",
"not",
"CID",
"All",
"the",
"keys",
"are",
"copied",
"as",
"is",
"except",
"for",
"the",
"subrs",
"key"
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/CFFFontSubset.java#L1611-L1630 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.