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 |
|---|---|---|---|---|---|---|---|---|---|---|
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java | ViterbiBuilder.repairBrokenLatticeAfter | private void repairBrokenLatticeAfter(ViterbiLattice lattice, int nodeEndIndex) {
"""
Tries to repair the lattice by creating and adding an additional Viterbi node to the RIGHT of the newly
inserted user dictionary entry by using the substring of the node in the lattice that overlaps the least
@param lattice
@p... | java | private void repairBrokenLatticeAfter(ViterbiLattice lattice, int nodeEndIndex) {
ViterbiNode[][] nodeEndIndices = lattice.getEndIndexArr();
for (int endIndex = nodeEndIndex + 1; endIndex < nodeEndIndices.length; endIndex++) {
if (nodeEndIndices[endIndex] != null) {
ViterbiN... | [
"private",
"void",
"repairBrokenLatticeAfter",
"(",
"ViterbiLattice",
"lattice",
",",
"int",
"nodeEndIndex",
")",
"{",
"ViterbiNode",
"[",
"]",
"[",
"]",
"nodeEndIndices",
"=",
"lattice",
".",
"getEndIndexArr",
"(",
")",
";",
"for",
"(",
"int",
"endIndex",
"="... | Tries to repair the lattice by creating and adding an additional Viterbi node to the RIGHT of the newly
inserted user dictionary entry by using the substring of the node in the lattice that overlaps the least
@param lattice
@param nodeEndIndex | [
"Tries",
"to",
"repair",
"the",
"lattice",
"by",
"creating",
"and",
"adding",
"an",
"additional",
"Viterbi",
"node",
"to",
"the",
"RIGHT",
"of",
"the",
"newly",
"inserted",
"user",
"dictionary",
"entry",
"by",
"using",
"the",
"substring",
"of",
"the",
"node"... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-japanese/src/main/java/com/atilika/kuromoji/viterbi/ViterbiBuilder.java#L260-L276 |
cdk/cdk | descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/XLogPDescriptor.java | XLogPDescriptor.getHalogenCount | private int getHalogenCount(IAtomContainer ac, IAtom atom) {
"""
Gets the HalogenCount attribute of the XLogPDescriptor object.
@param ac Description of the Parameter
@param atom Description of the Parameter
@return The alogenCount value
"""
List<IAtom> neighbours = ac.getConnectedAtom... | java | private int getHalogenCount(IAtomContainer ac, IAtom atom) {
List<IAtom> neighbours = ac.getConnectedAtomsList(atom);
int acounter = 0;
for (IAtom neighbour : neighbours) {
if (neighbour.getSymbol().equals("F") || neighbour.getSymbol().equals("I")
|| neighbour.get... | [
"private",
"int",
"getHalogenCount",
"(",
"IAtomContainer",
"ac",
",",
"IAtom",
"atom",
")",
"{",
"List",
"<",
"IAtom",
">",
"neighbours",
"=",
"ac",
".",
"getConnectedAtomsList",
"(",
"atom",
")",
";",
"int",
"acounter",
"=",
"0",
";",
"for",
"(",
"IAto... | Gets the HalogenCount attribute of the XLogPDescriptor object.
@param ac Description of the Parameter
@param atom Description of the Parameter
@return The alogenCount value | [
"Gets",
"the",
"HalogenCount",
"attribute",
"of",
"the",
"XLogPDescriptor",
"object",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/XLogPDescriptor.java#L1031-L1041 |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Entry.java | Entry.changeStartTime | public final void changeStartTime(LocalTime time, boolean keepDuration) {
"""
Changes the start time of the entry interval.
@param time the new start time
@param keepDuration if true then this method will also change the end time in such a way that the total duration
of the entry will not change. If f... | java | public final void changeStartTime(LocalTime time, boolean keepDuration) {
requireNonNull(time);
Interval interval = getInterval();
LocalDateTime newStartDateTime = getStartAsLocalDateTime().with(time);
LocalDateTime endDateTime = getEndAsLocalDateTime();
if (keepDuration) {
... | [
"public",
"final",
"void",
"changeStartTime",
"(",
"LocalTime",
"time",
",",
"boolean",
"keepDuration",
")",
"{",
"requireNonNull",
"(",
"time",
")",
";",
"Interval",
"interval",
"=",
"getInterval",
"(",
")",
";",
"LocalDateTime",
"newStartDateTime",
"=",
"getSt... | Changes the start time of the entry interval.
@param time the new start time
@param keepDuration if true then this method will also change the end time in such a way that the total duration
of the entry will not change. If false then this method will ensure that the entry's interval
stays valid, which means th... | [
"Changes",
"the",
"start",
"time",
"of",
"the",
"entry",
"interval",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Entry.java#L441-L462 |
aragozin/jvm-tools | mxdump/src/main/java/org/gridkit/jvmtool/jackson/JsonGenerator.java | JsonGenerator.writeBooleanField | public final void writeBooleanField(String fieldName, boolean value)
throws IOException, JsonGenerationException {
"""
Convenience method for outputting a field entry ("member")
that has a boolean value. Equivalent to:
<pre>
writeFieldName(fieldName);
writeBoolean(value);
</pre>
"""
writeF... | java | public final void writeBooleanField(String fieldName, boolean value)
throws IOException, JsonGenerationException
{
writeFieldName(fieldName);
writeBoolean(value);
} | [
"public",
"final",
"void",
"writeBooleanField",
"(",
"String",
"fieldName",
",",
"boolean",
"value",
")",
"throws",
"IOException",
",",
"JsonGenerationException",
"{",
"writeFieldName",
"(",
"fieldName",
")",
";",
"writeBoolean",
"(",
"value",
")",
";",
"}"
] | Convenience method for outputting a field entry ("member")
that has a boolean value. Equivalent to:
<pre>
writeFieldName(fieldName);
writeBoolean(value);
</pre> | [
"Convenience",
"method",
"for",
"outputting",
"a",
"field",
"entry",
"(",
"member",
")",
"that",
"has",
"a",
"boolean",
"value",
".",
"Equivalent",
"to",
":",
"<pre",
">",
"writeFieldName",
"(",
"fieldName",
")",
";",
"writeBoolean",
"(",
"value",
")",
";"... | train | https://github.com/aragozin/jvm-tools/blob/d3a4d0c6a47fb9317f274988569655f30dcd2f76/mxdump/src/main/java/org/gridkit/jvmtool/jackson/JsonGenerator.java#L706-L711 |
glyptodon/guacamole-client | guacamole/src/main/java/org/apache/guacamole/tunnel/InterceptedStream.java | InterceptedStream.setStreamError | public void setStreamError(int code, String message) {
"""
Reports that this InterceptedStream did not complete successfully due to
an error described by the given status code and human-readable message.
The error reported by this call can later be retrieved as a
GuacamoleStreamException by calling getStreamErr... | java | public void setStreamError(int code, String message) {
// Map status code to GuacamoleStatus, assuming SERVER_ERROR by default
GuacamoleStatus status = GuacamoleStatus.fromGuacamoleStatusCode(code);
if (status == null)
status = GuacamoleStatus.SERVER_ERROR;
// Associate str... | [
"public",
"void",
"setStreamError",
"(",
"int",
"code",
",",
"String",
"message",
")",
"{",
"// Map status code to GuacamoleStatus, assuming SERVER_ERROR by default",
"GuacamoleStatus",
"status",
"=",
"GuacamoleStatus",
".",
"fromGuacamoleStatusCode",
"(",
"code",
")",
";",... | Reports that this InterceptedStream did not complete successfully due to
an error described by the given status code and human-readable message.
The error reported by this call can later be retrieved as a
GuacamoleStreamException by calling getStreamError().
@param code
The Guacamole protocol status code which describ... | [
"Reports",
"that",
"this",
"InterceptedStream",
"did",
"not",
"complete",
"successfully",
"due",
"to",
"an",
"error",
"described",
"by",
"the",
"given",
"status",
"code",
"and",
"human",
"-",
"readable",
"message",
".",
"The",
"error",
"reported",
"by",
"this"... | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole/src/main/java/org/apache/guacamole/tunnel/InterceptedStream.java#L123-L133 |
lightblue-platform/lightblue-migrator | migrator/src/main/java/com/redhat/lightblue/migrator/Migrator.java | Migrator.beforeSaveToDestination | protected void beforeSaveToDestination(Map<Identity, JsonNode> sourceDocs, Map<Identity, JsonNode> destDocs, Set<Identity> insertDocs, Set<Identity> rewriteDocs, List<JsonNode> saveDocsList) {
"""
Execute this method before docs are saved to destination (Lightblue). Modifying saveDocsList
will affect what gets ac... | java | protected void beforeSaveToDestination(Map<Identity, JsonNode> sourceDocs, Map<Identity, JsonNode> destDocs, Set<Identity> insertDocs, Set<Identity> rewriteDocs, List<JsonNode> saveDocsList) {
// do nothing by default
// override this in child classes to get access to docs before they are saved
} | [
"protected",
"void",
"beforeSaveToDestination",
"(",
"Map",
"<",
"Identity",
",",
"JsonNode",
">",
"sourceDocs",
",",
"Map",
"<",
"Identity",
",",
"JsonNode",
">",
"destDocs",
",",
"Set",
"<",
"Identity",
">",
"insertDocs",
",",
"Set",
"<",
"Identity",
">",
... | Execute this method before docs are saved to destination (Lightblue). Modifying saveDocsList
will affect what gets actually saved. Implementation of this method is responsible for exception handling.
@param sourceDocs docs read from source
@param destDocs corresponding docs read from destination
@param insertDocs docs... | [
"Execute",
"this",
"method",
"before",
"docs",
"are",
"saved",
"to",
"destination",
"(",
"Lightblue",
")",
".",
"Modifying",
"saveDocsList",
"will",
"affect",
"what",
"gets",
"actually",
"saved",
".",
"Implementation",
"of",
"this",
"method",
"is",
"responsible"... | train | https://github.com/lightblue-platform/lightblue-migrator/blob/ec20748557b40d1f7851e1816d1b76dae48d2027/migrator/src/main/java/com/redhat/lightblue/migrator/Migrator.java#L117-L120 |
apache/incubator-gobblin | gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/policy/HiveRegistrationPolicyBase.java | HiveRegistrationPolicyBase.getTable | protected HiveTable getTable(Path path, String dbName, String tableName) throws IOException {
"""
A base implementation for creating a non bucketed, external {@link HiveTable} for a {@link Path}.
@param path a {@link Path} used to create the {@link HiveTable}.
@param dbName the database name for the created {@... | java | protected HiveTable getTable(Path path, String dbName, String tableName) throws IOException {
HiveTable.Builder tableBuilder = new HiveTable.Builder().withDbName(dbName).withTableName(tableName);
if (!this.emptyInputPathFlag) {
tableBuilder = tableBuilder.withSerdeManaager(HiveSerDeManager.get(this.prop... | [
"protected",
"HiveTable",
"getTable",
"(",
"Path",
"path",
",",
"String",
"dbName",
",",
"String",
"tableName",
")",
"throws",
"IOException",
"{",
"HiveTable",
".",
"Builder",
"tableBuilder",
"=",
"new",
"HiveTable",
".",
"Builder",
"(",
")",
".",
"withDbName"... | A base implementation for creating a non bucketed, external {@link HiveTable} for a {@link Path}.
@param path a {@link Path} used to create the {@link HiveTable}.
@param dbName the database name for the created {@link HiveTable}.
@param tableName the table name for the created {@link HiveTable}.
@return a {@link HiveT... | [
"A",
"base",
"implementation",
"for",
"creating",
"a",
"non",
"bucketed",
"external",
"{",
"@link",
"HiveTable",
"}",
"for",
"a",
"{",
"@link",
"Path",
"}",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/policy/HiveRegistrationPolicyBase.java#L348-L371 |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/model/BatchResponse.java | BatchResponse.withItems | public BatchResponse withItems(java.util.Map<String,AttributeValue>... items) {
"""
Sets the value of the Items property for this object.
<p>
Returns a reference to this object so that method calls can be chained together.
@param items The new value for the Items property for this object.
@return A referen... | java | public BatchResponse withItems(java.util.Map<String,AttributeValue>... items) {
if (getItems() == null) setItems(new java.util.ArrayList<java.util.Map<String,AttributeValue>>(items.length));
for (java.util.Map<String,AttributeValue> value : items) {
getItems().add(value);
}
r... | [
"public",
"BatchResponse",
"withItems",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"AttributeValue",
">",
"...",
"items",
")",
"{",
"if",
"(",
"getItems",
"(",
")",
"==",
"null",
")",
"setItems",
"(",
"new",
"java",
".",
"util",
".",
"... | Sets the value of the Items property for this object.
<p>
Returns a reference to this object so that method calls can be chained together.
@param items The new value for the Items property for this object.
@return A reference to this updated object so that method calls can be chained
together. | [
"Sets",
"the",
"value",
"of",
"the",
"Items",
"property",
"for",
"this",
"object",
".",
"<p",
">",
"Returns",
"a",
"reference",
"to",
"this",
"object",
"so",
"that",
"method",
"calls",
"can",
"be",
"chained",
"together",
"."
] | train | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/model/BatchResponse.java#L76-L82 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/component/AnimatedModelComponent.java | AnimatedModelComponent.forceStart | public Timer forceStart(BlockPos pos, String animation) {
"""
Starts the {@link Timer} for the specified animation.<br>
Restarts the animation if it is already running.
@param pos the pos
@param animation the animation
@return the timer
"""
return forceStart(pos, animation, new Timer());
} | java | public Timer forceStart(BlockPos pos, String animation)
{
return forceStart(pos, animation, new Timer());
} | [
"public",
"Timer",
"forceStart",
"(",
"BlockPos",
"pos",
",",
"String",
"animation",
")",
"{",
"return",
"forceStart",
"(",
"pos",
",",
"animation",
",",
"new",
"Timer",
"(",
")",
")",
";",
"}"
] | Starts the {@link Timer} for the specified animation.<br>
Restarts the animation if it is already running.
@param pos the pos
@param animation the animation
@return the timer | [
"Starts",
"the",
"{",
"@link",
"Timer",
"}",
"for",
"the",
"specified",
"animation",
".",
"<br",
">",
"Restarts",
"the",
"animation",
"if",
"it",
"is",
"already",
"running",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/component/AnimatedModelComponent.java#L179-L182 |
jenkinsci/jenkins | core/src/main/java/hudson/model/MyViewsProperty.java | MyViewsProperty.doViewExistsCheck | public FormValidation doViewExistsCheck(@QueryParameter String value, @QueryParameter boolean exists) {
"""
Checks if a private view with the given name exists.
An error is returned if exists==true but the view does not exist.
An error is also returned if exists==false but the view does exist.
"""
ch... | java | public FormValidation doViewExistsCheck(@QueryParameter String value, @QueryParameter boolean exists) {
checkPermission(View.CREATE);
String view = Util.fixEmpty(value);
if (view == null) return FormValidation.ok();
if (exists) {
return (getView(view)!=null) ?
For... | [
"public",
"FormValidation",
"doViewExistsCheck",
"(",
"@",
"QueryParameter",
"String",
"value",
",",
"@",
"QueryParameter",
"boolean",
"exists",
")",
"{",
"checkPermission",
"(",
"View",
".",
"CREATE",
")",
";",
"String",
"view",
"=",
"Util",
".",
"fixEmpty",
... | Checks if a private view with the given name exists.
An error is returned if exists==true but the view does not exist.
An error is also returned if exists==false but the view does exist. | [
"Checks",
"if",
"a",
"private",
"view",
"with",
"the",
"given",
"name",
"exists",
".",
"An",
"error",
"is",
"returned",
"if",
"exists",
"==",
"true",
"but",
"the",
"view",
"does",
"not",
"exist",
".",
"An",
"error",
"is",
"also",
"returned",
"if",
"exi... | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/MyViewsProperty.java#L186-L200 |
restfb/restfb | src/main/java/com/restfb/DefaultFacebookClient.java | DefaultFacebookClient.makeRequest | protected String makeRequest(String endpoint, Parameter... parameters) {
"""
Coordinates the process of executing the API request GET/POST and processing the response we receive from the
endpoint.
@param endpoint
Facebook Graph API endpoint.
@param parameters
Arbitrary number of parameters to send along to ... | java | protected String makeRequest(String endpoint, Parameter... parameters) {
return makeRequest(endpoint, false, false, null, parameters);
} | [
"protected",
"String",
"makeRequest",
"(",
"String",
"endpoint",
",",
"Parameter",
"...",
"parameters",
")",
"{",
"return",
"makeRequest",
"(",
"endpoint",
",",
"false",
",",
"false",
",",
"null",
",",
"parameters",
")",
";",
"}"
] | Coordinates the process of executing the API request GET/POST and processing the response we receive from the
endpoint.
@param endpoint
Facebook Graph API endpoint.
@param parameters
Arbitrary number of parameters to send along to Facebook as part of the API call.
@return The JSON returned by Facebook for the API call... | [
"Coordinates",
"the",
"process",
"of",
"executing",
"the",
"API",
"request",
"GET",
"/",
"POST",
"and",
"processing",
"the",
"response",
"we",
"receive",
"from",
"the",
"endpoint",
"."
] | train | https://github.com/restfb/restfb/blob/fb77ba5486d1339e7deb81b9830670fa209b1047/src/main/java/com/restfb/DefaultFacebookClient.java#L723-L725 |
aws/aws-sdk-java | aws-java-sdk-pi/src/main/java/com/amazonaws/services/pi/model/MetricQuery.java | MetricQuery.withFilter | public MetricQuery withFilter(java.util.Map<String, String> filter) {
"""
<p>
One or more filters to apply in the request. Restrictions:
</p>
<ul>
<li>
<p>
Any number of filters by the same dimension, as specified in the <code>GroupBy</code> parameter.
</p>
</li>
<li>
<p>
A single filter for any other d... | java | public MetricQuery withFilter(java.util.Map<String, String> filter) {
setFilter(filter);
return this;
} | [
"public",
"MetricQuery",
"withFilter",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"filter",
")",
"{",
"setFilter",
"(",
"filter",
")",
";",
"return",
"this",
";",
"}"
] | <p>
One or more filters to apply in the request. Restrictions:
</p>
<ul>
<li>
<p>
Any number of filters by the same dimension, as specified in the <code>GroupBy</code> parameter.
</p>
</li>
<li>
<p>
A single filter for any other dimension in this dimension group.
</p>
</li>
</ul>
@param filter
One or more filters to a... | [
"<p",
">",
"One",
"or",
"more",
"filters",
"to",
"apply",
"in",
"the",
"request",
".",
"Restrictions",
":",
"<",
"/",
"p",
">",
"<ul",
">",
"<li",
">",
"<p",
">",
"Any",
"number",
"of",
"filters",
"by",
"the",
"same",
"dimension",
"as",
"specified",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pi/src/main/java/com/amazonaws/services/pi/model/MetricQuery.java#L375-L378 |
structr/structr | structr-ui/src/main/java/org/structr/web/common/FileHelper.java | FileHelper.writeToFile | public static void writeToFile(final File fileNode, final InputStream data) throws FrameworkException, IOException {
"""
Write binary data from FileInputStream to a file and reference the file on disk at the given file node
@param fileNode
@param data The input stream from which to read the file data (Stream i... | java | public static void writeToFile(final File fileNode, final InputStream data) throws FrameworkException, IOException {
setFileProperties(fileNode);
try (final FileOutputStream out = new FileOutputStream(fileNode.getFileOnDisk())) {
IOUtils.copy(data, out);
}
} | [
"public",
"static",
"void",
"writeToFile",
"(",
"final",
"File",
"fileNode",
",",
"final",
"InputStream",
"data",
")",
"throws",
"FrameworkException",
",",
"IOException",
"{",
"setFileProperties",
"(",
"fileNode",
")",
";",
"try",
"(",
"final",
"FileOutputStream",... | Write binary data from FileInputStream to a file and reference the file on disk at the given file node
@param fileNode
@param data The input stream from which to read the file data (Stream is not closed automatically - has to be handled by caller)
@throws FrameworkException
@throws IOException | [
"Write",
"binary",
"data",
"from",
"FileInputStream",
"to",
"a",
"file",
"and",
"reference",
"the",
"file",
"on",
"disk",
"at",
"the",
"given",
"file",
"node"
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L565-L573 |
jbundle/jbundle | main/db/src/main/java/org/jbundle/main/db/FolderField.java | FolderField.setupDefaultView | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) {
"""
Set up the default screen control for this field.
@param itsLocation Location of this component on screen (ie., GridBagConstraint).
@param t... | java | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties)
{
Record record = this.getReferenceRecord(); // Get/make the record that describes the referenced class.
if (record != null)
... | [
"public",
"ScreenComponent",
"setupDefaultView",
"(",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"Convert",
"converter",
",",
"int",
"iDisplayFieldDesc",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"Record",
... | Set up the default screen control for this field.
@param itsLocation Location of this component on screen (ie., GridBagConstraint).
@param targetScreen Where to place this component (ie., Parent screen or GridBagLayout).
@param converter The converter to set the screenfield to.
@param iDisplayFieldDesc Display the labe... | [
"Set",
"up",
"the",
"default",
"screen",
"control",
"for",
"this",
"field",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/db/src/main/java/org/jbundle/main/db/FolderField.java#L72-L79 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/trie/bintrie/BinTrie.java | BinTrie.load | public boolean load(String path, V[] value) {
"""
从磁盘加载二分数组树
@param path 路径
@param value 额外提供的值数组,按照值的字典序。(之所以要求提供它,是因为泛型的保存不归树管理)
@return 是否成功
"""
byte[] bytes = IOUtil.readBytes(path);
if (bytes == null) return false;
_ValueArray valueArray = new _ValueArray(value);
Byte... | java | public boolean load(String path, V[] value)
{
byte[] bytes = IOUtil.readBytes(path);
if (bytes == null) return false;
_ValueArray valueArray = new _ValueArray(value);
ByteArray byteArray = new ByteArray(bytes);
for (int i = 0; i < child.length; ++i)
{
int ... | [
"public",
"boolean",
"load",
"(",
"String",
"path",
",",
"V",
"[",
"]",
"value",
")",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"IOUtil",
".",
"readBytes",
"(",
"path",
")",
";",
"if",
"(",
"bytes",
"==",
"null",
")",
"return",
"false",
";",
"_ValueArra... | 从磁盘加载二分数组树
@param path 路径
@param value 额外提供的值数组,按照值的字典序。(之所以要求提供它,是因为泛型的保存不归树管理)
@return 是否成功 | [
"从磁盘加载二分数组树"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/trie/bintrie/BinTrie.java#L412-L430 |
Squarespace/cldr | compiler/src/main/java/com/squarespace/cldr/codegen/CalendarCodeGenerator.java | CalendarCodeGenerator.addIntervalPattern | private void addIntervalPattern(MethodSpec.Builder method, List<Node> pattern, String which) {
"""
Adds code to format a date time interval pattern, which may be the start or end
date time, signified by the 'which' parameter.
"""
for (Node node : pattern) {
if (node instanceof Text) {
method... | java | private void addIntervalPattern(MethodSpec.Builder method, List<Node> pattern, String which) {
for (Node node : pattern) {
if (node instanceof Text) {
method.addStatement("b.append($S)", ((Text)node).text());
} else if (node instanceof Field) {
Field field = (Field)node;
method.a... | [
"private",
"void",
"addIntervalPattern",
"(",
"MethodSpec",
".",
"Builder",
"method",
",",
"List",
"<",
"Node",
">",
"pattern",
",",
"String",
"which",
")",
"{",
"for",
"(",
"Node",
"node",
":",
"pattern",
")",
"{",
"if",
"(",
"node",
"instanceof",
"Text... | Adds code to format a date time interval pattern, which may be the start or end
date time, signified by the 'which' parameter. | [
"Adds",
"code",
"to",
"format",
"a",
"date",
"time",
"interval",
"pattern",
"which",
"may",
"be",
"the",
"start",
"or",
"end",
"date",
"time",
"signified",
"by",
"the",
"which",
"parameter",
"."
] | train | https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/compiler/src/main/java/com/squarespace/cldr/codegen/CalendarCodeGenerator.java#L480-L489 |
datacleaner/DataCleaner | engine/env/spark/src/main/java/org/datacleaner/spark/SparkRunner.java | SparkRunner.findFile | private URI findFile(final String filePath, final boolean upload) {
"""
Tries to find a file on HDFS, and optionally uploads it if not found.
@param filePath Path of the file to find
@param upload true if file upload should be attempted.
@return Either the resolved URI, or the uploaded file.
"""
t... | java | private URI findFile(final String filePath, final boolean upload) {
try {
URI fileURI;
try {
fileURI = _hadoopDefaultFS.getUri().resolve(filePath);
} catch (final Exception e) {
fileURI = null;
}
if ((fileURI == null ||... | [
"private",
"URI",
"findFile",
"(",
"final",
"String",
"filePath",
",",
"final",
"boolean",
"upload",
")",
"{",
"try",
"{",
"URI",
"fileURI",
";",
"try",
"{",
"fileURI",
"=",
"_hadoopDefaultFS",
".",
"getUri",
"(",
")",
".",
"resolve",
"(",
"filePath",
")... | Tries to find a file on HDFS, and optionally uploads it if not found.
@param filePath Path of the file to find
@param upload true if file upload should be attempted.
@return Either the resolved URI, or the uploaded file. | [
"Tries",
"to",
"find",
"a",
"file",
"on",
"HDFS",
"and",
"optionally",
"uploads",
"it",
"if",
"not",
"found",
"."
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/engine/env/spark/src/main/java/org/datacleaner/spark/SparkRunner.java#L88-L112 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/quantiles/ItemsSketch.java | ItemsSketch.getQuantileUpperBound | public T getQuantileUpperBound(final double fraction) {
"""
Gets the upper bound of the value interval in which the true quantile of the given rank
exists with a confidence of at least 99%.
@param fraction the given normalized rank as a fraction
@return the upper bound of the value interval in which the true qu... | java | public T getQuantileUpperBound(final double fraction) {
return getQuantile(min(1.0, fraction + Util.getNormalizedRankError(k_, false)));
} | [
"public",
"T",
"getQuantileUpperBound",
"(",
"final",
"double",
"fraction",
")",
"{",
"return",
"getQuantile",
"(",
"min",
"(",
"1.0",
",",
"fraction",
"+",
"Util",
".",
"getNormalizedRankError",
"(",
"k_",
",",
"false",
")",
")",
")",
";",
"}"
] | Gets the upper bound of the value interval in which the true quantile of the given rank
exists with a confidence of at least 99%.
@param fraction the given normalized rank as a fraction
@return the upper bound of the value interval in which the true quantile of the given rank
exists with a confidence of at least 99%. R... | [
"Gets",
"the",
"upper",
"bound",
"of",
"the",
"value",
"interval",
"in",
"which",
"the",
"true",
"quantile",
"of",
"the",
"given",
"rank",
"exists",
"with",
"a",
"confidence",
"of",
"at",
"least",
"99%",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/quantiles/ItemsSketch.java#L282-L284 |
mguymon/naether | src/main/java/com/tobedevoured/naether/util/Notation.java | Notation.generate | public static String generate( Map<String,String> notationMap ) {
"""
Convert a {@link Map} to String notation of
groupId:artifactId:version or if type is present, groupId:artifactId:type:version
@param notationMap Map
@return String notation
"""
StringBuilder notation = new StringBuilder();
... | java | public static String generate( Map<String,String> notationMap ) {
StringBuilder notation = new StringBuilder();
notation.append( notationMap.get( "groupId" ) ).append(":").append( notationMap.get( "artifactId") ).append(":");
if ( notationMap.get( "type" ) != null ) {
notation.appen... | [
"public",
"static",
"String",
"generate",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"notationMap",
")",
"{",
"StringBuilder",
"notation",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"notation",
".",
"append",
"(",
"notationMap",
".",
"get",
"(",
"\"gr... | Convert a {@link Map} to String notation of
groupId:artifactId:version or if type is present, groupId:artifactId:type:version
@param notationMap Map
@return String notation | [
"Convert",
"a",
"{",
"@link",
"Map",
"}",
"to",
"String",
"notation",
"of",
"groupId",
":",
"artifactId",
":",
"version",
"or",
"if",
"type",
"is",
"present",
"groupId",
":",
"artifactId",
":",
"type",
":",
"version"
] | train | https://github.com/mguymon/naether/blob/218d8fd36c0b8b6e16d66e5715975570b4560ec4/src/main/java/com/tobedevoured/naether/util/Notation.java#L123-L134 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TimeZoneFormat.java | TimeZoneFormat.parseSingleLocalizedDigit | private int parseSingleLocalizedDigit(String text, int start, int[] len) {
"""
Reads a single decimal digit, either localized digits used by this object
or any Unicode numeric character.
@param text the text
@param start the start index
@param len the actual length read from the text
the start index is not a ... | java | private int parseSingleLocalizedDigit(String text, int start, int[] len) {
int digit = -1;
len[0] = 0;
if (start < text.length()) {
int cp = Character.codePointAt(text, start);
// First, try digits configured for this instance
for (int i = 0; i < _gmtOffsetDi... | [
"private",
"int",
"parseSingleLocalizedDigit",
"(",
"String",
"text",
",",
"int",
"start",
",",
"int",
"[",
"]",
"len",
")",
"{",
"int",
"digit",
"=",
"-",
"1",
";",
"len",
"[",
"0",
"]",
"=",
"0",
";",
"if",
"(",
"start",
"<",
"text",
".",
"leng... | Reads a single decimal digit, either localized digits used by this object
or any Unicode numeric character.
@param text the text
@param start the start index
@param len the actual length read from the text
the start index is not a decimal number.
@return the integer value of the parsed digit, or -1 on failure. | [
"Reads",
"a",
"single",
"decimal",
"digit",
"either",
"localized",
"digits",
"used",
"by",
"this",
"object",
"or",
"any",
"Unicode",
"numeric",
"character",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TimeZoneFormat.java#L2618-L2641 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.perspectiveLH | public Matrix4f perspectiveLH(float fovy, float aspect, float zNear, float zFar, Matrix4f dest) {
"""
Apply a symmetric perspective projection frustum transformation for a left-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code> to this matrix and store the result in <code>dest</code>.
<... | java | public Matrix4f perspectiveLH(float fovy, float aspect, float zNear, float zFar, Matrix4f dest) {
return perspectiveLH(fovy, aspect, zNear, zFar, false, dest);
} | [
"public",
"Matrix4f",
"perspectiveLH",
"(",
"float",
"fovy",
",",
"float",
"aspect",
",",
"float",
"zNear",
",",
"float",
"zFar",
",",
"Matrix4f",
"dest",
")",
"{",
"return",
"perspectiveLH",
"(",
"fovy",
",",
"aspect",
",",
"zNear",
",",
"zFar",
",",
"f... | Apply a symmetric perspective projection frustum transformation for a left-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code> to this matrix and store the result in <code>dest</code>.
<p>
If <code>M</code> is <code>this</code> matrix and <code>P</code> the perspective projection matrix,
then t... | [
"Apply",
"a",
"symmetric",
"perspective",
"projection",
"frustum",
"transformation",
"for",
"a",
"left",
"-",
"handed",
"coordinate",
"system",
"using",
"OpenGL",
"s",
"NDC",
"z",
"range",
"of",
"<code",
">",
"[",
"-",
"1",
"..",
"+",
"1",
"]",
"<",
"/",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L10177-L10179 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/MessageProcessor.java | MessageProcessor.createConnection | protected SICoreConnection createConnection() throws SIResourceException {
"""
Connection locks are obtained on the connection lock manager.
@return
"""
if (TraceComponent.isAnyTracingEnabled()
&& tc.isEntryEnabled())
SibTr.entry(tc, "createConnection");
SICoreConnec... | java | protected SICoreConnection createConnection() throws SIResourceException {
if (TraceComponent.isAnyTracingEnabled()
&& tc.isEntryEnabled())
SibTr.entry(tc, "createConnection");
SICoreConnection newConn = new ConnectionImpl(this, null, null);
// Lock the connections so t... | [
"protected",
"SICoreConnection",
"createConnection",
"(",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"... | Connection locks are obtained on the connection lock manager.
@return | [
"Connection",
"locks",
"are",
"obtained",
"on",
"the",
"connection",
"lock",
"manager",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/MessageProcessor.java#L320-L347 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SDVariable.java | SDVariable.storeAndAllocateNewArray | public INDArray storeAndAllocateNewArray() {
"""
Allocate and return a new array
based on the vertex id and weight initialization.
@return the allocated array
"""
Preconditions.checkState(variableType == VariableType.VARIABLE, "Unable to allocate and store array for variable of type %s: only" +
... | java | public INDArray storeAndAllocateNewArray() {
Preconditions.checkState(variableType == VariableType.VARIABLE, "Unable to allocate and store array for variable of type %s: only" +
" VARIABLE type variables can be initialized using this method", variableType);
if(!sameDiff.arrayAlreadyExis... | [
"public",
"INDArray",
"storeAndAllocateNewArray",
"(",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"variableType",
"==",
"VariableType",
".",
"VARIABLE",
",",
"\"Unable to allocate and store array for variable of type %s: only\"",
"+",
"\" VARIABLE type variables can be in... | Allocate and return a new array
based on the vertex id and weight initialization.
@return the allocated array | [
"Allocate",
"and",
"return",
"a",
"new",
"array",
"based",
"on",
"the",
"vertex",
"id",
"and",
"weight",
"initialization",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SDVariable.java#L158-L175 |
WolfgangFahl/Mediawiki-Japi | src/main/java/com/bitplan/mediawiki/japi/Mediawiki.java | Mediawiki.getActionResult | public Api getActionResult(String action, String params) throws Exception {
"""
get the result for the given action and query
@param action
@param params
@return the API result for the action
@throws Exception
"""
Api result = this.getActionResult(action, params, null, null);
return result;
} | java | public Api getActionResult(String action, String params) throws Exception {
Api result = this.getActionResult(action, params, null, null);
return result;
} | [
"public",
"Api",
"getActionResult",
"(",
"String",
"action",
",",
"String",
"params",
")",
"throws",
"Exception",
"{",
"Api",
"result",
"=",
"this",
".",
"getActionResult",
"(",
"action",
",",
"params",
",",
"null",
",",
"null",
")",
";",
"return",
"result... | get the result for the given action and query
@param action
@param params
@return the API result for the action
@throws Exception | [
"get",
"the",
"result",
"for",
"the",
"given",
"action",
"and",
"query"
] | train | https://github.com/WolfgangFahl/Mediawiki-Japi/blob/78d0177ebfe02eb05da5550839727861f1e888a5/src/main/java/com/bitplan/mediawiki/japi/Mediawiki.java#L481-L484 |
jronrun/benayn | benayn-berkeley/src/main/java/com/benayn/berkeley/Berkeley.java | Berkeley.of | public static BerkeleyStore of(String envHomePath, String storeName) {
"""
Returns a new {@link BerkeleyStore} instance, {@link Environment} with {@link Berkeley#defaultEnvironmentConfig()
and {@link EntityStore} with {@link Berkeley#defaultStoreConfig()}
"""
return env(envHomePath).connection(storeNa... | java | public static BerkeleyStore of(String envHomePath, String storeName) {
return env(envHomePath).connection(storeName, null);
} | [
"public",
"static",
"BerkeleyStore",
"of",
"(",
"String",
"envHomePath",
",",
"String",
"storeName",
")",
"{",
"return",
"env",
"(",
"envHomePath",
")",
".",
"connection",
"(",
"storeName",
",",
"null",
")",
";",
"}"
] | Returns a new {@link BerkeleyStore} instance, {@link Environment} with {@link Berkeley#defaultEnvironmentConfig()
and {@link EntityStore} with {@link Berkeley#defaultStoreConfig()} | [
"Returns",
"a",
"new",
"{"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-berkeley/src/main/java/com/benayn/berkeley/Berkeley.java#L123-L125 |
paypal/SeLion | client/src/main/java/com/paypal/selion/configuration/Config.java | Config.setConfigProperty | public static synchronized void setConfigProperty(ConfigProperty configProperty, Object configPropertyValue) {
"""
Sets a SeLion configuration value. This is useful when you want to override or set a setting.
@param configProperty
The configuration element to set
@param configPropertyValue
The value of the c... | java | public static synchronized void setConfigProperty(ConfigProperty configProperty, Object configPropertyValue) {
checkArgument(configProperty != null, "Config property cannot be null.");
checkArgument(configPropertyValue != null, "Config property value cannot be null.");
getConfig().setProperty(co... | [
"public",
"static",
"synchronized",
"void",
"setConfigProperty",
"(",
"ConfigProperty",
"configProperty",
",",
"Object",
"configPropertyValue",
")",
"{",
"checkArgument",
"(",
"configProperty",
"!=",
"null",
",",
"\"Config property cannot be null.\"",
")",
";",
"checkArgu... | Sets a SeLion configuration value. This is useful when you want to override or set a setting.
@param configProperty
The configuration element to set
@param configPropertyValue
The value of the configuration element
@throws IllegalArgumentException
If problems occur during the set | [
"Sets",
"a",
"SeLion",
"configuration",
"value",
".",
"This",
"is",
"useful",
"when",
"you",
"want",
"to",
"override",
"or",
"set",
"a",
"setting",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/client/src/main/java/com/paypal/selion/configuration/Config.java#L376-L380 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java | GeoJsonWriteDriver.writeCRS | private void writeCRS(JsonGenerator jsonGenerator, String[] authorityAndSRID) throws IOException {
"""
Write the CRS in the geojson
@param jsonGenerator
@param authorityAndSRID
@throws IOException
"""
if (authorityAndSRID[1] != null) {
jsonGenerator.writeObjectFieldStart("crs");
... | java | private void writeCRS(JsonGenerator jsonGenerator, String[] authorityAndSRID) throws IOException {
if (authorityAndSRID[1] != null) {
jsonGenerator.writeObjectFieldStart("crs");
jsonGenerator.writeStringField("type", "name");
jsonGenerator.writeObjectFieldStart("properties");... | [
"private",
"void",
"writeCRS",
"(",
"JsonGenerator",
"jsonGenerator",
",",
"String",
"[",
"]",
"authorityAndSRID",
")",
"throws",
"IOException",
"{",
"if",
"(",
"authorityAndSRID",
"[",
"1",
"]",
"!=",
"null",
")",
"{",
"jsonGenerator",
".",
"writeObjectFieldSta... | Write the CRS in the geojson
@param jsonGenerator
@param authorityAndSRID
@throws IOException | [
"Write",
"the",
"CRS",
"in",
"the",
"geojson"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/geojson/GeoJsonWriteDriver.java#L630-L641 |
alkacon/opencms-core | src/org/opencms/importexport/CmsImportVersion10.java | CmsImportVersion10.createResourceObjectFromFields | protected CmsResource createResourceObjectFromFields(String translatedName, int size) {
"""
Create a CmsResource object from the currently set field values.<p>
@param translatedName the resource name
@param size the size
@return the new CmsResource object
"""
m_resourceBuilder.setRootPath(transla... | java | protected CmsResource createResourceObjectFromFields(String translatedName, int size) {
m_resourceBuilder.setRootPath(translatedName);
m_resourceBuilder.setState(CmsResource.STATE_NEW);
m_resourceBuilder.setProjectLastModified(getRequestContext().getCurrentProject().getUuid());
m_resour... | [
"protected",
"CmsResource",
"createResourceObjectFromFields",
"(",
"String",
"translatedName",
",",
"int",
"size",
")",
"{",
"m_resourceBuilder",
".",
"setRootPath",
"(",
"translatedName",
")",
";",
"m_resourceBuilder",
".",
"setState",
"(",
"CmsResource",
".",
"STATE... | Create a CmsResource object from the currently set field values.<p>
@param translatedName the resource name
@param size the size
@return the new CmsResource object | [
"Create",
"a",
"CmsResource",
"object",
"from",
"the",
"currently",
"set",
"field",
"values",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/CmsImportVersion10.java#L3439-L3449 |
bbossgroups/bboss-elasticsearch | bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java | RestClientUtil.addDocumentWithId | public String addDocumentWithId(String indexName, Object bean, Object docId, Object parentId) throws ElasticSearchException {
"""
创建或者更新索引文档
For Elasticsearch 7 and 7+
@param indexName
@param bean
@param docId
@return
@throws ElasticSearchException
"""
return addDocumentWithId( indexName, _doc, b... | java | public String addDocumentWithId(String indexName, Object bean, Object docId, Object parentId) throws ElasticSearchException{
return addDocumentWithId( indexName, _doc, bean, docId, parentId);
} | [
"public",
"String",
"addDocumentWithId",
"(",
"String",
"indexName",
",",
"Object",
"bean",
",",
"Object",
"docId",
",",
"Object",
"parentId",
")",
"throws",
"ElasticSearchException",
"{",
"return",
"addDocumentWithId",
"(",
"indexName",
",",
"_doc",
",",
"bean",
... | 创建或者更新索引文档
For Elasticsearch 7 and 7+
@param indexName
@param bean
@param docId
@return
@throws ElasticSearchException | [
"创建或者更新索引文档",
"For",
"Elasticsearch",
"7",
"and",
"7",
"+"
] | train | https://github.com/bbossgroups/bboss-elasticsearch/blob/31717c8aa2c4c880987be53aeeb8a0cf5183c3a7/bboss-elasticsearch-rest/src/main/java/org/frameworkset/elasticsearch/client/RestClientUtil.java#L4498-L4500 |
apache/incubator-druid | processing/src/main/java/org/apache/druid/query/scan/ScanQueryEngine.java | ScanQueryEngine.calculateLimit | private long calculateLimit(ScanQuery query, Map<String, Object> responseContext) {
"""
If we're performing time-ordering, we want to scan through the first `limit` rows in each segment ignoring the number
of rows already counted on other segments.
"""
if (query.getOrder().equals(ScanQuery.Order.NONE)) {
... | java | private long calculateLimit(ScanQuery query, Map<String, Object> responseContext)
{
if (query.getOrder().equals(ScanQuery.Order.NONE)) {
return query.getLimit() - (long) responseContext.get(ScanQueryRunnerFactory.CTX_COUNT);
}
return query.getLimit();
} | [
"private",
"long",
"calculateLimit",
"(",
"ScanQuery",
"query",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"responseContext",
")",
"{",
"if",
"(",
"query",
".",
"getOrder",
"(",
")",
".",
"equals",
"(",
"ScanQuery",
".",
"Order",
".",
"NONE",
")",
... | If we're performing time-ordering, we want to scan through the first `limit` rows in each segment ignoring the number
of rows already counted on other segments. | [
"If",
"we",
"re",
"performing",
"time",
"-",
"ordering",
"we",
"want",
"to",
"scan",
"through",
"the",
"first",
"limit",
"rows",
"in",
"each",
"segment",
"ignoring",
"the",
"number",
"of",
"rows",
"already",
"counted",
"on",
"other",
"segments",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/processing/src/main/java/org/apache/druid/query/scan/ScanQueryEngine.java#L265-L271 |
synchronoss/cpo-api | cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java | CassandraCpoAdapter.insertObject | @Override
public <T> long insertObject(String name, T obj, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException {
"""
Creates the Object in the datasource. The assumption is that the object does not exist in the datasource. This
method... | java | @Override
public <T> long insertObject(String name, T obj, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException {
return processUpdateGroup(obj, CpoAdapter.CREATE_GROUP, name, wheres, orderBy, nativeExpressions);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"long",
"insertObject",
"(",
"String",
"name",
",",
"T",
"obj",
",",
"Collection",
"<",
"CpoWhere",
">",
"wheres",
",",
"Collection",
"<",
"CpoOrderBy",
">",
"orderBy",
",",
"Collection",
"<",
"CpoNativeFunction",
... | Creates the Object in the datasource. The assumption is that the object does not exist in the datasource. This
method creates and stores the object in the datasource
<p/>
<pre>Example:
<code>
<p/>
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
<p/>
try {
cpo = new CpoAdapter(new JdbcDataSourceInfo... | [
"Creates",
"the",
"Object",
"in",
"the",
"datasource",
".",
"The",
"assumption",
"is",
"that",
"the",
"object",
"does",
"not",
"exist",
"in",
"the",
"datasource",
".",
"This",
"method",
"creates",
"and",
"stores",
"the",
"object",
"in",
"the",
"datasource",
... | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java#L243-L246 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/kg/AipKnowledgeGraphic.java | AipKnowledgeGraphic.updateTask | public JSONObject updateTask(int id, HashMap<String, String> options) {
"""
更新任务接口
更新任务配置,在任务重新启动后生效
@param id - 任务ID
@param options - 可选参数对象,key: value都为string类型
options - options列表:
name 任务名字
template_content json string 解析模板内容
input_mapping_file 抓取结果映射文件的路径
url_pattern url pattern
output_file 输出文件名字
... | java | public JSONObject updateTask(int id, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("id", id);
if (options != null) {
request.addBody(options);
}
request.setUri(KnowledgeGraphicConsts.U... | [
"public",
"JSONObject",
"updateTask",
"(",
"int",
"id",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"request",
".",
"a... | 更新任务接口
更新任务配置,在任务重新启动后生效
@param id - 任务ID
@param options - 可选参数对象,key: value都为string类型
options - options列表:
name 任务名字
template_content json string 解析模板内容
input_mapping_file 抓取结果映射文件的路径
url_pattern url pattern
output_file 输出文件名字
@return JSONObject | [
"更新任务接口",
"更新任务配置,在任务重新启动后生效"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/kg/AipKnowledgeGraphic.java#L77-L88 |
ben-manes/caffeine | caffeine/src/main/java/com/github/benmanes/caffeine/cache/LocalAsyncLoadingCache.java | LocalAsyncLoadingCache.canBulkLoad | private static boolean canBulkLoad(AsyncCacheLoader<?, ?> loader) {
"""
Returns whether the supplied cache loader has bulk load functionality.
"""
try {
Class<?> defaultLoaderClass = AsyncCacheLoader.class;
if (loader instanceof CacheLoader<?, ?>) {
defaultLoaderClass = CacheLoader.clas... | java | private static boolean canBulkLoad(AsyncCacheLoader<?, ?> loader) {
try {
Class<?> defaultLoaderClass = AsyncCacheLoader.class;
if (loader instanceof CacheLoader<?, ?>) {
defaultLoaderClass = CacheLoader.class;
Method classLoadAll = loader.getClass().getMethod("loadAll", Iterable.class)... | [
"private",
"static",
"boolean",
"canBulkLoad",
"(",
"AsyncCacheLoader",
"<",
"?",
",",
"?",
">",
"loader",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"defaultLoaderClass",
"=",
"AsyncCacheLoader",
".",
"class",
";",
"if",
"(",
"loader",
"instanceof",
"C... | Returns whether the supplied cache loader has bulk load functionality. | [
"Returns",
"whether",
"the",
"supplied",
"cache",
"loader",
"has",
"bulk",
"load",
"functionality",
"."
] | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/caffeine/src/main/java/com/github/benmanes/caffeine/cache/LocalAsyncLoadingCache.java#L55-L77 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Matth.java | Matth.saturatedMultiply | public static long saturatedMultiply(long a, long b) {
"""
Returns the product of {@code a} and {@code b} unless it would overflow or underflow in which
case {@code Long.MAX_VALUE} or {@code Long.MIN_VALUE} is returned, respectively.
@since 20.0
"""
// see checkedMultiply for explanation
... | java | public static long saturatedMultiply(long a, long b) {
// see checkedMultiply for explanation
int leadingZeros = Long.numberOfLeadingZeros(a) + Long.numberOfLeadingZeros(~a) + Long.numberOfLeadingZeros(b) + Long.numberOfLeadingZeros(~b);
if (leadingZeros > Long.SIZE + 1) {
return... | [
"public",
"static",
"long",
"saturatedMultiply",
"(",
"long",
"a",
",",
"long",
"b",
")",
"{",
"// see checkedMultiply for explanation\r",
"int",
"leadingZeros",
"=",
"Long",
".",
"numberOfLeadingZeros",
"(",
"a",
")",
"+",
"Long",
".",
"numberOfLeadingZeros",
"("... | Returns the product of {@code a} and {@code b} unless it would overflow or underflow in which
case {@code Long.MAX_VALUE} or {@code Long.MIN_VALUE} is returned, respectively.
@since 20.0 | [
"Returns",
"the",
"product",
"of",
"{",
"@code",
"a",
"}",
"and",
"{",
"@code",
"b",
"}",
"unless",
"it",
"would",
"overflow",
"or",
"underflow",
"in",
"which",
"case",
"{",
"@code",
"Long",
".",
"MAX_VALUE",
"}",
"or",
"{",
"@code",
"Long",
".",
"MI... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Matth.java#L1628-L1645 |
joelittlejohn/jsonschema2pojo | jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/util/NameHelper.java | NameHelper.getSetterName | public String getSetterName(String propertyName, JsonNode node) {
"""
Generate setter method name for property.
@param propertyName
@param node
@return
"""
propertyName = getPropertyNameForAccessor(propertyName, node);
String prefix = "set";
String setterName;
if (propert... | java | public String getSetterName(String propertyName, JsonNode node) {
propertyName = getPropertyNameForAccessor(propertyName, node);
String prefix = "set";
String setterName;
if (propertyName.length() > 1 && Character.isUpperCase(propertyName.charAt(1))) {
setterName = prefix +... | [
"public",
"String",
"getSetterName",
"(",
"String",
"propertyName",
",",
"JsonNode",
"node",
")",
"{",
"propertyName",
"=",
"getPropertyNameForAccessor",
"(",
"propertyName",
",",
"node",
")",
";",
"String",
"prefix",
"=",
"\"set\"",
";",
"String",
"setterName",
... | Generate setter method name for property.
@param propertyName
@param node
@return | [
"Generate",
"setter",
"method",
"name",
"for",
"property",
"."
] | train | https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/util/NameHelper.java#L128-L145 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/model/crf/crfpp/Node.java | Node.calcExpectation | public void calcExpectation(double[] expected, double Z, int size) {
"""
计算节点期望
@param expected 输出期望
@param Z 规范化因子
@param size 标签个数
"""
double c = Math.exp(alpha + beta - cost - Z);
for (int i = 0; fVector.get(i) != -1; i++)
{
int idx = fVector.get(i) + y;
... | java | public void calcExpectation(double[] expected, double Z, int size)
{
double c = Math.exp(alpha + beta - cost - Z);
for (int i = 0; fVector.get(i) != -1; i++)
{
int idx = fVector.get(i) + y;
expected[idx] += c;
}
for (Path p : lpath)
{
... | [
"public",
"void",
"calcExpectation",
"(",
"double",
"[",
"]",
"expected",
",",
"double",
"Z",
",",
"int",
"size",
")",
"{",
"double",
"c",
"=",
"Math",
".",
"exp",
"(",
"alpha",
"+",
"beta",
"-",
"cost",
"-",
"Z",
")",
";",
"for",
"(",
"int",
"i"... | 计算节点期望
@param expected 输出期望
@param Z 规范化因子
@param size 标签个数 | [
"计算节点期望"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/crf/crfpp/Node.java#L80-L92 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java | TileBoundingBoxUtils.getWebMercatorBoundingBox | public static BoundingBox getWebMercatorBoundingBox(long x, long y, int zoom) {
"""
Get the Web Mercator tile bounding box from the Google Maps API tile
coordinates and zoom level
@param x
x coordinate
@param y
y coordinate
@param zoom
zoom level
@return bounding box
"""
double tileSize = tileSize... | java | public static BoundingBox getWebMercatorBoundingBox(long x, long y, int zoom) {
double tileSize = tileSizeWithZoom(zoom);
double minLon = (-1 * ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH)
+ (x * tileSize);
double maxLon = (-1 * ProjectionConstants.WEB_MERCATOR_HALF_WORLD_WIDTH)
+ ((x + 1) * tileS... | [
"public",
"static",
"BoundingBox",
"getWebMercatorBoundingBox",
"(",
"long",
"x",
",",
"long",
"y",
",",
"int",
"zoom",
")",
"{",
"double",
"tileSize",
"=",
"tileSizeWithZoom",
"(",
"zoom",
")",
";",
"double",
"minLon",
"=",
"(",
"-",
"1",
"*",
"Projection... | Get the Web Mercator tile bounding box from the Google Maps API tile
coordinates and zoom level
@param x
x coordinate
@param y
y coordinate
@param zoom
zoom level
@return bounding box | [
"Get",
"the",
"Web",
"Mercator",
"tile",
"bounding",
"box",
"from",
"the",
"Google",
"Maps",
"API",
"tile",
"coordinates",
"and",
"zoom",
"level"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java#L347-L363 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PatternsImpl.java | PatternsImpl.getIntentPatternsAsync | public Observable<List<PatternRuleInfo>> getIntentPatternsAsync(UUID appId, String versionId, UUID intentId, GetIntentPatternsOptionalParameter getIntentPatternsOptionalParameter) {
"""
Returns patterns to be retrieved for the specific intent.
@param appId The application ID.
@param versionId The version ID.
... | java | public Observable<List<PatternRuleInfo>> getIntentPatternsAsync(UUID appId, String versionId, UUID intentId, GetIntentPatternsOptionalParameter getIntentPatternsOptionalParameter) {
return getIntentPatternsWithServiceResponseAsync(appId, versionId, intentId, getIntentPatternsOptionalParameter).map(new Func1<Ser... | [
"public",
"Observable",
"<",
"List",
"<",
"PatternRuleInfo",
">",
">",
"getIntentPatternsAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"intentId",
",",
"GetIntentPatternsOptionalParameter",
"getIntentPatternsOptionalParameter",
")",
"{",
"return... | Returns patterns to be retrieved for the specific intent.
@param appId The application ID.
@param versionId The version ID.
@param intentId The intent classifier ID.
@param getIntentPatternsOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentExcept... | [
"Returns",
"patterns",
"to",
"be",
"retrieved",
"for",
"the",
"specific",
"intent",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PatternsImpl.java#L881-L888 |
mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.getObjectElem | @Deprecated
public static Object getObjectElem(Object obj, Object elem, Context cx) {
"""
Call obj.[[Get]](id)
@deprecated Use {@link #getObjectElem(Object, Object, Context, Scriptable)} instead
"""
return getObjectElem(obj, elem, cx, getTopCallScope(cx));
} | java | @Deprecated
public static Object getObjectElem(Object obj, Object elem, Context cx)
{
return getObjectElem(obj, elem, cx, getTopCallScope(cx));
} | [
"@",
"Deprecated",
"public",
"static",
"Object",
"getObjectElem",
"(",
"Object",
"obj",
",",
"Object",
"elem",
",",
"Context",
"cx",
")",
"{",
"return",
"getObjectElem",
"(",
"obj",
",",
"elem",
",",
"cx",
",",
"getTopCallScope",
"(",
"cx",
")",
")",
";"... | Call obj.[[Get]](id)
@deprecated Use {@link #getObjectElem(Object, Object, Context, Scriptable)} instead | [
"Call",
"obj",
".",
"[[",
"Get",
"]]",
"(",
"id",
")"
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L1513-L1517 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.copy | public static File copy(String srcPath, String destPath, boolean isOverride) throws IORuntimeException {
"""
复制文件或目录<br>
如果目标文件为目录,则将源文件以相同文件名拷贝到目标目录
@param srcPath 源文件或目录
@param destPath 目标文件或目录,目标不存在会自动创建(目录、文件都创建)
@param isOverride 是否覆盖目标文件
@return 目标目录或文件
@throws IORuntimeException IO异常
"""
retu... | java | public static File copy(String srcPath, String destPath, boolean isOverride) throws IORuntimeException {
return copy(file(srcPath), file(destPath), isOverride);
} | [
"public",
"static",
"File",
"copy",
"(",
"String",
"srcPath",
",",
"String",
"destPath",
",",
"boolean",
"isOverride",
")",
"throws",
"IORuntimeException",
"{",
"return",
"copy",
"(",
"file",
"(",
"srcPath",
")",
",",
"file",
"(",
"destPath",
")",
",",
"is... | 复制文件或目录<br>
如果目标文件为目录,则将源文件以相同文件名拷贝到目标目录
@param srcPath 源文件或目录
@param destPath 目标文件或目录,目标不存在会自动创建(目录、文件都创建)
@param isOverride 是否覆盖目标文件
@return 目标目录或文件
@throws IORuntimeException IO异常 | [
"复制文件或目录<br",
">",
"如果目标文件为目录,则将源文件以相同文件名拷贝到目标目录"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L983-L985 |
needle4j/needle4j | src/main/java/org/needle4j/db/operation/AbstractDBOperation.java | AbstractDBOperation.openConnection | protected void openConnection() throws SQLException {
"""
Establish a connection to the given database.
@throws SQLException
if a database access error occurs
"""
if (connection == null) {
try {
Class.forName(configuration.getJdbcDriver());
} catch (NullPoint... | java | protected void openConnection() throws SQLException {
if (connection == null) {
try {
Class.forName(configuration.getJdbcDriver());
} catch (NullPointerException npe) {
throw new RuntimeException("error while lookup jdbc driver class. jdbc driver is not co... | [
"protected",
"void",
"openConnection",
"(",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"connection",
"==",
"null",
")",
"{",
"try",
"{",
"Class",
".",
"forName",
"(",
"configuration",
".",
"getJdbcDriver",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Null... | Establish a connection to the given database.
@throws SQLException
if a database access error occurs | [
"Establish",
"a",
"connection",
"to",
"the",
"given",
"database",
"."
] | train | https://github.com/needle4j/needle4j/blob/55fbcdeed72be5cf26e4404b0fe40282792b51f2/src/main/java/org/needle4j/db/operation/AbstractDBOperation.java#L43-L57 |
code4everything/util | src/main/java/com/zhazhapan/util/dialog/Alerts.java | Alerts.showConfirmation | public static Optional<ButtonType> showConfirmation(String title, String content) {
"""
弹出确认框
@param title 标题
@param content 内容
@return {@link ButtonType}
"""
return showConfirmation(title, null, content);
} | java | public static Optional<ButtonType> showConfirmation(String title, String content) {
return showConfirmation(title, null, content);
} | [
"public",
"static",
"Optional",
"<",
"ButtonType",
">",
"showConfirmation",
"(",
"String",
"title",
",",
"String",
"content",
")",
"{",
"return",
"showConfirmation",
"(",
"title",
",",
"null",
",",
"content",
")",
";",
"}"
] | 弹出确认框
@param title 标题
@param content 内容
@return {@link ButtonType} | [
"弹出确认框"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/dialog/Alerts.java#L107-L109 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/EntityListenersIntrospector.java | EntityListenersIntrospector.validateExternalCallback | private void validateExternalCallback(Method method, CallbackType callbackType) {
"""
Validates and registers the given callback method.
@param method
the callback method
@param callbackType
the callback type
"""
Class<?>[] parameters = method.getParameterTypes();
if (!parameters[0].isAssignableF... | java | private void validateExternalCallback(Method method, CallbackType callbackType) {
Class<?>[] parameters = method.getParameterTypes();
if (!parameters[0].isAssignableFrom(entityClass)) {
String message = String.format("Method %s in class %s is not valid for entity %s",
method.getName(), method.ge... | [
"private",
"void",
"validateExternalCallback",
"(",
"Method",
"method",
",",
"CallbackType",
"callbackType",
")",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"parameters",
"=",
"method",
".",
"getParameterTypes",
"(",
")",
";",
"if",
"(",
"!",
"parameters",
"[",
... | Validates and registers the given callback method.
@param method
the callback method
@param callbackType
the callback type | [
"Validates",
"and",
"registers",
"the",
"given",
"callback",
"method",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/EntityListenersIntrospector.java#L162-L172 |
cdk/cdk | base/data/src/main/java/org/openscience/cdk/AtomContainerSet.java | AtomContainerSet.sortAtomContainers | @Override
public void sortAtomContainers(final Comparator<IAtomContainer> comparator) {
"""
Sort the AtomContainers and multipliers using a provided Comparator.
@param comparator defines the sorting method
"""
// need to use boxed primitives as we can't customise sorting of int primitives
... | java | @Override
public void sortAtomContainers(final Comparator<IAtomContainer> comparator) {
// need to use boxed primitives as we can't customise sorting of int primitives
Integer[] indexes = new Integer[atomContainerCount];
for (int i = 0; i < indexes.length; i++)
indexes[i] = i;
... | [
"@",
"Override",
"public",
"void",
"sortAtomContainers",
"(",
"final",
"Comparator",
"<",
"IAtomContainer",
">",
"comparator",
")",
"{",
"// need to use boxed primitives as we can't customise sorting of int primitives",
"Integer",
"[",
"]",
"indexes",
"=",
"new",
"Integer",... | Sort the AtomContainers and multipliers using a provided Comparator.
@param comparator defines the sorting method | [
"Sort",
"the",
"AtomContainers",
"and",
"multipliers",
"using",
"a",
"provided",
"Comparator",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/data/src/main/java/org/openscience/cdk/AtomContainerSet.java#L412-L439 |
apache/flink | flink-core/src/main/java/org/apache/flink/configuration/Configuration.java | Configuration.getFloat | @PublicEvolving
public float getFloat(ConfigOption<Float> configOption, float overrideDefault) {
"""
Returns the value associated with the given config option as a float.
If no value is mapped under any key of the option, it returns the specified
default instead of the option's default value.
@param configOp... | java | @PublicEvolving
public float getFloat(ConfigOption<Float> configOption, float overrideDefault) {
Object o = getRawValueFromOption(configOption);
if (o == null) {
return overrideDefault;
}
return convertToFloat(o, configOption.defaultValue());
} | [
"@",
"PublicEvolving",
"public",
"float",
"getFloat",
"(",
"ConfigOption",
"<",
"Float",
">",
"configOption",
",",
"float",
"overrideDefault",
")",
"{",
"Object",
"o",
"=",
"getRawValueFromOption",
"(",
"configOption",
")",
";",
"if",
"(",
"o",
"==",
"null",
... | Returns the value associated with the given config option as a float.
If no value is mapped under any key of the option, it returns the specified
default instead of the option's default value.
@param configOption The configuration option
@param overrideDefault The value to return if no value was mapper for any key of ... | [
"Returns",
"the",
"value",
"associated",
"with",
"the",
"given",
"config",
"option",
"as",
"a",
"float",
".",
"If",
"no",
"value",
"is",
"mapped",
"under",
"any",
"key",
"of",
"the",
"option",
"it",
"returns",
"the",
"specified",
"default",
"instead",
"of"... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L456-L463 |
Impetus/Kundera | src/kundera-mongo/src/main/java/com/impetus/client/mongodb/DocumentObjectMapper.java | DocumentObjectMapper.extractFieldValue | static void extractFieldValue(Object entity, DBObject dbObj, Attribute column) throws PropertyAccessException {
"""
Extract entity field.
@param entity
the entity
@param dbObj
the db obj
@param column
the column
@throws PropertyAccessException
the property access exception
"""
try
{... | java | static void extractFieldValue(Object entity, DBObject dbObj, Attribute column) throws PropertyAccessException
{
try
{
Object valueObject = PropertyAccessorHelper.getObject(entity, (Field) column.getJavaMember());
if (valueObject != null)
{
... | [
"static",
"void",
"extractFieldValue",
"(",
"Object",
"entity",
",",
"DBObject",
"dbObj",
",",
"Attribute",
"column",
")",
"throws",
"PropertyAccessException",
"{",
"try",
"{",
"Object",
"valueObject",
"=",
"PropertyAccessorHelper",
".",
"getObject",
"(",
"entity",
... | Extract entity field.
@param entity
the entity
@param dbObj
the db obj
@param column
the column
@throws PropertyAccessException
the property access exception | [
"Extract",
"entity",
"field",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-mongo/src/main/java/com/impetus/client/mongodb/DocumentObjectMapper.java#L278-L333 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java | WordVectorSerializer.readParagraphVectors | public static ParagraphVectors readParagraphVectors(File file) throws IOException {
"""
This method restores ParagraphVectors model previously saved with writeParagraphVectors()
@return
"""
Word2Vec w2v = readWord2Vec(file);
// and "convert" it to ParaVec model + optionally trying to restor... | java | public static ParagraphVectors readParagraphVectors(File file) throws IOException {
Word2Vec w2v = readWord2Vec(file);
// and "convert" it to ParaVec model + optionally trying to restore labels information
ParagraphVectors vectors = new ParagraphVectors.Builder(w2v.getConfiguration())
... | [
"public",
"static",
"ParagraphVectors",
"readParagraphVectors",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"Word2Vec",
"w2v",
"=",
"readWord2Vec",
"(",
"file",
")",
";",
"// and \"convert\" it to ParaVec model + optionally trying to restore labels information",
"... | This method restores ParagraphVectors model previously saved with writeParagraphVectors()
@return | [
"This",
"method",
"restores",
"ParagraphVectors",
"model",
"previously",
"saved",
"with",
"writeParagraphVectors",
"()"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java#L730-L760 |
alkacon/opencms-core | src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBProjectId.java | CmsUpdateDBProjectId.needsUpdating | protected boolean needsUpdating(CmsSetupDb dbCon, String tablename) throws SQLException {
"""
Checks if the given table needs an update of the uuids.<p>
@param dbCon the db connection interface
@param tablename the table to check
@return true if the project ids are not yet updated, false if nothing needs to... | java | protected boolean needsUpdating(CmsSetupDb dbCon, String tablename) throws SQLException {
System.out.println(new Exception().getStackTrace()[0].toString());
boolean result = true;
String query = readQuery(QUERY_DESCRIBE_TABLE);
Map<String, String> replacer = new HashMap<String, String>... | [
"protected",
"boolean",
"needsUpdating",
"(",
"CmsSetupDb",
"dbCon",
",",
"String",
"tablename",
")",
"throws",
"SQLException",
"{",
"System",
".",
"out",
".",
"println",
"(",
"new",
"Exception",
"(",
")",
".",
"getStackTrace",
"(",
")",
"[",
"0",
"]",
"."... | Checks if the given table needs an update of the uuids.<p>
@param dbCon the db connection interface
@param tablename the table to check
@return true if the project ids are not yet updated, false if nothing needs to be done
@throws SQLException if something goes wrong | [
"Checks",
"if",
"the",
"given",
"table",
"needs",
"an",
"update",
"of",
"the",
"uuids",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBProjectId.java#L465-L498 |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/context/ContextRuntime.java | ContextRuntime.spawnChildContext | ContextRuntime spawnChildContext(
final Configuration contextConfiguration,
final Configuration serviceConfiguration) throws ContextClientCodeException {
"""
Spawns a new context.
<p>
The new context will have a serviceInjector that is created by forking the one in this object with the given
service... | java | ContextRuntime spawnChildContext(
final Configuration contextConfiguration,
final Configuration serviceConfiguration) throws ContextClientCodeException {
synchronized (this.contextLifeCycle) {
if (this.task.isPresent()) {
throw new IllegalStateException(
"Attempting to spawn ... | [
"ContextRuntime",
"spawnChildContext",
"(",
"final",
"Configuration",
"contextConfiguration",
",",
"final",
"Configuration",
"serviceConfiguration",
")",
"throws",
"ContextClientCodeException",
"{",
"synchronized",
"(",
"this",
".",
"contextLifeCycle",
")",
"{",
"if",
"("... | Spawns a new context.
<p>
The new context will have a serviceInjector that is created by forking the one in this object with the given
serviceConfiguration. The contextConfiguration is used to fork the contextInjector from that new serviceInjector.
@param contextConfiguration the new context's context (local) Configur... | [
"Spawns",
"a",
"new",
"context",
".",
"<p",
">",
"The",
"new",
"context",
"will",
"have",
"a",
"serviceInjector",
"that",
"is",
"created",
"by",
"forking",
"the",
"one",
"in",
"this",
"object",
"with",
"the",
"given",
"serviceConfiguration",
".",
"The",
"c... | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/context/ContextRuntime.java#L147-L186 |
lucee/Lucee | core/src/main/java/lucee/runtime/tag/Zip.java | Zip.required | private void required(String attributeName, String attributValue) throws ApplicationException {
"""
throw a error if the value is empty (null)
@param attributeName
@param attributValue
@throws ApplicationException
"""
if (StringUtil.isEmpty(attributValue))
throw new ApplicationException("invalid att... | java | private void required(String attributeName, String attributValue) throws ApplicationException {
if (StringUtil.isEmpty(attributValue))
throw new ApplicationException("invalid attribute constellation for the tag zip", "attribute [" + attributeName + "] is required, if action is [" + action + "]");
} | [
"private",
"void",
"required",
"(",
"String",
"attributeName",
",",
"String",
"attributValue",
")",
"throws",
"ApplicationException",
"{",
"if",
"(",
"StringUtil",
".",
"isEmpty",
"(",
"attributValue",
")",
")",
"throw",
"new",
"ApplicationException",
"(",
"\"inva... | throw a error if the value is empty (null)
@param attributeName
@param attributValue
@throws ApplicationException | [
"throw",
"a",
"error",
"if",
"the",
"value",
"is",
"empty",
"(",
"null",
")"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Zip.java#L677-L680 |
rometools/rome | rome-utils/src/main/java/com/rometools/utils/Lists.java | Lists.sizeIs | public static boolean sizeIs(final List<?> list, final int size) {
"""
Checks whether the list has the given size. A null list is treated like a list without
entries.
@param list The list to check
@param size The size to check
@return true when the list has the given size or when size = 0 and the list is nul... | java | public static boolean sizeIs(final List<?> list, final int size) {
if (size == 0) {
return list == null || list.isEmpty();
} else {
return list != null && list.size() == size;
}
} | [
"public",
"static",
"boolean",
"sizeIs",
"(",
"final",
"List",
"<",
"?",
">",
"list",
",",
"final",
"int",
"size",
")",
"{",
"if",
"(",
"size",
"==",
"0",
")",
"{",
"return",
"list",
"==",
"null",
"||",
"list",
".",
"isEmpty",
"(",
")",
";",
"}",... | Checks whether the list has the given size. A null list is treated like a list without
entries.
@param list The list to check
@param size The size to check
@return true when the list has the given size or when size = 0 and the list is null, false
otherwise | [
"Checks",
"whether",
"the",
"list",
"has",
"the",
"given",
"size",
".",
"A",
"null",
"list",
"is",
"treated",
"like",
"a",
"list",
"without",
"entries",
"."
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-utils/src/main/java/com/rometools/utils/Lists.java#L94-L100 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/Messages.java | Messages.getWithDefault | public String getWithDefault(String key, String defaultMessage, RouteContext routeContext, Object... args) {
"""
Gets the requested localized message.
<p/>
<p>
The current Request and Response are used to help determine the messages
resource to use.
<ol>
<li>Exact locale match, return the registered locale m... | java | public String getWithDefault(String key, String defaultMessage, RouteContext routeContext, Object... args) {
String language = languages.getLanguageOrDefault(routeContext);
return getWithDefault(key, defaultMessage, language, args);
} | [
"public",
"String",
"getWithDefault",
"(",
"String",
"key",
",",
"String",
"defaultMessage",
",",
"RouteContext",
"routeContext",
",",
"Object",
"...",
"args",
")",
"{",
"String",
"language",
"=",
"languages",
".",
"getLanguageOrDefault",
"(",
"routeContext",
")",... | Gets the requested localized message.
<p/>
<p>
The current Request and Response are used to help determine the messages
resource to use.
<ol>
<li>Exact locale match, return the registered locale message
<li>Language match, but not a locale match, return the registered
language message
<li>Return the supplied default me... | [
"Gets",
"the",
"requested",
"localized",
"message",
".",
"<p",
"/",
">",
"<p",
">",
"The",
"current",
"Request",
"and",
"Response",
"are",
"used",
"to",
"help",
"determine",
"the",
"messages",
"resource",
"to",
"use",
".",
"<ol",
">",
"<li",
">",
"Exact"... | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/Messages.java#L151-L154 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailmxplan/src/main/java/net/minidev/ovh/api/ApiOvhEmailmxplan.java | ApiOvhEmailmxplan.service_account_email_PUT | public void service_account_email_PUT(String service, String email, OvhAccount body) throws IOException {
"""
Alter this object properties
REST: PUT /email/mxplan/{service}/account/{email}
@param body [required] New object properties
@param service [required] The internal name of your mxplan organization
@pa... | java | public void service_account_email_PUT(String service, String email, OvhAccount body) throws IOException {
String qPath = "/email/mxplan/{service}/account/{email}";
StringBuilder sb = path(qPath, service, email);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"service_account_email_PUT",
"(",
"String",
"service",
",",
"String",
"email",
",",
"OvhAccount",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/mxplan/{service}/account/{email}\"",
";",
"StringBuilder",
"sb",
"=",
"path... | Alter this object properties
REST: PUT /email/mxplan/{service}/account/{email}
@param body [required] New object properties
@param service [required] The internal name of your mxplan organization
@param email [required] Default email for this mailbox
API beta | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailmxplan/src/main/java/net/minidev/ovh/api/ApiOvhEmailmxplan.java#L174-L178 |
JakeWharton/ActionBarSherlock | actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAdapterView.java | IcsAdapterView.performItemClick | public boolean performItemClick(View view, int position, long id) {
"""
Call the OnItemClickListener, if it is defined.
@param view The view within the AdapterView that was clicked.
@param position The position of the view in the adapter.
@param id The row id of the item that was clicked.
@return True if the... | java | public boolean performItemClick(View view, int position, long id) {
if (mOnItemClickListener != null) {
playSoundEffect(SoundEffectConstants.CLICK);
if (view != null) {
view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
}
mOnItemCli... | [
"public",
"boolean",
"performItemClick",
"(",
"View",
"view",
",",
"int",
"position",
",",
"long",
"id",
")",
"{",
"if",
"(",
"mOnItemClickListener",
"!=",
"null",
")",
"{",
"playSoundEffect",
"(",
"SoundEffectConstants",
".",
"CLICK",
")",
";",
"if",
"(",
... | Call the OnItemClickListener, if it is defined.
@param view The view within the AdapterView that was clicked.
@param position The position of the view in the adapter.
@param id The row id of the item that was clicked.
@return True if there was an assigned OnItemClickListener that was
called, false otherwise is returne... | [
"Call",
"the",
"OnItemClickListener",
"if",
"it",
"is",
"defined",
"."
] | train | https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/internal/widget/IcsAdapterView.java#L266-L277 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/query/QueryImpl.java | QueryImpl.setRelationEntities | protected List<Object> setRelationEntities(List enhanceEntities, Client client, EntityMetadata m) {
"""
Sets the relation entities.
@param enhanceEntities
the enhance entities
@param client
the client
@param m
the m
@return the list
"""
// Enhance entities can contain or may not contain relati... | java | protected List<Object> setRelationEntities(List enhanceEntities, Client client, EntityMetadata m)
{
// Enhance entities can contain or may not contain relation.
// if it contain a relation means it is a child
// if it does not then it means it is a parent.
List<Object> result = new A... | [
"protected",
"List",
"<",
"Object",
">",
"setRelationEntities",
"(",
"List",
"enhanceEntities",
",",
"Client",
"client",
",",
"EntityMetadata",
"m",
")",
"{",
"// Enhance entities can contain or may not contain relation.",
"// if it contain a relation means it is a child",
"// ... | Sets the relation entities.
@param enhanceEntities
the enhance entities
@param client
the client
@param m
the m
@return the list | [
"Sets",
"the",
"relation",
"entities",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/query/QueryImpl.java#L218-L254 |
mozilla/rhino | src/org/mozilla/javascript/Context.java | Context.decompileScript | public final String decompileScript(Script script, int indent) {
"""
Decompile the script.
<p>
The canonical source of the script is returned.
@param script the script to decompile
@param indent the number of spaces to indent the result
@return a string representing the script source
"""
NativeF... | java | public final String decompileScript(Script script, int indent)
{
NativeFunction scriptImpl = (NativeFunction) script;
return scriptImpl.decompile(indent, 0);
} | [
"public",
"final",
"String",
"decompileScript",
"(",
"Script",
"script",
",",
"int",
"indent",
")",
"{",
"NativeFunction",
"scriptImpl",
"=",
"(",
"NativeFunction",
")",
"script",
";",
"return",
"scriptImpl",
".",
"decompile",
"(",
"indent",
",",
"0",
")",
"... | Decompile the script.
<p>
The canonical source of the script is returned.
@param script the script to decompile
@param indent the number of spaces to indent the result
@return a string representing the script source | [
"Decompile",
"the",
"script",
".",
"<p",
">",
"The",
"canonical",
"source",
"of",
"the",
"script",
"is",
"returned",
"."
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Context.java#L1580-L1584 |
ow2-chameleon/fuchsia | bases/knx/calimero/src/main/java/tuwien/auto/calimero/dptxlator/DPTXlator.java | DPTXlator.logThrow | final KNXFormatException logThrow(LogLevel level, String msg, String excMsg,
String item) {
"""
Helper which logs message and creates a format exception.
<p>
Adds the current dpt ID as prefix to log output.
@param level log level
@param msg log output, exception message if <code>excMsg</code> is
<code>nu... | java | final KNXFormatException logThrow(LogLevel level, String msg, String excMsg,
String item)
{
final KNXFormatException e =
new KNXFormatException(excMsg != null ? excMsg : msg, item);
if (excMsg != null)
logger.log(level, dpt.getID() + " - " + msg, e);
else
logger.log(level, dpt.getID() + " - " ... | [
"final",
"KNXFormatException",
"logThrow",
"(",
"LogLevel",
"level",
",",
"String",
"msg",
",",
"String",
"excMsg",
",",
"String",
"item",
")",
"{",
"final",
"KNXFormatException",
"e",
"=",
"new",
"KNXFormatException",
"(",
"excMsg",
"!=",
"null",
"?",
"excMsg... | Helper which logs message and creates a format exception.
<p>
Adds the current dpt ID as prefix to log output.
@param level log level
@param msg log output, exception message if <code>excMsg</code> is
<code>null</code>
@param excMsg exception message, if <code>null</code> <code>msg</code> is used
@param item item in K... | [
"Helper",
"which",
"logs",
"message",
"and",
"creates",
"a",
"format",
"exception",
".",
"<p",
">",
"Adds",
"the",
"current",
"dpt",
"ID",
"as",
"prefix",
"to",
"log",
"output",
"."
] | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/bases/knx/calimero/src/main/java/tuwien/auto/calimero/dptxlator/DPTXlator.java#L477-L487 |
overturetool/overture | ide/debug/src/main/java/org/overture/ide/debug/ui/propertypages/VdmBreakpointPropertyPage.java | VdmBreakpointPropertyPage.createLabel | protected Label createLabel(Composite parent, String text) {
"""
Creates a fully configured label with the given text.
@param parent
the parent composite
@param text
the test of the returned label
@return a fully configured label
"""
return SWTFactory.createLabel(parent, text, 1);
} | java | protected Label createLabel(Composite parent, String text)
{
return SWTFactory.createLabel(parent, text, 1);
} | [
"protected",
"Label",
"createLabel",
"(",
"Composite",
"parent",
",",
"String",
"text",
")",
"{",
"return",
"SWTFactory",
".",
"createLabel",
"(",
"parent",
",",
"text",
",",
"1",
")",
";",
"}"
] | Creates a fully configured label with the given text.
@param parent
the parent composite
@param text
the test of the returned label
@return a fully configured label | [
"Creates",
"a",
"fully",
"configured",
"label",
"with",
"the",
"given",
"text",
"."
] | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/ide/debug/src/main/java/org/overture/ide/debug/ui/propertypages/VdmBreakpointPropertyPage.java#L518-L521 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/DevicesManagementApi.java | DevicesManagementApi.updateTask | public TaskUpdateResponse updateTask(String tid, TaskUpdateRequest taskUpdateRequest) throws ApiException {
"""
Updates a task for all devices - For now just allows changing the state to cancelled.
Updates a task for all devices - For now just allows changing the state to cancelled.
@param tid Task ID. (required... | java | public TaskUpdateResponse updateTask(String tid, TaskUpdateRequest taskUpdateRequest) throws ApiException {
ApiResponse<TaskUpdateResponse> resp = updateTaskWithHttpInfo(tid, taskUpdateRequest);
return resp.getData();
} | [
"public",
"TaskUpdateResponse",
"updateTask",
"(",
"String",
"tid",
",",
"TaskUpdateRequest",
"taskUpdateRequest",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"TaskUpdateResponse",
">",
"resp",
"=",
"updateTaskWithHttpInfo",
"(",
"tid",
",",
"taskUpdateReque... | Updates a task for all devices - For now just allows changing the state to cancelled.
Updates a task for all devices - For now just allows changing the state to cancelled.
@param tid Task ID. (required)
@param taskUpdateRequest Task update request (required)
@return TaskUpdateResponse
@throws ApiException If fail to ca... | [
"Updates",
"a",
"task",
"for",
"all",
"devices",
"-",
"For",
"now",
"just",
"allows",
"changing",
"the",
"state",
"to",
"cancelled",
".",
"Updates",
"a",
"task",
"for",
"all",
"devices",
"-",
"For",
"now",
"just",
"allows",
"changing",
"the",
"state",
"t... | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/DevicesManagementApi.java#L1808-L1811 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.removeResourceFromUsersPubList | public void removeResourceFromUsersPubList(CmsDbContext dbc, CmsUUID userId, Collection<CmsUUID> structureIds)
throws CmsDataAccessException {
"""
Removes the given resource to the given user's publish list.<p>
@param dbc the database context
@param userId the user's id
@param structureIds the collection ... | java | public void removeResourceFromUsersPubList(CmsDbContext dbc, CmsUUID userId, Collection<CmsUUID> structureIds)
throws CmsDataAccessException {
for (CmsUUID structureId : structureIds) {
CmsLogEntry entry = new CmsLogEntry(
userId,
System.currentTimeMillis(),
... | [
"public",
"void",
"removeResourceFromUsersPubList",
"(",
"CmsDbContext",
"dbc",
",",
"CmsUUID",
"userId",
",",
"Collection",
"<",
"CmsUUID",
">",
"structureIds",
")",
"throws",
"CmsDataAccessException",
"{",
"for",
"(",
"CmsUUID",
"structureId",
":",
"structureIds",
... | Removes the given resource to the given user's publish list.<p>
@param dbc the database context
@param userId the user's id
@param structureIds the collection of structure IDs to remove
@throws CmsDataAccessException if something goes wrong | [
"Removes",
"the",
"given",
"resource",
"to",
"the",
"given",
"user",
"s",
"publish",
"list",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L8258-L8270 |
logic-ng/LogicNG | src/main/java/org/logicng/graphs/datastructures/HypergraphNode.java | HypergraphNode.computeTentativeNewLocation | public double computeTentativeNewLocation(final Map<HypergraphNode<T>, Integer> nodeOrdering) {
"""
Computes the tentative new location for this node (see Aloul, Markov, and Sakallah).
@param nodeOrdering the node ordering for which the COG is computed
@return the tentative new location for this node
"""
... | java | public double computeTentativeNewLocation(final Map<HypergraphNode<T>, Integer> nodeOrdering) {
double newLocation = 0;
for (final HypergraphEdge<T> edge : this.edges)
newLocation += edge.centerOfGravity(nodeOrdering);
return newLocation / this.edges.size();
} | [
"public",
"double",
"computeTentativeNewLocation",
"(",
"final",
"Map",
"<",
"HypergraphNode",
"<",
"T",
">",
",",
"Integer",
">",
"nodeOrdering",
")",
"{",
"double",
"newLocation",
"=",
"0",
";",
"for",
"(",
"final",
"HypergraphEdge",
"<",
"T",
">",
"edge",... | Computes the tentative new location for this node (see Aloul, Markov, and Sakallah).
@param nodeOrdering the node ordering for which the COG is computed
@return the tentative new location for this node | [
"Computes",
"the",
"tentative",
"new",
"location",
"for",
"this",
"node",
"(",
"see",
"Aloul",
"Markov",
"and",
"Sakallah",
")",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/graphs/datastructures/HypergraphNode.java#L97-L102 |
Netflix/frigga | src/main/java/com/netflix/frigga/NameValidation.java | NameValidation.usesReservedFormat | public static Boolean usesReservedFormat(String name) {
"""
Determines whether a name ends with the reserved format -v000 where 0 represents any digit, or starts with the
reserved format z0 where z is any letter, or contains a hyphen-separated token that starts with the z0 format.
@param name to inspect
@retu... | java | public static Boolean usesReservedFormat(String name) {
return checkMatch(name, PUSH_FORMAT_PATTERN) || checkMatch(name, LABELED_VARIABLE_PATTERN);
} | [
"public",
"static",
"Boolean",
"usesReservedFormat",
"(",
"String",
"name",
")",
"{",
"return",
"checkMatch",
"(",
"name",
",",
"PUSH_FORMAT_PATTERN",
")",
"||",
"checkMatch",
"(",
"name",
",",
"LABELED_VARIABLE_PATTERN",
")",
";",
"}"
] | Determines whether a name ends with the reserved format -v000 where 0 represents any digit, or starts with the
reserved format z0 where z is any letter, or contains a hyphen-separated token that starts with the z0 format.
@param name to inspect
@return true if the name ends with the reserved format | [
"Determines",
"whether",
"a",
"name",
"ends",
"with",
"the",
"reserved",
"format",
"-",
"v000",
"where",
"0",
"represents",
"any",
"digit",
"or",
"starts",
"with",
"the",
"reserved",
"format",
"z0",
"where",
"z",
"is",
"any",
"letter",
"or",
"contains",
"a... | train | https://github.com/Netflix/frigga/blob/38afefd1726116f3431b95fcb96a6af640b99d10/src/main/java/com/netflix/frigga/NameValidation.java#L93-L95 |
graknlabs/grakn | server/src/server/kb/concept/RelationImpl.java | RelationImpl.assign | @Override
public Relation assign(Role role, Thing player) {
"""
Expands this Relation to include a new role player which is playing a specific Role.
@param role The role of the new role player.
@param player The new role player.
@return The Relation itself
"""
reify().addRolePlayer(role, pla... | java | @Override
public Relation assign(Role role, Thing player) {
reify().addRolePlayer(role, player);
return this;
} | [
"@",
"Override",
"public",
"Relation",
"assign",
"(",
"Role",
"role",
",",
"Thing",
"player",
")",
"{",
"reify",
"(",
")",
".",
"addRolePlayer",
"(",
"role",
",",
"player",
")",
";",
"return",
"this",
";",
"}"
] | Expands this Relation to include a new role player which is playing a specific Role.
@param role The role of the new role player.
@param player The new role player.
@return The Relation itself | [
"Expands",
"this",
"Relation",
"to",
"include",
"a",
"new",
"role",
"player",
"which",
"is",
"playing",
"a",
"specific",
"Role",
"."
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/kb/concept/RelationImpl.java#L163-L167 |
influxdata/influxdb-java | src/main/java/org/influxdb/impl/InfluxDBResultMapper.java | InfluxDBResultMapper.setFieldValue | <T> void setFieldValue(final T object, final Field field, final Object value, final TimeUnit precision)
throws IllegalArgumentException, IllegalAccessException {
"""
InfluxDB client returns any number as Double.
See https://github.com/influxdata/influxdb-java/issues/153#issuecomment-259681987
for more inform... | java | <T> void setFieldValue(final T object, final Field field, final Object value, final TimeUnit precision)
throws IllegalArgumentException, IllegalAccessException {
if (value == null) {
return;
}
Class<?> fieldType = field.getType();
try {
if (!field.isAccessible()) {
field.setAcces... | [
"<",
"T",
">",
"void",
"setFieldValue",
"(",
"final",
"T",
"object",
",",
"final",
"Field",
"field",
",",
"final",
"Object",
"value",
",",
"final",
"TimeUnit",
"precision",
")",
"throws",
"IllegalArgumentException",
",",
"IllegalAccessException",
"{",
"if",
"(... | InfluxDB client returns any number as Double.
See https://github.com/influxdata/influxdb-java/issues/153#issuecomment-259681987
for more information.
@param object
@param field
@param value
@param precision
@throws IllegalArgumentException
@throws IllegalAccessException | [
"InfluxDB",
"client",
"returns",
"any",
"number",
"as",
"Double",
".",
"See",
"https",
":",
"//",
"github",
".",
"com",
"/",
"influxdata",
"/",
"influxdb",
"-",
"java",
"/",
"issues",
"/",
"153#issuecomment",
"-",
"259681987",
"for",
"more",
"information",
... | train | https://github.com/influxdata/influxdb-java/blob/8ae777f34aa2e598f609208cf4fa12d4642f83f5/src/main/java/org/influxdb/impl/InfluxDBResultMapper.java#L305-L329 |
joniles/mpxj | src/main/java/net/sf/mpxj/turboproject/Table.java | Table.addRow | protected void addRow(int uniqueID, Map<String, Object> map) {
"""
Adds a row to the internal storage, indexed by primary key.
@param uniqueID unique ID of the row
@param map row data as a simpe map
"""
m_rows.put(Integer.valueOf(uniqueID), new MapRow(map));
} | java | protected void addRow(int uniqueID, Map<String, Object> map)
{
m_rows.put(Integer.valueOf(uniqueID), new MapRow(map));
} | [
"protected",
"void",
"addRow",
"(",
"int",
"uniqueID",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"m_rows",
".",
"put",
"(",
"Integer",
".",
"valueOf",
"(",
"uniqueID",
")",
",",
"new",
"MapRow",
"(",
"map",
")",
")",
";",
"}"
... | Adds a row to the internal storage, indexed by primary key.
@param uniqueID unique ID of the row
@param map row data as a simpe map | [
"Adds",
"a",
"row",
"to",
"the",
"internal",
"storage",
"indexed",
"by",
"primary",
"key",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/turboproject/Table.java#L106-L109 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/VersionInfo.java | VersionInfo.getVersionString | @Deprecated
public String getVersionString(int minDigits, int maxDigits) {
"""
Generate version string separated by dots with
the specified digit width. Version digit 0
after <code>minDigits</code> will be trimmed off.
@param minDigits Minimum number of version digits
@param maxDigits Maximum number of ve... | java | @Deprecated
public String getVersionString(int minDigits, int maxDigits) {
if (minDigits < 1 || maxDigits < 1
|| minDigits > 4 || maxDigits > 4 || minDigits > maxDigits) {
throw new IllegalArgumentException("Invalid min/maxDigits range");
}
int[] digits = new int... | [
"@",
"Deprecated",
"public",
"String",
"getVersionString",
"(",
"int",
"minDigits",
",",
"int",
"maxDigits",
")",
"{",
"if",
"(",
"minDigits",
"<",
"1",
"||",
"maxDigits",
"<",
"1",
"||",
"minDigits",
">",
"4",
"||",
"maxDigits",
">",
"4",
"||",
"minDigi... | Generate version string separated by dots with
the specified digit width. Version digit 0
after <code>minDigits</code> will be trimmed off.
@param minDigits Minimum number of version digits
@param maxDigits Maximum number of version digits
@return A tailored version string
@deprecated This API is ICU internal only. (F... | [
"Generate",
"version",
"string",
"separated",
"by",
"dots",
"with",
"the",
"specified",
"digit",
"width",
".",
"Version",
"digit",
"0",
"after",
"<code",
">",
"minDigits<",
"/",
"code",
">",
"will",
"be",
"trimmed",
"off",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/VersionInfo.java#L608-L637 |
apereo/cas | support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java | LdapUtils.executePasswordModifyOperation | public static boolean executePasswordModifyOperation(final String currentDn,
final ConnectionFactory connectionFactory,
final String oldPassword,
fin... | java | public static boolean executePasswordModifyOperation(final String currentDn,
final ConnectionFactory connectionFactory,
final String oldPassword,
fin... | [
"public",
"static",
"boolean",
"executePasswordModifyOperation",
"(",
"final",
"String",
"currentDn",
",",
"final",
"ConnectionFactory",
"connectionFactory",
",",
"final",
"String",
"oldPassword",
",",
"final",
"String",
"newPassword",
",",
"final",
"AbstractLdapPropertie... | Execute a password modify operation.
@param currentDn the current dn
@param connectionFactory the connection factory
@param oldPassword the old password
@param newPassword the new password
@param type the type
@return true /false | [
"Execute",
"a",
"password",
"modify",
"operation",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java#L314-L345 |
udoprog/tiny-async-java | tiny-async-core/src/main/java/eu/toolchain/concurrent/CollectHelper.java | CollectHelper.add | void add(final byte type, final Object value) {
"""
Checks in a doCall back. It also wraps up the group if all the callbacks have checked in.
"""
final int w = write.getAndIncrement();
if (w < size) {
writeAt(w, type, value);
}
// countdown could wrap around, however we check the state ... | java | void add(final byte type, final Object value) {
final int w = write.getAndIncrement();
if (w < size) {
writeAt(w, type, value);
}
// countdown could wrap around, however we check the state of finished in here.
// MUST be called after write to make sure that results and states are synchronize... | [
"void",
"add",
"(",
"final",
"byte",
"type",
",",
"final",
"Object",
"value",
")",
"{",
"final",
"int",
"w",
"=",
"write",
".",
"getAndIncrement",
"(",
")",
";",
"if",
"(",
"w",
"<",
"size",
")",
"{",
"writeAt",
"(",
"w",
",",
"type",
",",
"value... | Checks in a doCall back. It also wraps up the group if all the callbacks have checked in. | [
"Checks",
"in",
"a",
"doCall",
"back",
".",
"It",
"also",
"wraps",
"up",
"the",
"group",
"if",
"all",
"the",
"callbacks",
"have",
"checked",
"in",
"."
] | train | https://github.com/udoprog/tiny-async-java/blob/987706d4b7f2d13b45eefdc6c54ea63ce64b3310/tiny-async-core/src/main/java/eu/toolchain/concurrent/CollectHelper.java#L123-L151 |
HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/AbstractRadial.java | AbstractRadial.createLcdImage | protected BufferedImage createLcdImage(final Rectangle2D BOUNDS, final LcdColor LCD_COLOR, final Paint CUSTOM_LCD_BACKGROUND, final BufferedImage IMAGE) {
"""
Returns the image with the given lcd color.
@param BOUNDS
@param LCD_COLOR
@param CUSTOM_LCD_BACKGROUND
@param IMAGE
@return buffered image containing ... | java | protected BufferedImage createLcdImage(final Rectangle2D BOUNDS, final LcdColor LCD_COLOR, final Paint CUSTOM_LCD_BACKGROUND, final BufferedImage IMAGE) {
return LCD_FACTORY.create_LCD_Image(BOUNDS, LCD_COLOR, CUSTOM_LCD_BACKGROUND, IMAGE);
} | [
"protected",
"BufferedImage",
"createLcdImage",
"(",
"final",
"Rectangle2D",
"BOUNDS",
",",
"final",
"LcdColor",
"LCD_COLOR",
",",
"final",
"Paint",
"CUSTOM_LCD_BACKGROUND",
",",
"final",
"BufferedImage",
"IMAGE",
")",
"{",
"return",
"LCD_FACTORY",
".",
"create_LCD_Im... | Returns the image with the given lcd color.
@param BOUNDS
@param LCD_COLOR
@param CUSTOM_LCD_BACKGROUND
@param IMAGE
@return buffered image containing the lcd with the selected lcd color | [
"Returns",
"the",
"image",
"with",
"the",
"given",
"lcd",
"color",
"."
] | train | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/AbstractRadial.java#L1503-L1505 |
alkacon/opencms-core | src/org/opencms/util/CmsHtml2TextConverter.java | CmsHtml2TextConverter.appendAttribute | private void appendAttribute(Tag tag, String text) {
"""
Appends an attribute.<p>
@param tag the tag
@param text the attribute text
"""
if (tag.getTagName().equals("IMG")) {
appendText(text);
} else {
String current = m_attributeMap.get(tag);
if (current... | java | private void appendAttribute(Tag tag, String text) {
if (tag.getTagName().equals("IMG")) {
appendText(text);
} else {
String current = m_attributeMap.get(tag);
if (current != null) {
text = current + text;
}
m_attributeMap.put(... | [
"private",
"void",
"appendAttribute",
"(",
"Tag",
"tag",
",",
"String",
"text",
")",
"{",
"if",
"(",
"tag",
".",
"getTagName",
"(",
")",
".",
"equals",
"(",
"\"IMG\"",
")",
")",
"{",
"appendText",
"(",
"text",
")",
";",
"}",
"else",
"{",
"String",
... | Appends an attribute.<p>
@param tag the tag
@param text the attribute text | [
"Appends",
"an",
"attribute",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsHtml2TextConverter.java#L129-L140 |
networknt/light-4j | dump/src/main/java/com/networknt/dump/CookiesDumper.java | CookiesDumper.dumpResponse | @Override
public void dumpResponse(Map<String, Object> result) {
"""
impl of dumping response cookies to result
@param result A map you want to put dump information to
"""
Map<String, Cookie> cookiesMap = exchange.getResponseCookies();
dumpCookies(cookiesMap, "responseCookies");
th... | java | @Override
public void dumpResponse(Map<String, Object> result) {
Map<String, Cookie> cookiesMap = exchange.getResponseCookies();
dumpCookies(cookiesMap, "responseCookies");
this.putDumpInfoTo(result);
} | [
"@",
"Override",
"public",
"void",
"dumpResponse",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"result",
")",
"{",
"Map",
"<",
"String",
",",
"Cookie",
">",
"cookiesMap",
"=",
"exchange",
".",
"getResponseCookies",
"(",
")",
";",
"dumpCookies",
"(",
"... | impl of dumping response cookies to result
@param result A map you want to put dump information to | [
"impl",
"of",
"dumping",
"response",
"cookies",
"to",
"result"
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/dump/src/main/java/com/networknt/dump/CookiesDumper.java#L50-L55 |
LearnLib/automatalib | incremental/src/main/java/net/automatalib/incremental/dfa/tree/Node.java | Node.setChild | public void setChild(int idx, int alphabetSize, Node<I> child) {
"""
Sets the child for a given index.
@param idx
the alphabet symbol index
@param alphabetSize
the overall alphabet size; this is needed if a new children array needs to be created
@param child
the new child
"""
if (children == nu... | java | public void setChild(int idx, int alphabetSize, Node<I> child) {
if (children == null) {
children = new ResizingArrayStorage<>(Node.class, alphabetSize);
}
children.array[idx] = child;
} | [
"public",
"void",
"setChild",
"(",
"int",
"idx",
",",
"int",
"alphabetSize",
",",
"Node",
"<",
"I",
">",
"child",
")",
"{",
"if",
"(",
"children",
"==",
"null",
")",
"{",
"children",
"=",
"new",
"ResizingArrayStorage",
"<>",
"(",
"Node",
".",
"class",
... | Sets the child for a given index.
@param idx
the alphabet symbol index
@param alphabetSize
the overall alphabet size; this is needed if a new children array needs to be created
@param child
the new child | [
"Sets",
"the",
"child",
"for",
"a",
"given",
"index",
"."
] | train | https://github.com/LearnLib/automatalib/blob/8a462ec52f6eaab9f8996e344f2163a72cb8aa6e/incremental/src/main/java/net/automatalib/incremental/dfa/tree/Node.java#L102-L107 |
nemerosa/ontrack | ontrack-ui/src/main/java/net/nemerosa/ontrack/boot/ui/BranchController.java | BranchController.setTemplateDefinition | @RequestMapping(value = "branches/ {
"""
Sets this branch as a template definition, or updates the definition.
"""branchId}/template/definition", method = RequestMethod.PUT)
public Branch setTemplateDefinition(@PathVariable ID branchId, @RequestBody @Valid TemplateDefinition templateDefinition) {
r... | java | @RequestMapping(value = "branches/{branchId}/template/definition", method = RequestMethod.PUT)
public Branch setTemplateDefinition(@PathVariable ID branchId, @RequestBody @Valid TemplateDefinition templateDefinition) {
return branchTemplateService.setTemplateDefinition(branchId, templateDefinition);
} | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"branches/{branchId}/template/definition\"",
",",
"method",
"=",
"RequestMethod",
".",
"PUT",
")",
"public",
"Branch",
"setTemplateDefinition",
"(",
"@",
"PathVariable",
"ID",
"branchId",
",",
"@",
"RequestBody",
"@",
"Val... | Sets this branch as a template definition, or updates the definition. | [
"Sets",
"this",
"branch",
"as",
"a",
"template",
"definition",
"or",
"updates",
"the",
"definition",
"."
] | train | https://github.com/nemerosa/ontrack/blob/37b0874cbf387b58aba95cd3c1bc3b15e11bc913/ontrack-ui/src/main/java/net/nemerosa/ontrack/boot/ui/BranchController.java#L347-L350 |
kopihao/peasy-recyclerview | peasy-recyclerview/src/main/java/com/kopirealm/peasyrecyclerview/PeasyRecyclerView.java | PeasyRecyclerView.onBindViewHolder | private void onBindViewHolder(Context context, PeasyViewHolder holder, int position) {
"""
Enhanced Implementation Layer of {@link RecyclerView.Adapter#onBindViewHolder(RecyclerView.ViewHolder, int)}
@param holder PeasyViewHolder
@param position position
"""
if (holder == null) return;
tr... | java | private void onBindViewHolder(Context context, PeasyViewHolder holder, int position) {
if (holder == null) return;
try {
if (headerContent != null && holder.isHeaderView()) {
headerContent.onBindViewHolder(context, holder.asIs(PeasyHeaderViewHolder.class), position, getItem(p... | [
"private",
"void",
"onBindViewHolder",
"(",
"Context",
"context",
",",
"PeasyViewHolder",
"holder",
",",
"int",
"position",
")",
"{",
"if",
"(",
"holder",
"==",
"null",
")",
"return",
";",
"try",
"{",
"if",
"(",
"headerContent",
"!=",
"null",
"&&",
"holder... | Enhanced Implementation Layer of {@link RecyclerView.Adapter#onBindViewHolder(RecyclerView.ViewHolder, int)}
@param holder PeasyViewHolder
@param position position | [
"Enhanced",
"Implementation",
"Layer",
"of",
"{",
"@link",
"RecyclerView",
".",
"Adapter#onBindViewHolder",
"(",
"RecyclerView",
".",
"ViewHolder",
"int",
")",
"}"
] | train | https://github.com/kopihao/peasy-recyclerview/blob/a26071849e5d5b5b1febe685f205558b49908f87/peasy-recyclerview/src/main/java/com/kopirealm/peasyrecyclerview/PeasyRecyclerView.java#L632-L647 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509Key.java | X509Key.parse | public static PublicKey parse(DerValue in) throws IOException {
"""
Construct X.509 subject public key from a DER value. If
the runtime environment is configured with a specific class for
this kind of key, a subclass is returned. Otherwise, a generic
X509Key object is returned.
<P>This mechanism gurantees ... | java | public static PublicKey parse(DerValue in) throws IOException
{
AlgorithmId algorithm;
PublicKey subjectKey;
if (in.tag != DerValue.tag_Sequence)
throw new IOException("corrupt subject key");
algorithm = AlgorithmId.parse(in.data.getDerValue());
try {
... | [
"public",
"static",
"PublicKey",
"parse",
"(",
"DerValue",
"in",
")",
"throws",
"IOException",
"{",
"AlgorithmId",
"algorithm",
";",
"PublicKey",
"subjectKey",
";",
"if",
"(",
"in",
".",
"tag",
"!=",
"DerValue",
".",
"tag_Sequence",
")",
"throw",
"new",
"IOE... | Construct X.509 subject public key from a DER value. If
the runtime environment is configured with a specific class for
this kind of key, a subclass is returned. Otherwise, a generic
X509Key object is returned.
<P>This mechanism gurantees that keys (and algorithms) may be
freely manipulated and transferred, without ... | [
"Construct",
"X",
".",
"509",
"subject",
"public",
"key",
"from",
"a",
"DER",
"value",
".",
"If",
"the",
"runtime",
"environment",
"is",
"configured",
"with",
"a",
"specific",
"class",
"for",
"this",
"kind",
"of",
"key",
"a",
"subclass",
"is",
"returned",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X509Key.java#L160-L180 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/periodic/GVRPeriodicEngine.java | GVRPeriodicEngine.runEvery | public PeriodicEvent runEvery(Runnable task, float delay, float period) {
"""
Run a task periodically and indefinitely.
@param task
Task to run.
@param delay
The first execution will happen in {@code delay} seconds.
@param period
Subsequent executions will happen every {@code period} seconds
after the fir... | java | public PeriodicEvent runEvery(Runnable task, float delay, float period) {
return runEvery(task, delay, period, null);
} | [
"public",
"PeriodicEvent",
"runEvery",
"(",
"Runnable",
"task",
",",
"float",
"delay",
",",
"float",
"period",
")",
"{",
"return",
"runEvery",
"(",
"task",
",",
"delay",
",",
"period",
",",
"null",
")",
";",
"}"
] | Run a task periodically and indefinitely.
@param task
Task to run.
@param delay
The first execution will happen in {@code delay} seconds.
@param period
Subsequent executions will happen every {@code period} seconds
after the first.
@return An interface that lets you query the status; cancel; or
reschedule the event. | [
"Run",
"a",
"task",
"periodically",
"and",
"indefinitely",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/periodic/GVRPeriodicEngine.java#L138-L140 |
OpenBEL/openbel-framework | org.openbel.framework.core/src/main/java/org/openbel/framework/core/protocol/ResourceResolver.java | ResourceResolver.resolveResource | public File resolveResource(String resourceLocation,
String downloadLocation) throws ResourceDownloadError {
"""
Retrieves a resource from the {@code resourceLocation} and saves
it to {@code downloadLocation}.
@param resourceLocation {@link String}, the resource location url
@param downloadLocatio... | java | public File resolveResource(String resourceLocation,
String downloadLocation) throws ResourceDownloadError {
int indexOf = resourceLocation.indexOf(':');
if (indexOf == -1) {
final String url = downloadLocation;
final String msg = "Unknown protocol";
throw... | [
"public",
"File",
"resolveResource",
"(",
"String",
"resourceLocation",
",",
"String",
"downloadLocation",
")",
"throws",
"ResourceDownloadError",
"{",
"int",
"indexOf",
"=",
"resourceLocation",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"indexOf",
"=="... | Retrieves a resource from the {@code resourceLocation} and saves
it to {@code downloadLocation}.
@param resourceLocation {@link String}, the resource location url
@param downloadLocation {@link String}, the download location path
@return {@link File}, the local downloaded resource file
@throws ResourceDownloadError Th... | [
"Retrieves",
"a",
"resource",
"from",
"the",
"{",
"@code",
"resourceLocation",
"}",
"and",
"saves",
"it",
"to",
"{",
"@code",
"downloadLocation",
"}",
"."
] | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/protocol/ResourceResolver.java#L66-L110 |
banq/jdonframework | src/main/java/com/jdon/controller/WebAppUtil.java | WebAppUtil.getService | public static Object getService(String name, ServletContext sc) {
"""
Difference with getComponentInstance method: 1. this method return new
service instance each times.
2. call methods of the return service instance, will active interceptors.
execept some interceptors about session, such as Stateful disable.... | java | public static Object getService(String name, ServletContext sc) {
AppContextWrapper acw = new ServletContextWrapper(sc);
ServiceFacade serviceFacade = new ServiceFacade();
ServiceFactory serviceFactory = serviceFacade.getServiceFactory(acw);
return serviceFactory.getService(name, acw);
} | [
"public",
"static",
"Object",
"getService",
"(",
"String",
"name",
",",
"ServletContext",
"sc",
")",
"{",
"AppContextWrapper",
"acw",
"=",
"new",
"ServletContextWrapper",
"(",
"sc",
")",
";",
"ServiceFacade",
"serviceFacade",
"=",
"new",
"ServiceFacade",
"(",
")... | Difference with getComponentInstance method: 1. this method return new
service instance each times.
2. call methods of the return service instance, will active interceptors.
execept some interceptors about session, such as Stateful disable.
3. not support session ,if you need your jsp page not create cookie with
JSES... | [
"Difference",
"with",
"getComponentInstance",
"method",
":",
"1",
".",
"this",
"method",
"return",
"new",
"service",
"instance",
"each",
"times",
"."
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/controller/WebAppUtil.java#L113-L118 |
samskivert/samskivert | src/main/java/com/samskivert/util/RandomUtil.java | RandomUtil.pickRandom | public static <T> T pickRandom (List<T> values, T skip, Random r) {
"""
Picks a random object from the supplied List. The specified skip object will be skipped when
selecting a random value. The skipped object must exist exactly once in the List.
@param r the random number generator to use.
@return a random... | java | public static <T> T pickRandom (List<T> values, T skip, Random r)
{
int size = values.size();
if (size < 2) {
throw new IllegalArgumentException(
"Must have at least two elements [size=" + size + "]");
}
int pick = r.nextInt(size - 1);
for (int ii... | [
"public",
"static",
"<",
"T",
">",
"T",
"pickRandom",
"(",
"List",
"<",
"T",
">",
"values",
",",
"T",
"skip",
",",
"Random",
"r",
")",
"{",
"int",
"size",
"=",
"values",
".",
"size",
"(",
")",
";",
"if",
"(",
"size",
"<",
"2",
")",
"{",
"thro... | Picks a random object from the supplied List. The specified skip object will be skipped when
selecting a random value. The skipped object must exist exactly once in the List.
@param r the random number generator to use.
@return a randomly selected item. | [
"Picks",
"a",
"random",
"object",
"from",
"the",
"supplied",
"List",
".",
"The",
"specified",
"skip",
"object",
"will",
"be",
"skipped",
"when",
"selecting",
"a",
"random",
"value",
".",
"The",
"skipped",
"object",
"must",
"exist",
"exactly",
"once",
"in",
... | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/RandomUtil.java#L363-L379 |
overturetool/overture | ide/debug/src/main/java/org/overture/ide/debug/utils/CharOperation.java | CharOperation.compareWith | public static final int compareWith(char[] array, char[] prefix) {
"""
Compares the contents of the two arrays array and prefix. Returns
<ul>
<li>zero if the array starts with the prefix contents</li>
<li>the difference between the first two characters that are not equal</li>
<li>one if array length is lower t... | java | public static final int compareWith(char[] array, char[] prefix)
{
int arrayLength = array.length;
int prefixLength = prefix.length;
int min = Math.min(arrayLength, prefixLength);
int i = 0;
while (min-- != 0)
{
char c1 = array[i];
char c2 = prefix[i++];
if (c1 != c2)
{
return c1 - c2;
}... | [
"public",
"static",
"final",
"int",
"compareWith",
"(",
"char",
"[",
"]",
"array",
",",
"char",
"[",
"]",
"prefix",
")",
"{",
"int",
"arrayLength",
"=",
"array",
".",
"length",
";",
"int",
"prefixLength",
"=",
"prefix",
".",
"length",
";",
"int",
"min"... | Compares the contents of the two arrays array and prefix. Returns
<ul>
<li>zero if the array starts with the prefix contents</li>
<li>the difference between the first two characters that are not equal</li>
<li>one if array length is lower than the prefix length and that the prefix starts with the array contents.</li>
<... | [
"Compares",
"the",
"contents",
"of",
"the",
"two",
"arrays",
"array",
"and",
"prefix",
".",
"Returns",
"<ul",
">",
"<li",
">",
"zero",
"if",
"the",
"array",
"starts",
"with",
"the",
"prefix",
"contents<",
"/",
"li",
">",
"<li",
">",
"the",
"difference",
... | train | https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/ide/debug/src/main/java/org/overture/ide/debug/utils/CharOperation.java#L406-L427 |
threerings/narya | core/src/main/java/com/threerings/presents/dobj/DObject.java | DObject.requestEntryUpdate | protected <T extends DSet.Entry> void requestEntryUpdate (
String name, DSet<T> set, T entry, Transport transport) {
"""
Calls by derived instances when a set updater method was called.
"""
// if we're on the authoritative server, we update the set immediately
T oldEntry = null;
... | java | protected <T extends DSet.Entry> void requestEntryUpdate (
String name, DSet<T> set, T entry, Transport transport)
{
// if we're on the authoritative server, we update the set immediately
T oldEntry = null;
if (isAuthoritative()) {
oldEntry = set.update(entry);
... | [
"protected",
"<",
"T",
"extends",
"DSet",
".",
"Entry",
">",
"void",
"requestEntryUpdate",
"(",
"String",
"name",
",",
"DSet",
"<",
"T",
">",
"set",
",",
"T",
"entry",
",",
"Transport",
"transport",
")",
"{",
"// if we're on the authoritative server, we update t... | Calls by derived instances when a set updater method was called. | [
"Calls",
"by",
"derived",
"instances",
"when",
"a",
"set",
"updater",
"method",
"was",
"called",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DObject.java#L931-L946 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java | ReflectUtil.setFieldValue | public static void setFieldValue(Object obj, String fieldName, Object value) throws UtilException {
"""
设置字段值
@param obj 对象
@param fieldName 字段名
@param value 值,值类型必须与字段类型匹配,不会自动转换对象类型
@throws UtilException 包装IllegalAccessException异常
"""
Assert.notNull(obj);
Assert.notBlank(fieldName);
setFieldVa... | java | public static void setFieldValue(Object obj, String fieldName, Object value) throws UtilException {
Assert.notNull(obj);
Assert.notBlank(fieldName);
setFieldValue(obj, getField(obj.getClass(), fieldName), value);
} | [
"public",
"static",
"void",
"setFieldValue",
"(",
"Object",
"obj",
",",
"String",
"fieldName",
",",
"Object",
"value",
")",
"throws",
"UtilException",
"{",
"Assert",
".",
"notNull",
"(",
"obj",
")",
";",
"Assert",
".",
"notBlank",
"(",
"fieldName",
")",
";... | 设置字段值
@param obj 对象
@param fieldName 字段名
@param value 值,值类型必须与字段类型匹配,不会自动转换对象类型
@throws UtilException 包装IllegalAccessException异常 | [
"设置字段值"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java#L236-L240 |
unbescape/unbescape | src/main/java/org/unbescape/xml/XmlEscape.java | XmlEscape.escapeXml11Minimal | public static void escapeXml11Minimal(final String text, final Writer writer)
throws IOException {
"""
<p>
Perform an XML 1.1 level 1 (only markup-significant chars) <strong>escape</strong> operation
on a <tt>String</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 1</em> means ... | java | public static void escapeXml11Minimal(final String text, final Writer writer)
throws IOException {
escapeXml(text, writer, XmlEscapeSymbols.XML11_SYMBOLS,
XmlEscapeType.CHARACTER_ENTITY_REFERENCES_DEFAULT_TO_HEXA,
XmlEscapeLevel.LEVEL_1_ONLY_MARKUP_SIGNIFICANT);
} | [
"public",
"static",
"void",
"escapeXml11Minimal",
"(",
"final",
"String",
"text",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeXml",
"(",
"text",
",",
"writer",
",",
"XmlEscapeSymbols",
".",
"XML11_SYMBOLS",
",",
"XmlEscapeType",
"... | <p>
Perform an XML 1.1 level 1 (only markup-significant chars) <strong>escape</strong> operation
on a <tt>String</tt> input, writing results to a <tt>Writer</tt>.
</p>
<p>
<em>Level 1</em> means this method will only escape the five markup-significant characters which
are <em>predefined</em> as Character Entity Referen... | [
"<p",
">",
"Perform",
"an",
"XML",
"1",
".",
"1",
"level",
"1",
"(",
"only",
"markup",
"-",
"significant",
"chars",
")",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
"writing",... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/xml/XmlEscape.java#L734-L739 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/MapPrinter.java | MapPrinter.setConfiguration | public final void setConfiguration(final URI newConfigFile, final byte[] configFileData)
throws IOException {
"""
Set the configuration file and update the configuration for this printer.
@param newConfigFile the file containing the new configuration.
@param configFileData the config file data.
... | java | public final void setConfiguration(final URI newConfigFile, final byte[] configFileData)
throws IOException {
this.configFile = new File(newConfigFile);
this.configuration = this.configurationFactory
.getConfig(this.configFile, new ByteArrayInputStream(configFileData));
} | [
"public",
"final",
"void",
"setConfiguration",
"(",
"final",
"URI",
"newConfigFile",
",",
"final",
"byte",
"[",
"]",
"configFileData",
")",
"throws",
"IOException",
"{",
"this",
".",
"configFile",
"=",
"new",
"File",
"(",
"newConfigFile",
")",
";",
"this",
"... | Set the configuration file and update the configuration for this printer.
@param newConfigFile the file containing the new configuration.
@param configFileData the config file data. | [
"Set",
"the",
"configuration",
"file",
"and",
"update",
"the",
"configuration",
"for",
"this",
"printer",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/MapPrinter.java#L70-L75 |
Kickflip/kickflip-android-sdk | sdk/src/main/java/io/kickflip/sdk/api/KickflipApiClient.java | KickflipApiClient.startStreamWithUser | private void startStreamWithUser(User user, Stream stream, final KickflipCallback cb) {
"""
Start a new Stream owned by the given User. Must be called after
{@link io.kickflip.sdk.api.KickflipApiClient#createNewUser(KickflipCallback)}
Delivers stream endpoint destination data via a {@link io.kickflip.sdk.api.Kic... | java | private void startStreamWithUser(User user, Stream stream, final KickflipCallback cb) {
checkNotNull(user);
checkNotNull(stream);
GenericData data = new GenericData();
data.put("uuid", user.getUUID());
data.put("private", stream.isPrivate());
if (stream.getTitle() != null... | [
"private",
"void",
"startStreamWithUser",
"(",
"User",
"user",
",",
"Stream",
"stream",
",",
"final",
"KickflipCallback",
"cb",
")",
"{",
"checkNotNull",
"(",
"user",
")",
";",
"checkNotNull",
"(",
"stream",
")",
";",
"GenericData",
"data",
"=",
"new",
"Gene... | Start a new Stream owned by the given User. Must be called after
{@link io.kickflip.sdk.api.KickflipApiClient#createNewUser(KickflipCallback)}
Delivers stream endpoint destination data via a {@link io.kickflip.sdk.api.KickflipCallback}.
@param user The Kickflip User on whose behalf this request is performed.
@param cb... | [
"Start",
"a",
"new",
"Stream",
"owned",
"by",
"the",
"given",
"User",
".",
"Must",
"be",
"called",
"after",
"{",
"@link",
"io",
".",
"kickflip",
".",
"sdk",
".",
"api",
".",
"KickflipApiClient#createNewUser",
"(",
"KickflipCallback",
")",
"}",
"Delivers",
... | train | https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/api/KickflipApiClient.java#L331-L347 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java | SDBaseOps.scalarSet | public SDVariable scalarSet(SDVariable in, Number set) {
"""
Return an array with equal shape to the input, but all elements set to value 'set'
@param in Input variable
@param set Value to set
@return Output variable
"""
return scalarSet(null, in, set);
} | java | public SDVariable scalarSet(SDVariable in, Number set) {
return scalarSet(null, in, set);
} | [
"public",
"SDVariable",
"scalarSet",
"(",
"SDVariable",
"in",
",",
"Number",
"set",
")",
"{",
"return",
"scalarSet",
"(",
"null",
",",
"in",
",",
"set",
")",
";",
"}"
] | Return an array with equal shape to the input, but all elements set to value 'set'
@param in Input variable
@param set Value to set
@return Output variable | [
"Return",
"an",
"array",
"with",
"equal",
"shape",
"to",
"the",
"input",
"but",
"all",
"elements",
"set",
"to",
"value",
"set"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDBaseOps.java#L1993-L1995 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/internal/ExtensionFactory.java | ExtensionFactory.getExtensionIssueManagement | public ExtensionIssueManagement getExtensionIssueManagement(String system, String url) {
"""
Store and return a weak reference equals to the passed {@link ExtensionIssueManagement} elements.
@param system the name of the issue management system (jira, bugzilla, etc.)
@param url the URL of that extension in the... | java | public ExtensionIssueManagement getExtensionIssueManagement(String system, String url)
{
return getExtensionIssueManagement(new DefaultExtensionIssueManagement(system, url));
} | [
"public",
"ExtensionIssueManagement",
"getExtensionIssueManagement",
"(",
"String",
"system",
",",
"String",
"url",
")",
"{",
"return",
"getExtensionIssueManagement",
"(",
"new",
"DefaultExtensionIssueManagement",
"(",
"system",
",",
"url",
")",
")",
";",
"}"
] | Store and return a weak reference equals to the passed {@link ExtensionIssueManagement} elements.
@param system the name of the issue management system (jira, bugzilla, etc.)
@param url the URL of that extension in the issues management system
@return unique instance of {@link ExtensionIssueManagement} equals to the p... | [
"Store",
"and",
"return",
"a",
"weak",
"reference",
"equals",
"to",
"the",
"passed",
"{",
"@link",
"ExtensionIssueManagement",
"}",
"elements",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/internal/ExtensionFactory.java#L157-L160 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/HOSECodeGenerator.java | HOSECodeGenerator.breadthFirstSearch | private void breadthFirstSearch(IAtom root, boolean addTreeNode) throws CDKException {
"""
Prepares for a breadth first search within the {@link IAtomContainer}. The actual
recursion is done in <code>nextSphere()</code>.
@param root The atom at which we start the search
@exception org.openscience.cdk.excep... | java | private void breadthFirstSearch(IAtom root, boolean addTreeNode) throws CDKException {
sphere = 0;
TreeNode tempNode = null;
List<IAtom> conAtoms = atomContainer.getConnectedAtomsList(root);
IAtom atom;
IBond bond = null;
sphereNodes.clear();
sphereNodesWithAtoms.... | [
"private",
"void",
"breadthFirstSearch",
"(",
"IAtom",
"root",
",",
"boolean",
"addTreeNode",
")",
"throws",
"CDKException",
"{",
"sphere",
"=",
"0",
";",
"TreeNode",
"tempNode",
"=",
"null",
";",
"List",
"<",
"IAtom",
">",
"conAtoms",
"=",
"atomContainer",
... | Prepares for a breadth first search within the {@link IAtomContainer}. The actual
recursion is done in <code>nextSphere()</code>.
@param root The atom at which we start the search
@exception org.openscience.cdk.exception.CDKException If something goes wrong. | [
"Prepares",
"for",
"a",
"breadth",
"first",
"search",
"within",
"the",
"{",
"@link",
"IAtomContainer",
"}",
".",
"The",
"actual",
"recursion",
"is",
"done",
"in",
"<code",
">",
"nextSphere",
"()",
"<",
"/",
"code",
">",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/HOSECodeGenerator.java#L326-L362 |
EdwardRaff/JSAT | JSAT/src/jsat/utils/concurrent/ParallelUtils.java | ParallelUtils.getEndBlock | public static int getEndBlock(int N, int ID, int P) {
"""
Gets the ending index (exclusive) for splitting up a list of items into
{@code P} evenly sized blocks. In the event that {@code N} is not evenly
divisible by {@code P}, the size of ranges will differ by at most 1.
@param N the number of items to split up... | java | public static int getEndBlock(int N, int ID, int P)
{
int rem = N%P;
int start = (N/P)*(ID+1)+min(rem, ID+1);
return start;
} | [
"public",
"static",
"int",
"getEndBlock",
"(",
"int",
"N",
",",
"int",
"ID",
",",
"int",
"P",
")",
"{",
"int",
"rem",
"=",
"N",
"%",
"P",
";",
"int",
"start",
"=",
"(",
"N",
"/",
"P",
")",
"*",
"(",
"ID",
"+",
"1",
")",
"+",
"min",
"(",
"... | Gets the ending index (exclusive) for splitting up a list of items into
{@code P} evenly sized blocks. In the event that {@code N} is not evenly
divisible by {@code P}, the size of ranges will differ by at most 1.
@param N the number of items to split up
@param ID the block number in [0, {@code P})
@param P the number ... | [
"Gets",
"the",
"ending",
"index",
"(",
"exclusive",
")",
"for",
"splitting",
"up",
"a",
"list",
"of",
"items",
"into",
"{"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/utils/concurrent/ParallelUtils.java#L320-L325 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/activator/Activator.java | Activator.enlistBean | public final void enlistBean(ContainerTx tx, BeanO bean) {
"""
Perform actions required when a bean is enlisted in a transaction
at some point in time other than at activation. Used only for
beans using TX_BEAN_MANAGED.
"""
bean.getActivationStrategy().atEnlist(tx, bean);
} | java | public final void enlistBean(ContainerTx tx, BeanO bean)
{
bean.getActivationStrategy().atEnlist(tx, bean);
} | [
"public",
"final",
"void",
"enlistBean",
"(",
"ContainerTx",
"tx",
",",
"BeanO",
"bean",
")",
"{",
"bean",
".",
"getActivationStrategy",
"(",
")",
".",
"atEnlist",
"(",
"tx",
",",
"bean",
")",
";",
"}"
] | Perform actions required when a bean is enlisted in a transaction
at some point in time other than at activation. Used only for
beans using TX_BEAN_MANAGED. | [
"Perform",
"actions",
"required",
"when",
"a",
"bean",
"is",
"enlisted",
"in",
"a",
"transaction",
"at",
"some",
"point",
"in",
"time",
"other",
"than",
"at",
"activation",
".",
"Used",
"only",
"for",
"beans",
"using",
"TX_BEAN_MANAGED",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/activator/Activator.java#L429-L432 |
spotify/docgenerator | scanner/src/main/java/com/spotify/docgenerator/JacksonJerseyAnnotationProcessor.java | JacksonJerseyAnnotationProcessor.computeMethodArguments | private List<ResourceArgument> computeMethodArguments(final ExecutableElement ee) {
"""
Given an {@link ExecutableElement} representing the method, compute it's arguments.
"""
final List<ResourceArgument> arguments = Lists.newArrayList();
for (VariableElement ve : ee.getParameters()) {
final Path... | java | private List<ResourceArgument> computeMethodArguments(final ExecutableElement ee) {
final List<ResourceArgument> arguments = Lists.newArrayList();
for (VariableElement ve : ee.getParameters()) {
final PathParam pathAnnotation = ve.getAnnotation(PathParam.class);
final String argName;
if (pathA... | [
"private",
"List",
"<",
"ResourceArgument",
">",
"computeMethodArguments",
"(",
"final",
"ExecutableElement",
"ee",
")",
"{",
"final",
"List",
"<",
"ResourceArgument",
">",
"arguments",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"for",
"(",
"VariableEleme... | Given an {@link ExecutableElement} representing the method, compute it's arguments. | [
"Given",
"an",
"{"
] | train | https://github.com/spotify/docgenerator/blob/a7965f6d4a1546864a3f8584b86841cef9ac2f65/scanner/src/main/java/com/spotify/docgenerator/JacksonJerseyAnnotationProcessor.java#L150-L163 |
Netflix/conductor | client/src/main/java/com/netflix/conductor/client/http/WorkflowClient.java | WorkflowClient.startWorkflow | public String startWorkflow(StartWorkflowRequest startWorkflowRequest) {
"""
Starts a workflow.
If the size of the workflow input payload is bigger than {@link ConductorClientConfiguration#getWorkflowInputPayloadThresholdKB()},
it is uploaded to {@link ExternalPayloadStorage}, if enabled, else the workflow is re... | java | public String startWorkflow(StartWorkflowRequest startWorkflowRequest) {
Preconditions.checkNotNull(startWorkflowRequest, "StartWorkflowRequest cannot be null");
Preconditions.checkArgument(StringUtils.isNotBlank(startWorkflowRequest.getName()), "Workflow name cannot be null or empty");
Precondi... | [
"public",
"String",
"startWorkflow",
"(",
"StartWorkflowRequest",
"startWorkflowRequest",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"startWorkflowRequest",
",",
"\"StartWorkflowRequest cannot be null\"",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"Stri... | Starts a workflow.
If the size of the workflow input payload is bigger than {@link ConductorClientConfiguration#getWorkflowInputPayloadThresholdKB()},
it is uploaded to {@link ExternalPayloadStorage}, if enabled, else the workflow is rejected.
@param startWorkflowRequest the {@link StartWorkflowRequest} object to star... | [
"Starts",
"a",
"workflow",
".",
"If",
"the",
"size",
"of",
"the",
"workflow",
"input",
"payload",
"is",
"bigger",
"than",
"{",
"@link",
"ConductorClientConfiguration#getWorkflowInputPayloadThresholdKB",
"()",
"}",
"it",
"is",
"uploaded",
"to",
"{",
"@link",
"Exter... | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/client/src/main/java/com/netflix/conductor/client/http/WorkflowClient.java#L106-L135 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspNavBuilder.java | CmsJspNavBuilder.getNavigationForResource | @Deprecated
public static CmsJspNavElement getNavigationForResource(CmsObject cms, String resource) {
"""
Returns a navigation element for the named resource.<p>
@param cms context provider for the current request
@param resource the resource name to get the navigation information for,
must be a full path... | java | @Deprecated
public static CmsJspNavElement getNavigationForResource(CmsObject cms, String resource) {
return new CmsJspNavBuilder(cms).getNavigationForResource(resource);
} | [
"@",
"Deprecated",
"public",
"static",
"CmsJspNavElement",
"getNavigationForResource",
"(",
"CmsObject",
"cms",
",",
"String",
"resource",
")",
"{",
"return",
"new",
"CmsJspNavBuilder",
"(",
"cms",
")",
".",
"getNavigationForResource",
"(",
"resource",
")",
";",
"... | Returns a navigation element for the named resource.<p>
@param cms context provider for the current request
@param resource the resource name to get the navigation information for,
must be a full path name, e.g. "/docs/index.html"
@return a navigation element for the given resource
@deprecated use {@link #getNavigat... | [
"Returns",
"a",
"navigation",
"element",
"for",
"the",
"named",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspNavBuilder.java#L269-L273 |
tempodb/tempodb-java | src/main/java/com/tempodb/Filter.java | Filter.addAttribute | public synchronized Filter addAttribute(String key, String value) {
"""
Adds an attribute to the filter.
@param key The attribute key.
@param value The attribute value.
@return This filter
@since 1.0.0
"""
attributes.put(key, value);
return this;
} | java | public synchronized Filter addAttribute(String key, String value) {
attributes.put(key, value);
return this;
} | [
"public",
"synchronized",
"Filter",
"addAttribute",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"attributes",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds an attribute to the filter.
@param key The attribute key.
@param value The attribute value.
@return This filter
@since 1.0.0 | [
"Adds",
"an",
"attribute",
"to",
"the",
"filter",
"."
] | train | https://github.com/tempodb/tempodb-java/blob/5733f204fe4c8dda48916ba1f67cf44f5a3f9c69/src/main/java/com/tempodb/Filter.java#L139-L142 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerCommunicationLinksInner.java | ServerCommunicationLinksInner.getAsync | public Observable<ServerCommunicationLinkInner> getAsync(String resourceGroupName, String serverName, String communicationLinkName) {
"""
Returns a server communication link.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Man... | java | public Observable<ServerCommunicationLinkInner> getAsync(String resourceGroupName, String serverName, String communicationLinkName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, communicationLinkName).map(new Func1<ServiceResponse<ServerCommunicationLinkInner>, ServerCommunicationLinkInner... | [
"public",
"Observable",
"<",
"ServerCommunicationLinkInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"communicationLinkName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"server... | Returns a server communication link.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param communicationLinkName The name of the server communication link.
@throws... | [
"Returns",
"a",
"server",
"communication",
"link",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerCommunicationLinksInner.java#L210-L217 |
sporniket/p3 | src/main/java/com/sporniket/libre/p3/builtins/WrappedObjectMapperProcessor.java | WrappedObjectMapperProcessor.findSetterTarget | private SetterTarget findSetterTarget(String path) throws NoSuchMethodException, IllegalAccessException,
InvocationTargetException {
"""
Find the object to change and the setter method name.
@param path
the path to the object and setter.
@return a {@link SetterTarget} storing the object to change and the s... | java | private SetterTarget findSetterTarget(String path) throws NoSuchMethodException, IllegalAccessException,
InvocationTargetException
{
String[] _accessStack = path.split(REGEXP__CHAR_DOT);
if (0 == _accessStack.length)
{
throw new IllegalArgumentException(path);
}
int _setterIndex = _accessStack.length -... | [
"private",
"SetterTarget",
"findSetterTarget",
"(",
"String",
"path",
")",
"throws",
"NoSuchMethodException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"String",
"[",
"]",
"_accessStack",
"=",
"path",
".",
"split",
"(",
"REGEXP__CHAR_DOT",
... | Find the object to change and the setter method name.
@param path
the path to the object and setter.
@return a {@link SetterTarget} storing the object to change and the setter name.
@throws NoSuchMethodException
when a getter does not exists.
@throws IllegalAccessException
when there is a problem.
@throws InvocationTa... | [
"Find",
"the",
"object",
"to",
"change",
"and",
"the",
"setter",
"method",
"name",
"."
] | train | https://github.com/sporniket/p3/blob/fc20b3066dc4a9cd759090adae0a6b02508df135/src/main/java/com/sporniket/libre/p3/builtins/WrappedObjectMapperProcessor.java#L208-L227 |
alkacon/opencms-core | src/org/opencms/loader/CmsResourceManager.java | CmsResourceManager.matchResourceType | public boolean matchResourceType(String name, int id) {
"""
Checks if there is a resource type with a given name whose id matches the given id.<p>
This will return 'false' if no resource type with the given name is registered.<p>
@param name a resource type name
@param id a resource type id
@return true ... | java | public boolean matchResourceType(String name, int id) {
if (hasResourceType(name)) {
try {
return getResourceType(name).getTypeId() == id;
} catch (Exception e) {
// should never happen because we already checked with hasResourceType, still have to
... | [
"public",
"boolean",
"matchResourceType",
"(",
"String",
"name",
",",
"int",
"id",
")",
"{",
"if",
"(",
"hasResourceType",
"(",
"name",
")",
")",
"{",
"try",
"{",
"return",
"getResourceType",
"(",
"name",
")",
".",
"getTypeId",
"(",
")",
"==",
"id",
";... | Checks if there is a resource type with a given name whose id matches the given id.<p>
This will return 'false' if no resource type with the given name is registered.<p>
@param name a resource type name
@param id a resource type id
@return true if a matching resource type with the given name and id was found | [
"Checks",
"if",
"there",
"is",
"a",
"resource",
"type",
"with",
"a",
"given",
"name",
"whose",
"id",
"matches",
"the",
"given",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsResourceManager.java#L1207-L1221 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/SjavacServer.java | SjavacServer.startServer | public int startServer() throws IOException, InterruptedException {
"""
Start a server using a settings string. Typically: "--startserver:portfile=/tmp/myserver,poolsize=3" and the string "portfile=/tmp/myserver,poolsize=3"
is sent as the settings parameter. Returns 0 on success, -1 on failure.
"""
lo... | java | public int startServer() throws IOException, InterruptedException {
long serverStart = System.currentTimeMillis();
// The port file is locked and the server port and cookie is written into it.
portFile = getPortFile(portfilename);
synchronized (portFile) {
portFile.lock();
... | [
"public",
"int",
"startServer",
"(",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"long",
"serverStart",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"// The port file is locked and the server port and cookie is written into it.",
"portFile",
"... | Start a server using a settings string. Typically: "--startserver:portfile=/tmp/myserver,poolsize=3" and the string "portfile=/tmp/myserver,poolsize=3"
is sent as the settings parameter. Returns 0 on success, -1 on failure. | [
"Start",
"a",
"server",
"using",
"a",
"settings",
"string",
".",
"Typically",
":",
"--",
"startserver",
":",
"portfile",
"=",
"/",
"tmp",
"/",
"myserver",
"poolsize",
"=",
"3",
"and",
"the",
"string",
"portfile",
"=",
"/",
"tmp",
"/",
"myserver",
"poolsi... | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/SjavacServer.java#L160-L227 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/configure/SchemaConfiguration.java | SchemaConfiguration.getJoinColumn | private ColumnInfo getJoinColumn(TableInfo tableInfo, String joinColumnName, Class columnType) {
"""
getJoinColumn method return ColumnInfo for the join column
@param columnType
@param String
joinColumnName.
@return ColumnInfo object columnInfo.
"""
ColumnInfo columnInfo = new ColumnInfo();
... | java | private ColumnInfo getJoinColumn(TableInfo tableInfo, String joinColumnName, Class columnType)
{
ColumnInfo columnInfo = new ColumnInfo();
columnInfo.setColumnName(joinColumnName);
columnInfo.setIndexable(true);
IndexInfo indexInfo = new IndexInfo(joinColumnName);
tableInfo.... | [
"private",
"ColumnInfo",
"getJoinColumn",
"(",
"TableInfo",
"tableInfo",
",",
"String",
"joinColumnName",
",",
"Class",
"columnType",
")",
"{",
"ColumnInfo",
"columnInfo",
"=",
"new",
"ColumnInfo",
"(",
")",
";",
"columnInfo",
".",
"setColumnName",
"(",
"joinColum... | getJoinColumn method return ColumnInfo for the join column
@param columnType
@param String
joinColumnName.
@return ColumnInfo object columnInfo. | [
"getJoinColumn",
"method",
"return",
"ColumnInfo",
"for",
"the",
"join",
"column"
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/configure/SchemaConfiguration.java#L685-L696 |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/runtime/KnowledgeRuntimeManagerRegistry.java | KnowledgeRuntimeManagerRegistry.putRuntimeManager | public static final synchronized void putRuntimeManager(QName serviceDomainName, QName serviceName, KnowledgeRuntimeManager runtimeManager) {
"""
Puts a runtime manager.
@param serviceDomainName the service domain name
@param serviceName the service name
@param runtimeManager the runtime manager
"""
... | java | public static final synchronized void putRuntimeManager(QName serviceDomainName, QName serviceName, KnowledgeRuntimeManager runtimeManager) {
if (serviceDomainName == null) {
serviceDomainName = ROOT_DOMAIN;
}
Map<QName, KnowledgeRuntimeManager> reg = REGISTRY.get(serviceDomainName);... | [
"public",
"static",
"final",
"synchronized",
"void",
"putRuntimeManager",
"(",
"QName",
"serviceDomainName",
",",
"QName",
"serviceName",
",",
"KnowledgeRuntimeManager",
"runtimeManager",
")",
"{",
"if",
"(",
"serviceDomainName",
"==",
"null",
")",
"{",
"serviceDomain... | Puts a runtime manager.
@param serviceDomainName the service domain name
@param serviceName the service name
@param runtimeManager the runtime manager | [
"Puts",
"a",
"runtime",
"manager",
"."
] | train | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/runtime/KnowledgeRuntimeManagerRegistry.java#L48-L62 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.