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 |
|---|---|---|---|---|---|---|---|---|---|---|
igniterealtime/Smack | smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java | AbstractXMPPConnection.populateHostAddresses | protected List<HostAddress> populateHostAddresses() {
"""
Populates {@link #hostAddresses} with the resolved addresses or with the configured host address. If no host
address was configured and all lookups failed, for example with NX_DOMAIN, then {@link #hostAddresses} will be
populated with the empty list.
@... | java | protected List<HostAddress> populateHostAddresses() {
List<HostAddress> failedAddresses = new LinkedList<>();
if (config.hostAddress != null) {
hostAddresses = new ArrayList<>(1);
HostAddress hostAddress = new HostAddress(config.port, config.hostAddress);
hostAddresse... | [
"protected",
"List",
"<",
"HostAddress",
">",
"populateHostAddresses",
"(",
")",
"{",
"List",
"<",
"HostAddress",
">",
"failedAddresses",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"if",
"(",
"config",
".",
"hostAddress",
"!=",
"null",
")",
"{",
"hostA... | Populates {@link #hostAddresses} with the resolved addresses or with the configured host address. If no host
address was configured and all lookups failed, for example with NX_DOMAIN, then {@link #hostAddresses} will be
populated with the empty list.
@return a list of host addresses where DNS (SRV) RR resolution faile... | [
"Populates",
"{",
"@link",
"#hostAddresses",
"}",
"with",
"the",
"resolved",
"addresses",
"or",
"with",
"the",
"configured",
"host",
"address",
".",
"If",
"no",
"host",
"address",
"was",
"configured",
"and",
"all",
"lookups",
"failed",
"for",
"example",
"with"... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java#L731-L752 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/BaseGridTableScreen.java | BaseGridTableScreen.setSelectQuery | public boolean setSelectQuery(Rec recMaint, boolean bUpdateOnSelect) {
"""
Find the sub-screen that uses this grid query and set for selection.
When you select a new record here, you read the same record in the SelectQuery.
@param recMaint The record which is synced on record change.
@param bUpdateOnSelect Do I... | java | public boolean setSelectQuery(Rec recMaint, boolean bUpdateOnSelect)
{
if (recMaint == null)
return true; // BaseTable Set!
if (this.getMainRecord() != null)
if (this.getMainRecord() != recMaint)
if (this.getMainRecord().getBaseRecord().getTableNames(false)... | [
"public",
"boolean",
"setSelectQuery",
"(",
"Rec",
"recMaint",
",",
"boolean",
"bUpdateOnSelect",
")",
"{",
"if",
"(",
"recMaint",
"==",
"null",
")",
"return",
"true",
";",
"// BaseTable Set!",
"if",
"(",
"this",
".",
"getMainRecord",
"(",
")",
"!=",
"null",... | Find the sub-screen that uses this grid query and set for selection.
When you select a new record here, you read the same record in the SelectQuery.
@param recMaint The record which is synced on record change.
@param bUpdateOnSelect Do I update the current record if a selection occurs.
@return True if successful. | [
"Find",
"the",
"sub",
"-",
"screen",
"that",
"uses",
"this",
"grid",
"query",
"and",
"set",
"for",
"selection",
".",
"When",
"you",
"select",
"a",
"new",
"record",
"here",
"you",
"read",
"the",
"same",
"record",
"in",
"the",
"SelectQuery",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/BaseGridTableScreen.java#L164-L176 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/EcKey.java | EcKey.fromJsonWebKey | public static EcKey fromJsonWebKey(JsonWebKey jwk) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeySpecException, NoSuchProviderException {
"""
Converts JSON web key to EC key pair, does not include the private key.
@param jwk
@return EcKey
@throws NoSuchAlgorithmException
@throw... | java | public static EcKey fromJsonWebKey(JsonWebKey jwk) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeySpecException, NoSuchProviderException {
return fromJsonWebKey(jwk, false, null);
} | [
"public",
"static",
"EcKey",
"fromJsonWebKey",
"(",
"JsonWebKey",
"jwk",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidAlgorithmParameterException",
",",
"InvalidKeySpecException",
",",
"NoSuchProviderException",
"{",
"return",
"fromJsonWebKey",
"(",
"jwk",
",",
... | Converts JSON web key to EC key pair, does not include the private key.
@param jwk
@return EcKey
@throws NoSuchAlgorithmException
@throws InvalidAlgorithmParameterException
@throws InvalidKeySpecException
@throws NoSuchProviderException | [
"Converts",
"JSON",
"web",
"key",
"to",
"EC",
"key",
"pair",
"does",
"not",
"include",
"the",
"private",
"key",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-cryptography/src/main/java/com/microsoft/azure/keyvault/cryptography/EcKey.java#L197-L199 |
BranchMetrics/android-branch-deep-linking | Branch-SDK/src/io/branch/referral/Branch.java | Branch.redeemRewards | public void redeemRewards(@NonNull final String bucket,
final int count, BranchReferralStateChangedListener callback) {
"""
<p>Redeems the specified number of credits from the named bucket, if there are sufficient
credits within it. If the number to redeem exceeds the number availabl... | java | public void redeemRewards(@NonNull final String bucket,
final int count, BranchReferralStateChangedListener callback) {
ServerRequestRedeemRewards req = new ServerRequestRedeemRewards(context_, bucket, count, callback);
if (!req.constructError_ && !req.handleErrors(context_... | [
"public",
"void",
"redeemRewards",
"(",
"@",
"NonNull",
"final",
"String",
"bucket",
",",
"final",
"int",
"count",
",",
"BranchReferralStateChangedListener",
"callback",
")",
"{",
"ServerRequestRedeemRewards",
"req",
"=",
"new",
"ServerRequestRedeemRewards",
"(",
"con... | <p>Redeems the specified number of credits from the named bucket, if there are sufficient
credits within it. If the number to redeem exceeds the number available in the bucket, all of
the available credits will be redeemed instead.</p>
@param bucket A {@link String} value containing the name of the referral bucket t... | [
"<p",
">",
"Redeems",
"the",
"specified",
"number",
"of",
"credits",
"from",
"the",
"named",
"bucket",
"if",
"there",
"are",
"sufficient",
"credits",
"within",
"it",
".",
"If",
"the",
"number",
"to",
"redeem",
"exceeds",
"the",
"number",
"available",
"in",
... | train | https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/Branch.java#L1916-L1922 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/script/Script.java | Script.writeBytes | public static void writeBytes(OutputStream os, byte[] buf) throws IOException {
"""
Writes out the given byte buffer to the output stream with the correct opcode prefix
To write an integer call writeBytes(out, Utils.reverseBytes(Utils.encodeMPI(val, false)));
"""
if (buf.length < OP_PUSHDATA1) {
... | java | public static void writeBytes(OutputStream os, byte[] buf) throws IOException {
if (buf.length < OP_PUSHDATA1) {
os.write(buf.length);
os.write(buf);
} else if (buf.length < 256) {
os.write(OP_PUSHDATA1);
os.write(buf.length);
os.write(buf);
... | [
"public",
"static",
"void",
"writeBytes",
"(",
"OutputStream",
"os",
",",
"byte",
"[",
"]",
"buf",
")",
"throws",
"IOException",
"{",
"if",
"(",
"buf",
".",
"length",
"<",
"OP_PUSHDATA1",
")",
"{",
"os",
".",
"write",
"(",
"buf",
".",
"length",
")",
... | Writes out the given byte buffer to the output stream with the correct opcode prefix
To write an integer call writeBytes(out, Utils.reverseBytes(Utils.encodeMPI(val, false))); | [
"Writes",
"out",
"the",
"given",
"byte",
"buffer",
"to",
"the",
"output",
"stream",
"with",
"the",
"correct",
"opcode",
"prefix",
"To",
"write",
"an",
"integer",
"call",
"writeBytes",
"(",
"out",
"Utils",
".",
"reverseBytes",
"(",
"Utils",
".",
"encodeMPI",
... | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/script/Script.java#L320-L335 |
milaboratory/milib | src/main/java/com/milaboratory/core/alignment/BandedLinearAligner.java | BandedLinearAligner.alignLeftAdded | public static Alignment<NucleotideSequence> alignLeftAdded(LinearGapAlignmentScoring scoring, NucleotideSequence seq1, NucleotideSequence seq2,
int offset1, int length1, int addedNucleotides1, int offset2, int length2, int addedNucleotides2,
... | java | public static Alignment<NucleotideSequence> alignLeftAdded(LinearGapAlignmentScoring scoring, NucleotideSequence seq1, NucleotideSequence seq2,
int offset1, int length1, int addedNucleotides1, int offset2, int length2, int addedNucleotides2,
... | [
"public",
"static",
"Alignment",
"<",
"NucleotideSequence",
">",
"alignLeftAdded",
"(",
"LinearGapAlignmentScoring",
"scoring",
",",
"NucleotideSequence",
"seq1",
",",
"NucleotideSequence",
"seq2",
",",
"int",
"offset1",
",",
"int",
"length1",
",",
"int",
"addedNucleo... | Semi-semi-global alignment with artificially added letters.
<p>Alignment where second sequence is aligned to the left part of first sequence.</p>
<p>Whole second sequence must be highly similar to the first sequence, except last {@code width} letters, which
are to be checked whether they can improve alignment or not.... | [
"Semi",
"-",
"semi",
"-",
"global",
"alignment",
"with",
"artificially",
"added",
"letters",
"."
] | train | https://github.com/milaboratory/milib/blob/2349b3dccdd3c7948643760e570238d6e30d5a34/src/main/java/com/milaboratory/core/alignment/BandedLinearAligner.java#L596-L610 |
percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/ViewUtils.java | ViewUtils.showView | public static void showView(View parentView, int id) {
"""
Sets visibility of the given view to <code>View.VISIBLE</code>.
@param parentView The View used to call findViewId() on.
@param id R.id.xxxx value for the view to show.
"""
if (parentView != null) {
View view = parentView.... | java | public static void showView(View parentView, int id) {
if (parentView != null) {
View view = parentView.findViewById(id);
if (view != null) {
view.setVisibility(View.VISIBLE);
} else {
Log.e("Caffeine", "View does not exist. Could not show it.");
... | [
"public",
"static",
"void",
"showView",
"(",
"View",
"parentView",
",",
"int",
"id",
")",
"{",
"if",
"(",
"parentView",
"!=",
"null",
")",
"{",
"View",
"view",
"=",
"parentView",
".",
"findViewById",
"(",
"id",
")",
";",
"if",
"(",
"view",
"!=",
"nul... | Sets visibility of the given view to <code>View.VISIBLE</code>.
@param parentView The View used to call findViewId() on.
@param id R.id.xxxx value for the view to show. | [
"Sets",
"visibility",
"of",
"the",
"given",
"view",
"to",
"<code",
">",
"View",
".",
"VISIBLE<",
"/",
"code",
">",
"."
] | train | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/ViewUtils.java#L283-L292 |
codelibs/fess | src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java | FessMessages.addErrorsCrudFailedToDeleteCrudTable | public FessMessages addErrorsCrudFailedToDeleteCrudTable(String property, String arg0) {
"""
Add the created action message for the key 'errors.crud_failed_to_delete_crud_table' with parameters.
<pre>
message: Failed to delete the data. ({0})
</pre>
@param property The property name for the message. (NotNull)
... | java | public FessMessages addErrorsCrudFailedToDeleteCrudTable(String property, String arg0) {
assertPropertyNotNull(property);
add(property, new UserMessage(ERRORS_crud_failed_to_delete_crud_table, arg0));
return this;
} | [
"public",
"FessMessages",
"addErrorsCrudFailedToDeleteCrudTable",
"(",
"String",
"property",
",",
"String",
"arg0",
")",
"{",
"assertPropertyNotNull",
"(",
"property",
")",
";",
"add",
"(",
"property",
",",
"new",
"UserMessage",
"(",
"ERRORS_crud_failed_to_delete_crud_t... | Add the created action message for the key 'errors.crud_failed_to_delete_crud_table' with parameters.
<pre>
message: Failed to delete the data. ({0})
</pre>
@param property The property name for the message. (NotNull)
@param arg0 The parameter arg0 for message. (NotNull)
@return this. (NotNull) | [
"Add",
"the",
"created",
"action",
"message",
"for",
"the",
"key",
"errors",
".",
"crud_failed_to_delete_crud_table",
"with",
"parameters",
".",
"<pre",
">",
"message",
":",
"Failed",
"to",
"delete",
"the",
"data",
".",
"(",
"{",
"0",
"}",
")",
"<",
"/",
... | train | https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java#L2155-L2159 |
CenturyLinkCloud/mdw | mdw-workflow/src/com/centurylink/mdw/workflow/activity/timer/TimerWaitActivity.java | TimerWaitActivity.getWaitPeriodInSeconds | protected int getWaitPeriodInSeconds() throws ActivityException {
"""
Method that returns the wait period for the activity
@return Wait period
"""
String unit = super.getAttributeValue(WAIT_UNIT);
int factor;
if (MINUTES.equals(unit)) factor = 60;
else if (HOURS.equals(unit)) f... | java | protected int getWaitPeriodInSeconds() throws ActivityException {
String unit = super.getAttributeValue(WAIT_UNIT);
int factor;
if (MINUTES.equals(unit)) factor = 60;
else if (HOURS.equals(unit)) factor = 3600;
else if (DAYS.equals(unit)) factor = 86400;
else factor = 1; ... | [
"protected",
"int",
"getWaitPeriodInSeconds",
"(",
")",
"throws",
"ActivityException",
"{",
"String",
"unit",
"=",
"super",
".",
"getAttributeValue",
"(",
"WAIT_UNIT",
")",
";",
"int",
"factor",
";",
"if",
"(",
"MINUTES",
".",
"equals",
"(",
"unit",
")",
")"... | Method that returns the wait period for the activity
@return Wait period | [
"Method",
"that",
"returns",
"the",
"wait",
"period",
"for",
"the",
"activity"
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-workflow/src/com/centurylink/mdw/workflow/activity/timer/TimerWaitActivity.java#L135-L151 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.addAll | public static <T> boolean addAll(Collection<T> self, Iterator<T> items) {
"""
Adds all items from the iterator to the Collection.
@param self the collection
@param items the items to add
@return true if the collection changed
"""
boolean changed = false;
while (items.hasNext()) {
... | java | public static <T> boolean addAll(Collection<T> self, Iterator<T> items) {
boolean changed = false;
while (items.hasNext()) {
T next = items.next();
if (self.add(next)) changed = true;
}
return changed;
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"addAll",
"(",
"Collection",
"<",
"T",
">",
"self",
",",
"Iterator",
"<",
"T",
">",
"items",
")",
"{",
"boolean",
"changed",
"=",
"false",
";",
"while",
"(",
"items",
".",
"hasNext",
"(",
")",
")",
"{",... | Adds all items from the iterator to the Collection.
@param self the collection
@param items the items to add
@return true if the collection changed | [
"Adds",
"all",
"items",
"from",
"the",
"iterator",
"to",
"the",
"Collection",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L9371-L9378 |
zxing/zxing | javase/src/main/java/com/google/zxing/client/j2se/MatrixToImageWriter.java | MatrixToImageWriter.writeToStream | public static void writeToStream(BitMatrix matrix, String format, OutputStream stream, MatrixToImageConfig config)
throws IOException {
"""
As {@link #writeToStream(BitMatrix, String, OutputStream)}, but allows customization of the output.
@param matrix {@link BitMatrix} to write
@param format image for... | java | public static void writeToStream(BitMatrix matrix, String format, OutputStream stream, MatrixToImageConfig config)
throws IOException {
BufferedImage image = toBufferedImage(matrix, config);
if (!ImageIO.write(image, format, stream)) {
throw new IOException("Could not write an image of format " +... | [
"public",
"static",
"void",
"writeToStream",
"(",
"BitMatrix",
"matrix",
",",
"String",
"format",
",",
"OutputStream",
"stream",
",",
"MatrixToImageConfig",
"config",
")",
"throws",
"IOException",
"{",
"BufferedImage",
"image",
"=",
"toBufferedImage",
"(",
"matrix",... | As {@link #writeToStream(BitMatrix, String, OutputStream)}, but allows customization of the output.
@param matrix {@link BitMatrix} to write
@param format image format
@param stream {@link OutputStream} to write image to
@param config output configuration
@throws IOException if writes to the stream fail | [
"As",
"{",
"@link",
"#writeToStream",
"(",
"BitMatrix",
"String",
"OutputStream",
")",
"}",
"but",
"allows",
"customization",
"of",
"the",
"output",
"."
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/javase/src/main/java/com/google/zxing/client/j2se/MatrixToImageWriter.java#L156-L162 |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JJDocMojo.java | JJDocMojo.scanForGrammars | private GrammarInfo [] scanForGrammars (final File sourceDirectory) throws MavenReportException {
"""
Searches the specified source directory to find grammar files that can be
documented.
@param sourceDirectory
The source directory to scan for grammar files.
@return An array of grammar infos describing the f... | java | private GrammarInfo [] scanForGrammars (final File sourceDirectory) throws MavenReportException
{
if (!sourceDirectory.isDirectory ())
{
return null;
}
GrammarInfo [] grammarInfos;
getLog ().debug ("Scanning for grammars: " + sourceDirectory);
try
{
final String [] includes =... | [
"private",
"GrammarInfo",
"[",
"]",
"scanForGrammars",
"(",
"final",
"File",
"sourceDirectory",
")",
"throws",
"MavenReportException",
"{",
"if",
"(",
"!",
"sourceDirectory",
".",
"isDirectory",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"GrammarInfo",
"[... | Searches the specified source directory to find grammar files that can be
documented.
@param sourceDirectory
The source directory to scan for grammar files.
@return An array of grammar infos describing the found grammar files or
<code>null</code> if the source directory does not exist.
@throws MavenReportException
If ... | [
"Searches",
"the",
"specified",
"source",
"directory",
"to",
"find",
"grammar",
"files",
"that",
"can",
"be",
"documented",
"."
] | train | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JJDocMojo.java#L519-L545 |
mguymon/model-citizen | core/src/main/java/com/tobedevoured/modelcitizen/ModelFactory.java | ModelFactory.createModel | @SuppressWarnings( {
"""
Create a Model for a registered Blueprint. Values set in the
model will not be overridden by defaults in the Blueprint.
@param <T> model Class
@param referenceModel Object
@param withPolicies boolean if Policies should be applied to the create
@return Model
@throws CreateModelExc... | java | @SuppressWarnings({"rawtypes", "unchecked"})
public <T> T createModel(T referenceModel, boolean withPolicies) throws CreateModelException {
Erector erector = erectors.get(referenceModel.getClass());
if (erector == null) {
throw new CreateModelException("Unregistered class: " + reference... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"public",
"<",
"T",
">",
"T",
"createModel",
"(",
"T",
"referenceModel",
",",
"boolean",
"withPolicies",
")",
"throws",
"CreateModelException",
"{",
"Erector",
"erector",
"=",
"... | Create a Model for a registered Blueprint. Values set in the
model will not be overridden by defaults in the Blueprint.
@param <T> model Class
@param referenceModel Object
@param withPolicies boolean if Policies should be applied to the create
@return Model
@throws CreateModelException model failed to create | [
"Create",
"a",
"Model",
"for",
"a",
"registered",
"Blueprint",
".",
"Values",
"set",
"in",
"the",
"model",
"will",
"not",
"be",
"overridden",
"by",
"defaults",
"in",
"the",
"Blueprint",
"."
] | train | https://github.com/mguymon/model-citizen/blob/9078ab4121897a21e598dd4f0efa6996b46e4dea/core/src/main/java/com/tobedevoured/modelcitizen/ModelFactory.java#L497-L506 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/lss/LssClient.java | LssClient.getStream | public GetStreamResponse getStream(GetStreamRequest request) {
"""
Get detail of stream in the live stream service.
@param request The request object containing all options for querying detail of stream
@return the response
"""
checkNotNull(request, "The parameter request should NOT be null.");
... | java | public GetStreamResponse getStream(GetStreamRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getPlayDomain(), "playDomain should NOT be empty.");
checkStringNotEmpty(request.getApp(), "App should NOT be empty.");
checkStr... | [
"public",
"GetStreamResponse",
"getStream",
"(",
"GetStreamRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getPlayDomain",
"(",
")",
",",
"\"playD... | Get detail of stream in the live stream service.
@param request The request object containing all options for querying detail of stream
@return the response | [
"Get",
"detail",
"of",
"stream",
"in",
"the",
"live",
"stream",
"service",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L1463-L1475 |
wdullaer/MaterialDateTimePicker | library/src/main/java/com/wdullaer/materialdatetimepicker/date/MonthView.java | MonthView.getDayFromLocation | public int getDayFromLocation(float x, float y) {
"""
Calculates the day that the given x position is in, accounting for week
number. Returns the day or -1 if the position wasn't in a day.
@param x The x position of the touch event
@return The day number, or -1 if the position wasn't in a day
"""
... | java | public int getDayFromLocation(float x, float y) {
final int day = getInternalDayFromLocation(x, y);
if (day < 1 || day > mNumCells) {
return -1;
}
return day;
} | [
"public",
"int",
"getDayFromLocation",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"final",
"int",
"day",
"=",
"getInternalDayFromLocation",
"(",
"x",
",",
"y",
")",
";",
"if",
"(",
"day",
"<",
"1",
"||",
"day",
">",
"mNumCells",
")",
"{",
"retur... | Calculates the day that the given x position is in, accounting for week
number. Returns the day or -1 if the position wasn't in a day.
@param x The x position of the touch event
@return The day number, or -1 if the position wasn't in a day | [
"Calculates",
"the",
"day",
"that",
"the",
"given",
"x",
"position",
"is",
"in",
"accounting",
"for",
"week",
"number",
".",
"Returns",
"the",
"day",
"or",
"-",
"1",
"if",
"the",
"position",
"wasn",
"t",
"in",
"a",
"day",
"."
] | train | https://github.com/wdullaer/MaterialDateTimePicker/blob/0a8fe28f19db4f5a5a6cfc525a852416232873a8/library/src/main/java/com/wdullaer/materialdatetimepicker/date/MonthView.java#L503-L509 |
operasoftware/operaprestodriver | src/com/opera/core/systems/OperaWebElement.java | OperaWebElement.saveScreenshot | public String saveScreenshot(String filename, long timeout) {
"""
Take a screenshot of the area this element covers. Saves a copy of the image to the given
filename.
@param filename the location to save the screenshot
@param timeout the number of milliseconds to wait before taking the screenshot
@return the... | java | public String saveScreenshot(String filename, long timeout) {
return saveScreenshot(filename, timeout, true, new ArrayList<String>());
} | [
"public",
"String",
"saveScreenshot",
"(",
"String",
"filename",
",",
"long",
"timeout",
")",
"{",
"return",
"saveScreenshot",
"(",
"filename",
",",
"timeout",
",",
"true",
",",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
")",
";",
"}"
] | Take a screenshot of the area this element covers. Saves a copy of the image to the given
filename.
@param filename the location to save the screenshot
@param timeout the number of milliseconds to wait before taking the screenshot
@return the MD5 hash of the screenshot | [
"Take",
"a",
"screenshot",
"of",
"the",
"area",
"this",
"element",
"covers",
".",
"Saves",
"a",
"copy",
"of",
"the",
"image",
"to",
"the",
"given",
"filename",
"."
] | train | https://github.com/operasoftware/operaprestodriver/blob/1ccceda80f1c1a0489171d17dcaa6e7b18fb4c01/src/com/opera/core/systems/OperaWebElement.java#L345-L347 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/query/algebra/ProductPlan.java | ProductPlan.productHistogram | public static Histogram productHistogram(Histogram hist1, Histogram hist2) {
"""
Returns a histogram that, for each field, approximates the value
distribution of products from the specified histograms.
@param hist1
the left-hand-side histogram
@param hist2
the right-hand-side histogram
@return a histogram ... | java | public static Histogram productHistogram(Histogram hist1, Histogram hist2) {
Set<String> prodFlds = new HashSet<String>(hist1.fields());
prodFlds.addAll(hist2.fields());
Histogram prodHist = new Histogram(prodFlds);
double numRec1 = hist1.recordsOutput();
double numRec2 = hist2.recordsOutput();
if (Do... | [
"public",
"static",
"Histogram",
"productHistogram",
"(",
"Histogram",
"hist1",
",",
"Histogram",
"hist2",
")",
"{",
"Set",
"<",
"String",
">",
"prodFlds",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
"hist1",
".",
"fields",
"(",
")",
")",
";",
"prodF... | Returns a histogram that, for each field, approximates the value
distribution of products from the specified histograms.
@param hist1
the left-hand-side histogram
@param hist2
the right-hand-side histogram
@return a histogram that, for each field, approximates the value
distribution of the products | [
"Returns",
"a",
"histogram",
"that",
"for",
"each",
"field",
"approximates",
"the",
"value",
"distribution",
"of",
"products",
"from",
"the",
"specified",
"histograms",
"."
] | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/query/algebra/ProductPlan.java#L41-L61 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/preview/CmsFocalPointController.java | CmsFocalPointController.handleMove | private void handleMove(NativeEvent nativeEvent) {
"""
Handles mouse drag.<p>
@param nativeEvent the mousemove event
"""
Element imageElem = m_image.getElement();
int offsetX = ((int)pageX(nativeEvent)) - imageElem.getParentElement().getAbsoluteLeft();
int offsetY = ((int)pageY(nati... | java | private void handleMove(NativeEvent nativeEvent) {
Element imageElem = m_image.getElement();
int offsetX = ((int)pageX(nativeEvent)) - imageElem.getParentElement().getAbsoluteLeft();
int offsetY = ((int)pageY(nativeEvent)) - imageElem.getParentElement().getAbsoluteTop();
if (m_coordinat... | [
"private",
"void",
"handleMove",
"(",
"NativeEvent",
"nativeEvent",
")",
"{",
"Element",
"imageElem",
"=",
"m_image",
".",
"getElement",
"(",
")",
";",
"int",
"offsetX",
"=",
"(",
"(",
"int",
")",
"pageX",
"(",
"nativeEvent",
")",
")",
"-",
"imageElem",
... | Handles mouse drag.<p>
@param nativeEvent the mousemove event | [
"Handles",
"mouse",
"drag",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/preview/CmsFocalPointController.java#L306-L318 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/Widgets.java | Widgets.newRow | public static HorizontalPanel newRow (String styleName, Widget... contents) {
"""
Creates a row of widgets in a horizontal panel with a 5 pixel gap between them.
"""
return newRow(HasAlignment.ALIGN_MIDDLE, styleName, contents);
} | java | public static HorizontalPanel newRow (String styleName, Widget... contents)
{
return newRow(HasAlignment.ALIGN_MIDDLE, styleName, contents);
} | [
"public",
"static",
"HorizontalPanel",
"newRow",
"(",
"String",
"styleName",
",",
"Widget",
"...",
"contents",
")",
"{",
"return",
"newRow",
"(",
"HasAlignment",
".",
"ALIGN_MIDDLE",
",",
"styleName",
",",
"contents",
")",
";",
"}"
] | Creates a row of widgets in a horizontal panel with a 5 pixel gap between them. | [
"Creates",
"a",
"row",
"of",
"widgets",
"in",
"a",
"horizontal",
"panel",
"with",
"a",
"5",
"pixel",
"gap",
"between",
"them",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L147-L150 |
zandero/rest.vertx | src/main/java/com/zandero/rest/RestRouter.java | RestRouter.notFound | public static void notFound(Router router, Class<? extends NotFoundResponseWriter> notFound) {
"""
Handles not found route for all requests
@param router to add route to
@param notFound handler
"""
notFound(router, null, notFound);
} | java | public static void notFound(Router router, Class<? extends NotFoundResponseWriter> notFound) {
notFound(router, null, notFound);
} | [
"public",
"static",
"void",
"notFound",
"(",
"Router",
"router",
",",
"Class",
"<",
"?",
"extends",
"NotFoundResponseWriter",
">",
"notFound",
")",
"{",
"notFound",
"(",
"router",
",",
"null",
",",
"notFound",
")",
";",
"}"
] | Handles not found route for all requests
@param router to add route to
@param notFound handler | [
"Handles",
"not",
"found",
"route",
"for",
"all",
"requests"
] | train | https://github.com/zandero/rest.vertx/blob/ba458720cf59e076953eab9dac7227eeaf9e58ce/src/main/java/com/zandero/rest/RestRouter.java#L268-L270 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/SLINK.java | SLINK.run | public PointerHierarchyRepresentationResult run(Database database, Relation<O> relation) {
"""
Performs the SLINK algorithm on the given database.
@param database Database to process
@param relation Data relation to use
"""
DBIDs ids = relation.getDBIDs();
WritableDBIDDataStore pi = DataStoreUtil.m... | java | public PointerHierarchyRepresentationResult run(Database database, Relation<O> relation) {
DBIDs ids = relation.getDBIDs();
WritableDBIDDataStore pi = DataStoreUtil.makeDBIDStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_STATIC);
WritableDoubleDataStore lambda = DataStoreUtil.makeDoubleStorag... | [
"public",
"PointerHierarchyRepresentationResult",
"run",
"(",
"Database",
"database",
",",
"Relation",
"<",
"O",
">",
"relation",
")",
"{",
"DBIDs",
"ids",
"=",
"relation",
".",
"getDBIDs",
"(",
")",
";",
"WritableDBIDDataStore",
"pi",
"=",
"DataStoreUtil",
".",... | Performs the SLINK algorithm on the given database.
@param database Database to process
@param relation Data relation to use | [
"Performs",
"the",
"SLINK",
"algorithm",
"on",
"the",
"given",
"database",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/SLINK.java#L101-L149 |
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/jbeanbox/AopUtils.java | AopUtils.createProxyBean | public static Object createProxyBean(Class<?> clazz, BeanBox box, BeanBoxContext ctx) {
"""
Create a ProxyBean
@param clazz
The target class
@param box
The BeanBox of target class
@param ctx
The BeanBoxContext
@return A Proxy Bean with AOP support
"""
BeanBoxException.assureNotNull(clazz, "Try to cr... | java | public static Object createProxyBean(Class<?> clazz, BeanBox box, BeanBoxContext ctx) {
BeanBoxException.assureNotNull(clazz, "Try to create a proxy bean, but beanClass not found.");
Enhancer enhancer = new Enhancer();
enhancer.setSuperclass(clazz);
if (box.getConstructorParams() != null && box.getConstructorPa... | [
"public",
"static",
"Object",
"createProxyBean",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"BeanBox",
"box",
",",
"BeanBoxContext",
"ctx",
")",
"{",
"BeanBoxException",
".",
"assureNotNull",
"(",
"clazz",
",",
"\"Try to create a proxy bean, but beanClass not found.\"... | Create a ProxyBean
@param clazz
The target class
@param box
The BeanBox of target class
@param ctx
The BeanBoxContext
@return A Proxy Bean with AOP support | [
"Create",
"a",
"ProxyBean"
] | train | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/jbeanbox/AopUtils.java#L34-L55 |
cesarferreira/AndroidQuickUtils | library/src/main/java/quickutils/core/categories/security.java | security.privateBase64Encoder | private static String privateBase64Encoder(String toEncode, int flags) {
"""
private Encoder in base64
@param toEncode
String to be encoded
@param flags
flags to encode the String
@return encoded String in base64
"""
byte[] data = null;
try {
data = toEncode.getBytes("UTF-8");
} catch (Unsu... | java | private static String privateBase64Encoder(String toEncode, int flags) {
byte[] data = null;
try {
data = toEncode.getBytes("UTF-8");
} catch (UnsupportedEncodingException e1) {
e1.printStackTrace();
}
if (flags == -1) {
flags = Base64.DEFAULT;
}
return Base64.encodeToString(data, f... | [
"private",
"static",
"String",
"privateBase64Encoder",
"(",
"String",
"toEncode",
",",
"int",
"flags",
")",
"{",
"byte",
"[",
"]",
"data",
"=",
"null",
";",
"try",
"{",
"data",
"=",
"toEncode",
".",
"getBytes",
"(",
"\"UTF-8\"",
")",
";",
"}",
"catch",
... | private Encoder in base64
@param toEncode
String to be encoded
@param flags
flags to encode the String
@return encoded String in base64 | [
"private",
"Encoder",
"in",
"base64"
] | train | https://github.com/cesarferreira/AndroidQuickUtils/blob/73a91daedbb9f7be7986ea786fbc441c9e5a881c/library/src/main/java/quickutils/core/categories/security.java#L53-L66 |
alibaba/vlayout | vlayout/src/main/java/com/alibaba/android/vlayout/VirtualLayoutManager.java | VirtualLayoutManager.updateSpecWithExtra | private int updateSpecWithExtra(int spec, int startInset, int endInset) {
"""
Update measure spec with insets
@param spec
@param startInset
@param endInset
@return
"""
if (startInset == 0 && endInset == 0) {
return spec;
}
final int mode = View.MeasureSpec.getMode(spec... | java | private int updateSpecWithExtra(int spec, int startInset, int endInset) {
if (startInset == 0 && endInset == 0) {
return spec;
}
final int mode = View.MeasureSpec.getMode(spec);
if (mode == View.MeasureSpec.AT_MOST || mode == View.MeasureSpec.EXACTLY) {
int size =... | [
"private",
"int",
"updateSpecWithExtra",
"(",
"int",
"spec",
",",
"int",
"startInset",
",",
"int",
"endInset",
")",
"{",
"if",
"(",
"startInset",
"==",
"0",
"&&",
"endInset",
"==",
"0",
")",
"{",
"return",
"spec",
";",
"}",
"final",
"int",
"mode",
"=",... | Update measure spec with insets
@param spec
@param startInset
@param endInset
@return | [
"Update",
"measure",
"spec",
"with",
"insets"
] | train | https://github.com/alibaba/vlayout/blob/8a5a51d9d2eeb91fed2ee331a4cf3496282452ce/vlayout/src/main/java/com/alibaba/android/vlayout/VirtualLayoutManager.java#L1531-L1546 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabsInner.java | LabsInner.registerAsync | public Observable<Void> registerAsync(String resourceGroupName, String labAccountName, String labName) {
"""
Register to managed lab.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@throws IllegalArgumentExceptio... | java | public Observable<Void> registerAsync(String resourceGroupName, String labAccountName, String labName) {
return registerWithServiceResponseAsync(resourceGroupName, labAccountName, labName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> res... | [
"public",
"Observable",
"<",
"Void",
">",
"registerAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"labName",
")",
"{",
"return",
"registerWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"labAccountName",
",",
"lab... | Register to managed lab.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponse} object if successful. | [
"Register",
"to",
"managed",
"lab",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/LabsInner.java#L1063-L1070 |
Wadpam/guja | guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java | GeneratedDContactDaoImpl.queryByCreatedDate | public Iterable<DContact> queryByCreatedDate(Object parent, java.util.Date createdDate) {
"""
query-by method for field createdDate
@param createdDate the specified attribute
@return an Iterable of DContacts for the specified createdDate
"""
return queryByField(parent, DContactMapper.Field.CREATEDDATE.ge... | java | public Iterable<DContact> queryByCreatedDate(Object parent, java.util.Date createdDate) {
return queryByField(parent, DContactMapper.Field.CREATEDDATE.getFieldName(), createdDate);
} | [
"public",
"Iterable",
"<",
"DContact",
">",
"queryByCreatedDate",
"(",
"Object",
"parent",
",",
"java",
".",
"util",
".",
"Date",
"createdDate",
")",
"{",
"return",
"queryByField",
"(",
"parent",
",",
"DContactMapper",
".",
"Field",
".",
"CREATEDDATE",
".",
... | query-by method for field createdDate
@param createdDate the specified attribute
@return an Iterable of DContacts for the specified createdDate | [
"query",
"-",
"by",
"method",
"for",
"field",
"createdDate"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-contact/src/main/java/com/wadpam/guja/dao/GeneratedDContactDaoImpl.java#L142-L144 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/ConnectionListenerImpl.java | ConnectionListenerImpl.commsFailure | public void commsFailure(SICoreConnection conn, SIConnectionLostException exception) {
"""
This method is called when a connection is closed due to a communications
failure. Examine the SICommsException to determine the nature of the failure.
<p>The conn parameter is ignored. The JMS API uses a 1 to 1 mapping ... | java | public void commsFailure(SICoreConnection conn, SIConnectionLostException exception) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "commsFailure", new Object[]{conn, exception});
JMSException jmse = (JMSException)JmsErrorUtils.newThrowable(JMSException.class,
... | [
"public",
"void",
"commsFailure",
"(",
"SICoreConnection",
"conn",
",",
"SIConnectionLostException",
"exception",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry"... | This method is called when a connection is closed due to a communications
failure. Examine the SICommsException to determine the nature of the failure.
<p>The conn parameter is ignored. The JMS API uses a 1 to 1 mapping of ConnectionListenerImpl
to JMS Connection instances, so we should only ever receive calls for our... | [
"This",
"method",
"is",
"called",
"when",
"a",
"connection",
"is",
"closed",
"due",
"to",
"a",
"communications",
"failure",
".",
"Examine",
"the",
"SICommsException",
"to",
"determine",
"the",
"nature",
"of",
"the",
"failure",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/ConnectionListenerImpl.java#L99-L111 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/Block.java | Block.verifyTransactions | public void verifyTransactions(final int height, final EnumSet<VerifyFlag> flags) throws VerificationException {
"""
Checks the block contents
@param height block height, if known, or -1 otherwise. If valid, used
to validate the coinbase input script of v2 and above blocks.
@param flags flags to indicate whic... | java | public void verifyTransactions(final int height, final EnumSet<VerifyFlag> flags) throws VerificationException {
// Now we need to check that the body of the block actually matches the headers. The network won't generate
// an invalid block, but if we didn't validate this then an untrusted man-in-the-mi... | [
"public",
"void",
"verifyTransactions",
"(",
"final",
"int",
"height",
",",
"final",
"EnumSet",
"<",
"VerifyFlag",
">",
"flags",
")",
"throws",
"VerificationException",
"{",
"// Now we need to check that the body of the block actually matches the headers. The network won't genera... | Checks the block contents
@param height block height, if known, or -1 otherwise. If valid, used
to validate the coinbase input script of v2 and above blocks.
@param flags flags to indicate which tests should be applied (i.e.
whether to test for height in the coinbase transaction).
@throws VerificationException if ther... | [
"Checks",
"the",
"block",
"contents"
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/Block.java#L728-L742 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/execution/dispatch/ParallelNodeDispatcher.java | ParallelNodeDispatcher.genSetThreadLocalRefValue | private static Task genSetThreadLocalRefValue(final String refid, final String value) {
"""
Return a task configured to set the thread local value for a particular refid
@param refid the refid
@param value the value to set
@return the Task
"""
final SetThreadLocalTask task = new SetThreadLocalTa... | java | private static Task genSetThreadLocalRefValue(final String refid, final String value) {
final SetThreadLocalTask task = new SetThreadLocalTask();
task.setRefid(refid);
task.setValue(value);
return task;
} | [
"private",
"static",
"Task",
"genSetThreadLocalRefValue",
"(",
"final",
"String",
"refid",
",",
"final",
"String",
"value",
")",
"{",
"final",
"SetThreadLocalTask",
"task",
"=",
"new",
"SetThreadLocalTask",
"(",
")",
";",
"task",
".",
"setRefid",
"(",
"refid",
... | Return a task configured to set the thread local value for a particular refid
@param refid the refid
@param value the value to set
@return the Task | [
"Return",
"a",
"task",
"configured",
"to",
"set",
"the",
"thread",
"local",
"value",
"for",
"a",
"particular",
"refid"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/execution/dispatch/ParallelNodeDispatcher.java#L325-L330 |
craftercms/deployer | src/main/java/org/craftercms/deployer/utils/ConfigUtils.java | ConfigUtils.getBooleanProperty | public static Boolean getBooleanProperty(Configuration config, String key) throws DeployerConfigurationException {
"""
Returns the specified Boolean property from the configuration
@param config the configuration
@param key the key of the property
@return the Boolean value of the property, or null if not f... | java | public static Boolean getBooleanProperty(Configuration config, String key) throws DeployerConfigurationException {
return getBooleanProperty(config, key, null);
} | [
"public",
"static",
"Boolean",
"getBooleanProperty",
"(",
"Configuration",
"config",
",",
"String",
"key",
")",
"throws",
"DeployerConfigurationException",
"{",
"return",
"getBooleanProperty",
"(",
"config",
",",
"key",
",",
"null",
")",
";",
"}"
] | Returns the specified Boolean property from the configuration
@param config the configuration
@param key the key of the property
@return the Boolean value of the property, or null if not found
@throws DeployerConfigurationException if an error occurred | [
"Returns",
"the",
"specified",
"Boolean",
"property",
"from",
"the",
"configuration"
] | train | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/utils/ConfigUtils.java#L140-L142 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-talent/src/main/java/com/google/cloud/talent/v4beta1/JobServiceClient.java | JobServiceClient.batchDeleteJobs | public final void batchDeleteJobs(TenantOrProjectName parent, String filter) {
"""
Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s by filter.
<p>Sample code:
<pre><code>
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
TenantOrProjectName parent = TenantName.of("[PROJECT]", "... | java | public final void batchDeleteJobs(TenantOrProjectName parent, String filter) {
BatchDeleteJobsRequest request =
BatchDeleteJobsRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setFilter(filter)
.build();
batchDeleteJobs(request);
} | [
"public",
"final",
"void",
"batchDeleteJobs",
"(",
"TenantOrProjectName",
"parent",
",",
"String",
"filter",
")",
"{",
"BatchDeleteJobsRequest",
"request",
"=",
"BatchDeleteJobsRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"parent",
"==",
"null",
"... | Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s by filter.
<p>Sample code:
<pre><code>
try (JobServiceClient jobServiceClient = JobServiceClient.create()) {
TenantOrProjectName parent = TenantName.of("[PROJECT]", "[TENANT]");
String filter = "";
jobServiceClient.batchDeleteJobs(parent, filter);
}
</code></p... | [
"Deletes",
"a",
"list",
"of",
"[",
"Job",
"]",
"[",
"google",
".",
"cloud",
".",
"talent",
".",
"v4beta1",
".",
"Job",
"]",
"s",
"by",
"filter",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-talent/src/main/java/com/google/cloud/talent/v4beta1/JobServiceClient.java#L763-L771 |
citrusframework/citrus | modules/citrus-selenium/src/main/java/com/consol/citrus/selenium/endpoint/SeleniumBrowser.java | SeleniumBrowser.getStoredFile | public String getStoredFile(String filename) {
"""
Retrieve resource object
@param filename Resource to retrieve.
@return String with the path to the resource.
"""
try {
File stored = new File(temporaryStorage.toFile(), filename);
if (!stored.exists()) {
thr... | java | public String getStoredFile(String filename) {
try {
File stored = new File(temporaryStorage.toFile(), filename);
if (!stored.exists()) {
throw new CitrusRuntimeException("Failed to access stored file: " + stored.getCanonicalPath());
}
return sto... | [
"public",
"String",
"getStoredFile",
"(",
"String",
"filename",
")",
"{",
"try",
"{",
"File",
"stored",
"=",
"new",
"File",
"(",
"temporaryStorage",
".",
"toFile",
"(",
")",
",",
"filename",
")",
";",
"if",
"(",
"!",
"stored",
".",
"exists",
"(",
")",
... | Retrieve resource object
@param filename Resource to retrieve.
@return String with the path to the resource. | [
"Retrieve",
"resource",
"object"
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-selenium/src/main/java/com/consol/citrus/selenium/endpoint/SeleniumBrowser.java#L181-L193 |
lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/CommonOps_DSCC.java | CommonOps_DSCC.sumRows | public static DMatrixRMaj sumRows(DMatrixSparseCSC input , @Nullable DMatrixRMaj output ) {
"""
<p>
Computes the sum of each row in the input matrix and returns the results in a vector:<br>
<br>
b<sub>j</sub> = sum(i=1:n ; a<sub>ji</sub>)
</p>
@param input Input matrix
@param output Optional storage for ou... | java | public static DMatrixRMaj sumRows(DMatrixSparseCSC input , @Nullable DMatrixRMaj output ) {
if( output == null ) {
output = new DMatrixRMaj(input.numRows,1);
} else {
output.reshape(input.numRows,1);
}
Arrays.fill(output.data,0,input.numRows,0);
for (int... | [
"public",
"static",
"DMatrixRMaj",
"sumRows",
"(",
"DMatrixSparseCSC",
"input",
",",
"@",
"Nullable",
"DMatrixRMaj",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"{",
"output",
"=",
"new",
"DMatrixRMaj",
"(",
"input",
".",
"numRows",
",",
"1... | <p>
Computes the sum of each row in the input matrix and returns the results in a vector:<br>
<br>
b<sub>j</sub> = sum(i=1:n ; a<sub>ji</sub>)
</p>
@param input Input matrix
@param output Optional storage for output. Reshaped into a column vector. Modified.
@return Vector containing the sum of each row | [
"<p",
">",
"Computes",
"the",
"sum",
"of",
"each",
"row",
"in",
"the",
"input",
"matrix",
"and",
"returns",
"the",
"results",
"in",
"a",
"vector",
":",
"<br",
">",
"<br",
">",
"b<sub",
">",
"j<",
"/",
"sub",
">",
"=",
"sum",
"(",
"i",
"=",
"1",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/CommonOps_DSCC.java#L1393-L1412 |
op4j/op4j-jodatime | src/main/java/org/op4j/jodatime/functions/FnPeriod.java | FnPeriod.baseDateTimeFieldCollectionToPeriod | public static final Function<Collection<? extends BaseDateTime>, Period> baseDateTimeFieldCollectionToPeriod(final PeriodType periodType, final Chronology chronology) {
"""
<p>
It creates a {@link Period} with the specified {@link PeriodType} and {@link Chronology}. The input received by the {@link Function}
mus... | java | public static final Function<Collection<? extends BaseDateTime>, Period> baseDateTimeFieldCollectionToPeriod(final PeriodType periodType, final Chronology chronology) {
return new BaseDateTimeFieldCollectionToPeriod(periodType, chronology);
} | [
"public",
"static",
"final",
"Function",
"<",
"Collection",
"<",
"?",
"extends",
"BaseDateTime",
">",
",",
"Period",
">",
"baseDateTimeFieldCollectionToPeriod",
"(",
"final",
"PeriodType",
"periodType",
",",
"final",
"Chronology",
"chronology",
")",
"{",
"return",
... | <p>
It creates a {@link Period} with the specified {@link PeriodType} and {@link Chronology}. The input received by the {@link Function}
must have size 2 and represents the start and end instants of the {@link Period}
</p>
@param periodType the {@link PeriodType} to be created. It specifies which duration fields are t... | [
"<p",
">",
"It",
"creates",
"a",
"{",
"@link",
"Period",
"}",
"with",
"the",
"specified",
"{",
"@link",
"PeriodType",
"}",
"and",
"{",
"@link",
"Chronology",
"}",
".",
"The",
"input",
"received",
"by",
"the",
"{",
"@link",
"Function",
"}",
"must",
"hav... | train | https://github.com/op4j/op4j-jodatime/blob/26e5b8cda8553fb3b5a4a64b3109dbbf5df21194/src/main/java/org/op4j/jodatime/functions/FnPeriod.java#L614-L616 |
fcrepo3/fcrepo | fcrepo-common/src/main/java/org/fcrepo/utilities/xml/XercesXmlSerializers.java | XercesXmlSerializers.writeConsoleWithDocType | public static void writeConsoleWithDocType(Document ele, Writer out)
throws IOException {
"""
This method is used in object conversion.
None of the standard formats --
FOXML, METS, ATOM -- have DOCTYPE declarations,
so the inability of XSLT to propagate that
information is probably irrelevant. However, the... | java | public static void writeConsoleWithDocType(Document ele, Writer out)
throws IOException {
XMLSerializer serializer =
new XMLSerializer(out, CONSOLE_WITH_DOCTYPE);
serializer.serialize(ele);
} | [
"public",
"static",
"void",
"writeConsoleWithDocType",
"(",
"Document",
"ele",
",",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"XMLSerializer",
"serializer",
"=",
"new",
"XMLSerializer",
"(",
"out",
",",
"CONSOLE_WITH_DOCTYPE",
")",
";",
"serializer",
"."... | This method is used in object conversion.
None of the standard formats --
FOXML, METS, ATOM -- have DOCTYPE declarations,
so the inability of XSLT to propagate that
information is probably irrelevant. However, the
line wrapping issue remains.
method: "XML"
charset: "UTF-8"
indenting: TRUE
indent-width: 2
line-width: 8... | [
"This",
"method",
"is",
"used",
"in",
"object",
"conversion",
".",
"None",
"of",
"the",
"standard",
"formats",
"--",
"FOXML",
"METS",
"ATOM",
"--",
"have",
"DOCTYPE",
"declarations",
"so",
"the",
"inability",
"of",
"XSLT",
"to",
"propagate",
"that",
"informa... | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-common/src/main/java/org/fcrepo/utilities/xml/XercesXmlSerializers.java#L108-L113 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java | BugInstance.setProperty | @Nonnull
public BugInstance setProperty(String name, String value) {
"""
Set value of given property.
@param name
name of the property to set
@param value
the value of the property
@return this object, so calls can be chained
"""
BugProperty prop = lookupProperty(name);
if (prop != n... | java | @Nonnull
public BugInstance setProperty(String name, String value) {
BugProperty prop = lookupProperty(name);
if (prop != null) {
prop.setValue(value);
} else {
prop = new BugProperty(name, value);
addProperty(prop);
}
return this;
} | [
"@",
"Nonnull",
"public",
"BugInstance",
"setProperty",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"BugProperty",
"prop",
"=",
"lookupProperty",
"(",
"name",
")",
";",
"if",
"(",
"prop",
"!=",
"null",
")",
"{",
"prop",
".",
"setValue",
"(",... | Set value of given property.
@param name
name of the property to set
@param value
the value of the property
@return this object, so calls can be chained | [
"Set",
"value",
"of",
"given",
"property",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java#L711-L721 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/IntegerField.java | IntegerField.setValue | public int setValue(double value, boolean bDisplayOption, int moveMode) {
"""
/*
Set the Value of this field as a double.
@param value The value of this field.
@param iDisplayOption If true, display the new field.
@param iMoveMove The move mode.
@return An error code (NORMAL_RETURN for success).
""" ... | java | public int setValue(double value, boolean bDisplayOption, int moveMode)
{ // Set this field's value
Integer tempLong = new Integer((int)value);
int iErrorCode = this.setData(tempLong, bDisplayOption, moveMode);
return iErrorCode;
} | [
"public",
"int",
"setValue",
"(",
"double",
"value",
",",
"boolean",
"bDisplayOption",
",",
"int",
"moveMode",
")",
"{",
"// Set this field's value",
"Integer",
"tempLong",
"=",
"new",
"Integer",
"(",
"(",
"int",
")",
"value",
")",
";",
"int",
"iErrorCode",
... | /*
Set the Value of this field as a double.
@param value The value of this field.
@param iDisplayOption If true, display the new field.
@param iMoveMove The move mode.
@return An error code (NORMAL_RETURN for success). | [
"/",
"*",
"Set",
"the",
"Value",
"of",
"this",
"field",
"as",
"a",
"double",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/IntegerField.java#L191-L196 |
Harium/keel | src/main/java/com/harium/keel/catalano/core/ArraysUtil.java | ArraysUtil.Shuffle | public static void Shuffle(double[] array, long seed) {
"""
Shuffle an array.
@param array Array.
@param seed Random seed.
"""
Random random = new Random();
if (seed != 0) random.setSeed(seed);
for (int i = array.length - 1; i > 0; i--) {
int index = random.nextInt(i +... | java | public static void Shuffle(double[] array, long seed) {
Random random = new Random();
if (seed != 0) random.setSeed(seed);
for (int i = array.length - 1; i > 0; i--) {
int index = random.nextInt(i + 1);
double temp = array[index];
array[index] = array[i];
... | [
"public",
"static",
"void",
"Shuffle",
"(",
"double",
"[",
"]",
"array",
",",
"long",
"seed",
")",
"{",
"Random",
"random",
"=",
"new",
"Random",
"(",
")",
";",
"if",
"(",
"seed",
"!=",
"0",
")",
"random",
".",
"setSeed",
"(",
"seed",
")",
";",
"... | Shuffle an array.
@param array Array.
@param seed Random seed. | [
"Shuffle",
"an",
"array",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/core/ArraysUtil.java#L293-L303 |
phax/ph-commons | ph-security/src/main/java/com/helger/security/authentication/result/AuthIdentificationResult.java | AuthIdentificationResult.createSuccess | @Nonnull
public static AuthIdentificationResult createSuccess (@Nonnull final IAuthToken aAuthToken) {
"""
Factory method for success authentication.
@param aAuthToken
The auth token. May not be <code>null</code>.
@return Never <code>null</code>.
"""
ValueEnforcer.notNull (aAuthToken, "AuthToken");
... | java | @Nonnull
public static AuthIdentificationResult createSuccess (@Nonnull final IAuthToken aAuthToken)
{
ValueEnforcer.notNull (aAuthToken, "AuthToken");
return new AuthIdentificationResult (aAuthToken, null);
} | [
"@",
"Nonnull",
"public",
"static",
"AuthIdentificationResult",
"createSuccess",
"(",
"@",
"Nonnull",
"final",
"IAuthToken",
"aAuthToken",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aAuthToken",
",",
"\"AuthToken\"",
")",
";",
"return",
"new",
"AuthIdentificat... | Factory method for success authentication.
@param aAuthToken
The auth token. May not be <code>null</code>.
@return Never <code>null</code>. | [
"Factory",
"method",
"for",
"success",
"authentication",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-security/src/main/java/com/helger/security/authentication/result/AuthIdentificationResult.java#L106-L111 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/application/greedyensemble/VisualizePairwiseGainMatrix.java | VisualizePairwiseGainMatrix.showVisualization | private void showVisualization(VisualizerContext context, SimilarityMatrixVisualizer factory, VisualizationTask task) {
"""
Show a single visualization.
@param context Visualizer context
@param factory Visualizer factory
@param task Visualization task
"""
VisualizationPlot plot = new VisualizationPlot... | java | private void showVisualization(VisualizerContext context, SimilarityMatrixVisualizer factory, VisualizationTask task) {
VisualizationPlot plot = new VisualizationPlot();
Visualization vis = factory.makeVisualization(context, task, plot, 1.0, 1.0, null);
plot.getRoot().appendChild(vis.getLayer());
plot.g... | [
"private",
"void",
"showVisualization",
"(",
"VisualizerContext",
"context",
",",
"SimilarityMatrixVisualizer",
"factory",
",",
"VisualizationTask",
"task",
")",
"{",
"VisualizationPlot",
"plot",
"=",
"new",
"VisualizationPlot",
"(",
")",
";",
"Visualization",
"vis",
... | Show a single visualization.
@param context Visualizer context
@param factory Visualizer factory
@param task Visualization task | [
"Show",
"a",
"single",
"visualization",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/application/greedyensemble/VisualizePairwiseGainMatrix.java#L265-L275 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/requests/RestAction.java | RestAction.queueAfter | public ScheduledFuture<?> queueAfter(long delay, TimeUnit unit, Consumer<? super T> success) {
"""
Schedules a call to {@link #queue(java.util.function.Consumer)} to be executed after the specified {@code delay}.
<br>This is an <b>asynchronous</b> operation that will return a
{@link java.util.concurrent.Schedule... | java | public ScheduledFuture<?> queueAfter(long delay, TimeUnit unit, Consumer<? super T> success)
{
return queueAfter(delay, unit, success, api.get().getRateLimitPool());
} | [
"public",
"ScheduledFuture",
"<",
"?",
">",
"queueAfter",
"(",
"long",
"delay",
",",
"TimeUnit",
"unit",
",",
"Consumer",
"<",
"?",
"super",
"T",
">",
"success",
")",
"{",
"return",
"queueAfter",
"(",
"delay",
",",
"unit",
",",
"success",
",",
"api",
"... | Schedules a call to {@link #queue(java.util.function.Consumer)} to be executed after the specified {@code delay}.
<br>This is an <b>asynchronous</b> operation that will return a
{@link java.util.concurrent.ScheduledFuture ScheduledFuture} representing the task.
<p>This operation gives no access to the failure callback... | [
"Schedules",
"a",
"call",
"to",
"{",
"@link",
"#queue",
"(",
"java",
".",
"util",
".",
"function",
".",
"Consumer",
")",
"}",
"to",
"be",
"executed",
"after",
"the",
"specified",
"{",
"@code",
"delay",
"}",
".",
"<br",
">",
"This",
"is",
"an",
"<b",
... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/requests/RestAction.java#L598-L601 |
awin/rabbiteasy | rabbiteasy-core/src/main/java/com/zanox/rabbiteasy/MessageReader.java | MessageReader.readBodyAsString | public String readBodyAsString() {
"""
Extracts the message body and interprets it
as a string.
@return The message body as string
"""
Charset charset = readCharset();
byte[] bodyContent = message.getBodyContent();
return new String(bodyContent, charset);
} | java | public String readBodyAsString() {
Charset charset = readCharset();
byte[] bodyContent = message.getBodyContent();
return new String(bodyContent, charset);
} | [
"public",
"String",
"readBodyAsString",
"(",
")",
"{",
"Charset",
"charset",
"=",
"readCharset",
"(",
")",
";",
"byte",
"[",
"]",
"bodyContent",
"=",
"message",
".",
"getBodyContent",
"(",
")",
";",
"return",
"new",
"String",
"(",
"bodyContent",
",",
"char... | Extracts the message body and interprets it
as a string.
@return The message body as string | [
"Extracts",
"the",
"message",
"body",
"and",
"interprets",
"it",
"as",
"a",
"string",
"."
] | train | https://github.com/awin/rabbiteasy/blob/c161efda6c0f7ef319aedf09dfe40a4a90165510/rabbiteasy-core/src/main/java/com/zanox/rabbiteasy/MessageReader.java#L80-L84 |
gallandarakhneorg/afc | advanced/gis/gisroad/src/main/java/org/arakhne/afc/gis/road/StandardRoadConnection.java | StandardRoadConnection.addConnectedSegment | void addConnectedSegment(RoadPolyline segment, boolean attachToStartPoint) {
"""
Add a segment to this connection point.
<p>The segments are ordered according to there
geo-localization along a trigonometric cicle.
The first segment has the nearest angle to the
vector (1,0), and the following segments are
or... | java | void addConnectedSegment(RoadPolyline segment, boolean attachToStartPoint) {
if (segment == null) {
return;
}
if (this.connectedSegments.isEmpty()) {
this.connectedSegments.add(new Connection(segment, attachToStartPoint));
} else {
// Compute the angle to the unit vector for the new segment
final do... | [
"void",
"addConnectedSegment",
"(",
"RoadPolyline",
"segment",
",",
"boolean",
"attachToStartPoint",
")",
"{",
"if",
"(",
"segment",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"this",
".",
"connectedSegments",
".",
"isEmpty",
"(",
")",
")",
"{"... | Add a segment to this connection point.
<p>The segments are ordered according to there
geo-localization along a trigonometric cicle.
The first segment has the nearest angle to the
vector (1,0), and the following segments are
ordered according to the positive value of there
angles to this unity vector (counterclockwise... | [
"Add",
"a",
"segment",
"to",
"this",
"connection",
"point",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisroad/src/main/java/org/arakhne/afc/gis/road/StandardRoadConnection.java#L310-L326 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/code/Types.java | Types.functionalInterfaceBridges | public List<Symbol> functionalInterfaceBridges(TypeSymbol origin) {
"""
Find the minimal set of methods that are overridden by the functional
descriptor in 'origin'. All returned methods are assumed to have different
erased signatures.
"""
Assert.check(isFunctionalInterface(origin));
Symbol d... | java | public List<Symbol> functionalInterfaceBridges(TypeSymbol origin) {
Assert.check(isFunctionalInterface(origin));
Symbol descSym = findDescriptorSymbol(origin);
CompoundScope members = membersClosure(origin.type, false);
ListBuffer<Symbol> overridden = new ListBuffer<>();
outer: f... | [
"public",
"List",
"<",
"Symbol",
">",
"functionalInterfaceBridges",
"(",
"TypeSymbol",
"origin",
")",
"{",
"Assert",
".",
"check",
"(",
"isFunctionalInterface",
"(",
"origin",
")",
")",
";",
"Symbol",
"descSym",
"=",
"findDescriptorSymbol",
"(",
"origin",
")",
... | Find the minimal set of methods that are overridden by the functional
descriptor in 'origin'. All returned methods are assumed to have different
erased signatures. | [
"Find",
"the",
"minimal",
"set",
"of",
"methods",
"that",
"are",
"overridden",
"by",
"the",
"functional",
"descriptor",
"in",
"origin",
".",
"All",
"returned",
"methods",
"are",
"assumed",
"to",
"have",
"different",
"erased",
"signatures",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/code/Types.java#L658-L678 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTable.java | WTable.updateBeanValueForColumnInRow | private void updateBeanValueForColumnInRow(final WTableRowRenderer rowRenderer,
final UIContext rowContext,
final List<Integer> rowIndex, final int col, final TableModel model) {
"""
Update the column in the row.
@param rowRenderer the table row renderer
@param rowContext the row context
@param rowIndex... | java | private void updateBeanValueForColumnInRow(final WTableRowRenderer rowRenderer,
final UIContext rowContext,
final List<Integer> rowIndex, final int col, final TableModel model) {
// The actual component is wrapped in a renderer wrapper, so we have to fetch it from that
WComponent renderer = ((Container) rowRe... | [
"private",
"void",
"updateBeanValueForColumnInRow",
"(",
"final",
"WTableRowRenderer",
"rowRenderer",
",",
"final",
"UIContext",
"rowContext",
",",
"final",
"List",
"<",
"Integer",
">",
"rowIndex",
",",
"final",
"int",
"col",
",",
"final",
"TableModel",
"model",
"... | Update the column in the row.
@param rowRenderer the table row renderer
@param rowContext the row context
@param rowIndex the row id to update
@param col the column to update
@param model the table model | [
"Update",
"the",
"column",
"in",
"the",
"row",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTable.java#L440-L465 |
aws/aws-sdk-java | aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/InitiateAuthRequest.java | InitiateAuthRequest.withClientMetadata | public InitiateAuthRequest withClientMetadata(java.util.Map<String, String> clientMetadata) {
"""
<p>
This is a random key-value pair map which can contain any key and will be passed to your PreAuthentication Lambda
trigger as-is. It can be used to implement additional validations around authentication.
</p>
... | java | public InitiateAuthRequest withClientMetadata(java.util.Map<String, String> clientMetadata) {
setClientMetadata(clientMetadata);
return this;
} | [
"public",
"InitiateAuthRequest",
"withClientMetadata",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"clientMetadata",
")",
"{",
"setClientMetadata",
"(",
"clientMetadata",
")",
";",
"return",
"this",
";",
"}"
] | <p>
This is a random key-value pair map which can contain any key and will be passed to your PreAuthentication Lambda
trigger as-is. It can be used to implement additional validations around authentication.
</p>
@param clientMetadata
This is a random key-value pair map which can contain any key and will be passed to y... | [
"<p",
">",
"This",
"is",
"a",
"random",
"key",
"-",
"value",
"pair",
"map",
"which",
"can",
"contain",
"any",
"key",
"and",
"will",
"be",
"passed",
"to",
"your",
"PreAuthentication",
"Lambda",
"trigger",
"as",
"-",
"is",
".",
"It",
"can",
"be",
"used",... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidp/src/main/java/com/amazonaws/services/cognitoidp/model/InitiateAuthRequest.java#L946-L949 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierApplications.java | TypeQualifierApplications.getDirectTypeQualifierAnnotation | public static @CheckForNull @CheckReturnValue
TypeQualifierAnnotation getDirectTypeQualifierAnnotation(XMethod xmethod, int parameter, TypeQualifierValue<?> typeQualifierValue) {
"""
Get the TypeQualifierAnnotation directly applied to given method
parameter.
@param xmethod
a method
@param parameter
a pa... | java | public static @CheckForNull @CheckReturnValue
TypeQualifierAnnotation getDirectTypeQualifierAnnotation(XMethod xmethod, int parameter, TypeQualifierValue<?> typeQualifierValue) {
XMethod bridge = xmethod.bridgeTo();
if (bridge != null) {
xmethod = bridge;
}
Set<TypeQualif... | [
"public",
"static",
"@",
"CheckForNull",
"@",
"CheckReturnValue",
"TypeQualifierAnnotation",
"getDirectTypeQualifierAnnotation",
"(",
"XMethod",
"xmethod",
",",
"int",
"parameter",
",",
"TypeQualifierValue",
"<",
"?",
">",
"typeQualifierValue",
")",
"{",
"XMethod",
"bri... | Get the TypeQualifierAnnotation directly applied to given method
parameter.
@param xmethod
a method
@param parameter
a parameter (0 == first parameter)
@param typeQualifierValue
the kind of TypeQualifierValue we are looking for
@return TypeQualifierAnnotation directly applied to the parameter, or
null if there is no d... | [
"Get",
"the",
"TypeQualifierAnnotation",
"directly",
"applied",
"to",
"given",
"method",
"parameter",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierApplications.java#L924-L937 |
apereo/cas | support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/AbstractSamlProfileHandlerController.java | AbstractSamlProfileHandlerController.buildCasAssertion | protected Assertion buildCasAssertion(final Authentication authentication,
final Service service,
final RegisteredService registeredService,
final Map<String, List<Object>> attributesToCombine) ... | java | protected Assertion buildCasAssertion(final Authentication authentication,
final Service service,
final RegisteredService registeredService,
final Map<String, List<Object>> attributesToCombine) ... | [
"protected",
"Assertion",
"buildCasAssertion",
"(",
"final",
"Authentication",
"authentication",
",",
"final",
"Service",
"service",
",",
"final",
"RegisteredService",
"registeredService",
",",
"final",
"Map",
"<",
"String",
",",
"List",
"<",
"Object",
">",
">",
"... | Build cas assertion.
@param authentication the authentication
@param service the service
@param registeredService the registered service
@param attributesToCombine the attributes to combine
@return the assertion | [
"Build",
"cas",
"assertion",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/AbstractSamlProfileHandlerController.java#L159-L171 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WMenu.java | WMenu.isSelectable | private boolean isSelectable(final MenuItem item, final SelectionMode selectionMode) {
"""
Indicates whether the given menu item is selectable.
@param item the menu item to check.
@param selectionMode the select mode of the current menu/sub-menu
@return true if the meu item is selectable, false otherwise.
... | java | private boolean isSelectable(final MenuItem item, final SelectionMode selectionMode) {
if (!(item instanceof MenuItemSelectable) || !item.isVisible()
|| (item instanceof Disableable && ((Disableable) item).isDisabled())) {
return false;
}
// SubMenus are only selectable in a column menu type
if (item i... | [
"private",
"boolean",
"isSelectable",
"(",
"final",
"MenuItem",
"item",
",",
"final",
"SelectionMode",
"selectionMode",
")",
"{",
"if",
"(",
"!",
"(",
"item",
"instanceof",
"MenuItemSelectable",
")",
"||",
"!",
"item",
".",
"isVisible",
"(",
")",
"||",
"(",
... | Indicates whether the given menu item is selectable.
@param item the menu item to check.
@param selectionMode the select mode of the current menu/sub-menu
@return true if the meu item is selectable, false otherwise. | [
"Indicates",
"whether",
"the",
"given",
"menu",
"item",
"is",
"selectable",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WMenu.java#L568-L589 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/dependency/nnparser/parser_dll.java | parser_dll.parse | public int parse(List<String> words, List<String> postags, List<Integer> heads, List<String> deprels) {
"""
分析句法
@param words 词语列表
@param postags 词性列表
@param heads 输出依存指向列表
@param deprels 输出依存名称列表
@return 节点的个数
"""
Instance inst = new Instance();
inst.forms.add(SpecialOption.ROOT);
... | java | public int parse(List<String> words, List<String> postags, List<Integer> heads, List<String> deprels)
{
Instance inst = new Instance();
inst.forms.add(SpecialOption.ROOT);
inst.postags.add(SpecialOption.ROOT);
for (int i = 0; i < words.size(); i++)
{
inst.forms.a... | [
"public",
"int",
"parse",
"(",
"List",
"<",
"String",
">",
"words",
",",
"List",
"<",
"String",
">",
"postags",
",",
"List",
"<",
"Integer",
">",
"heads",
",",
"List",
"<",
"String",
">",
"deprels",
")",
"{",
"Instance",
"inst",
"=",
"new",
"Instance... | 分析句法
@param words 词语列表
@param postags 词性列表
@param heads 输出依存指向列表
@param deprels 输出依存名称列表
@return 节点的个数 | [
"分析句法"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/parser_dll.java#L61-L78 |
Azure/azure-sdk-for-java | storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountsInner.java | StorageAccountsInner.listServiceSAS | public ListServiceSasResponseInner listServiceSAS(String resourceGroupName, String accountName, ServiceSasParameters parameters) {
"""
List service SAS credentials of a specific resource.
@param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
@para... | java | public ListServiceSasResponseInner listServiceSAS(String resourceGroupName, String accountName, ServiceSasParameters parameters) {
return listServiceSASWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().body();
} | [
"public",
"ListServiceSasResponseInner",
"listServiceSAS",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"ServiceSasParameters",
"parameters",
")",
"{",
"return",
"listServiceSASWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
... | List service SAS credentials of a specific resource.
@param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
@param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in... | [
"List",
"service",
"SAS",
"credentials",
"of",
"a",
"specific",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/StorageAccountsInner.java#L1109-L1111 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLService.java | CQLService.executeQuery | private ResultSet executeQuery(Query query, String tableName, Object... values) {
"""
Execute the given query for the given table using the given values.
"""
m_logger.debug("Executing statement {} on table {}.{}; total params={}",
new Object[]{query, m_keyspace, tableName, values... | java | private ResultSet executeQuery(Query query, String tableName, Object... values) {
m_logger.debug("Executing statement {} on table {}.{}; total params={}",
new Object[]{query, m_keyspace, tableName, values.length});
try {
PreparedStatement prepState = getPreparedQuery(q... | [
"private",
"ResultSet",
"executeQuery",
"(",
"Query",
"query",
",",
"String",
"tableName",
",",
"Object",
"...",
"values",
")",
"{",
"m_logger",
".",
"debug",
"(",
"\"Executing statement {} on table {}.{}; total params={}\"",
",",
"new",
"Object",
"[",
"]",
"{",
"... | Execute the given query for the given table using the given values. | [
"Execute",
"the",
"given",
"query",
"for",
"the",
"given",
"table",
"using",
"the",
"given",
"values",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLService.java#L309-L322 |
jmxtrans/embedded-jmxtrans | src/main/java/org/jmxtrans/embedded/util/Preconditions.java | Preconditions.checkNotEmpty | public static String checkNotEmpty(String reference, @Nullable String message) throws IllegalArgumentException {
"""
Check the nullity and emptiness of the given <code>reference</code>.
@param reference reference to check
@param message exception message, can be <code>null</code>
@return the given <code>ref... | java | public static String checkNotEmpty(String reference, @Nullable String message) throws IllegalArgumentException {
if (reference == null || reference.isEmpty()) {
throw new IllegalArgumentException(message == null ? "Null or empty value" : message);
}
return reference;
} | [
"public",
"static",
"String",
"checkNotEmpty",
"(",
"String",
"reference",
",",
"@",
"Nullable",
"String",
"message",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"reference",
"==",
"null",
"||",
"reference",
".",
"isEmpty",
"(",
")",
")",
"{",
... | Check the nullity and emptiness of the given <code>reference</code>.
@param reference reference to check
@param message exception message, can be <code>null</code>
@return the given <code>reference</code>
@throws IllegalArgumentException if the given <code>reference</code> is <code>null</code> | [
"Check",
"the",
"nullity",
"and",
"emptiness",
"of",
"the",
"given",
"<code",
">",
"reference<",
"/",
"code",
">",
"."
] | train | https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/util/Preconditions.java#L82-L87 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/analyzer/RubyBundleAuditAnalyzer.java | RubyBundleAuditAnalyzer.addReferenceToVulnerability | private void addReferenceToVulnerability(String parentName, Vulnerability vulnerability, String nextLine) {
"""
Adds a reference to the vulnerability.
@param parentName the parent name
@param vulnerability the vulnerability
@param nextLine the line to parse
"""
final String url = nextLine.substrin... | java | private void addReferenceToVulnerability(String parentName, Vulnerability vulnerability, String nextLine) {
final String url = nextLine.substring("URL: ".length());
if (null != vulnerability) {
final Reference ref = new Reference();
ref.setName(vulnerability.getName());
... | [
"private",
"void",
"addReferenceToVulnerability",
"(",
"String",
"parentName",
",",
"Vulnerability",
"vulnerability",
",",
"String",
"nextLine",
")",
"{",
"final",
"String",
"url",
"=",
"nextLine",
".",
"substring",
"(",
"\"URL: \"",
".",
"length",
"(",
")",
")"... | Adds a reference to the vulnerability.
@param parentName the parent name
@param vulnerability the vulnerability
@param nextLine the line to parse | [
"Adds",
"a",
"reference",
"to",
"the",
"vulnerability",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/RubyBundleAuditAnalyzer.java#L398-L408 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java | ReflectUtil.invokeWithCheck | public static <T> T invokeWithCheck(Object obj, Method method, Object... args) throws UtilException {
"""
执行方法<br>
执行前要检查给定参数:
<pre>
1. 参数个数是否与方法参数个数一致
2. 如果某个参数为null但是方法这个位置的参数为原始类型,则赋予原始类型默认值
</pre>
@param <T> 返回对象类型
@param obj 对象,如果执行静态方法,此值为<code>null</code>
@param method 方法(对象方法或static方法都可)
@para... | java | public static <T> T invokeWithCheck(Object obj, Method method, Object... args) throws UtilException {
final Class<?>[] types = method.getParameterTypes();
if (null != types && null != args) {
Assert.isTrue(args.length == types.length, "Params length [{}] is not fit for param length [{}] of method !", args.len... | [
"public",
"static",
"<",
"T",
">",
"T",
"invokeWithCheck",
"(",
"Object",
"obj",
",",
"Method",
"method",
",",
"Object",
"...",
"args",
")",
"throws",
"UtilException",
"{",
"final",
"Class",
"<",
"?",
">",
"[",
"]",
"types",
"=",
"method",
".",
"getPar... | 执行方法<br>
执行前要检查给定参数:
<pre>
1. 参数个数是否与方法参数个数一致
2. 如果某个参数为null但是方法这个位置的参数为原始类型,则赋予原始类型默认值
</pre>
@param <T> 返回对象类型
@param obj 对象,如果执行静态方法,此值为<code>null</code>
@param method 方法(对象方法或static方法都可)
@param args 参数对象
@return 结果
@throws UtilException 一些列异常的包装 | [
"执行方法<br",
">",
"执行前要检查给定参数:"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReflectUtil.java#L755-L770 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.vps_serviceName_ip_GET | public ArrayList<String> vps_serviceName_ip_GET(String serviceName, OvhGeolocationEnum country, Long number) throws IOException {
"""
Get allowed durations for 'ip' option
REST: GET /order/vps/{serviceName}/ip
@param number [required] Number of IPs to order
@param country [required] Choose a geolocation for y... | java | public ArrayList<String> vps_serviceName_ip_GET(String serviceName, OvhGeolocationEnum country, Long number) throws IOException {
String qPath = "/order/vps/{serviceName}/ip";
StringBuilder sb = path(qPath, serviceName);
query(sb, "country", country);
query(sb, "number", number);
String resp = exec(qPath, "GE... | [
"public",
"ArrayList",
"<",
"String",
">",
"vps_serviceName_ip_GET",
"(",
"String",
"serviceName",
",",
"OvhGeolocationEnum",
"country",
",",
"Long",
"number",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/vps/{serviceName}/ip\"",
";",
"StringBu... | Get allowed durations for 'ip' option
REST: GET /order/vps/{serviceName}/ip
@param number [required] Number of IPs to order
@param country [required] Choose a geolocation for your IP Address
@param serviceName [required] The internal name of your VPS offer | [
"Get",
"allowed",
"durations",
"for",
"ip",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L3400-L3407 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/FaceAPIManager.java | FaceAPIManager.authenticate | public static FaceAPI authenticate(AzureRegions region, String subscriptionKey) {
"""
Initializes an instance of Face API client.
@param region Supported Azure regions for Cognitive Services endpoints.
@param subscriptionKey the Face API key
@return the Face API client
"""
return authenticate("htt... | java | public static FaceAPI authenticate(AzureRegions region, String subscriptionKey) {
return authenticate("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0/", subscriptionKey)
.withAzureRegion(region);
} | [
"public",
"static",
"FaceAPI",
"authenticate",
"(",
"AzureRegions",
"region",
",",
"String",
"subscriptionKey",
")",
"{",
"return",
"authenticate",
"(",
"\"https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0/\"",
",",
"subscriptionKey",
")",
".",
"withAzureRegion",
... | Initializes an instance of Face API client.
@param region Supported Azure regions for Cognitive Services endpoints.
@param subscriptionKey the Face API key
@return the Face API client | [
"Initializes",
"an",
"instance",
"of",
"Face",
"API",
"client",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/FaceAPIManager.java#L31-L34 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/DoubleStream.java | DoubleStream.takeUntil | @NotNull
public DoubleStream takeUntil(@NotNull final DoublePredicate stopPredicate) {
"""
Takes elements while the predicate returns {@code false}.
Once predicate condition is satisfied by an element, the stream
finishes with this element.
<p>This is an intermediate operation.
<p>Example:
<pre>
stop... | java | @NotNull
public DoubleStream takeUntil(@NotNull final DoublePredicate stopPredicate) {
return new DoubleStream(params, new DoubleTakeUntil(iterator, stopPredicate));
} | [
"@",
"NotNull",
"public",
"DoubleStream",
"takeUntil",
"(",
"@",
"NotNull",
"final",
"DoublePredicate",
"stopPredicate",
")",
"{",
"return",
"new",
"DoubleStream",
"(",
"params",
",",
"new",
"DoubleTakeUntil",
"(",
"iterator",
",",
"stopPredicate",
")",
")",
";"... | Takes elements while the predicate returns {@code false}.
Once predicate condition is satisfied by an element, the stream
finishes with this element.
<p>This is an intermediate operation.
<p>Example:
<pre>
stopPredicate: (a) -> a > 2
stream: [1, 2, 3, 4, 1, 2, 3, 4]
result: [1, 2, 3]
</pre>
@param stopPredicat... | [
"Takes",
"elements",
"while",
"the",
"predicate",
"returns",
"{",
"@code",
"false",
"}",
".",
"Once",
"predicate",
"condition",
"is",
"satisfied",
"by",
"an",
"element",
"the",
"stream",
"finishes",
"with",
"this",
"element",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/DoubleStream.java#L719-L722 |
kopihao/peasy-recyclerview | peasy-recyclerview/src/main/java/com/kopirealm/peasyrecyclerview/PeasyRecyclerView.java | PeasyRecyclerView.onItemLongClick | public boolean onItemLongClick(final View view, final int viewType, final int position, final T item, final PeasyViewHolder viewHolder) {
"""
Indicate content is clicked with long tap
@param view view
@param viewType viewType
@param position position
@param item item
@param viewHolder viewHo... | java | public boolean onItemLongClick(final View view, final int viewType, final int position, final T item, final PeasyViewHolder viewHolder) {
return true;
} | [
"public",
"boolean",
"onItemLongClick",
"(",
"final",
"View",
"view",
",",
"final",
"int",
"viewType",
",",
"final",
"int",
"position",
",",
"final",
"T",
"item",
",",
"final",
"PeasyViewHolder",
"viewHolder",
")",
"{",
"return",
"true",
";",
"}"
] | Indicate content is clicked with long tap
@param view view
@param viewType viewType
@param position position
@param item item
@param viewHolder viewHolder
@return true by default
@see View.OnLongClickListener#onLongClick(View) Enhanced Implementation | [
"Indicate",
"content",
"is",
"clicked",
"with",
"long",
"tap"
] | train | https://github.com/kopihao/peasy-recyclerview/blob/a26071849e5d5b5b1febe685f205558b49908f87/peasy-recyclerview/src/main/java/com/kopirealm/peasyrecyclerview/PeasyRecyclerView.java#L1076-L1078 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java | VirtualMachinesInner.beginCreateOrUpdateAsync | public Observable<VirtualMachineInner> beginCreateOrUpdateAsync(String resourceGroupName, String vmName, VirtualMachineInner parameters) {
"""
The operation to create or update a virtual machine.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@param par... | java | public Observable<VirtualMachineInner> beginCreateOrUpdateAsync(String resourceGroupName, String vmName, VirtualMachineInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, parameters).map(new Func1<ServiceResponse<VirtualMachineInner>, VirtualMachineInner>() {
... | [
"public",
"Observable",
"<",
"VirtualMachineInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmName",
",",
"VirtualMachineInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupNa... | The operation to create or update a virtual machine.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@param parameters Parameters supplied to the Create Virtual Machine operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return t... | [
"The",
"operation",
"to",
"create",
"or",
"update",
"a",
"virtual",
"machine",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java#L654-L661 |
SpoonLabs/gumtree-spoon-ast-diff | src/main/java/gumtree/spoon/builder/Json4SpoonGenerator.java | Json4SpoonGenerator.getJSONwithOperations | public JsonObject getJSONwithOperations(TreeContext context, ITree tree, List<Operation> operations) {
"""
Decorates a node with the affected operator, if any.
@param context
@param tree
@param operations
@return
"""
OperationNodePainter opNodePainter = new OperationNodePainter(operations);
Collecti... | java | public JsonObject getJSONwithOperations(TreeContext context, ITree tree, List<Operation> operations) {
OperationNodePainter opNodePainter = new OperationNodePainter(operations);
Collection<NodePainter> painters = new ArrayList<NodePainter>();
painters.add(opNodePainter);
return getJSONwithCustorLabels(context,... | [
"public",
"JsonObject",
"getJSONwithOperations",
"(",
"TreeContext",
"context",
",",
"ITree",
"tree",
",",
"List",
"<",
"Operation",
">",
"operations",
")",
"{",
"OperationNodePainter",
"opNodePainter",
"=",
"new",
"OperationNodePainter",
"(",
"operations",
")",
";"... | Decorates a node with the affected operator, if any.
@param context
@param tree
@param operations
@return | [
"Decorates",
"a",
"node",
"with",
"the",
"affected",
"operator",
"if",
"any",
"."
] | train | https://github.com/SpoonLabs/gumtree-spoon-ast-diff/blob/361364ddaad3e8f0921a068275d4d21b6e836e85/src/main/java/gumtree/spoon/builder/Json4SpoonGenerator.java#L76-L82 |
glyptodon/guacamole-client | guacamole-ext/src/main/java/org/apache/guacamole/token/TokenFilter.java | TokenFilter.setTokens | public void setTokens(Map<String, String> tokens) {
"""
Replaces all current token values with the contents of the given map,
where each map key represents a token name, and each map value
represents a token value.
@param tokens
A map containing the token names and corresponding values to
assign.
"""
... | java | public void setTokens(Map<String, String> tokens) {
tokenValues.clear();
tokenValues.putAll(tokens);
} | [
"public",
"void",
"setTokens",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"tokens",
")",
"{",
"tokenValues",
".",
"clear",
"(",
")",
";",
"tokenValues",
".",
"putAll",
"(",
"tokens",
")",
";",
"}"
] | Replaces all current token values with the contents of the given map,
where each map key represents a token name, and each map value
represents a token value.
@param tokens
A map containing the token names and corresponding values to
assign. | [
"Replaces",
"all",
"current",
"token",
"values",
"with",
"the",
"contents",
"of",
"the",
"given",
"map",
"where",
"each",
"map",
"key",
"represents",
"a",
"token",
"name",
"and",
"each",
"map",
"value",
"represents",
"a",
"token",
"value",
"."
] | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole-ext/src/main/java/org/apache/guacamole/token/TokenFilter.java#L155-L158 |
heroku/heroku.jar | heroku-api/src/main/java/com/heroku/api/HerokuAPI.java | HerokuAPI.createBuild | public Build createBuild(String appName, Build build) {
"""
Creates a build
@param appName See {@link #listApps} for a list of apps that can be used.
@param build the build information
"""
return connection.execute(new BuildCreate(appName, build), apiKey);
} | java | public Build createBuild(String appName, Build build) {
return connection.execute(new BuildCreate(appName, build), apiKey);
} | [
"public",
"Build",
"createBuild",
"(",
"String",
"appName",
",",
"Build",
"build",
")",
"{",
"return",
"connection",
".",
"execute",
"(",
"new",
"BuildCreate",
"(",
"appName",
",",
"build",
")",
",",
"apiKey",
")",
";",
"}"
] | Creates a build
@param appName See {@link #listApps} for a list of apps that can be used.
@param build the build information | [
"Creates",
"a",
"build"
] | train | https://github.com/heroku/heroku.jar/blob/d9e52991293159498c10c498c6f91fcdd637378e/heroku-api/src/main/java/com/heroku/api/HerokuAPI.java#L441-L443 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtend2/lib/StringConcatenation.java | StringConcatenation.appendSegments | protected void appendSegments(int index, List<String> otherSegments) {
"""
Add the list of segments to this sequence at the given index. The given indentation will be prepended to each
line except the first one if the object has a multi-line string representation.
@param index
the index in this instance's lis... | java | protected void appendSegments(int index, List<String> otherSegments) {
growSegments(otherSegments.size());
if (segments.addAll(index, otherSegments)) {
cachedToString = null;
}
} | [
"protected",
"void",
"appendSegments",
"(",
"int",
"index",
",",
"List",
"<",
"String",
">",
"otherSegments",
")",
"{",
"growSegments",
"(",
"otherSegments",
".",
"size",
"(",
")",
")",
";",
"if",
"(",
"segments",
".",
"addAll",
"(",
"index",
",",
"other... | Add the list of segments to this sequence at the given index. The given indentation will be prepended to each
line except the first one if the object has a multi-line string representation.
@param index
the index in this instance's list of segments.
@param otherSegments
the to-be-appended segments. May not be <code>nu... | [
"Add",
"the",
"list",
"of",
"segments",
"to",
"this",
"sequence",
"at",
"the",
"given",
"index",
".",
"The",
"given",
"indentation",
"will",
"be",
"prepended",
"to",
"each",
"line",
"except",
"the",
"first",
"one",
"if",
"the",
"object",
"has",
"a",
"mul... | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtend2/lib/StringConcatenation.java#L435-L440 |
UrielCh/ovh-java-sdk | ovh-java-sdk-service/src/main/java/net/minidev/ovh/api/ApiOvhService.java | ApiOvhService.serviceId_GET | public OvhService serviceId_GET(Long serviceId) throws IOException {
"""
Get this object properties
REST: GET /service/{serviceId}
@param serviceId [required] The internal ID of your service
API beta
"""
String qPath = "/service/{serviceId}";
StringBuilder sb = path(qPath, serviceId);
String resp ... | java | public OvhService serviceId_GET(Long serviceId) throws IOException {
String qPath = "/service/{serviceId}";
StringBuilder sb = path(qPath, serviceId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhService.class);
} | [
"public",
"OvhService",
"serviceId_GET",
"(",
"Long",
"serviceId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/service/{serviceId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"serviceId",
")",
";",
"String",
"resp",
"=",
... | Get this object properties
REST: GET /service/{serviceId}
@param serviceId [required] The internal ID of your service
API beta | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-service/src/main/java/net/minidev/ovh/api/ApiOvhService.java#L60-L65 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/ResourceBundleMessagesGenerator.java | ResourceBundleMessagesGenerator.addLinkedResources | protected void addLinkedResources(String path, GeneratorContext context) {
"""
Adds the linked resources
@param path
the resource path
@param context
the generator context
"""
List<Locale> locales = new ArrayList<>();
Locale currentLocale = context.getLocale();
if (currentLocale != null) {
local... | java | protected void addLinkedResources(String path, GeneratorContext context) {
List<Locale> locales = new ArrayList<>();
Locale currentLocale = context.getLocale();
if (currentLocale != null) {
locales.add(currentLocale);
if (StringUtils.isNotEmpty(currentLocale.getVariant())) {
locales.add(new Locale(curre... | [
"protected",
"void",
"addLinkedResources",
"(",
"String",
"path",
",",
"GeneratorContext",
"context",
")",
"{",
"List",
"<",
"Locale",
">",
"locales",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Locale",
"currentLocale",
"=",
"context",
".",
"getLocale",
... | Adds the linked resources
@param path
the resource path
@param context
the generator context | [
"Adds",
"the",
"linked",
"resources"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/locale/ResourceBundleMessagesGenerator.java#L172-L195 |
imsweb/naaccr-xml | src/main/java/com/imsweb/naaccrxml/runtime/NaaccrStreamConfiguration.java | NaaccrStreamConfiguration.registerImplicitCollection | public void registerImplicitCollection(Class<?> clazz, String fieldName, Class<?> fieldClass) {
"""
Register an implicit collection (a collection that shouldn't appear as a tag in the XML).
@param clazz class containing the field (the collection in this case), required
@param fieldName field name, required
@par... | java | public void registerImplicitCollection(Class<?> clazz, String fieldName, Class<?> fieldClass) {
_xstream.addImplicitCollection(clazz, fieldName, fieldClass);
} | [
"public",
"void",
"registerImplicitCollection",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"fieldName",
",",
"Class",
"<",
"?",
">",
"fieldClass",
")",
"{",
"_xstream",
".",
"addImplicitCollection",
"(",
"clazz",
",",
"fieldName",
",",
"fieldClass",
... | Register an implicit collection (a collection that shouldn't appear as a tag in the XML).
@param clazz class containing the field (the collection in this case), required
@param fieldName field name, required
@param fieldClass field type, required | [
"Register",
"an",
"implicit",
"collection",
"(",
"a",
"collection",
"that",
"shouldn",
"t",
"appear",
"as",
"a",
"tag",
"in",
"the",
"XML",
")",
"."
] | train | https://github.com/imsweb/naaccr-xml/blob/a3a501faa2a0c3411dd5248b2c1379f279131696/src/main/java/com/imsweb/naaccrxml/runtime/NaaccrStreamConfiguration.java#L301-L303 |
terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/naming/PhysicalNamingStrategyShogunCore.java | PhysicalNamingStrategyShogunCore.toPhysicalColumnName | @Override
public Identifier toPhysicalColumnName(Identifier columnIdentifier, JdbcEnvironment context) {
"""
Converts column names to lower case and limits the length if necessary.
"""
return convertToLimitedLowerCase(context, columnIdentifier, null);
} | java | @Override
public Identifier toPhysicalColumnName(Identifier columnIdentifier, JdbcEnvironment context) {
return convertToLimitedLowerCase(context, columnIdentifier, null);
} | [
"@",
"Override",
"public",
"Identifier",
"toPhysicalColumnName",
"(",
"Identifier",
"columnIdentifier",
",",
"JdbcEnvironment",
"context",
")",
"{",
"return",
"convertToLimitedLowerCase",
"(",
"context",
",",
"columnIdentifier",
",",
"null",
")",
";",
"}"
] | Converts column names to lower case and limits the length if necessary. | [
"Converts",
"column",
"names",
"to",
"lower",
"case",
"and",
"limits",
"the",
"length",
"if",
"necessary",
"."
] | train | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/naming/PhysicalNamingStrategyShogunCore.java#L56-L59 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmTypesBuilder.java | JvmTypesBuilder.setFileHeader | public void setFileHeader(/* @Nullable */ JvmDeclaredType jvmDeclaredType, /* @Nullable */ String headerText) {
"""
Attaches the given headText to the given {@link JvmDeclaredType}.
"""
if (jvmDeclaredType == null || headerText == null) {
return;
}
FileHeaderAdapter fileHeaderAdapter = (FileHeaderAdap... | java | public void setFileHeader(/* @Nullable */ JvmDeclaredType jvmDeclaredType, /* @Nullable */ String headerText) {
if (jvmDeclaredType == null || headerText == null) {
return;
}
FileHeaderAdapter fileHeaderAdapter = (FileHeaderAdapter) EcoreUtil.getAdapter(jvmDeclaredType.eAdapters(),
FileHeaderAdapter.class)... | [
"public",
"void",
"setFileHeader",
"(",
"/* @Nullable */",
"JvmDeclaredType",
"jvmDeclaredType",
",",
"/* @Nullable */",
"String",
"headerText",
")",
"{",
"if",
"(",
"jvmDeclaredType",
"==",
"null",
"||",
"headerText",
"==",
"null",
")",
"{",
"return",
";",
"}",
... | Attaches the given headText to the given {@link JvmDeclaredType}. | [
"Attaches",
"the",
"given",
"headText",
"to",
"the",
"given",
"{"
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/jvmmodel/JvmTypesBuilder.java#L305-L316 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/optionalusertools/PickerUtilities.java | PickerUtilities.isSameLocalDate | static public boolean isSameLocalDate(LocalDate first, LocalDate second) {
"""
isSameLocalDate, This compares two date variables to see if their values are equal. Returns
true if the values are equal, otherwise returns false.
More specifically: This returns true if both values are null (an empty date). Or, thi... | java | static public boolean isSameLocalDate(LocalDate first, LocalDate second) {
// If both values are null, return true.
if (first == null && second == null) {
return true;
}
// At least one value contains a date. If the other value is null, then return false.
if (first ==... | [
"static",
"public",
"boolean",
"isSameLocalDate",
"(",
"LocalDate",
"first",
",",
"LocalDate",
"second",
")",
"{",
"// If both values are null, return true.",
"if",
"(",
"first",
"==",
"null",
"&&",
"second",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
... | isSameLocalDate, This compares two date variables to see if their values are equal. Returns
true if the values are equal, otherwise returns false.
More specifically: This returns true if both values are null (an empty date). Or, this
returns true if both of the supplied dates contain a date and represent the same date... | [
"isSameLocalDate",
"This",
"compares",
"two",
"date",
"variables",
"to",
"see",
"if",
"their",
"values",
"are",
"equal",
".",
"Returns",
"true",
"if",
"the",
"values",
"are",
"equal",
"otherwise",
"returns",
"false",
"."
] | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/optionalusertools/PickerUtilities.java#L78-L89 |
ZuInnoTe/hadoopcryptoledger | hiveudf/src/main/java/org/zuinnote/hadoop/bitcoin/hive/udf/BitcoinTransactionHashUDF.java | BitcoinTransactionHashUDF.readListOfInputsFromTable | private List<BitcoinTransactionInput> readListOfInputsFromTable(ListObjectInspector loi, Object listOfInputsObject) {
"""
Read list of Bitcoin transaction inputs from a table in Hive in any format (e.g. ORC, Parquet)
@param loi ObjectInspector for processing the Object containing a list
@param listOfInputsObje... | java | private List<BitcoinTransactionInput> readListOfInputsFromTable(ListObjectInspector loi, Object listOfInputsObject) {
int listLength=loi.getListLength(listOfInputsObject);
List<BitcoinTransactionInput> result = new ArrayList<>(listLength);
StructObjectInspector listOfInputsElementObjectInspector = (StructObjectInspecto... | [
"private",
"List",
"<",
"BitcoinTransactionInput",
">",
"readListOfInputsFromTable",
"(",
"ListObjectInspector",
"loi",
",",
"Object",
"listOfInputsObject",
")",
"{",
"int",
"listLength",
"=",
"loi",
".",
"getListLength",
"(",
"listOfInputsObject",
")",
";",
"List",
... | Read list of Bitcoin transaction inputs from a table in Hive in any format (e.g. ORC, Parquet)
@param loi ObjectInspector for processing the Object containing a list
@param listOfInputsObject object containing the list of inputs to a Bitcoin Transaction
@return a list of BitcoinTransactionInputs | [
"Read",
"list",
"of",
"Bitcoin",
"transaction",
"inputs",
"from",
"a",
"table",
"in",
"Hive",
"in",
"any",
"format",
"(",
"e",
".",
"g",
".",
"ORC",
"Parquet",
")"
] | train | https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/hiveudf/src/main/java/org/zuinnote/hadoop/bitcoin/hive/udf/BitcoinTransactionHashUDF.java#L185-L212 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.writeString | public static File writeString(String content, File file, String charset) throws IORuntimeException {
"""
将String写入文件,覆盖模式
@param content 写入的内容
@param file 文件
@param charset 字符集
@return 被写入的文件
@throws IORuntimeException IO异常
"""
return FileWriter.create(file, CharsetUtil.charset(charset)).write(con... | java | public static File writeString(String content, File file, String charset) throws IORuntimeException {
return FileWriter.create(file, CharsetUtil.charset(charset)).write(content);
} | [
"public",
"static",
"File",
"writeString",
"(",
"String",
"content",
",",
"File",
"file",
",",
"String",
"charset",
")",
"throws",
"IORuntimeException",
"{",
"return",
"FileWriter",
".",
"create",
"(",
"file",
",",
"CharsetUtil",
".",
"charset",
"(",
"charset"... | 将String写入文件,覆盖模式
@param content 写入的内容
@param file 文件
@param charset 字符集
@return 被写入的文件
@throws IORuntimeException IO异常 | [
"将String写入文件,覆盖模式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L2747-L2749 |
powermock/powermock | powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java | PowerMock.createPartialMockForAllMethodsExcept | public static synchronized <T> T createPartialMockForAllMethodsExcept(Class<T> type, String methodNameToExclude,
Class<?> firstArgumentType, Class<?>... moreTypes) {
"""
Mock all methods of a class except for a specific one. Use this method
... | java | public static synchronized <T> T createPartialMockForAllMethodsExcept(Class<T> type, String methodNameToExclude,
Class<?> firstArgumentType, Class<?>... moreTypes) {
/*
* The reason why we've split the first and "additional typ... | [
"public",
"static",
"synchronized",
"<",
"T",
">",
"T",
"createPartialMockForAllMethodsExcept",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"methodNameToExclude",
",",
"Class",
"<",
"?",
">",
"firstArgumentType",
",",
"Class",
"<",
"?",
">",
"...",
"... | Mock all methods of a class except for a specific one. Use this method
only if you have several overloaded methods.
@param <T> The type of the mock.
@param type The type that'll be used to create a mock instance.
@param methodNameToExclude The name of the method not to mock.
@param first... | [
"Mock",
"all",
"methods",
"of",
"a",
"class",
"except",
"for",
"a",
"specific",
"one",
".",
"Use",
"this",
"method",
"only",
"if",
"you",
"have",
"several",
"overloaded",
"methods",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/PowerMock.java#L396-L406 |
infinispan/infinispan | server/core/src/main/java/org/infinispan/server/core/security/simple/SimpleServerAuthenticationProvider.java | SimpleServerAuthenticationProvider.addUser | public void addUser(String userName, String userRealm, char[] password, String... groups) {
"""
Add a user to the authentication table.
@param userName
the user name
@param userRealm
the user realm
@param password
the password
@param groups
the groups the user belongs to
"""
if (userName == nul... | java | public void addUser(String userName, String userRealm, char[] password, String... groups) {
if (userName == null) {
throw new IllegalArgumentException("userName is null");
}
if (userRealm == null) {
throw new IllegalArgumentException("userRealm is null");
}
if (password =... | [
"public",
"void",
"addUser",
"(",
"String",
"userName",
",",
"String",
"userRealm",
",",
"char",
"[",
"]",
"password",
",",
"String",
"...",
"groups",
")",
"{",
"if",
"(",
"userName",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",... | Add a user to the authentication table.
@param userName
the user name
@param userRealm
the user realm
@param password
the password
@param groups
the groups the user belongs to | [
"Add",
"a",
"user",
"to",
"the",
"authentication",
"table",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/server/core/src/main/java/org/infinispan/server/core/security/simple/SimpleServerAuthenticationProvider.java#L126-L146 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageBandMath.java | ImageBandMath.stdDev | public static void stdDev(Planar<GrayU16> input, GrayU16 output, @Nullable GrayU16 avg) {
"""
Computes the standard deviation for each pixel across all bands in the {@link Planar}
image.
@param input Planar image - not modified
@param output Gray scale image containing average pixel values - modified
@p... | java | public static void stdDev(Planar<GrayU16> input, GrayU16 output, @Nullable GrayU16 avg) {
stdDev(input,output,avg,0,input.getNumBands() - 1);
} | [
"public",
"static",
"void",
"stdDev",
"(",
"Planar",
"<",
"GrayU16",
">",
"input",
",",
"GrayU16",
"output",
",",
"@",
"Nullable",
"GrayU16",
"avg",
")",
"{",
"stdDev",
"(",
"input",
",",
"output",
",",
"avg",
",",
"0",
",",
"input",
".",
"getNumBands"... | Computes the standard deviation for each pixel across all bands in the {@link Planar}
image.
@param input Planar image - not modified
@param output Gray scale image containing average pixel values - modified
@param avg Input Gray scale image containing average image. Can be null | [
"Computes",
"the",
"standard",
"deviation",
"for",
"each",
"pixel",
"across",
"all",
"bands",
"in",
"the",
"{"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageBandMath.java#L527-L529 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/MapIterate.java | MapIterate.getIfAbsent | public static <K, V> V getIfAbsent(Map<K, V> map, K key, Function0<? extends V> instanceBlock) {
"""
Get and return the value in the Map that corresponds to the specified key, or if there is no value
at the key, return the result of evaluating the specified {@link Function0}.
"""
if (map instanceof Un... | java | public static <K, V> V getIfAbsent(Map<K, V> map, K key, Function0<? extends V> instanceBlock)
{
if (map instanceof UnsortedMapIterable)
{
return ((MapIterable<K, V>) map).getIfAbsent(key, instanceBlock);
}
V result = map.get(key);
if (MapIterate.isAbsent(result, ... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"V",
"getIfAbsent",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"K",
"key",
",",
"Function0",
"<",
"?",
"extends",
"V",
">",
"instanceBlock",
")",
"{",
"if",
"(",
"map",
"instanceof",
"UnsortedMapIt... | Get and return the value in the Map that corresponds to the specified key, or if there is no value
at the key, return the result of evaluating the specified {@link Function0}. | [
"Get",
"and",
"return",
"the",
"value",
"in",
"the",
"Map",
"that",
"corresponds",
"to",
"the",
"specified",
"key",
"or",
"if",
"there",
"is",
"no",
"value",
"at",
"the",
"key",
"return",
"the",
"result",
"of",
"evaluating",
"the",
"specified",
"{"
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/MapIterate.java#L176-L188 |
qmx/jitescript | src/main/java/me/qmx/jitescript/JiteClass.java | JiteClass.defineField | public FieldDefinition defineField(String fieldName, int modifiers, String signature, Object value) {
"""
Defines a new field on the target class
@param fieldName the field name
@param modifiers the modifier bitmask, made by OR'ing constants from ASM's {@link Opcodes} interface
@param signature the field si... | java | public FieldDefinition defineField(String fieldName, int modifiers, String signature, Object value) {
FieldDefinition field = new FieldDefinition(fieldName, modifiers, signature, value);
this.fields.add(field);
return field;
} | [
"public",
"FieldDefinition",
"defineField",
"(",
"String",
"fieldName",
",",
"int",
"modifiers",
",",
"String",
"signature",
",",
"Object",
"value",
")",
"{",
"FieldDefinition",
"field",
"=",
"new",
"FieldDefinition",
"(",
"fieldName",
",",
"modifiers",
",",
"si... | Defines a new field on the target class
@param fieldName the field name
@param modifiers the modifier bitmask, made by OR'ing constants from ASM's {@link Opcodes} interface
@param signature the field signature, on standard JVM notation
@param value the default value (null for JVM default)
@return the new field defin... | [
"Defines",
"a",
"new",
"field",
"on",
"the",
"target",
"class"
] | train | https://github.com/qmx/jitescript/blob/bda6d02f37a8083248d9a0c80ea76bb5a63151ae/src/main/java/me/qmx/jitescript/JiteClass.java#L155-L159 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/lss/LssClient.java | LssClient.listDomainApp | public ListDomainAppResponse listDomainApp(ListDomainAppRequest request) {
"""
List a domain's app in the live stream service.
@param request The request object containing all options for listing domain's app
@return the response
"""
checkNotNull(request, "The parameter request should NOT be null."... | java | public ListDomainAppResponse listDomainApp(ListDomainAppRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getPlayDomain(), "playDomain should NOT be empty.");
InternalRequest internalRequest = createRequest(HttpMethodName.GET,
... | [
"public",
"ListDomainAppResponse",
"listDomainApp",
"(",
"ListDomainAppRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getPlayDomain",
"(",
")",
","... | List a domain's app in the live stream service.
@param request The request object containing all options for listing domain's app
@return the response | [
"List",
"a",
"domain",
"s",
"app",
"in",
"the",
"live",
"stream",
"service",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L1435-L1443 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.beginReset | public VirtualNetworkGatewayInner beginReset(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) {
"""
Resets the primary of the virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name... | java | public VirtualNetworkGatewayInner beginReset(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip) {
return beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, gatewayVip).toBlocking().single().body();
} | [
"public",
"VirtualNetworkGatewayInner",
"beginReset",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
",",
"String",
"gatewayVip",
")",
"{",
"return",
"beginResetWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"virtualNetworkGatewayName... | Resets the primary of the virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@param gatewayVip Virtual network gateway vip address supplied to the begin reset of the active-active fe... | [
"Resets",
"the",
"primary",
"of",
"the",
"virtual",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L1376-L1378 |
podio/podio-java | src/main/java/com/podio/hook/HookAPI.java | HookAPI.validateVerification | public void validateVerification(int id, String code) {
"""
Validates the hook using the code received from the verify call. On
successful validation the hook will become active.
@param id
The id of the hook to be verified
@param code
The code received from the call to the endpoint
"""
getResourceFact... | java | public void validateVerification(int id, String code) {
getResourceFactory().getApiResource("/hook/" + id + "/verify/validate")
.entity(new HookValidate(code), MediaType.APPLICATION_JSON)
.post();
} | [
"public",
"void",
"validateVerification",
"(",
"int",
"id",
",",
"String",
"code",
")",
"{",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/hook/\"",
"+",
"id",
"+",
"\"/verify/validate\"",
")",
".",
"entity",
"(",
"new",
"HookValidate",
"(",
... | Validates the hook using the code received from the verify call. On
successful validation the hook will become active.
@param id
The id of the hook to be verified
@param code
The code received from the call to the endpoint | [
"Validates",
"the",
"hook",
"using",
"the",
"code",
"received",
"from",
"the",
"verify",
"call",
".",
"On",
"successful",
"validation",
"the",
"hook",
"will",
"become",
"active",
"."
] | train | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/hook/HookAPI.java#L85-L89 |
brianwhu/xillium | data/src/main/java/org/xillium/data/DataBinder.java | DataBinder.putNamedObject | @SuppressWarnings("unchecked")
public <T, V> T putNamedObject(String name, V object) {
"""
Puts a named object into this binder returning the original object under the name, if any.
"""
return (T)_named.put(name, object);
} | java | @SuppressWarnings("unchecked")
public <T, V> T putNamedObject(String name, V object) {
return (T)_named.put(name, object);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
",",
"V",
">",
"T",
"putNamedObject",
"(",
"String",
"name",
",",
"V",
"object",
")",
"{",
"return",
"(",
"T",
")",
"_named",
".",
"put",
"(",
"name",
",",
"object",
")",
";",
... | Puts a named object into this binder returning the original object under the name, if any. | [
"Puts",
"a",
"named",
"object",
"into",
"this",
"binder",
"returning",
"the",
"original",
"object",
"under",
"the",
"name",
"if",
"any",
"."
] | train | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/DataBinder.java#L104-L107 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/privatejgoodies/forms/layout/FormLayout.java | FormLayout.setRowSpec | public void setRowSpec(int rowIndex, RowSpec rowSpec) {
"""
Sets the RowSpec at the specified row index.
@param rowIndex the index of the row to be changed
@param rowSpec the RowSpec to be set
@throws NullPointerException if {@code rowSpec} is {@code null}
@throws IndexOutOfBoundsException if the row index i... | java | public void setRowSpec(int rowIndex, RowSpec rowSpec) {
checkNotNull(rowSpec, "The row spec must not be null.");
rowSpecs.set(rowIndex - 1, rowSpec);
} | [
"public",
"void",
"setRowSpec",
"(",
"int",
"rowIndex",
",",
"RowSpec",
"rowSpec",
")",
"{",
"checkNotNull",
"(",
"rowSpec",
",",
"\"The row spec must not be null.\"",
")",
";",
"rowSpecs",
".",
"set",
"(",
"rowIndex",
"-",
"1",
",",
"rowSpec",
")",
";",
"}"... | Sets the RowSpec at the specified row index.
@param rowIndex the index of the row to be changed
@param rowSpec the RowSpec to be set
@throws NullPointerException if {@code rowSpec} is {@code null}
@throws IndexOutOfBoundsException if the row index is out of range | [
"Sets",
"the",
"RowSpec",
"at",
"the",
"specified",
"row",
"index",
"."
] | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/privatejgoodies/forms/layout/FormLayout.java#L566-L569 |
js-lib-com/commons | src/main/java/js/util/Classes.java | Classes.getResourceAsStream | private static InputStream getResourceAsStream(String name, ClassLoader[] classLoaders) {
"""
Get named resource input stream from a list of class loaders. Traverses class loaders in given order searching for
requested resource. Return first resource found or null if none found.
@param name resource name with ... | java | private static InputStream getResourceAsStream(String name, ClassLoader[] classLoaders)
{
// Java standard class loader require resource name to be an absolute path without leading path separator
// at this point <name> argument is guaranteed to not start with leading path separator
for(ClassLoader ... | [
"private",
"static",
"InputStream",
"getResourceAsStream",
"(",
"String",
"name",
",",
"ClassLoader",
"[",
"]",
"classLoaders",
")",
"{",
"// Java standard class loader require resource name to be an absolute path without leading path separator\r",
"// at this point <name> argument is ... | Get named resource input stream from a list of class loaders. Traverses class loaders in given order searching for
requested resource. Return first resource found or null if none found.
@param name resource name with syntax as required by Java ClassLoader,
@param classLoaders target class loaders.
@return found resour... | [
"Get",
"named",
"resource",
"input",
"stream",
"from",
"a",
"list",
"of",
"class",
"loaders",
".",
"Traverses",
"class",
"loaders",
"in",
"given",
"order",
"searching",
"for",
"requested",
"resource",
".",
"Return",
"first",
"resource",
"found",
"or",
"null",
... | train | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Classes.java#L1061-L1078 |
jOOQ/jOOX | jOOX-java-6/src/main/java/org/joox/Util.java | Util.createContent | static final DocumentFragment createContent(Document doc, String text) {
"""
Create some content in the context of a given document
@return <ul>
<li>A {@link DocumentFragment} if <code>text</code> is
well-formed.</li>
<li><code>null</code>, if <code>text</code> is plain text or not
well formed</li>
</ul>
... | java | static final DocumentFragment createContent(Document doc, String text) {
// [#150] Text might hold XML content, which can be leniently identified by the presence
// of either < or & characters (other entities, like >, ", ' are not stricly XML content)
if (text != null && (text.contains("... | [
"static",
"final",
"DocumentFragment",
"createContent",
"(",
"Document",
"doc",
",",
"String",
"text",
")",
"{",
"// [#150] Text might hold XML content, which can be leniently identified by the presence",
"// of either < or & characters (other entities, like >, \", ' are not stricly... | Create some content in the context of a given document
@return <ul>
<li>A {@link DocumentFragment} if <code>text</code> is
well-formed.</li>
<li><code>null</code>, if <code>text</code> is plain text or not
well formed</li>
</ul> | [
"Create",
"some",
"content",
"in",
"the",
"context",
"of",
"a",
"given",
"document"
] | train | https://github.com/jOOQ/jOOX/blob/3793b96f0cee126f64074da4d7fad63f91d2440e/jOOX-java-6/src/main/java/org/joox/Util.java#L99-L148 |
xebia-france/xebia-servlet-extras | src/main/java/fr/xebia/servlet/filter/ExpiresFilter.java | ExpiresFilter.startsWithIgnoreCase | protected static boolean startsWithIgnoreCase(String string, String prefix) {
"""
Return <code>true</code> if the given <code>string</code> starts with the
given <code>prefix</code> ignoring case.
@param string
can be <code>null</code>
@param prefix
can be <code>null</code>
"""
if (string == nul... | java | protected static boolean startsWithIgnoreCase(String string, String prefix) {
if (string == null || prefix == null) {
return string == null && prefix == null;
}
if (prefix.length() > string.length()) {
return false;
}
return string.regionMatches(true, 0, ... | [
"protected",
"static",
"boolean",
"startsWithIgnoreCase",
"(",
"String",
"string",
",",
"String",
"prefix",
")",
"{",
"if",
"(",
"string",
"==",
"null",
"||",
"prefix",
"==",
"null",
")",
"{",
"return",
"string",
"==",
"null",
"&&",
"prefix",
"==",
"null",... | Return <code>true</code> if the given <code>string</code> starts with the
given <code>prefix</code> ignoring case.
@param string
can be <code>null</code>
@param prefix
can be <code>null</code> | [
"Return",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"given",
"<code",
">",
"string<",
"/",
"code",
">",
"starts",
"with",
"the",
"given",
"<code",
">",
"prefix<",
"/",
"code",
">",
"ignoring",
"case",
"."
] | train | https://github.com/xebia-france/xebia-servlet-extras/blob/b263636fc78f8794dde57d92b835edb5e95ce379/src/main/java/fr/xebia/servlet/filter/ExpiresFilter.java#L1170-L1179 |
xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/LocalUnitsManager.java | LocalUnitsManager.replaceUnit | public static void replaceUnit(/*String group, String unitName, */ Unit newUnit) {
"""
Dynamically change the unit collections. Currently we use this for aop.
"""
String group = newUnit.getGroup().getName(), unitName = newUnit.getName();
readWriteLock.writeLock().lock();
try {
... | java | public static void replaceUnit(/*String group, String unitName, */ Unit newUnit) {
String group = newUnit.getGroup().getName(), unitName = newUnit.getName();
readWriteLock.writeLock().lock();
try {
//unitMap
List<Unit> unitList = unitMap.get(group);
unitList.r... | [
"public",
"static",
"void",
"replaceUnit",
"(",
"/*String group, String unitName, */",
"Unit",
"newUnit",
")",
"{",
"String",
"group",
"=",
"newUnit",
".",
"getGroup",
"(",
")",
".",
"getName",
"(",
")",
",",
"unitName",
"=",
"newUnit",
".",
"getName",
"(",
... | Dynamically change the unit collections. Currently we use this for aop. | [
"Dynamically",
"change",
"the",
"unit",
"collections",
".",
"Currently",
"we",
"use",
"this",
"for",
"aop",
"."
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/LocalUnitsManager.java#L129-L154 |
roboconf/roboconf-platform | miscellaneous/roboconf-dm-rest-client/src/main/java/net/roboconf/dm/rest/client/delegates/ApplicationWsDelegate.java | ApplicationWsDelegate.setDescription | public void setDescription( String applicationName, String newDesc )
throws ApplicationWsException {
"""
Changes the description of an application.
@param applicationName the application name
@param newDesc the new description to set
@throws ApplicationWsException if something went wrong
"""
this.logger... | java | public void setDescription( String applicationName, String newDesc )
throws ApplicationWsException {
this.logger.finer( "Updating the description of application " + applicationName + "." );
WebResource path = this.resource.path( UrlConstants.APP ).path( applicationName ).path( "description" );
ClientResponse r... | [
"public",
"void",
"setDescription",
"(",
"String",
"applicationName",
",",
"String",
"newDesc",
")",
"throws",
"ApplicationWsException",
"{",
"this",
".",
"logger",
".",
"finer",
"(",
"\"Updating the description of application \"",
"+",
"applicationName",
"+",
"\".\"",
... | Changes the description of an application.
@param applicationName the application name
@param newDesc the new description to set
@throws ApplicationWsException if something went wrong | [
"Changes",
"the",
"description",
"of",
"an",
"application",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/miscellaneous/roboconf-dm-rest-client/src/main/java/net/roboconf/dm/rest/client/delegates/ApplicationWsDelegate.java#L108-L120 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliCompiler.java | CliCompiler.getColumn | public static String getColumn(Tree astNode, int pos) {
"""
Returns the pos'th (0-based index) column specifier in the astNode
"""
// Skip over keyspace, column family and rowKey
return CliUtils.unescapeSQLString(astNode.getChild(pos + 2).getText());
} | java | public static String getColumn(Tree astNode, int pos)
{
// Skip over keyspace, column family and rowKey
return CliUtils.unescapeSQLString(astNode.getChild(pos + 2).getText());
} | [
"public",
"static",
"String",
"getColumn",
"(",
"Tree",
"astNode",
",",
"int",
"pos",
")",
"{",
"// Skip over keyspace, column family and rowKey",
"return",
"CliUtils",
".",
"unescapeSQLString",
"(",
"astNode",
".",
"getChild",
"(",
"pos",
"+",
"2",
")",
".",
"g... | Returns the pos'th (0-based index) column specifier in the astNode | [
"Returns",
"the",
"pos",
"th",
"(",
"0",
"-",
"based",
"index",
")",
"column",
"specifier",
"in",
"the",
"astNode"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliCompiler.java#L166-L170 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/Compiler.java | Compiler.compilePredicates | private void compilePredicates(int opPos, Expression[] predicates)
throws TransformerException {
"""
Compiles predicates in the step.
@param opPos The position of the first predicate the m_opMap array.
@param predicates An empty pre-determined array of
{@link org.apache.xpath.Expression}s, that will... | java | private void compilePredicates(int opPos, Expression[] predicates)
throws TransformerException
{
for (int i = 0; OpCodes.OP_PREDICATE == getOp(opPos); i++)
{
predicates[i] = predicate(opPos);
opPos = getNextOpPos(opPos);
}
} | [
"private",
"void",
"compilePredicates",
"(",
"int",
"opPos",
",",
"Expression",
"[",
"]",
"predicates",
")",
"throws",
"TransformerException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"OpCodes",
".",
"OP_PREDICATE",
"==",
"getOp",
"(",
"opPos",
")",
";"... | Compiles predicates in the step.
@param opPos The position of the first predicate the m_opMap array.
@param predicates An empty pre-determined array of
{@link org.apache.xpath.Expression}s, that will be filled in.
@throws TransformerException | [
"Compiles",
"predicates",
"in",
"the",
"step",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/compiler/Compiler.java#L998-L1007 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java | VirtualMachinesInner.beginCapture | public VirtualMachineCaptureResultInner beginCapture(String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) {
"""
Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs.
@param resourceGroupName The name of the resource... | java | public VirtualMachineCaptureResultInner beginCapture(String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) {
return beginCaptureWithServiceResponseAsync(resourceGroupName, vmName, parameters).toBlocking().single().body();
} | [
"public",
"VirtualMachineCaptureResultInner",
"beginCapture",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmName",
",",
"VirtualMachineCaptureParameters",
"parameters",
")",
"{",
"return",
"beginCaptureWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmName",
... | Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@param parameters Parameters supplied to the Capture Virtual Machine operation.
@throws IllegalA... | [
"Captures",
"the",
"VM",
"by",
"copying",
"virtual",
"hard",
"disks",
"of",
"the",
"VM",
"and",
"outputs",
"a",
"template",
"that",
"can",
"be",
"used",
"to",
"create",
"similar",
"VMs",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java#L455-L457 |
mnlipp/jgrapes | org.jgrapes.core/src/org/jgrapes/core/internal/HandlerReference.java | HandlerReference.newRef | public static HandlerReference newRef(
ComponentType component, Method method,
int priority, HandlerScope filter) {
"""
Create a new {@link HandlerReference} from the given values.
@param component the component
@param method the method
@param priority the priority
@param filter the f... | java | public static HandlerReference newRef(
ComponentType component, Method method,
int priority, HandlerScope filter) {
if (handlerTracking.isLoggable(Level.FINE)) {
return new VerboseHandlerReference(
component, method, priority, filter);
} else {
... | [
"public",
"static",
"HandlerReference",
"newRef",
"(",
"ComponentType",
"component",
",",
"Method",
"method",
",",
"int",
"priority",
",",
"HandlerScope",
"filter",
")",
"{",
"if",
"(",
"handlerTracking",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",... | Create a new {@link HandlerReference} from the given values.
@param component the component
@param method the method
@param priority the priority
@param filter the filter
@return the handler reference | [
"Create",
"a",
"new",
"{",
"@link",
"HandlerReference",
"}",
"from",
"the",
"given",
"values",
"."
] | train | https://github.com/mnlipp/jgrapes/blob/8b5d874935d84c34a52d3e3d3745e869b5203fa0/org.jgrapes.core/src/org/jgrapes/core/internal/HandlerReference.java#L166-L175 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java | Expressions.stringTemplate | @Deprecated
public static StringTemplate stringTemplate(String template, ImmutableList<?> args) {
"""
Create a new Template expression
@deprecated Use {@link #stringTemplate(String, List)} instead.
@param template template
@param args template parameters
@return template expression
"""
retu... | java | @Deprecated
public static StringTemplate stringTemplate(String template, ImmutableList<?> args) {
return stringTemplate(createTemplate(template), args);
} | [
"@",
"Deprecated",
"public",
"static",
"StringTemplate",
"stringTemplate",
"(",
"String",
"template",
",",
"ImmutableList",
"<",
"?",
">",
"args",
")",
"{",
"return",
"stringTemplate",
"(",
"createTemplate",
"(",
"template",
")",
",",
"args",
")",
";",
"}"
] | Create a new Template expression
@deprecated Use {@link #stringTemplate(String, List)} instead.
@param template template
@param args template parameters
@return template expression | [
"Create",
"a",
"new",
"Template",
"expression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/Expressions.java#L901-L904 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/dgmimpl/NumberNumberPlus.java | NumberNumberPlus.plus | public static Number plus(Number left, Number right) {
"""
Add two numbers and return the result.
@param left a Number
@param right another Number to add
@return the addition of both Numbers
"""
return NumberMath.add(left, right);
} | java | public static Number plus(Number left, Number right) {
return NumberMath.add(left, right);
} | [
"public",
"static",
"Number",
"plus",
"(",
"Number",
"left",
",",
"Number",
"right",
")",
"{",
"return",
"NumberMath",
".",
"add",
"(",
"left",
",",
"right",
")",
";",
"}"
] | Add two numbers and return the result.
@param left a Number
@param right another Number to add
@return the addition of both Numbers | [
"Add",
"two",
"numbers",
"and",
"return",
"the",
"result",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/dgmimpl/NumberNumberPlus.java#L42-L44 |
pressgang-ccms/PressGangCCMSBuilder | src/main/java/org/jboss/pressgang/ccms/contentspec/builder/utils/DocBookBuildUtilities.java | DocBookBuildUtilities.addLevelsToDatabase | public static void addLevelsToDatabase(final BuildDatabase buildDatabase, final Level level) {
"""
Adds the levels in the provided Level object to the content spec database.
@param buildDatabase
@param level The content spec level to be added to the database.
"""
// Add the level to the dat... | java | public static void addLevelsToDatabase(final BuildDatabase buildDatabase, final Level level) {
// Add the level to the database
buildDatabase.add(level);
// Add the child levels to the database
for (final Level childLevel : level.getChildLevels()) {
addLevelsToDatabase(build... | [
"public",
"static",
"void",
"addLevelsToDatabase",
"(",
"final",
"BuildDatabase",
"buildDatabase",
",",
"final",
"Level",
"level",
")",
"{",
"// Add the level to the database",
"buildDatabase",
".",
"add",
"(",
"level",
")",
";",
"// Add the child levels to the database",... | Adds the levels in the provided Level object to the content spec database.
@param buildDatabase
@param level The content spec level to be added to the database. | [
"Adds",
"the",
"levels",
"in",
"the",
"provided",
"Level",
"object",
"to",
"the",
"content",
"spec",
"database",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/utils/DocBookBuildUtilities.java#L76-L84 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WComponentGroupRenderer.java | WComponentGroupRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
"""
Paints the given WComponentGroup.
@param component the WComponentGroup to paint.
@param renderContext the RenderContext to paint to.
"""
WComponentGroup group = (WComponentGroup) component;
XmlStr... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WComponentGroup group = (WComponentGroup) component;
XmlStringBuilder xml = renderContext.getWriter();
List<WComponent> components = group.getComponents();
if (components != null && !components.isEmpty()) {
... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WComponentGroup",
"group",
"=",
"(",
"WComponentGroup",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
... | Paints the given WComponentGroup.
@param component the WComponentGroup to paint.
@param renderContext the RenderContext to paint to. | [
"Paints",
"the",
"given",
"WComponentGroup",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WComponentGroupRenderer.java#L23-L43 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getPetInfo | public void getPetInfo(int[] ids, Callback<List<Pet>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on pets API go <a href="https://wiki.guildwars2.com/wiki/API:2/pets">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(... | java | public void getPetInfo(int[] ids, Callback<List<Pet>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getPetInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback);
} | [
"public",
"void",
"getPetInfo",
"(",
"int",
"[",
"]",
"ids",
",",
"Callback",
"<",
"List",
"<",
"Pet",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"ids",
")",
... | For more info on pets API go <a href="https://wiki.guildwars2.com/wiki/API:2/pets">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param ids list of pet id
@param callback callback that is going to b... | [
"For",
"more",
"info",
"on",
"pets",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"pets",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Give",
"user",
"the",... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1963-L1966 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/layer/AbstractLayer.java | AbstractLayer.updateShowing | protected void updateShowing(boolean fireEvents) {
"""
Update showing state.
@param fireEvents Should events be fired if state changes?
"""
double scale = mapModel.getMapView().getCurrentScale();
if (visible) {
boolean oldShowing = showing;
showing = scale >= layerInfo.getMinimumScale().getPixelPe... | java | protected void updateShowing(boolean fireEvents) {
double scale = mapModel.getMapView().getCurrentScale();
if (visible) {
boolean oldShowing = showing;
showing = scale >= layerInfo.getMinimumScale().getPixelPerUnit()
&& scale <= layerInfo.getMaximumScale().getPixelPerUnit();
if (oldShowing != showing ... | [
"protected",
"void",
"updateShowing",
"(",
"boolean",
"fireEvents",
")",
"{",
"double",
"scale",
"=",
"mapModel",
".",
"getMapView",
"(",
")",
".",
"getCurrentScale",
"(",
")",
";",
"if",
"(",
"visible",
")",
"{",
"boolean",
"oldShowing",
"=",
"showing",
"... | Update showing state.
@param fireEvents Should events be fired if state changes? | [
"Update",
"showing",
"state",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/layer/AbstractLayer.java#L130-L142 |
Erudika/para | para-server/src/main/java/com/erudika/para/persistence/AWSDynamoUtils.java | AWSDynamoUtils.batchWrite | protected static void batchWrite(Map<String, List<WriteRequest>> items, int backoff) {
"""
Writes multiple items in batch.
@param items a map of tables->write requests
@param backoff backoff seconds
"""
if (items == null || items.isEmpty()) {
return;
}
try {
BatchWriteItemResult result = getClien... | java | protected static void batchWrite(Map<String, List<WriteRequest>> items, int backoff) {
if (items == null || items.isEmpty()) {
return;
}
try {
BatchWriteItemResult result = getClient().batchWriteItem(new BatchWriteItemRequest().
withReturnConsumedCapacity(ReturnConsumedCapacity.TOTAL).withRequestItems(... | [
"protected",
"static",
"void",
"batchWrite",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"WriteRequest",
">",
">",
"items",
",",
"int",
"backoff",
")",
"{",
"if",
"(",
"items",
"==",
"null",
"||",
"items",
".",
"isEmpty",
"(",
")",
")",
"{",
"return... | Writes multiple items in batch.
@param items a map of tables->write requests
@param backoff backoff seconds | [
"Writes",
"multiple",
"items",
"in",
"batch",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-server/src/main/java/com/erudika/para/persistence/AWSDynamoUtils.java#L453-L474 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/miner/UbiquitousIDMiner.java | UbiquitousIDMiner.getValue | @Override
public String getValue(Match m, int col) {
"""
Gets the ids of the small molecule reference and its physical entities.
@param m current match
@param col current column
@return ubique IDs
"""
assert col == 0;
return getRelatedIDs((SmallMoleculeReference) m.get("SMR", getPattern()));
} | java | @Override
public String getValue(Match m, int col)
{
assert col == 0;
return getRelatedIDs((SmallMoleculeReference) m.get("SMR", getPattern()));
} | [
"@",
"Override",
"public",
"String",
"getValue",
"(",
"Match",
"m",
",",
"int",
"col",
")",
"{",
"assert",
"col",
"==",
"0",
";",
"return",
"getRelatedIDs",
"(",
"(",
"SmallMoleculeReference",
")",
"m",
".",
"get",
"(",
"\"SMR\"",
",",
"getPattern",
"(",... | Gets the ids of the small molecule reference and its physical entities.
@param m current match
@param col current column
@return ubique IDs | [
"Gets",
"the",
"ids",
"of",
"the",
"small",
"molecule",
"reference",
"and",
"its",
"physical",
"entities",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/miner/UbiquitousIDMiner.java#L75-L81 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java | DataLabelingServiceClient.listDatasets | public final ListDatasetsPagedResponse listDatasets(String parent, String filter) {
"""
Lists datasets under a project. Pagination is supported.
<p>Sample code:
<pre><code>
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabeling... | java | public final ListDatasetsPagedResponse listDatasets(String parent, String filter) {
PROJECT_PATH_TEMPLATE.validate(parent, "listDatasets");
ListDatasetsRequest request =
ListDatasetsRequest.newBuilder().setParent(parent).setFilter(filter).build();
return listDatasets(request);
} | [
"public",
"final",
"ListDatasetsPagedResponse",
"listDatasets",
"(",
"String",
"parent",
",",
"String",
"filter",
")",
"{",
"PROJECT_PATH_TEMPLATE",
".",
"validate",
"(",
"parent",
",",
"\"listDatasets\"",
")",
";",
"ListDatasetsRequest",
"request",
"=",
"ListDatasets... | Lists datasets under a project. Pagination is supported.
<p>Sample code:
<pre><code>
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedParent = DataLabelingServiceClient.formatProjectName("[PROJECT]");
String filter = "";
for (Dataset element : dataLabeli... | [
"Lists",
"datasets",
"under",
"a",
"project",
".",
"Pagination",
"is",
"supported",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java#L634-L639 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.