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 |
|---|---|---|---|---|---|---|---|---|---|---|
spring-projects/spring-social | spring-social-core/src/main/java/org/springframework/social/oauth1/SigningSupport.java | SigningSupport.buildAuthorizationHeaderValue | public String buildAuthorizationHeaderValue(HttpMethod method, URI targetUrl, Map<String, String> oauthParameters, MultiValueMap<String, String> additionalParameters, String consumerSecret, String tokenSecret) {
"""
Builds the authorization header.
The elements in additionalParameters are expected to not be encod... | java | public String buildAuthorizationHeaderValue(HttpMethod method, URI targetUrl, Map<String, String> oauthParameters, MultiValueMap<String, String> additionalParameters, String consumerSecret, String tokenSecret) {
StringBuilder header = new StringBuilder();
header.append("OAuth ");
for (Entry<String, String> entry ... | [
"public",
"String",
"buildAuthorizationHeaderValue",
"(",
"HttpMethod",
"method",
",",
"URI",
"targetUrl",
",",
"Map",
"<",
"String",
",",
"String",
">",
"oauthParameters",
",",
"MultiValueMap",
"<",
"String",
",",
"String",
">",
"additionalParameters",
",",
"Stri... | Builds the authorization header.
The elements in additionalParameters are expected to not be encoded. | [
"Builds",
"the",
"authorization",
"header",
".",
"The",
"elements",
"in",
"additionalParameters",
"are",
"expected",
"to",
"not",
"be",
"encoded",
"."
] | train | https://github.com/spring-projects/spring-social/blob/e41cfecb288022b83c79413b58f52511c3c9d4fc/spring-social-core/src/main/java/org/springframework/social/oauth1/SigningSupport.java#L56-L69 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/tsx/db/Query.java | Query.main | public static void main(String args[]) {
"""
This method was created in VisualAge.
@param args java.lang.String[]
"""
String dbDriver = "COM.ibm.db2.jdbc.app.DB2Driver";
String url = "jdbc:db2:sample";
String user = "Murali";
String pass = "ibm";
String querystring = "S... | java | public static void main(String args[]) {
String dbDriver = "COM.ibm.db2.jdbc.app.DB2Driver";
String url = "jdbc:db2:sample";
String user = "Murali";
String pass = "ibm";
String querystring = "Select * from Murali.department";
try {
ConnectionProperties cp = n... | [
"public",
"static",
"void",
"main",
"(",
"String",
"args",
"[",
"]",
")",
"{",
"String",
"dbDriver",
"=",
"\"COM.ibm.db2.jdbc.app.DB2Driver\"",
";",
"String",
"url",
"=",
"\"jdbc:db2:sample\"",
";",
"String",
"user",
"=",
"\"Murali\"",
";",
"String",
"pass",
"... | This method was created in VisualAge.
@param args java.lang.String[] | [
"This",
"method",
"was",
"created",
"in",
"VisualAge",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/tsx/db/Query.java#L294-L326 |
exoplatform/jcr | exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/GenericResource.java | GenericResource.supportedLock | protected HierarchicalProperty supportedLock() {
"""
The information about supported locks.
@return information about supported locks
"""
HierarchicalProperty supportedLock = new HierarchicalProperty(new QName("DAV:", "supportedlock"));
HierarchicalProperty lockEntry = new HierarchicalProper... | java | protected HierarchicalProperty supportedLock()
{
HierarchicalProperty supportedLock = new HierarchicalProperty(new QName("DAV:", "supportedlock"));
HierarchicalProperty lockEntry = new HierarchicalProperty(new QName("DAV:", "lockentry"));
supportedLock.addChild(lockEntry);
Hierarchic... | [
"protected",
"HierarchicalProperty",
"supportedLock",
"(",
")",
"{",
"HierarchicalProperty",
"supportedLock",
"=",
"new",
"HierarchicalProperty",
"(",
"new",
"QName",
"(",
"\"DAV:\"",
",",
"\"supportedlock\"",
")",
")",
";",
"HierarchicalProperty",
"lockEntry",
"=",
"... | The information about supported locks.
@return information about supported locks | [
"The",
"information",
"about",
"supported",
"locks",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/resource/GenericResource.java#L186-L202 |
wigforss/Ka-Commons-Reflection | src/main/java/org/kasource/commons/reflection/util/MethodUtils.java | MethodUtils.getDeclaredMethod | public static Method getDeclaredMethod(Class<?> clazz, String name, Class<?>... params) {
"""
Returns the named method from class <i>clazz</i>, does not throw checked exceptions.
@param clazz
The class to inspect
@param name
The name of the method to get
@param params
Parameter types for the method
@r... | java | public static Method getDeclaredMethod(Class<?> clazz, String name, Class<?>... params) {
try {
return clazz.getDeclaredMethod(name, params);
} catch (Exception e) {
throw new IllegalArgumentException("Could not access method: " + name + " on " + clazz, e);
}
} | [
"public",
"static",
"Method",
"getDeclaredMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"...",
"params",
")",
"{",
"try",
"{",
"return",
"clazz",
".",
"getDeclaredMethod",
"(",
"name",
",",
"params",
... | Returns the named method from class <i>clazz</i>, does not throw checked exceptions.
@param clazz
The class to inspect
@param name
The name of the method to get
@param params
Parameter types for the method
@return Returns the named method from class <i>clazz</i>.
@throws IllegalArgumentException if method could not... | [
"Returns",
"the",
"named",
"method",
"from",
"class",
"<i",
">",
"clazz<",
"/",
"i",
">",
"does",
"not",
"throw",
"checked",
"exceptions",
"."
] | train | https://github.com/wigforss/Ka-Commons-Reflection/blob/a80f7a164cd800089e4f4dd948ca6f0e7badcf33/src/main/java/org/kasource/commons/reflection/util/MethodUtils.java#L42-L48 |
algorithmiaio/algorithmia-java | src/main/java/com/algorithmia/data/DataDirectory.java | DataDirectory.putFile | public DataFile putFile(File file) throws APIException, FileNotFoundException {
"""
Convenience wrapper for putting a File
@param file a file to put into this data directory
@return a handle to the requested file
@throws APIException if there were any problems communicating with the Algorithmia API
@throws Fil... | java | public DataFile putFile(File file) throws APIException, FileNotFoundException {
DataFile dataFile = new DataFile(client, trimmedPath + "/" + file.getName());
dataFile.put(file);
return dataFile;
} | [
"public",
"DataFile",
"putFile",
"(",
"File",
"file",
")",
"throws",
"APIException",
",",
"FileNotFoundException",
"{",
"DataFile",
"dataFile",
"=",
"new",
"DataFile",
"(",
"client",
",",
"trimmedPath",
"+",
"\"/\"",
"+",
"file",
".",
"getName",
"(",
")",
")... | Convenience wrapper for putting a File
@param file a file to put into this data directory
@return a handle to the requested file
@throws APIException if there were any problems communicating with the Algorithmia API
@throws FileNotFoundException if the specified file does not exist | [
"Convenience",
"wrapper",
"for",
"putting",
"a",
"File"
] | train | https://github.com/algorithmiaio/algorithmia-java/blob/64bfdbd426e2d7f659be06d230523253e642a730/src/main/java/com/algorithmia/data/DataDirectory.java#L88-L92 |
HadoopGenomics/Hadoop-BAM | src/main/java/org/seqdoop/hadoop_bam/util/SAMOutputPreparer.java | SAMOutputPreparer.prepareForRecords | public OutputStream prepareForRecords(
OutputStream out, final SAMFormat format,
final SAMFileHeader header)
throws IOException {
"""
Prepares the given output stream for writing of SAMRecords in the given
format. This includes writing the given SAM header and, in the case of
BAM or CRAM, writing some fu... | java | public OutputStream prepareForRecords(
OutputStream out, final SAMFormat format,
final SAMFileHeader header)
throws IOException {
switch (format) {
case SAM:
out = prepareSAMOrBAMStream(out, format, header);
break;
case BAM:
out = ... | [
"public",
"OutputStream",
"prepareForRecords",
"(",
"OutputStream",
"out",
",",
"final",
"SAMFormat",
"format",
",",
"final",
"SAMFileHeader",
"header",
")",
"throws",
"IOException",
"{",
"switch",
"(",
"format",
")",
"{",
"case",
"SAM",
":",
"out",
"=",
"prep... | Prepares the given output stream for writing of SAMRecords in the given
format. This includes writing the given SAM header and, in the case of
BAM or CRAM, writing some further metadata as well as compressing everything
written. Returns a new stream to replace the original: it will do the
appropriate compression for BA... | [
"Prepares",
"the",
"given",
"output",
"stream",
"for",
"writing",
"of",
"SAMRecords",
"in",
"the",
"given",
"format",
".",
"This",
"includes",
"writing",
"the",
"given",
"SAM",
"header",
"and",
"in",
"the",
"case",
"of",
"BAM",
"or",
"CRAM",
"writing",
"so... | train | https://github.com/HadoopGenomics/Hadoop-BAM/blob/9f974cf635a8d72f69604021cc3d5f3469d38d2f/src/main/java/org/seqdoop/hadoop_bam/util/SAMOutputPreparer.java#L60-L85 |
omadahealth/CircularBarPager | library/src/main/java/com/github/omadahealth/circularbarpager/library/CircularBar.java | CircularBar.animateProgress | public void animateProgress(List<Boolean> circlePieceFillList, int duration) {
"""
Animate the change in progress of this view
@param duration The the time to run the animation over
"""
mCirclePieceFillList = circlePieceFillList;
AnimatorSet set = new AnimatorSet();
set.playTogether(... | java | public void animateProgress(List<Boolean> circlePieceFillList, int duration) {
mCirclePieceFillList = circlePieceFillList;
AnimatorSet set = new AnimatorSet();
set.playTogether(Glider.glide(Skill.QuadEaseInOut, duration, ObjectAnimator.ofFloat(this, "progress", 0, 100)));
set.setDuration... | [
"public",
"void",
"animateProgress",
"(",
"List",
"<",
"Boolean",
">",
"circlePieceFillList",
",",
"int",
"duration",
")",
"{",
"mCirclePieceFillList",
"=",
"circlePieceFillList",
";",
"AnimatorSet",
"set",
"=",
"new",
"AnimatorSet",
"(",
")",
";",
"set",
".",
... | Animate the change in progress of this view
@param duration The the time to run the animation over | [
"Animate",
"the",
"change",
"in",
"progress",
"of",
"this",
"view"
] | train | https://github.com/omadahealth/CircularBarPager/blob/3a43e8828849da727fd13345e83b8432f7271155/library/src/main/java/com/github/omadahealth/circularbarpager/library/CircularBar.java#L619-L626 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/EnvelopesApi.java | EnvelopesApi.updateRecipients | public RecipientsUpdateSummary updateRecipients(String accountId, String envelopeId, Recipients recipients) throws ApiException {
"""
Updates recipients in a draft envelope or corrects recipient information for an in process envelope.
Updates recipients in a draft envelope or corrects recipient information for an... | java | public RecipientsUpdateSummary updateRecipients(String accountId, String envelopeId, Recipients recipients) throws ApiException {
return updateRecipients(accountId, envelopeId, recipients, null);
} | [
"public",
"RecipientsUpdateSummary",
"updateRecipients",
"(",
"String",
"accountId",
",",
"String",
"envelopeId",
",",
"Recipients",
"recipients",
")",
"throws",
"ApiException",
"{",
"return",
"updateRecipients",
"(",
"accountId",
",",
"envelopeId",
",",
"recipients",
... | Updates recipients in a draft envelope or corrects recipient information for an in process envelope.
Updates recipients in a draft envelope or corrects recipient information for an in process envelope. For draft envelopes, you can edit the following properties: `email`, `userName`, `routingOr... | [
"Updates",
"recipients",
"in",
"a",
"draft",
"envelope",
"or",
"corrects",
"recipient",
"information",
"for",
"an",
"in",
"process",
"envelope",
".",
"Updates",
"recipients",
"in",
"a",
"draft",
"envelope",
"or",
"corrects",
"recipient",
"information",
"for",
"a... | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/EnvelopesApi.java#L5548-L5550 |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/util/BooleanFormula.java | BooleanFormula.resolveWith | public BooleanFormula resolveWith(Features features, boolean coerceUndefinedToFalse) {
"""
Resolves the formula using the boolean values specified in
<code>features</code>. If there are no more un-resolved variables in the
forumula, the resulting formula will be either TRUE or FALSE.
@param features
the valu... | java | public BooleanFormula resolveWith(Features features, boolean coerceUndefinedToFalse) {
if (isTrue() || isFalse()) {
return this;
}
BooleanFormula formula = new BooleanFormula();
for (BooleanTerm term : this) {
BooleanTerm evaluated = term.resolveWith(features, coerceUndefinedToFalse);
if (evalua... | [
"public",
"BooleanFormula",
"resolveWith",
"(",
"Features",
"features",
",",
"boolean",
"coerceUndefinedToFalse",
")",
"{",
"if",
"(",
"isTrue",
"(",
")",
"||",
"isFalse",
"(",
")",
")",
"{",
"return",
"this",
";",
"}",
"BooleanFormula",
"formula",
"=",
"new... | Resolves the formula using the boolean values specified in
<code>features</code>. If there are no more un-resolved variables in the
forumula, the resulting formula will be either TRUE or FALSE.
@param features
the values to assign to variables in the formula
@param coerceUndefinedToFalse
if true, then undefined featur... | [
"Resolves",
"the",
"formula",
"using",
"the",
"boolean",
"values",
"specified",
"in",
"<code",
">",
"features<",
"/",
"code",
">",
".",
"If",
"there",
"are",
"no",
"more",
"un",
"-",
"resolved",
"variables",
"in",
"the",
"forumula",
"the",
"resulting",
"fo... | train | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/util/BooleanFormula.java#L282-L303 |
samskivert/samskivert | src/main/java/com/samskivert/util/KeyUtil.java | KeyUtil.generateRandomKey | public static String generateRandomKey (Random rand, int length) {
"""
Return a key of the given length that contains random numbers.
"""
int numKeyChars = KEY_CHARS.length();
StringBuilder buf = new StringBuilder();
for (int ii = 0; ii < length; ii++) {
buf.append(KEY_CHARS... | java | public static String generateRandomKey (Random rand, int length)
{
int numKeyChars = KEY_CHARS.length();
StringBuilder buf = new StringBuilder();
for (int ii = 0; ii < length; ii++) {
buf.append(KEY_CHARS.charAt(rand.nextInt(numKeyChars)));
}
return buf.toString()... | [
"public",
"static",
"String",
"generateRandomKey",
"(",
"Random",
"rand",
",",
"int",
"length",
")",
"{",
"int",
"numKeyChars",
"=",
"KEY_CHARS",
".",
"length",
"(",
")",
";",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
... | Return a key of the given length that contains random numbers. | [
"Return",
"a",
"key",
"of",
"the",
"given",
"length",
"that",
"contains",
"random",
"numbers",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/KeyUtil.java#L29-L37 |
RKumsher/utils | src/main/java/com/github/rkumsher/date/RandomDateUtils.java | RandomDateUtils.randomDate | public static Date randomDate(Date startInclusive, Date endExclusive) {
"""
Returns a random {@link Date} within the specified range.
@param startInclusive the earliest {@link Date} that can be returned
@param endExclusive the upper bound (not included)
@return the random {@link Date}
@throws IllegalArgument... | java | public static Date randomDate(Date startInclusive, Date endExclusive) {
checkArgument(startInclusive != null, "Start must be non-null");
checkArgument(endExclusive != null, "End must be non-null");
Instant startInstant = startInclusive.toInstant();
Instant endInstant = endExclusive.toInstant();
Inst... | [
"public",
"static",
"Date",
"randomDate",
"(",
"Date",
"startInclusive",
",",
"Date",
"endExclusive",
")",
"{",
"checkArgument",
"(",
"startInclusive",
"!=",
"null",
",",
"\"Start must be non-null\"",
")",
";",
"checkArgument",
"(",
"endExclusive",
"!=",
"null",
"... | Returns a random {@link Date} within the specified range.
@param startInclusive the earliest {@link Date} that can be returned
@param endExclusive the upper bound (not included)
@return the random {@link Date}
@throws IllegalArgumentException if startInclusive or endExclusive are null or if endExclusive
is earlier tha... | [
"Returns",
"a",
"random",
"{",
"@link",
"Date",
"}",
"within",
"the",
"specified",
"range",
"."
] | train | https://github.com/RKumsher/utils/blob/fcdb190569cd0288249bf4b46fd418f8c01d1caf/src/main/java/com/github/rkumsher/date/RandomDateUtils.java#L380-L387 |
bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/AstyanaxBlockedDataReaderDAO.java | AstyanaxBlockedDataReaderDAO.decodeRows | private Iterator<Record> decodeRows(List<Map.Entry<ByteBuffer, Key>> keys, final Rows<ByteBuffer, DeltaKey> rows,
final int largeRowThreshold, final ReadConsistency consistency) {
"""
Decodes rows returned by querying for a specific set of rows.
"""
// Avoiding p... | java | private Iterator<Record> decodeRows(List<Map.Entry<ByteBuffer, Key>> keys, final Rows<ByteBuffer, DeltaKey> rows,
final int largeRowThreshold, final ReadConsistency consistency) {
// Avoiding pinning multiple decoded rows into memory at once.
return Iterators.tran... | [
"private",
"Iterator",
"<",
"Record",
">",
"decodeRows",
"(",
"List",
"<",
"Map",
".",
"Entry",
"<",
"ByteBuffer",
",",
"Key",
">",
">",
"keys",
",",
"final",
"Rows",
"<",
"ByteBuffer",
",",
"DeltaKey",
">",
"rows",
",",
"final",
"int",
"largeRowThreshol... | Decodes rows returned by querying for a specific set of rows. | [
"Decodes",
"rows",
"returned",
"by",
"querying",
"for",
"a",
"specific",
"set",
"of",
"rows",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/AstyanaxBlockedDataReaderDAO.java#L1053-L1067 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/JaiDebug.java | JaiDebug.dumpColorset | public static void dumpColorset(AiMesh mesh, int colorset) {
"""
Dumps a vertex color set of a mesh to stdout.<p>
@param mesh the mesh
@param colorset the color set
"""
if (!mesh.hasColors(colorset)) {
System.out.println("mesh has no vertex color set " + colorset);
return;
... | java | public static void dumpColorset(AiMesh mesh, int colorset) {
if (!mesh.hasColors(colorset)) {
System.out.println("mesh has no vertex color set " + colorset);
return;
}
for (int i = 0; i < mesh.getNumVertices(); i++) {
System.out.println("[" +
... | [
"public",
"static",
"void",
"dumpColorset",
"(",
"AiMesh",
"mesh",
",",
"int",
"colorset",
")",
"{",
"if",
"(",
"!",
"mesh",
".",
"hasColors",
"(",
"colorset",
")",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"mesh has no vertex color set \"",
"... | Dumps a vertex color set of a mesh to stdout.<p>
@param mesh the mesh
@param colorset the color set | [
"Dumps",
"a",
"vertex",
"color",
"set",
"of",
"a",
"mesh",
"to",
"stdout",
".",
"<p",
">"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/JaiDebug.java#L116-L130 |
alipay/sofa-rpc | core/api/src/main/java/com/alipay/sofa/rpc/common/RpcConfigs.java | RpcConfigs.changed | protected static boolean changed(Object oldObj, Object newObj) {
"""
值是否发生变化
@param oldObj 旧值
@param newObj 新值
@return 是否变化 boolean
"""
return oldObj == null ?
newObj != null :
!oldObj.equals(newObj);
} | java | protected static boolean changed(Object oldObj, Object newObj) {
return oldObj == null ?
newObj != null :
!oldObj.equals(newObj);
} | [
"protected",
"static",
"boolean",
"changed",
"(",
"Object",
"oldObj",
",",
"Object",
"newObj",
")",
"{",
"return",
"oldObj",
"==",
"null",
"?",
"newObj",
"!=",
"null",
":",
"!",
"oldObj",
".",
"equals",
"(",
"newObj",
")",
";",
"}"
] | 值是否发生变化
@param oldObj 旧值
@param newObj 新值
@return 是否变化 boolean | [
"值是否发生变化"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/common/RpcConfigs.java#L349-L353 |
Azure/azure-sdk-for-java | cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java | DatabaseAccountsInner.beginOfflineRegionAsync | public Observable<Void> beginOfflineRegionAsync(String resourceGroupName, String accountName, String region) {
"""
Offline the specified region for the specified Azure Cosmos DB database account.
@param resourceGroupName Name of an Azure resource group.
@param accountName Cosmos DB database account name.
@par... | java | public Observable<Void> beginOfflineRegionAsync(String resourceGroupName, String accountName, String region) {
return beginOfflineRegionWithServiceResponseAsync(resourceGroupName, accountName, region).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceRespon... | [
"public",
"Observable",
"<",
"Void",
">",
"beginOfflineRegionAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"region",
")",
"{",
"return",
"beginOfflineRegionWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
... | Offline the specified region for the specified Azure Cosmos DB database account.
@param resourceGroupName Name of an Azure resource group.
@param accountName Cosmos DB database account name.
@param region Cosmos DB region, with spaces between words and each word capitalized.
@throws IllegalArgumentException thrown if ... | [
"Offline",
"the",
"specified",
"region",
"for",
"the",
"specified",
"Azure",
"Cosmos",
"DB",
"database",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/DatabaseAccountsInner.java#L1388-L1395 |
kurbatov/firmata4j | src/main/java/org/firmata4j/firmata/FirmataI2CDevice.java | FirmataI2CDevice.onReceive | void onReceive(int register, byte[] message) {
"""
{@link FirmataDevice} calls this method when receives a message from I2C
device.
@param register The device register read from.
@param message actual data from I2C device
"""
I2CEvent evt = new I2CEvent(this, register, message);
I2CListe... | java | void onReceive(int register, byte[] message) {
I2CEvent evt = new I2CEvent(this, register, message);
I2CListener listener = callbacks.remove(register);
if (listener == null) {
for (I2CListener subscriber : subscribers) {
subscriber.onReceive(evt);
}
... | [
"void",
"onReceive",
"(",
"int",
"register",
",",
"byte",
"[",
"]",
"message",
")",
"{",
"I2CEvent",
"evt",
"=",
"new",
"I2CEvent",
"(",
"this",
",",
"register",
",",
"message",
")",
";",
"I2CListener",
"listener",
"=",
"callbacks",
".",
"remove",
"(",
... | {@link FirmataDevice} calls this method when receives a message from I2C
device.
@param register The device register read from.
@param message actual data from I2C device | [
"{",
"@link",
"FirmataDevice",
"}",
"calls",
"this",
"method",
"when",
"receives",
"a",
"message",
"from",
"I2C",
"device",
"."
] | train | https://github.com/kurbatov/firmata4j/blob/1bf75cd7f4f8d11dc2a91cf2bc6808f583d9a4ea/src/main/java/org/firmata4j/firmata/FirmataI2CDevice.java#L129-L139 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java | HtmlTree.NOSCRIPT | public static HtmlTree NOSCRIPT(Content body) {
"""
Generates a NOSCRIPT tag with some content.
@param body content of the noscript tag
@return an HtmlTree object for the NOSCRIPT tag
"""
HtmlTree htmltree = new HtmlTree(HtmlTag.NOSCRIPT, nullCheck(body));
return htmltree;
} | java | public static HtmlTree NOSCRIPT(Content body) {
HtmlTree htmltree = new HtmlTree(HtmlTag.NOSCRIPT, nullCheck(body));
return htmltree;
} | [
"public",
"static",
"HtmlTree",
"NOSCRIPT",
"(",
"Content",
"body",
")",
"{",
"HtmlTree",
"htmltree",
"=",
"new",
"HtmlTree",
"(",
"HtmlTag",
".",
"NOSCRIPT",
",",
"nullCheck",
"(",
"body",
")",
")",
";",
"return",
"htmltree",
";",
"}"
] | Generates a NOSCRIPT tag with some content.
@param body content of the noscript tag
@return an HtmlTree object for the NOSCRIPT tag | [
"Generates",
"a",
"NOSCRIPT",
"tag",
"with",
"some",
"content",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java#L615-L618 |
ironjacamar/ironjacamar | rarinfo/src/main/java/org/ironjacamar/rarinfo/Main.java | Main.outputRaDesc | private static void outputRaDesc(RaImpl raImpl, PrintStream out) throws ParserConfigurationException, SAXException,
IOException, TransformerFactoryConfigurationError, TransformerConfigurationException, TransformerException {
"""
Output Resource Adapter XML description
@param raImpl RaImpl
@param out P... | java | private static void outputRaDesc(RaImpl raImpl, PrintStream out) throws ParserConfigurationException, SAXException,
IOException, TransformerFactoryConfigurationError, TransformerConfigurationException, TransformerException
{
String raString = "<resource-adapters>" + raImpl.toString() + "</resource-ada... | [
"private",
"static",
"void",
"outputRaDesc",
"(",
"RaImpl",
"raImpl",
",",
"PrintStream",
"out",
")",
"throws",
"ParserConfigurationException",
",",
"SAXException",
",",
"IOException",
",",
"TransformerFactoryConfigurationError",
",",
"TransformerConfigurationException",
",... | Output Resource Adapter XML description
@param raImpl RaImpl
@param out PrintStream
@throws ParserConfigurationException
@throws SAXException
@throws IOException
@throws TransformerFactoryConfigurationError
@throws TransformerConfigurationException
@throws TransformerException | [
"Output",
"Resource",
"Adapter",
"XML",
"description"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/rarinfo/src/main/java/org/ironjacamar/rarinfo/Main.java#L1162-L1184 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/javax/el/ListELResolver.java | ListELResolver.getValue | @Override
public Object getValue(ELContext context, Object base, Object property) {
"""
If the base object is a list, returns the value at the given index. The index is specified by
the property argument, and coerced into an integer. If the coercion could not be performed,
an IllegalArgumentException is thrown.... | java | @Override
public Object getValue(ELContext context, Object base, Object property) {
if (context == null) {
throw new NullPointerException("context is null");
}
Object result = null;
if (isResolvable(base)) {
int index = toIndex(null, property);
List<?> list = (List<?>) base;
result = index < 0 || i... | [
"@",
"Override",
"public",
"Object",
"getValue",
"(",
"ELContext",
"context",
",",
"Object",
"base",
",",
"Object",
"property",
")",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"context is null\"",
")",
"... | If the base object is a list, returns the value at the given index. The index is specified by
the property argument, and coerced into an integer. If the coercion could not be performed,
an IllegalArgumentException is thrown. If the index is out of bounds, null is returned. If
the base is a List, the propertyResolved pr... | [
"If",
"the",
"base",
"object",
"is",
"a",
"list",
"returns",
"the",
"value",
"at",
"the",
"given",
"index",
".",
"The",
"index",
"is",
"specified",
"by",
"the",
"property",
"argument",
"and",
"coerced",
"into",
"an",
"integer",
".",
"If",
"the",
"coercio... | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/javax/el/ListELResolver.java#L152-L165 |
drewwills/cernunnos | cernunnos-core/src/main/java/org/danann/cernunnos/runtime/ScriptRunner.java | ScriptRunner.evaluate | public Object evaluate(Element m, TaskRequest req) {
"""
Invokes the script defined by the specified element with the specified
<code>TaskRequest</code> and returns the <code>RETURN_VALUE</code>.
@param m An <code>Element</code> that defines a Task.
@param req A <code>TaskRequest</code> prepared externally.
... | java | public Object evaluate(Element m, TaskRequest req) {
// Assertions.
if (m == null) {
String msg = "Argument 'm [Element]' cannot be null.";
throw new IllegalArgumentException(msg);
}
return evaluate(compileTask(m), req);
} | [
"public",
"Object",
"evaluate",
"(",
"Element",
"m",
",",
"TaskRequest",
"req",
")",
"{",
"// Assertions.",
"if",
"(",
"m",
"==",
"null",
")",
"{",
"String",
"msg",
"=",
"\"Argument 'm [Element]' cannot be null.\"",
";",
"throw",
"new",
"IllegalArgumentException",... | Invokes the script defined by the specified element with the specified
<code>TaskRequest</code> and returns the <code>RETURN_VALUE</code>.
@param m An <code>Element</code> that defines a Task.
@param req A <code>TaskRequest</code> prepared externally.
@return The <code>RETURN_VALUE</code> of the specified task. | [
"Invokes",
"the",
"script",
"defined",
"by",
"the",
"specified",
"element",
"with",
"the",
"specified",
"<code",
">",
"TaskRequest<",
"/",
"code",
">",
"and",
"returns",
"the",
"<code",
">",
"RETURN_VALUE<",
"/",
"code",
">",
"."
] | train | https://github.com/drewwills/cernunnos/blob/dc6848e0253775e22b6c869fd06506d4ddb6d728/cernunnos-core/src/main/java/org/danann/cernunnos/runtime/ScriptRunner.java#L332-L342 |
h2oai/h2o-3 | h2o-core/src/main/java/water/ExternalFrameUtils.java | ExternalFrameUtils.getConnection | public static ByteChannel getConnection(String h2oNodeHostname, int h2oNodeApiPort, short nodeTimeStamp) throws IOException {
"""
Get connection to a specific h2o node. The caller of this method is usually non-H2O node who wants to read H2O
frames or write to H2O frames from non-H2O environment, such as Spark exe... | java | public static ByteChannel getConnection(String h2oNodeHostname, int h2oNodeApiPort, short nodeTimeStamp) throws IOException{
SocketChannelFactory socketFactory = SocketChannelFactory.instance(H2OSecurityManager.instance());
return H2ONode.openChan(TCPReceiverThread.TCP_EXTERNAL, socketFactory, h2oNodeHo... | [
"public",
"static",
"ByteChannel",
"getConnection",
"(",
"String",
"h2oNodeHostname",
",",
"int",
"h2oNodeApiPort",
",",
"short",
"nodeTimeStamp",
")",
"throws",
"IOException",
"{",
"SocketChannelFactory",
"socketFactory",
"=",
"SocketChannelFactory",
".",
"instance",
"... | Get connection to a specific h2o node. The caller of this method is usually non-H2O node who wants to read H2O
frames or write to H2O frames from non-H2O environment, such as Spark executor.
This node usually does not have H2O running. | [
"Get",
"connection",
"to",
"a",
"specific",
"h2o",
"node",
".",
"The",
"caller",
"of",
"this",
"method",
"is",
"usually",
"non",
"-",
"H2O",
"node",
"who",
"wants",
"to",
"read",
"H2O",
"frames",
"or",
"write",
"to",
"H2O",
"frames",
"from",
"non",
"-"... | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/ExternalFrameUtils.java#L49-L52 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.updateText | protected void updateText(PageElement pageElement, String textOrKey, CharSequence keysToSend, Object... args) throws TechnicalException, FailureException {
"""
Update a html input text with a text.
@param pageElement
Is target element
@param textOrKey
Is the new data (text or text in context (after a save))
... | java | protected void updateText(PageElement pageElement, String textOrKey, CharSequence keysToSend, Object... args) throws TechnicalException, FailureException {
String value = getTextOrKey(textOrKey);
if (!"".equals(value)) {
try {
final WebElement element = Context.waitUntil(... | [
"protected",
"void",
"updateText",
"(",
"PageElement",
"pageElement",
",",
"String",
"textOrKey",
",",
"CharSequence",
"keysToSend",
",",
"Object",
"...",
"args",
")",
"throws",
"TechnicalException",
",",
"FailureException",
"{",
"String",
"value",
"=",
"getTextOrKe... | Update a html input text with a text.
@param pageElement
Is target element
@param textOrKey
Is the new data (text or text in context (after a save))
@param keysToSend
character to send to the element after {@link org.openqa.selenium.WebElement#sendKeys(CharSequence...) sendKeys} with textOrKey
@param args
list of argu... | [
"Update",
"a",
"html",
"input",
"text",
"with",
"a",
"text",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L207-L229 |
fuinorg/event-store-commons | eshttp/src/main/java/org/fuin/esc/eshttp/ESHttpUtils.java | ESHttpUtils.createDocumentBuilder | @NotNull
public static DocumentBuilder createDocumentBuilder() {
"""
Creates a namespace aware document builder.
@return New instance.
"""
try {
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
retur... | java | @NotNull
public static DocumentBuilder createDocumentBuilder() {
try {
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
return factory.newDocumentBuilder();
} catch (final ParserConfigurationException ex... | [
"@",
"NotNull",
"public",
"static",
"DocumentBuilder",
"createDocumentBuilder",
"(",
")",
"{",
"try",
"{",
"final",
"DocumentBuilderFactory",
"factory",
"=",
"DocumentBuilderFactory",
".",
"newInstance",
"(",
")",
";",
"factory",
".",
"setNamespaceAware",
"(",
"true... | Creates a namespace aware document builder.
@return New instance. | [
"Creates",
"a",
"namespace",
"aware",
"document",
"builder",
"."
] | train | https://github.com/fuinorg/event-store-commons/blob/ea175582d8cda2b5a6d2fe52bbb2f1c183eee77c/eshttp/src/main/java/org/fuin/esc/eshttp/ESHttpUtils.java#L186-L195 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/archivers/Bzip2Archiver.java | Bzip2Archiver.getDecompressionStream | public InputStreamReader getDecompressionStream(String path, String encoding)
throws IOException {
"""
Creates Stream for decompression
@param path
path to file to uncompress
@param encoding
ecoding to use
@return decompression stream
@throws IOException
"""
File fileToUncompress = new File(path);
... | java | public InputStreamReader getDecompressionStream(String path, String encoding)
throws IOException
{
File fileToUncompress = new File(path);
BufferedInputStream fileStream = new BufferedInputStream(new FileInputStream(fileToUncompress));
// read bzip2 prefix: BZ
fileStream.read();
fileStream.read();
Buf... | [
"public",
"InputStreamReader",
"getDecompressionStream",
"(",
"String",
"path",
",",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"File",
"fileToUncompress",
"=",
"new",
"File",
"(",
"path",
")",
";",
"BufferedInputStream",
"fileStream",
"=",
"new",
"B... | Creates Stream for decompression
@param path
path to file to uncompress
@param encoding
ecoding to use
@return decompression stream
@throws IOException | [
"Creates",
"Stream",
"for",
"decompression"
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/archivers/Bzip2Archiver.java#L128-L145 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerIdentityImpl.java | TransformerIdentityImpl.internalEntityDecl | public void internalEntityDecl (String name, String value)
throws SAXException {
"""
Report an internal entity declaration.
<p>Only the effective (first) declaration for each entity
will be reported.</p>
@param name The name of the entity. If it is a parameter
entity, the name will begin with '%'.... | java | public void internalEntityDecl (String name, String value)
throws SAXException
{
if (null != m_resultDeclHandler)
m_resultDeclHandler.internalEntityDecl(name, value);
} | [
"public",
"void",
"internalEntityDecl",
"(",
"String",
"name",
",",
"String",
"value",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"null",
"!=",
"m_resultDeclHandler",
")",
"m_resultDeclHandler",
".",
"internalEntityDecl",
"(",
"name",
",",
"value",
")",
";",... | Report an internal entity declaration.
<p>Only the effective (first) declaration for each entity
will be reported.</p>
@param name The name of the entity. If it is a parameter
entity, the name will begin with '%'.
@param value The replacement text of the entity.
@exception SAXException The application may raise an e... | [
"Report",
"an",
"internal",
"entity",
"declaration",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerIdentityImpl.java#L1394-L1399 |
eldur/jwbf | src/main/java/net/sourceforge/jwbf/mediawiki/actions/queries/UnreviewedPagesTitles.java | UnreviewedPagesTitles.generateRequest | private HttpAction generateRequest(int[] namespace, String urstart, String urend) {
"""
generates the next MediaWiki-request (GetMethod) and adds it to msgs.
@param namespace the namespace(s) that will be searched for links, as a string of numbers
separated by '|'; if null, this parameter is omitted
@param ur... | java | private HttpAction generateRequest(int[] namespace, String urstart, String urend) {
RequestBuilder requestBuilder =
new ApiRequestBuilder() //
.action("query") //
.formatXml() //
.param("list", "unreviewedpages") //
.param("urlimit", LIMIT) //
;
i... | [
"private",
"HttpAction",
"generateRequest",
"(",
"int",
"[",
"]",
"namespace",
",",
"String",
"urstart",
",",
"String",
"urend",
")",
"{",
"RequestBuilder",
"requestBuilder",
"=",
"new",
"ApiRequestBuilder",
"(",
")",
"//",
".",
"action",
"(",
"\"query\"",
")"... | generates the next MediaWiki-request (GetMethod) and adds it to msgs.
@param namespace the namespace(s) that will be searched for links, as a string of numbers
separated by '|'; if null, this parameter is omitted
@param urstart Start listing at this page title
@param urend Stop listing at this page title | [
"generates",
"the",
"next",
"MediaWiki",
"-",
"request",
"(",
"GetMethod",
")",
"and",
"adds",
"it",
"to",
"msgs",
"."
] | train | https://github.com/eldur/jwbf/blob/ee17ea2fa5a26f17c8332a094b2db86dd596d1ff/src/main/java/net/sourceforge/jwbf/mediawiki/actions/queries/UnreviewedPagesTitles.java#L59-L80 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java | CheckpointCoordinator.triggerSavepoint | public CompletableFuture<CompletedCheckpoint> triggerSavepoint(
final long timestamp,
@Nullable final String targetLocation) {
"""
Triggers a savepoint with the given savepoint directory as a target.
@param timestamp The timestamp for the savepoint.
@param targetLocation Target location for the savepoint... | java | public CompletableFuture<CompletedCheckpoint> triggerSavepoint(
final long timestamp,
@Nullable final String targetLocation) {
final CheckpointProperties properties = CheckpointProperties.forSavepoint();
return triggerSavepointInternal(timestamp, properties, false, targetLocation);
} | [
"public",
"CompletableFuture",
"<",
"CompletedCheckpoint",
">",
"triggerSavepoint",
"(",
"final",
"long",
"timestamp",
",",
"@",
"Nullable",
"final",
"String",
"targetLocation",
")",
"{",
"final",
"CheckpointProperties",
"properties",
"=",
"CheckpointProperties",
".",
... | Triggers a savepoint with the given savepoint directory as a target.
@param timestamp The timestamp for the savepoint.
@param targetLocation Target location for the savepoint, optional. If null, the
state backend's configured default will be used.
@return A future to the completed checkpoint
@throws IllegalStateExcept... | [
"Triggers",
"a",
"savepoint",
"with",
"the",
"given",
"savepoint",
"directory",
"as",
"a",
"target",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointCoordinator.java#L370-L376 |
joniles/mpxj | src/main/java/net/sf/mpxj/Resource.java | Resource.setDuration | public void setDuration(int index, Duration value) {
"""
Set a duration value.
@param index duration index (1-10)
@param value duration value
"""
set(selectField(ResourceFieldLists.CUSTOM_DURATION, index), value);
} | java | public void setDuration(int index, Duration value)
{
set(selectField(ResourceFieldLists.CUSTOM_DURATION, index), value);
} | [
"public",
"void",
"setDuration",
"(",
"int",
"index",
",",
"Duration",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"ResourceFieldLists",
".",
"CUSTOM_DURATION",
",",
"index",
")",
",",
"value",
")",
";",
"}"
] | Set a duration value.
@param index duration index (1-10)
@param value duration value | [
"Set",
"a",
"duration",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Resource.java#L1661-L1664 |
EvidentSolutions/dalesbred | dalesbred/src/main/java/org/dalesbred/Database.java | Database.forUrlAndCredentials | public static @NotNull Database forUrlAndCredentials(@NotNull String url, @Nullable String username, @Nullable String password) {
"""
Returns a new Database that uses given connection options to open connection. The database
opens connections directly from {@link DriverManager} without performing connection pooli... | java | public static @NotNull Database forUrlAndCredentials(@NotNull String url, @Nullable String username, @Nullable String password) {
return new Database(new DriverManagerConnectionProvider(url, username, password));
} | [
"public",
"static",
"@",
"NotNull",
"Database",
"forUrlAndCredentials",
"(",
"@",
"NotNull",
"String",
"url",
",",
"@",
"Nullable",
"String",
"username",
",",
"@",
"Nullable",
"String",
"password",
")",
"{",
"return",
"new",
"Database",
"(",
"new",
"DriverMana... | Returns a new Database that uses given connection options to open connection. The database
opens connections directly from {@link DriverManager} without performing connection pooling.
@see DriverManagerConnectionProvider | [
"Returns",
"a",
"new",
"Database",
"that",
"uses",
"given",
"connection",
"options",
"to",
"open",
"connection",
".",
"The",
"database",
"opens",
"connections",
"directly",
"from",
"{",
"@link",
"DriverManager",
"}",
"without",
"performing",
"connection",
"pooling... | train | https://github.com/EvidentSolutions/dalesbred/blob/713f5b6e152d97e1672ca68b9ff9c7c6c288ceb1/dalesbred/src/main/java/org/dalesbred/Database.java#L102-L104 |
jboss/jboss-jsf-api_spec | src/main/java/javax/faces/component/UIViewRoot.java | UIViewRoot.processRestoreState | @Override
public void processRestoreState(FacesContext context, Object state) {
"""
<p class="changed_added_2_0"><span
class="changed_deleted_2_0_rev_a">The</span> default
implementation must call {@link
UIComponentBase#processRestoreState} from within a
<code>try</code> block. The <code>try</code> block ... | java | @Override
public void processRestoreState(FacesContext context, Object state) {
// hack to work around older state managers that may not set the
// view root early enough
if (context.getViewRoot() == null) {
context.setViewRoot(this);
}
super.processRestoreState(... | [
"@",
"Override",
"public",
"void",
"processRestoreState",
"(",
"FacesContext",
"context",
",",
"Object",
"state",
")",
"{",
"// hack to work around older state managers that may not set the",
"// view root early enough",
"if",
"(",
"context",
".",
"getViewRoot",
"(",
")",
... | <p class="changed_added_2_0"><span
class="changed_deleted_2_0_rev_a">The</span> default
implementation must call {@link
UIComponentBase#processRestoreState} from within a
<code>try</code> block. The <code>try</code> block must have a
<code>finally</code> block that ensures that no {@link
FacesEvent}s remain in the eve... | [
"<p",
"class",
"=",
"changed_added_2_0",
">",
"<span",
"class",
"=",
"changed_deleted_2_0_rev_a",
">",
"The<",
"/",
"span",
">",
"default",
"implementation",
"must",
"call",
"{"
] | train | https://github.com/jboss/jboss-jsf-api_spec/blob/cb33d215acbab847f2db5cdf2c6fe4d99c0a01c3/src/main/java/javax/faces/component/UIViewRoot.java#L867-L877 |
Wikidata/Wikidata-Toolkit | wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/ApiConnection.java | ApiConnection.confirmLogin | @Deprecated
void confirmLogin(String token, String username, String password)
throws IOException, LoginFailedException, MediaWikiApiErrorException {
"""
Issues a Web API query to confirm that the previous login attempt was
successful, and sets the internal state of the API connection accordingly
in this case... | java | @Deprecated
void confirmLogin(String token, String username, String password)
throws IOException, LoginFailedException, MediaWikiApiErrorException {
Map<String, String> params = new HashMap<>();
params.put(ApiConnection.PARAM_ACTION, "login");
params.put(ApiConnection.PARAM_LOGIN_USERNAME, username);
params... | [
"@",
"Deprecated",
"void",
"confirmLogin",
"(",
"String",
"token",
",",
"String",
"username",
",",
"String",
"password",
")",
"throws",
"IOException",
",",
"LoginFailedException",
",",
"MediaWikiApiErrorException",
"{",
"Map",
"<",
"String",
",",
"String",
">",
... | Issues a Web API query to confirm that the previous login attempt was
successful, and sets the internal state of the API connection accordingly
in this case.
@deprecated because it will be migrated to {@class PasswordApiConnection}.
@param token
the login token string
@param username
the name of the user that was log... | [
"Issues",
"a",
"Web",
"API",
"query",
"to",
"confirm",
"that",
"the",
"previous",
"login",
"attempt",
"was",
"successful",
"and",
"sets",
"the",
"internal",
"state",
"of",
"the",
"API",
"connection",
"accordingly",
"in",
"this",
"case",
"."
] | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/ApiConnection.java#L568-L593 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/locale/LocaleFormatter.java | LocaleFormatter.getFormattedPercent | @Nonnull
public static String getFormattedPercent (final double dValue, @Nonnull final Locale aDisplayLocale) {
"""
Format the given value as percentage. The "%" sign is automatically
appended according to the requested locale. The number of fractional digits
depend on the locale.
@param dValue
The value t... | java | @Nonnull
public static String getFormattedPercent (final double dValue, @Nonnull final Locale aDisplayLocale)
{
ValueEnforcer.notNull (aDisplayLocale, "DisplayLocale");
return NumberFormat.getPercentInstance (aDisplayLocale).format (dValue);
} | [
"@",
"Nonnull",
"public",
"static",
"String",
"getFormattedPercent",
"(",
"final",
"double",
"dValue",
",",
"@",
"Nonnull",
"final",
"Locale",
"aDisplayLocale",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aDisplayLocale",
",",
"\"DisplayLocale\"",
")",
";",
... | Format the given value as percentage. The "%" sign is automatically
appended according to the requested locale. The number of fractional digits
depend on the locale.
@param dValue
The value to be used. E.g. "0.125" will result in something like
"12.5%"
@param aDisplayLocale
The locale to use.
@return The non-<code>nul... | [
"Format",
"the",
"given",
"value",
"as",
"percentage",
".",
"The",
"%",
"sign",
"is",
"automatically",
"appended",
"according",
"to",
"the",
"requested",
"locale",
".",
"The",
"number",
"of",
"fractional",
"digits",
"depend",
"on",
"the",
"locale",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/locale/LocaleFormatter.java#L203-L209 |
thorstenwagner/TraJ | src/main/java/de/biomedical_imaging/traJ/TrajectoryUtil.java | TrajectoryUtil.concactTrajectorie | public static Trajectory concactTrajectorie(Trajectory a, Trajectory b) {
"""
Concatenates the trajectory a and b
@param a The end of this trajectory will be connected to the start of trajectory b
@param b The start of this trajectory will be connected to the end of trajectory a
@return Concatenated trajectory
... | java | public static Trajectory concactTrajectorie(Trajectory a, Trajectory b){
if(a.getDimension()!=b.getDimension()){
throw new IllegalArgumentException("Combination not possible: The trajectorys does not have the same dimension");
}
Trajectory c = new Trajectory(a.getDimension());
for(int i = 0 ; i < a.size()... | [
"public",
"static",
"Trajectory",
"concactTrajectorie",
"(",
"Trajectory",
"a",
",",
"Trajectory",
"b",
")",
"{",
"if",
"(",
"a",
".",
"getDimension",
"(",
")",
"!=",
"b",
".",
"getDimension",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Concatenates the trajectory a and b
@param a The end of this trajectory will be connected to the start of trajectory b
@param b The start of this trajectory will be connected to the end of trajectory a
@return Concatenated trajectory | [
"Concatenates",
"the",
"trajectory",
"a",
"and",
"b"
] | train | https://github.com/thorstenwagner/TraJ/blob/505fafb1f2f77a2d67bb2a089a2fdebe2c9bc7cb/src/main/java/de/biomedical_imaging/traJ/TrajectoryUtil.java#L71-L97 |
real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java | XmlSchemaParser.findTypes | public static Map<String, Type> findTypes(final Document document, final XPath xPath) throws Exception {
"""
Scan XML for all types (encodedDataType, compositeType, enumType, and setType) and save in map
@param document for the XML parsing
@param xPath for XPath expression reuse
@return {@link java.util.Ma... | java | public static Map<String, Type> findTypes(final Document document, final XPath xPath) throws Exception
{
final Map<String, Type> typeByNameMap = new HashMap<>();
typeByNameMap.put("char", new EncodedDataType("char", REQUIRED, null, null, CHAR, 1, false));
typeByNameMap.put("int8", new Encod... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Type",
">",
"findTypes",
"(",
"final",
"Document",
"document",
",",
"final",
"XPath",
"xPath",
")",
"throws",
"Exception",
"{",
"final",
"Map",
"<",
"String",
",",
"Type",
">",
"typeByNameMap",
"=",
"new",
... | Scan XML for all types (encodedDataType, compositeType, enumType, and setType) and save in map
@param document for the XML parsing
@param xPath for XPath expression reuse
@return {@link java.util.Map} of name {@link java.lang.String} to Type
@throws Exception on parsing error. | [
"Scan",
"XML",
"for",
"all",
"types",
"(",
"encodedDataType",
"compositeType",
"enumType",
"and",
"setType",
")",
"and",
"save",
"in",
"map"
] | train | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java#L180-L209 |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/impl/AmqpBuffer.java | AmqpBuffer.putMethodArguments | AmqpBuffer putMethodArguments(Object[] args, List<Parameter> formalParams) {
"""
Encodes arguments given a method's parameter list and the provided arguments
"""
for (int i = 0; i < formalParams.size(); i++)
{
String type = formalParams.get(i).type;
... | java | AmqpBuffer putMethodArguments(Object[] args, List<Parameter> formalParams)
{
for (int i = 0; i < formalParams.size(); i++)
{
String type = formalParams.get(i).type;
if (type == null)
{
throw new IllegalStateException("Unk... | [
"AmqpBuffer",
"putMethodArguments",
"(",
"Object",
"[",
"]",
"args",
",",
"List",
"<",
"Parameter",
">",
"formalParams",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"formalParams",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"St... | Encodes arguments given a method's parameter list and the provided arguments | [
"Encodes",
"arguments",
"given",
"a",
"method",
"s",
"parameter",
"list",
"and",
"the",
"provided",
"arguments"
] | train | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/impl/AmqpBuffer.java#L531-L550 |
alkacon/opencms-core | src/org/opencms/ui/CmsVaadinUtils.java | CmsVaadinUtils.showAlert | public static void showAlert(String title, String message, final Runnable callback) {
"""
Shows an alert box to the user with the given information, which will perform the given action after the user clicks on OK.<p>
@param title the title
@param message the message
@param callback the callback to execute a... | java | public static void showAlert(String title, String message, final Runnable callback) {
final Window window = new Window();
window.setModal(true);
Panel panel = new Panel();
panel.setCaption(title);
panel.setWidth("500px");
VerticalLayout layout = new VerticalLayout();
... | [
"public",
"static",
"void",
"showAlert",
"(",
"String",
"title",
",",
"String",
"message",
",",
"final",
"Runnable",
"callback",
")",
"{",
"final",
"Window",
"window",
"=",
"new",
"Window",
"(",
")",
";",
"window",
".",
"setModal",
"(",
"true",
")",
";",... | Shows an alert box to the user with the given information, which will perform the given action after the user clicks on OK.<p>
@param title the title
@param message the message
@param callback the callback to execute after clicking OK | [
"Shows",
"an",
"alert",
"box",
"to",
"the",
"user",
"with",
"the",
"given",
"information",
"which",
"will",
"perform",
"the",
"given",
"action",
"after",
"the",
"user",
"clicks",
"on",
"OK",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/CmsVaadinUtils.java#L1163-L1198 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/viewer/MapTileViewerModel.java | MapTileViewerModel.renderHorizontal | private void renderHorizontal(Graphic g, int ty, double viewY) {
"""
Render horizontal tiles.
@param g The graphic output.
@param ty The current vertical tile location.
@param viewY The vertical view offset.
"""
final int inTileWidth = (int) Math.ceil(viewer.getWidth() / (double) map.getTileWidth... | java | private void renderHorizontal(Graphic g, int ty, double viewY)
{
final int inTileWidth = (int) Math.ceil(viewer.getWidth() / (double) map.getTileWidth());
final int sx = (int) Math.floor((viewer.getX() + viewer.getViewX()) / map.getTileWidth());
final double viewX = viewer.getX();
... | [
"private",
"void",
"renderHorizontal",
"(",
"Graphic",
"g",
",",
"int",
"ty",
",",
"double",
"viewY",
")",
"{",
"final",
"int",
"inTileWidth",
"=",
"(",
"int",
")",
"Math",
".",
"ceil",
"(",
"viewer",
".",
"getWidth",
"(",
")",
"/",
"(",
"double",
")... | Render horizontal tiles.
@param g The graphic output.
@param ty The current vertical tile location.
@param viewY The vertical view offset. | [
"Render",
"horizontal",
"tiles",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/viewer/MapTileViewerModel.java#L97-L111 |
BlueBrain/bluima | modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/PipelineScriptParser.java | PipelineScriptParser.parsePython | private static void parsePython(IteratorWithPrevious<String> it,
Pipeline pipeline) throws ParseException {
"""
Parses inline, raw Python code and executes it with Jython
@return
"""
String script = "";
while (it.hasNext()) {
String current = it.next();
i... | java | private static void parsePython(IteratorWithPrevious<String> it,
Pipeline pipeline) throws ParseException {
String script = "";
while (it.hasNext()) {
String current = it.next();
if (StringUtils.isBlank(current))
break;
script += current +... | [
"private",
"static",
"void",
"parsePython",
"(",
"IteratorWithPrevious",
"<",
"String",
">",
"it",
",",
"Pipeline",
"pipeline",
")",
"throws",
"ParseException",
"{",
"String",
"script",
"=",
"\"\"",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"... | Parses inline, raw Python code and executes it with Jython
@return | [
"Parses",
"inline",
"raw",
"Python",
"code",
"and",
"executes",
"it",
"with",
"Jython"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_scripting/src/main/java/ch/epfl/bbp/uima/laucher/PipelineScriptParser.java#L211-L233 |
Hygieia/Hygieia | collectors/scm/github-graphql/src/main/java/com/capitalone/dashboard/collector/DefaultGitHubClient.java | DefaultGitHubClient.getDataFromRestCallPost | private JSONObject getDataFromRestCallPost(GitHubParsed gitHubParsed, GitHubRepo repo, String password, String personalAccessToken, JSONObject query) throws MalformedURLException, HygieiaException {
"""
Makes use of the graphQL endpoint, will not work for REST api
"""
ResponseEntity<String> response = ... | java | private JSONObject getDataFromRestCallPost(GitHubParsed gitHubParsed, GitHubRepo repo, String password, String personalAccessToken, JSONObject query) throws MalformedURLException, HygieiaException {
ResponseEntity<String> response = makeRestCallPost(gitHubParsed.getGraphQLUrl(), repo.getUserId(), password, pers... | [
"private",
"JSONObject",
"getDataFromRestCallPost",
"(",
"GitHubParsed",
"gitHubParsed",
",",
"GitHubRepo",
"repo",
",",
"String",
"password",
",",
"String",
"personalAccessToken",
",",
"JSONObject",
"query",
")",
"throws",
"MalformedURLException",
",",
"HygieiaException"... | Makes use of the graphQL endpoint, will not work for REST api | [
"Makes",
"use",
"of",
"the",
"graphQL",
"endpoint",
"will",
"not",
"work",
"for",
"REST",
"api"
] | train | https://github.com/Hygieia/Hygieia/blob/d8b67a590da2744acf59bcd99d9b34ef1bb84890/collectors/scm/github-graphql/src/main/java/com/capitalone/dashboard/collector/DefaultGitHubClient.java#L1059-L1095 |
square/dagger | core/src/main/java/dagger/internal/Keys.java | Keys.getBuiltInBindingsKey | static String getBuiltInBindingsKey(String key) {
"""
Returns a key for the type provided by, or injected by this key. For
example, if this is a key for a {@code Provider<Foo>}, this returns the
key for {@code Foo}. This retains annotations and supports both Provider
keys and MembersInjector keys.
"""
i... | java | static String getBuiltInBindingsKey(String key) {
int start = startOfType(key);
if (substringStartsWith(key, start, PROVIDER_PREFIX)) {
return extractKey(key, start, key.substring(0, start), PROVIDER_PREFIX);
} else if (substringStartsWith(key, start, MEMBERS_INJECTOR_PREFIX)) {
return extractKe... | [
"static",
"String",
"getBuiltInBindingsKey",
"(",
"String",
"key",
")",
"{",
"int",
"start",
"=",
"startOfType",
"(",
"key",
")",
";",
"if",
"(",
"substringStartsWith",
"(",
"key",
",",
"start",
",",
"PROVIDER_PREFIX",
")",
")",
"{",
"return",
"extractKey",
... | Returns a key for the type provided by, or injected by this key. For
example, if this is a key for a {@code Provider<Foo>}, this returns the
key for {@code Foo}. This retains annotations and supports both Provider
keys and MembersInjector keys. | [
"Returns",
"a",
"key",
"for",
"the",
"type",
"provided",
"by",
"or",
"injected",
"by",
"this",
"key",
".",
"For",
"example",
"if",
"this",
"is",
"a",
"key",
"for",
"a",
"{"
] | train | https://github.com/square/dagger/blob/572cdd2fe97fc3c148fb3d8e1b2ce7beb4dcbcde/core/src/main/java/dagger/internal/Keys.java#L180-L189 |
synchronoss/cpo-api | cpo-jdbc/src/main/java/org/synchronoss/cpo/transform/jdbc/TransformTimestampToCalendar.java | TransformTimestampToCalendar.transformOut | @Override
public Timestamp transformOut(JdbcPreparedStatementFactory jpsf, Calendar cal) throws CpoException {
"""
Transforms a
<code>java.util.Calendar</code> from the CPO Bean into a
<code>java.sql.Timestamp</code> to be stored by JDBC
@param jpsf a reference to the JdbcPreparedStatementFactory. This is n... | java | @Override
public Timestamp transformOut(JdbcPreparedStatementFactory jpsf, Calendar cal) throws CpoException {
Timestamp ts = null;
if (cal != null) {
ts = new Timestamp(cal.getTimeInMillis());
}
return ts;
} | [
"@",
"Override",
"public",
"Timestamp",
"transformOut",
"(",
"JdbcPreparedStatementFactory",
"jpsf",
",",
"Calendar",
"cal",
")",
"throws",
"CpoException",
"{",
"Timestamp",
"ts",
"=",
"null",
";",
"if",
"(",
"cal",
"!=",
"null",
")",
"{",
"ts",
"=",
"new",
... | Transforms a
<code>java.util.Calendar</code> from the CPO Bean into a
<code>java.sql.Timestamp</code> to be stored by JDBC
@param jpsf a reference to the JdbcPreparedStatementFactory. This is necessary as some DBMSs (ORACLE !#$%^&!) that
require access to the connection to deal with certain datatypes.
@param A Calenda... | [
"Transforms",
"a",
"<code",
">",
"java",
".",
"util",
".",
"Calendar<",
"/",
"code",
">",
"from",
"the",
"CPO",
"Bean",
"into",
"a",
"<code",
">",
"java",
".",
"sql",
".",
"Timestamp<",
"/",
"code",
">",
"to",
"be",
"stored",
"by",
"JDBC"
] | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/transform/jdbc/TransformTimestampToCalendar.java#L90-L97 |
contentful/contentful-management.java | src/main/java/com/contentful/java/cma/AbsModule.java | AbsModule.getResourceIdOrThrow | String getResourceIdOrThrow(CMAResource resource, String param) {
"""
Extracts the resource ID from the given {@code resource} of name {@code param}.
Throws {@link IllegalArgumentException} if the value is not present.
"""
final String resourceId = resource.getId();
if (resourceId == null) {
thr... | java | String getResourceIdOrThrow(CMAResource resource, String param) {
final String resourceId = resource.getId();
if (resourceId == null) {
throw new IllegalArgumentException(String.format(
"%s.setId() was not called.", param));
}
return resourceId;
} | [
"String",
"getResourceIdOrThrow",
"(",
"CMAResource",
"resource",
",",
"String",
"param",
")",
"{",
"final",
"String",
"resourceId",
"=",
"resource",
".",
"getId",
"(",
")",
";",
"if",
"(",
"resourceId",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgume... | Extracts the resource ID from the given {@code resource} of name {@code param}.
Throws {@link IllegalArgumentException} if the value is not present. | [
"Extracts",
"the",
"resource",
"ID",
"from",
"the",
"given",
"{"
] | train | https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/AbsModule.java#L71-L78 |
alkacon/opencms-core | src/org/opencms/relations/CmsExternalLinksValidator.java | CmsExternalLinksValidator.launch | public String launch(CmsObject cms, Map<String, String> parameters) throws CmsException {
"""
This method is called by the cron scheduler.<p>
@param cms a OpenCms context object
@param parameters link check parameters
@return the String that is written to the OpenCms log
@throws CmsException if something goe... | java | public String launch(CmsObject cms, Map<String, String> parameters) throws CmsException {
if (Boolean.valueOf(parameters.get("writeLog")).booleanValue()) {
m_report = new CmsLogReport(cms.getRequestContext().getLocale(), CmsExternalLinksValidator.class);
}
validateLinks(cms);
... | [
"public",
"String",
"launch",
"(",
"CmsObject",
"cms",
",",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"Boolean",
".",
"valueOf",
"(",
"parameters",
".",
"get",
"(",
"\"writeLog\"",
")",
")",
".... | This method is called by the cron scheduler.<p>
@param cms a OpenCms context object
@param parameters link check parameters
@return the String that is written to the OpenCms log
@throws CmsException if something goes wrong | [
"This",
"method",
"is",
"called",
"by",
"the",
"cron",
"scheduler",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/relations/CmsExternalLinksValidator.java#L109-L116 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF3.java | CommonOps_DDF3.fill | public static void fill( DMatrix3 a , double v ) {
"""
<p>
Sets every element in the vector to the specified value.<br>
<br>
a<sub>i</sub> = value
<p>
@param a A vector whose elements are about to be set. Modified.
@param v The value each element will have.
"""
a.a1 = v;
a.a2 = v;
... | java | public static void fill( DMatrix3 a , double v ) {
a.a1 = v;
a.a2 = v;
a.a3 = v;
} | [
"public",
"static",
"void",
"fill",
"(",
"DMatrix3",
"a",
",",
"double",
"v",
")",
"{",
"a",
".",
"a1",
"=",
"v",
";",
"a",
".",
"a2",
"=",
"v",
";",
"a",
".",
"a3",
"=",
"v",
";",
"}"
] | <p>
Sets every element in the vector to the specified value.<br>
<br>
a<sub>i</sub> = value
<p>
@param a A vector whose elements are about to be set. Modified.
@param v The value each element will have. | [
"<p",
">",
"Sets",
"every",
"element",
"in",
"the",
"vector",
"to",
"the",
"specified",
"value",
".",
"<br",
">",
"<br",
">",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"=",
"value",
"<p",
">"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF3.java#L1337-L1341 |
fernandospr/java-wns | src/main/java/ar/com/fernandospr/wns/WnsService.java | WnsService.pushToast | public List<WnsNotificationResponse> pushToast(List<String> channelUris, WnsToast toast) throws WnsException {
"""
Pushes a toast to channelUris
@param channelUris
@param toast which should be built with {@link ar.com.fernandospr.wns.model.builders.WnsToastBuilder}
@return list of WnsNotificationResponse for ea... | java | public List<WnsNotificationResponse> pushToast(List<String> channelUris, WnsToast toast) throws WnsException {
return this.pushToast(channelUris, null, toast);
} | [
"public",
"List",
"<",
"WnsNotificationResponse",
">",
"pushToast",
"(",
"List",
"<",
"String",
">",
"channelUris",
",",
"WnsToast",
"toast",
")",
"throws",
"WnsException",
"{",
"return",
"this",
".",
"pushToast",
"(",
"channelUris",
",",
"null",
",",
"toast",... | Pushes a toast to channelUris
@param channelUris
@param toast which should be built with {@link ar.com.fernandospr.wns.model.builders.WnsToastBuilder}
@return list of WnsNotificationResponse for each channelUri, please see response headers from <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465435.aspx... | [
"Pushes",
"a",
"toast",
"to",
"channelUris"
] | train | https://github.com/fernandospr/java-wns/blob/cd621b9c17d1e706f6284e0913531d834904a90d/src/main/java/ar/com/fernandospr/wns/WnsService.java#L145-L147 |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/CollectSerIteratorFactory.java | CollectSerIteratorFactory.createChild | @Override
public SerIterator createChild(final Object value, final SerIterator parent) {
"""
Creates an iterator wrapper for a value retrieved from a parent iterator.
<p>
Allows the parent iterator to define the child iterator using generic type information.
This handles cases such as a {@code List} as the ... | java | @Override
public SerIterator createChild(final Object value, final SerIterator parent) {
Class<?> declaredType = parent.valueType();
List<Class<?>> childGenericTypes = parent.valueTypeTypes();
if (value instanceof Grid) {
if (childGenericTypes.size() == 1) {
retur... | [
"@",
"Override",
"public",
"SerIterator",
"createChild",
"(",
"final",
"Object",
"value",
",",
"final",
"SerIterator",
"parent",
")",
"{",
"Class",
"<",
"?",
">",
"declaredType",
"=",
"parent",
".",
"valueType",
"(",
")",
";",
"List",
"<",
"Class",
"<",
... | Creates an iterator wrapper for a value retrieved from a parent iterator.
<p>
Allows the parent iterator to define the child iterator using generic type information.
This handles cases such as a {@code List} as the value in a {@code Map}.
@param value the possible collection-like object, not null
@param parent the p... | [
"Creates",
"an",
"iterator",
"wrapper",
"for",
"a",
"value",
"retrieved",
"from",
"a",
"parent",
"iterator",
".",
"<p",
">",
"Allows",
"the",
"parent",
"iterator",
"to",
"define",
"the",
"child",
"iterator",
"using",
"generic",
"type",
"information",
".",
"T... | train | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/CollectSerIteratorFactory.java#L63-L74 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/throttling/ThrottlingHttpService.java | ThrottlingHttpService.newDecorator | public static Function<Service<HttpRequest, HttpResponse>, ThrottlingHttpService>
newDecorator(ThrottlingStrategy<HttpRequest> strategy) {
"""
Creates a new decorator using the specified {@link ThrottlingStrategy} instance.
@param strategy The {@link ThrottlingStrategy} instance to be used
"""
r... | java | public static Function<Service<HttpRequest, HttpResponse>, ThrottlingHttpService>
newDecorator(ThrottlingStrategy<HttpRequest> strategy) {
requireNonNull(strategy, "strategy");
return delegate -> new ThrottlingHttpService(delegate, strategy);
} | [
"public",
"static",
"Function",
"<",
"Service",
"<",
"HttpRequest",
",",
"HttpResponse",
">",
",",
"ThrottlingHttpService",
">",
"newDecorator",
"(",
"ThrottlingStrategy",
"<",
"HttpRequest",
">",
"strategy",
")",
"{",
"requireNonNull",
"(",
"strategy",
",",
"\"st... | Creates a new decorator using the specified {@link ThrottlingStrategy} instance.
@param strategy The {@link ThrottlingStrategy} instance to be used | [
"Creates",
"a",
"new",
"decorator",
"using",
"the",
"specified",
"{",
"@link",
"ThrottlingStrategy",
"}",
"instance",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/throttling/ThrottlingHttpService.java#L39-L43 |
StefanLiebenberg/kute | kute-core/src/main/java/slieb/kute/Kute.java | Kute.outputStreamResource | public static OutputStreamResource outputStreamResource(final String path,
final SupplierWithThrowable<OutputStream, IOException> supplier) {
"""
Create resources from input stream.
@param supplier The input stream to supply content.
@param path T... | java | public static OutputStreamResource outputStreamResource(final String path,
final SupplierWithThrowable<OutputStream, IOException> supplier) {
return new OutputStreamResource(path, supplier);
} | [
"public",
"static",
"OutputStreamResource",
"outputStreamResource",
"(",
"final",
"String",
"path",
",",
"final",
"SupplierWithThrowable",
"<",
"OutputStream",
",",
"IOException",
">",
"supplier",
")",
"{",
"return",
"new",
"OutputStreamResource",
"(",
"path",
",",
... | Create resources from input stream.
@param supplier The input stream to supply content.
@param path The path name for this resource.
@return a readable resource that reads from provided input stream. | [
"Create",
"resources",
"from",
"input",
"stream",
"."
] | train | https://github.com/StefanLiebenberg/kute/blob/1db0e8d2c76459d22c7d4b0ba99c18f74748f6fd/kute-core/src/main/java/slieb/kute/Kute.java#L200-L203 |
qspin/qtaste | plugins_src/javagui-fx/src/main/java/com/qspin/qtaste/javaguifx/server/TabGetter.java | TabGetter.executeCommand | @Override
public String executeCommand(int timeout, String componentName, Object... data) throws QTasteException {
"""
Executes the a command on a component.
@param timeout a timeout for the command execution (not used here)
@param componentName name of the component to execute the command on.
@param data... | java | @Override
public String executeCommand(int timeout, String componentName, Object... data) throws QTasteException {
Node component = getComponentByName(componentName);
// sanity checks
if (component == null) {
throw new QTasteTestFailException("Unable to find the component named... | [
"@",
"Override",
"public",
"String",
"executeCommand",
"(",
"int",
"timeout",
",",
"String",
"componentName",
",",
"Object",
"...",
"data",
")",
"throws",
"QTasteException",
"{",
"Node",
"component",
"=",
"getComponentByName",
"(",
"componentName",
")",
";",
"//... | Executes the a command on a component.
@param timeout a timeout for the command execution (not used here)
@param componentName name of the component to execute the command on.
@param data additional data (not used here)
@return the selected tab index, title or id, according to the specified info selector.
@throws QTas... | [
"Executes",
"the",
"a",
"command",
"on",
"a",
"component",
"."
] | train | https://github.com/qspin/qtaste/blob/ba45d4d86eb29b92f157c6e98536dee2002ddfdc/plugins_src/javagui-fx/src/main/java/com/qspin/qtaste/javaguifx/server/TabGetter.java#L59-L100 |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java | TupleCombiner.assertApplicable | private void assertApplicable( FunctionInputDef inputDef) throws IllegalArgumentException {
"""
Throws an exception if any included/excluded variable pattern is not applicable to the given input definition.
"""
try
{
for( VarNamePattern varNamePattern : getIncludedVars())
{
asse... | java | private void assertApplicable( FunctionInputDef inputDef) throws IllegalArgumentException
{
try
{
for( VarNamePattern varNamePattern : getIncludedVars())
{
assertApplicable( inputDef, varNamePattern);
}
for( VarNamePattern varNamePattern : getExcludedVars())
{
... | [
"private",
"void",
"assertApplicable",
"(",
"FunctionInputDef",
"inputDef",
")",
"throws",
"IllegalArgumentException",
"{",
"try",
"{",
"for",
"(",
"VarNamePattern",
"varNamePattern",
":",
"getIncludedVars",
"(",
")",
")",
"{",
"assertApplicable",
"(",
"inputDef",
"... | Throws an exception if any included/excluded variable pattern is not applicable to the given input definition. | [
"Throws",
"an",
"exception",
"if",
"any",
"included",
"/",
"excluded",
"variable",
"pattern",
"is",
"not",
"applicable",
"to",
"the",
"given",
"input",
"definition",
"."
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/TupleCombiner.java#L472-L489 |
davidmarquis/fluent-interface-proxy | src/main/java/com/fluentinterface/beans/ObjectWrapper.java | ObjectWrapper.getIndexedValue | public Object getIndexedValue(String propertyName, int index) {
"""
Returns the value of the specified indexed property from the wrapped object.
@param propertyName the name of the indexed property whose value is to be extracted, cannot be {@code null}
@param index the index of the property value to be ... | java | public Object getIndexedValue(String propertyName, int index) {
return getIndexedValue(object, getPropertyOrThrow(bean, propertyName), index, this);
} | [
"public",
"Object",
"getIndexedValue",
"(",
"String",
"propertyName",
",",
"int",
"index",
")",
"{",
"return",
"getIndexedValue",
"(",
"object",
",",
"getPropertyOrThrow",
"(",
"bean",
",",
"propertyName",
")",
",",
"index",
",",
"this",
")",
";",
"}"
] | Returns the value of the specified indexed property from the wrapped object.
@param propertyName the name of the indexed property whose value is to be extracted, cannot be {@code null}
@param index the index of the property value to be extracted
@return the indexed property value
@throws ReflectionException ... | [
"Returns",
"the",
"value",
"of",
"the",
"specified",
"indexed",
"property",
"from",
"the",
"wrapped",
"object",
"."
] | train | https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/beans/ObjectWrapper.java#L237-L239 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java | TaskManagerService.storeTaskRecord | private TaskRecord storeTaskRecord(Tenant tenant, Task task) {
"""
Create a TaskRecord for the given task and write it to the Tasks table.
"""
DBTransaction dbTran = DBService.instance(tenant).startTransaction();
TaskRecord taskRecord = new TaskRecord(task.getTaskID());
Map<String, Stri... | java | private TaskRecord storeTaskRecord(Tenant tenant, Task task) {
DBTransaction dbTran = DBService.instance(tenant).startTransaction();
TaskRecord taskRecord = new TaskRecord(task.getTaskID());
Map<String, String> propMap = taskRecord.getProperties();
assert propMap.size() > 0 : "Need at le... | [
"private",
"TaskRecord",
"storeTaskRecord",
"(",
"Tenant",
"tenant",
",",
"Task",
"task",
")",
"{",
"DBTransaction",
"dbTran",
"=",
"DBService",
".",
"instance",
"(",
"tenant",
")",
".",
"startTransaction",
"(",
")",
";",
"TaskRecord",
"taskRecord",
"=",
"new"... | Create a TaskRecord for the given task and write it to the Tasks table. | [
"Create",
"a",
"TaskRecord",
"for",
"the",
"given",
"task",
"and",
"write",
"it",
"to",
"the",
"Tasks",
"table",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/taskmanager/TaskManagerService.java#L484-L494 |
facebookarchive/hadoop-20 | src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/datanode/AvatarDataNode.java | AvatarDataNode.instantiateDataNode | public static AvatarDataNode instantiateDataNode(String args[],
Configuration conf) throws IOException {
"""
Instantiate a single datanode object. This must be run by invoking
{@link DataNode#runDatanodeDaemon(DataNode)} subsequently.
"""
if (conf == null)
conf ... | java | public static AvatarDataNode instantiateDataNode(String args[],
Configuration conf) throws IOException {
if (conf == null)
conf = new Configuration();
if (!parseArguments(args, conf)) {
printUsage();
return null;
}
if (conf.get("dfs.network.script"... | [
"public",
"static",
"AvatarDataNode",
"instantiateDataNode",
"(",
"String",
"args",
"[",
"]",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"if",
"(",
"conf",
"==",
"null",
")",
"conf",
"=",
"new",
"Configuration",
"(",
")",
";",
"if",
"... | Instantiate a single datanode object. This must be run by invoking
{@link DataNode#runDatanodeDaemon(DataNode)} subsequently. | [
"Instantiate",
"a",
"single",
"datanode",
"object",
".",
"This",
"must",
"be",
"run",
"by",
"invoking",
"{"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/highavailability/src/java/org/apache/hadoop/hdfs/server/datanode/AvatarDataNode.java#L1261-L1276 |
alkacon/opencms-core | src/org/opencms/staticexport/CmsLinkManager.java | CmsLinkManager.getServerLink | public String getServerLink(CmsObject cms, String resourceName, boolean forceSecure) {
"""
Returns the link for the given resource in the current project, with full server prefix.<p>
Like <code>http://site.enterprise.com:8080/index.html</code>.<p>
In case the resource name is a full root path, the site from ... | java | public String getServerLink(CmsObject cms, String resourceName, boolean forceSecure) {
String result = substituteLinkForUnknownTarget(cms, resourceName, forceSecure);
return appendServerPrefix(cms, result, resourceName, false);
} | [
"public",
"String",
"getServerLink",
"(",
"CmsObject",
"cms",
",",
"String",
"resourceName",
",",
"boolean",
"forceSecure",
")",
"{",
"String",
"result",
"=",
"substituteLinkForUnknownTarget",
"(",
"cms",
",",
"resourceName",
",",
"forceSecure",
")",
";",
"return"... | Returns the link for the given resource in the current project, with full server prefix.<p>
Like <code>http://site.enterprise.com:8080/index.html</code>.<p>
In case the resource name is a full root path, the site from the root path will be used.
Otherwise the resource is assumed to be in the current site set be the O... | [
"Returns",
"the",
"link",
"for",
"the",
"given",
"resource",
"in",
"the",
"current",
"project",
"with",
"full",
"server",
"prefix",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsLinkManager.java#L582-L586 |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.config.1.1/src/com/ibm/ws/microprofile/config/impl/AbstractConfig.java | AbstractConfig.getValue | protected Object getValue(String propertyName, Type propertyType, boolean optional, String defaultString) {
"""
Get the converted value of the given property.
If the property is not found and optional is true then use the default string to create a value to return.
If the property is not found and optional is fa... | java | protected Object getValue(String propertyName, Type propertyType, boolean optional, String defaultString) {
Object value = null;
assertNotClosed();
SourcedValue sourced = getSourcedValue(propertyName, propertyType);
if (sourced != null) {
value = sourced.getValue();
... | [
"protected",
"Object",
"getValue",
"(",
"String",
"propertyName",
",",
"Type",
"propertyType",
",",
"boolean",
"optional",
",",
"String",
"defaultString",
")",
"{",
"Object",
"value",
"=",
"null",
";",
"assertNotClosed",
"(",
")",
";",
"SourcedValue",
"sourced",... | Get the converted value of the given property.
If the property is not found and optional is true then use the default string to create a value to return.
If the property is not found and optional is false then throw an exception.
@param propertyName the property to get
@param propertyType the type to convert to
@par... | [
"Get",
"the",
"converted",
"value",
"of",
"the",
"given",
"property",
".",
"If",
"the",
"property",
"is",
"not",
"found",
"and",
"optional",
"is",
"true",
"then",
"use",
"the",
"default",
"string",
"to",
"create",
"a",
"value",
"to",
"return",
".",
"If",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.config.1.1/src/com/ibm/ws/microprofile/config/impl/AbstractConfig.java#L164-L179 |
joniles/mpxj | src/main/java/net/sf/mpxj/json/JsonStreamWriter.java | JsonStreamWriter.writeNameValuePair | public void writeNameValuePair(String name, long value) throws IOException {
"""
Write a long attribute.
@param name attribute name
@param value attribute value
"""
internalWriteNameValuePair(name, Long.toString(value));
} | java | public void writeNameValuePair(String name, long value) throws IOException
{
internalWriteNameValuePair(name, Long.toString(value));
} | [
"public",
"void",
"writeNameValuePair",
"(",
"String",
"name",
",",
"long",
"value",
")",
"throws",
"IOException",
"{",
"internalWriteNameValuePair",
"(",
"name",
",",
"Long",
".",
"toString",
"(",
"value",
")",
")",
";",
"}"
] | Write a long attribute.
@param name attribute name
@param value attribute value | [
"Write",
"a",
"long",
"attribute",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/json/JsonStreamWriter.java#L162-L165 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java | FactoryMultiView.fundamental_1 | public static Estimate1ofEpipolar fundamental_1(EnumFundamental which, int numRemoveAmbiguity) {
"""
<p>
Similar to {@link #fundamental_N}, but it returns only a single hypothesis. If
the underlying algorithm generates multiple hypotheses they are resolved by considering additional
sample points. For example, ... | java | public static Estimate1ofEpipolar fundamental_1(EnumFundamental which, int numRemoveAmbiguity)
{
switch( which ) {
case LINEAR_8:
return new WrapFundamentalLinear8(true);
}
if( numRemoveAmbiguity <= 0 )
throw new IllegalArgumentException("numRemoveAmbiguity must be greater than zero");
EstimateNofE... | [
"public",
"static",
"Estimate1ofEpipolar",
"fundamental_1",
"(",
"EnumFundamental",
"which",
",",
"int",
"numRemoveAmbiguity",
")",
"{",
"switch",
"(",
"which",
")",
"{",
"case",
"LINEAR_8",
":",
"return",
"new",
"WrapFundamentalLinear8",
"(",
"true",
")",
";",
... | <p>
Similar to {@link #fundamental_N}, but it returns only a single hypothesis. If
the underlying algorithm generates multiple hypotheses they are resolved by considering additional
sample points. For example, if you are using the 7 point algorithm at least one additional sample point
is required to resolve that ambig... | [
"<p",
">",
"Similar",
"to",
"{",
"@link",
"#fundamental_N",
"}",
"but",
"it",
"returns",
"only",
"a",
"single",
"hypothesis",
".",
"If",
"the",
"underlying",
"algorithm",
"generates",
"multiple",
"hypotheses",
"they",
"are",
"resolved",
"by",
"considering",
"a... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/factory/geo/FactoryMultiView.java#L328-L342 |
jcuda/jcudnn | JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java | JCudnn.cudnnOpTensor | public static int cudnnOpTensor(
cudnnHandle handle,
cudnnOpTensorDescriptor opTensorDesc,
Pointer alpha1,
cudnnTensorDescriptor aDesc,
Pointer A,
Pointer alpha2,
cudnnTensorDescriptor bDesc,
Pointer B,
Pointer beta,
cudnnTensorDes... | java | public static int cudnnOpTensor(
cudnnHandle handle,
cudnnOpTensorDescriptor opTensorDesc,
Pointer alpha1,
cudnnTensorDescriptor aDesc,
Pointer A,
Pointer alpha2,
cudnnTensorDescriptor bDesc,
Pointer B,
Pointer beta,
cudnnTensorDes... | [
"public",
"static",
"int",
"cudnnOpTensor",
"(",
"cudnnHandle",
"handle",
",",
"cudnnOpTensorDescriptor",
"opTensorDesc",
",",
"Pointer",
"alpha1",
",",
"cudnnTensorDescriptor",
"aDesc",
",",
"Pointer",
"A",
",",
"Pointer",
"alpha2",
",",
"cudnnTensorDescriptor",
"bDe... | B tensor is ignored for CUDNN_OP_TENSOR_SQRT, CUDNN_OP_TENSOR_NOT. | [
"B",
"tensor",
"is",
"ignored",
"for",
"CUDNN_OP_TENSOR_SQRT",
"CUDNN_OP_TENSOR_NOT",
"."
] | train | https://github.com/jcuda/jcudnn/blob/ce71f2fc02817cecace51a80e6db5f0c7f10cffc/JCudnnJava/src/main/java/jcuda/jcudnn/JCudnn.java#L532-L546 |
javagl/CommonUI | src/main/java/de/javagl/common/ui/panel/collapsible/AccordionPanel.java | AccordionPanel.addToAccordion | public CollapsiblePanel addToAccordion(String title, JComponent component) {
"""
Add the given component to this accordion, wrapping it into a
collapsible panel with the given title.
@param title The title
@param component The component to add
@return The collapsible panel that has been created internally
... | java | public CollapsiblePanel addToAccordion(String title, JComponent component)
{
return addToAccordion(title, component, false);
} | [
"public",
"CollapsiblePanel",
"addToAccordion",
"(",
"String",
"title",
",",
"JComponent",
"component",
")",
"{",
"return",
"addToAccordion",
"(",
"title",
",",
"component",
",",
"false",
")",
";",
"}"
] | Add the given component to this accordion, wrapping it into a
collapsible panel with the given title.
@param title The title
@param component The component to add
@return The collapsible panel that has been created internally | [
"Add",
"the",
"given",
"component",
"to",
"this",
"accordion",
"wrapping",
"it",
"into",
"a",
"collapsible",
"panel",
"with",
"the",
"given",
"title",
"."
] | train | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/panel/collapsible/AccordionPanel.java#L97-L100 |
Alluxio/alluxio | core/common/src/main/java/alluxio/heartbeat/HeartbeatScheduler.java | HeartbeatScheduler.await | public static void await(String name, long time, TimeUnit unit) throws InterruptedException {
"""
Waits until the given thread can be executed, throwing an unchecked exception of the given
timeout expires.
@param name a name of the thread to wait for
@param time the maximum time to wait
@param unit the time ... | java | public static void await(String name, long time, TimeUnit unit) throws InterruptedException {
try (LockResource r = new LockResource(sLock)) {
while (!sTimers.containsKey(name)) {
if (!sCondition.await(time, unit)) {
throw new RuntimeException(
"Timed out waiting for thread " +... | [
"public",
"static",
"void",
"await",
"(",
"String",
"name",
",",
"long",
"time",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
"{",
"try",
"(",
"LockResource",
"r",
"=",
"new",
"LockResource",
"(",
"sLock",
")",
")",
"{",
"while",
"(",
... | Waits until the given thread can be executed, throwing an unchecked exception of the given
timeout expires.
@param name a name of the thread to wait for
@param time the maximum time to wait
@param unit the time unit of the {@code time} argument
@throws InterruptedException if the waiting thread is interrupted | [
"Waits",
"until",
"the",
"given",
"thread",
"can",
"be",
"executed",
"throwing",
"an",
"unchecked",
"exception",
"of",
"the",
"given",
"timeout",
"expires",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/heartbeat/HeartbeatScheduler.java#L143-L152 |
nmorel/gwt-jackson | gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/stream/impl/DefaultJsonWriter.java | DefaultJsonWriter.open | private DefaultJsonWriter open(int empty, String openBracket) {
"""
Enters a new scope by appending any necessary whitespace and the given
bracket.
"""
beforeValue(true);
push(empty);
out.append(openBracket);
return this;
} | java | private DefaultJsonWriter open(int empty, String openBracket) {
beforeValue(true);
push(empty);
out.append(openBracket);
return this;
} | [
"private",
"DefaultJsonWriter",
"open",
"(",
"int",
"empty",
",",
"String",
"openBracket",
")",
"{",
"beforeValue",
"(",
"true",
")",
";",
"push",
"(",
"empty",
")",
";",
"out",
".",
"append",
"(",
"openBracket",
")",
";",
"return",
"this",
";",
"}"
] | Enters a new scope by appending any necessary whitespace and the given
bracket. | [
"Enters",
"a",
"new",
"scope",
"by",
"appending",
"any",
"necessary",
"whitespace",
"and",
"the",
"given",
"bracket",
"."
] | train | https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/client/stream/impl/DefaultJsonWriter.java#L276-L281 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Client.java | GrafeasV1Beta1Client.createNote | public final Note createNote(ProjectName parent, String noteId, Note note) {
"""
Creates a new note.
<p>Sample code:
<pre><code>
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
String noteId = "";
Note note = Note.newBuil... | java | public final Note createNote(ProjectName parent, String noteId, Note note) {
CreateNoteRequest request =
CreateNoteRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setNoteId(noteId)
.setNote(note)
.build();
return createNote(req... | [
"public",
"final",
"Note",
"createNote",
"(",
"ProjectName",
"parent",
",",
"String",
"noteId",
",",
"Note",
"note",
")",
"{",
"CreateNoteRequest",
"request",
"=",
"CreateNoteRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"parent",
"==",
"null",... | Creates a new note.
<p>Sample code:
<pre><code>
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
String noteId = "";
Note note = Note.newBuilder().build();
Note response = grafeasV1Beta1Client.createNote(parent, noteId, note);
}
</code... | [
"Creates",
"a",
"new",
"note",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Client.java#L1287-L1296 |
google/closure-templates | java/src/com/google/template/soy/jssrc/internal/GenJsCodeVisitor.java | GenJsCodeVisitor.addCodeToDeclareGoogModule | private void addCodeToDeclareGoogModule(StringBuilder header, SoyFileNode soyFile) {
"""
Helper for visitSoyFileNode(SoyFileNode) to generate a module definition.
@param header
@param soyFile The node we're visiting.
"""
String exportNamespace = getGoogModuleNamespace(soyFile.getNamespace());
heade... | java | private void addCodeToDeclareGoogModule(StringBuilder header, SoyFileNode soyFile) {
String exportNamespace = getGoogModuleNamespace(soyFile.getNamespace());
header.append("goog.module('").append(exportNamespace).append("');\n\n");
} | [
"private",
"void",
"addCodeToDeclareGoogModule",
"(",
"StringBuilder",
"header",
",",
"SoyFileNode",
"soyFile",
")",
"{",
"String",
"exportNamespace",
"=",
"getGoogModuleNamespace",
"(",
"soyFile",
".",
"getNamespace",
"(",
")",
")",
";",
"header",
".",
"append",
... | Helper for visitSoyFileNode(SoyFileNode) to generate a module definition.
@param header
@param soyFile The node we're visiting. | [
"Helper",
"for",
"visitSoyFileNode",
"(",
"SoyFileNode",
")",
"to",
"generate",
"a",
"module",
"definition",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/internal/GenJsCodeVisitor.java#L526-L529 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ExpandedNameTable.java | ExpandedNameTable.initExtendedTypes | private void initExtendedTypes() {
"""
Initialize the vector of extended types with the
basic DOM node types.
"""
m_extendedTypes = new ExtendedType[m_initialSize];
for (int i = 0; i < DTM.NTYPES; i++) {
m_extendedTypes[i] = m_defaultExtendedTypes[i];
m_table[i] = new HashEntry(m_d... | java | private void initExtendedTypes()
{
m_extendedTypes = new ExtendedType[m_initialSize];
for (int i = 0; i < DTM.NTYPES; i++) {
m_extendedTypes[i] = m_defaultExtendedTypes[i];
m_table[i] = new HashEntry(m_defaultExtendedTypes[i], i, i, null);
}
m_nextType = DTM.NTYPES;
} | [
"private",
"void",
"initExtendedTypes",
"(",
")",
"{",
"m_extendedTypes",
"=",
"new",
"ExtendedType",
"[",
"m_initialSize",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"DTM",
".",
"NTYPES",
";",
"i",
"++",
")",
"{",
"m_extendedTypes",
"[... | Initialize the vector of extended types with the
basic DOM node types. | [
"Initialize",
"the",
"vector",
"of",
"extended",
"types",
"with",
"the",
"basic",
"DOM",
"node",
"types",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/dtm/ref/ExpandedNameTable.java#L133-L142 |
devnied/EMV-NFC-Paycard-Enrollment | library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java | EmvParser.extractPublicData | protected boolean extractPublicData(final Application pApplication) throws CommunicationException {
"""
Read public card data from parameter AID
@param pApplication
application data
@return true if succeed false otherwise
@throws CommunicationException communication error
"""
boolean ret = false;
// ... | java | protected boolean extractPublicData(final Application pApplication) throws CommunicationException {
boolean ret = false;
// Select AID
byte[] data = selectAID(pApplication.getAid());
// check response
// Add SW_6285 to fix Interact issue
if (ResponseUtils.contains(data, SwEnum.SW_9000, SwEnum.SW_6285)) {
... | [
"protected",
"boolean",
"extractPublicData",
"(",
"final",
"Application",
"pApplication",
")",
"throws",
"CommunicationException",
"{",
"boolean",
"ret",
"=",
"false",
";",
"// Select AID",
"byte",
"[",
"]",
"data",
"=",
"selectAID",
"(",
"pApplication",
".",
"get... | Read public card data from parameter AID
@param pApplication
application data
@return true if succeed false otherwise
@throws CommunicationException communication error | [
"Read",
"public",
"card",
"data",
"from",
"parameter",
"AID"
] | train | https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/impl/EmvParser.java#L96-L126 |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/MutableBigInteger.java | MutableBigInteger.divide2n1n | private MutableBigInteger divide2n1n(MutableBigInteger b, MutableBigInteger quotient) {
"""
This method implements algorithm 1 from pg. 4 of the Burnikel-Ziegler paper.
It divides a 2n-digit number by a n-digit number.<br/>
The parameter beta is 2<sup>32</sup> so all shifts are multiples of 32 bits.
<br/>
{@co... | java | private MutableBigInteger divide2n1n(MutableBigInteger b, MutableBigInteger quotient) {
int n = b.intLen;
// step 1: base case
if (n%2 != 0 || n < BigInteger.BURNIKEL_ZIEGLER_THRESHOLD) {
return divideKnuth(b, quotient);
}
// step 2: view this as [a1,a2,a3,a4] where... | [
"private",
"MutableBigInteger",
"divide2n1n",
"(",
"MutableBigInteger",
"b",
",",
"MutableBigInteger",
"quotient",
")",
"{",
"int",
"n",
"=",
"b",
".",
"intLen",
";",
"// step 1: base case",
"if",
"(",
"n",
"%",
"2",
"!=",
"0",
"||",
"n",
"<",
"BigInteger",
... | This method implements algorithm 1 from pg. 4 of the Burnikel-Ziegler paper.
It divides a 2n-digit number by a n-digit number.<br/>
The parameter beta is 2<sup>32</sup> so all shifts are multiples of 32 bits.
<br/>
{@code this} must be a nonnegative number such that {@code this.bitLength() <= 2*b.bitLength()}
@param b ... | [
"This",
"method",
"implements",
"algorithm",
"1",
"from",
"pg",
".",
"4",
"of",
"the",
"Burnikel",
"-",
"Ziegler",
"paper",
".",
"It",
"divides",
"a",
"2n",
"-",
"digit",
"number",
"by",
"a",
"n",
"-",
"digit",
"number",
".",
"<br",
"/",
">",
"The",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/MutableBigInteger.java#L1310-L1334 |
vladmihalcea/flexy-pool | flexy-pool-core/src/main/java/com/vladmihalcea/flexypool/util/ReflectionUtils.java | ReflectionUtils.getSetter | public static Method getSetter(Object target, String property, Class<?> parameterType) {
"""
Get setter method
@param target target object
@param property property
@param parameterType setter parameter type
@return setter method
"""
String setterMethodName = SETTER_PREFIX + property.s... | java | public static Method getSetter(Object target, String property, Class<?> parameterType) {
String setterMethodName = SETTER_PREFIX + property.substring(0, 1).toUpperCase() + property.substring(1);
return getMethod(target, setterMethodName, parameterType);
} | [
"public",
"static",
"Method",
"getSetter",
"(",
"Object",
"target",
",",
"String",
"property",
",",
"Class",
"<",
"?",
">",
"parameterType",
")",
"{",
"String",
"setterMethodName",
"=",
"SETTER_PREFIX",
"+",
"property",
".",
"substring",
"(",
"0",
",",
"1",
... | Get setter method
@param target target object
@param property property
@param parameterType setter parameter type
@return setter method | [
"Get",
"setter",
"method"
] | train | https://github.com/vladmihalcea/flexy-pool/blob/d763d359e68299c2b4e28e4b67770581ae083431/flexy-pool-core/src/main/java/com/vladmihalcea/flexypool/util/ReflectionUtils.java#L109-L112 |
eurekaclinical/protempa | protempa-framework/src/main/java/org/protempa/ExtendedPropositionDefinition.java | ExtendedPropositionDefinition.getMatches | boolean getMatches(Proposition proposition, Collection<String> propIds) throws KnowledgeSourceReadException {
"""
Returns whether a proposition has the same id and value, and consistent
duration as specified by this extended parameter definition.
@param proposition
a <code>Proposition</code>
@return <code>tr... | java | boolean getMatches(Proposition proposition, Collection<String> propIds) throws KnowledgeSourceReadException {
if (proposition == null) {
return false;
} else {
String pId = proposition.getId();
if (this.propositionId != null && !propIds.contains(pId)) {
... | [
"boolean",
"getMatches",
"(",
"Proposition",
"proposition",
",",
"Collection",
"<",
"String",
">",
"propIds",
")",
"throws",
"KnowledgeSourceReadException",
"{",
"if",
"(",
"proposition",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"else",
"{",
"Strin... | Returns whether a proposition has the same id and value, and consistent
duration as specified by this extended parameter definition.
@param proposition
a <code>Proposition</code>
@return <code>true</code> if <code>proposition</code> has the same id and
value, consistent duration, and property values that match any
pro... | [
"Returns",
"whether",
"a",
"proposition",
"has",
"the",
"same",
"id",
"and",
"value",
"and",
"consistent",
"duration",
"as",
"specified",
"by",
"this",
"extended",
"parameter",
"definition",
"."
] | train | https://github.com/eurekaclinical/protempa/blob/5a620d1a407c7a5426d1cf17d47b97717cf71634/protempa-framework/src/main/java/org/protempa/ExtendedPropositionDefinition.java#L88-L105 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_statistics_disk_disk_GET | public OvhRtmDisk serviceName_statistics_disk_disk_GET(String serviceName, String disk) throws IOException {
"""
Get this object properties
REST: GET /dedicated/server/{serviceName}/statistics/disk/{disk}
@param serviceName [required] The internal name of your dedicated server
@param disk [required] Disk
... | java | public OvhRtmDisk serviceName_statistics_disk_disk_GET(String serviceName, String disk) throws IOException {
String qPath = "/dedicated/server/{serviceName}/statistics/disk/{disk}";
StringBuilder sb = path(qPath, serviceName, disk);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, O... | [
"public",
"OvhRtmDisk",
"serviceName_statistics_disk_disk_GET",
"(",
"String",
"serviceName",
",",
"String",
"disk",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/{serviceName}/statistics/disk/{disk}\"",
";",
"StringBuilder",
"sb",
"=",
"pa... | Get this object properties
REST: GET /dedicated/server/{serviceName}/statistics/disk/{disk}
@param serviceName [required] The internal name of your dedicated server
@param disk [required] Disk | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L1360-L1365 |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java | HttpConversionUtil.toHttp2Headers | public static Http2Headers toHttp2Headers(HttpMessage in, boolean validateHeaders) {
"""
Converts the given HTTP/1.x headers into HTTP/2 headers.
The following headers are only used if they can not be found in from the {@code HOST} header or the
{@code Request-Line} as defined by <a href="https://tools.ietf.org/... | java | public static Http2Headers toHttp2Headers(HttpMessage in, boolean validateHeaders) {
HttpHeaders inHeaders = in.headers();
final Http2Headers out = new DefaultHttp2Headers(validateHeaders, inHeaders.size());
if (in instanceof HttpRequest) {
HttpRequest request = (HttpRequest) in;
... | [
"public",
"static",
"Http2Headers",
"toHttp2Headers",
"(",
"HttpMessage",
"in",
",",
"boolean",
"validateHeaders",
")",
"{",
"HttpHeaders",
"inHeaders",
"=",
"in",
".",
"headers",
"(",
")",
";",
"final",
"Http2Headers",
"out",
"=",
"new",
"DefaultHttp2Headers",
... | Converts the given HTTP/1.x headers into HTTP/2 headers.
The following headers are only used if they can not be found in from the {@code HOST} header or the
{@code Request-Line} as defined by <a href="https://tools.ietf.org/html/rfc7230">rfc7230</a>
<ul>
<li>{@link ExtensionHeaderNames#SCHEME}</li>
</ul>
{@link Extensi... | [
"Converts",
"the",
"given",
"HTTP",
"/",
"1",
".",
"x",
"headers",
"into",
"HTTP",
"/",
"2",
"headers",
".",
"The",
"following",
"headers",
"are",
"only",
"used",
"if",
"they",
"can",
"not",
"be",
"found",
"in",
"from",
"the",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/HttpConversionUtil.java#L389-L412 |
geomajas/geomajas-project-client-gwt2 | plugin/editing/common/src/main/java/org/geomajas/plugin/editing/client/service/GeometryIndexService.java | GeometryIndexService.addChildren | public GeometryIndex addChildren(GeometryIndex index, GeometryIndexType type, int... values) {
"""
Given a certain geometry index, add more levels to it (This method will not change the underlying geometry !).
@param index The index to start out from.
@param type Add more levels to it, where the deepest level ... | java | public GeometryIndex addChildren(GeometryIndex index, GeometryIndexType type, int... values) {
return fromDelegate(delegate.addChildren(toDelegate(index), toDelegate(type), values));
} | [
"public",
"GeometryIndex",
"addChildren",
"(",
"GeometryIndex",
"index",
",",
"GeometryIndexType",
"type",
",",
"int",
"...",
"values",
")",
"{",
"return",
"fromDelegate",
"(",
"delegate",
".",
"addChildren",
"(",
"toDelegate",
"(",
"index",
")",
",",
"toDelegat... | Given a certain geometry index, add more levels to it (This method will not change the underlying geometry !).
@param index The index to start out from.
@param type Add more levels to it, where the deepest level should be of this type.
@param values A list of integer values that determine the indices on each level in ... | [
"Given",
"a",
"certain",
"geometry",
"index",
"add",
"more",
"levels",
"to",
"it",
"(",
"This",
"method",
"will",
"not",
"change",
"the",
"underlying",
"geometry",
"!",
")",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/plugin/editing/common/src/main/java/org/geomajas/plugin/editing/client/service/GeometryIndexService.java#L61-L63 |
rabbitmq/hop | src/main/java/com/rabbitmq/http/client/Client.java | Client.deleteShovel | public void deleteShovel(String vhost, String shovelname) {
"""
Deletes the specified shovel from specified virtual host.
@param vhost virtual host from where to delete the shovel
@param shovelname Shovel to be deleted.
"""
this.deleteIgnoring404(uriWithPath("./parameters/shovel/" + encodePathSegment(... | java | public void deleteShovel(String vhost, String shovelname) {
this.deleteIgnoring404(uriWithPath("./parameters/shovel/" + encodePathSegment(vhost) + "/" + encodePathSegment(shovelname)));
} | [
"public",
"void",
"deleteShovel",
"(",
"String",
"vhost",
",",
"String",
"shovelname",
")",
"{",
"this",
".",
"deleteIgnoring404",
"(",
"uriWithPath",
"(",
"\"./parameters/shovel/\"",
"+",
"encodePathSegment",
"(",
"vhost",
")",
"+",
"\"/\"",
"+",
"encodePathSegme... | Deletes the specified shovel from specified virtual host.
@param vhost virtual host from where to delete the shovel
@param shovelname Shovel to be deleted. | [
"Deletes",
"the",
"specified",
"shovel",
"from",
"specified",
"virtual",
"host",
"."
] | train | https://github.com/rabbitmq/hop/blob/94e70f1f7e39f523a11ab3162b4efc976311ee03/src/main/java/com/rabbitmq/http/client/Client.java#L827-L829 |
kohsuke/jcifs | src/jcifs/smb/SigningDigest.java | SigningDigest.verify | boolean verify(byte[] data, int offset, ServerMessageBlock response) {
"""
Performs MAC signature verification. This calculates the signature
of the SMB and compares it to the signature field on the SMB itself.
@param data The data.
@param offset The starting offset at which the SMB header begins.
@param le... | java | boolean verify(byte[] data, int offset, ServerMessageBlock response) {
update(macSigningKey, 0, macSigningKey.length);
int index = offset;
update(data, index, ServerMessageBlock.SIGNATURE_OFFSET);
index += ServerMessageBlock.SIGNATURE_OFFSET;
byte[] sequence = new byte[8]; ... | [
"boolean",
"verify",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"ServerMessageBlock",
"response",
")",
"{",
"update",
"(",
"macSigningKey",
",",
"0",
",",
"macSigningKey",
".",
"length",
")",
";",
"int",
"index",
"=",
"offset",
";",
"updat... | Performs MAC signature verification. This calculates the signature
of the SMB and compares it to the signature field on the SMB itself.
@param data The data.
@param offset The starting offset at which the SMB header begins.
@param length The length of the SMB data starting at offset. | [
"Performs",
"MAC",
"signature",
"verification",
".",
"This",
"calculates",
"the",
"signature",
"of",
"the",
"SMB",
"and",
"compares",
"it",
"to",
"the",
"signature",
"field",
"on",
"the",
"SMB",
"itself",
"."
] | train | https://github.com/kohsuke/jcifs/blob/7751f4e4826c35614d237a70c2582553f95b58de/src/jcifs/smb/SigningDigest.java#L158-L191 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.deleteSecretAsync | public ServiceFuture<DeletedSecretBundle> deleteSecretAsync(String vaultBaseUrl, String secretName, final ServiceCallback<DeletedSecretBundle> serviceCallback) {
"""
Deletes a secret from a specified key vault.
The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an in... | java | public ServiceFuture<DeletedSecretBundle> deleteSecretAsync(String vaultBaseUrl, String secretName, final ServiceCallback<DeletedSecretBundle> serviceCallback) {
return ServiceFuture.fromResponse(deleteSecretWithServiceResponseAsync(vaultBaseUrl, secretName), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"DeletedSecretBundle",
">",
"deleteSecretAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"secretName",
",",
"final",
"ServiceCallback",
"<",
"DeletedSecretBundle",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture",
".",
... | Deletes a secret from a specified key vault.
The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version of a secret. This operation requires the secrets/delete permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@para... | [
"Deletes",
"a",
"secret",
"from",
"a",
"specified",
"key",
"vault",
".",
"The",
"DELETE",
"operation",
"applies",
"to",
"any",
"secret",
"stored",
"in",
"Azure",
"Key",
"Vault",
".",
"DELETE",
"cannot",
"be",
"applied",
"to",
"an",
"individual",
"version",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L3545-L3547 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/BigIntegerExtensions.java | BigIntegerExtensions.operator_power | @Inline(value="$1.pow($2)")
@Pure
public static BigInteger operator_power(BigInteger a, int exponent) {
"""
The <code>power</code> operator.
@param a
a BigInteger. May not be <code>null</code>.
@param exponent
the exponent.
@return <code>a.pow(b)</code>
@throws NullPointerException
if {@code a} <code>nu... | java | @Inline(value="$1.pow($2)")
@Pure
public static BigInteger operator_power(BigInteger a, int exponent) {
return a.pow(exponent);
} | [
"@",
"Inline",
"(",
"value",
"=",
"\"$1.pow($2)\"",
")",
"@",
"Pure",
"public",
"static",
"BigInteger",
"operator_power",
"(",
"BigInteger",
"a",
",",
"int",
"exponent",
")",
"{",
"return",
"a",
".",
"pow",
"(",
"exponent",
")",
";",
"}"
] | The <code>power</code> operator.
@param a
a BigInteger. May not be <code>null</code>.
@param exponent
the exponent.
@return <code>a.pow(b)</code>
@throws NullPointerException
if {@code a} <code>null</code>. | [
"The",
"<code",
">",
"power<",
"/",
"code",
">",
"operator",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/BigIntegerExtensions.java#L82-L86 |
Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/webhook/WebhookBuilder.java | WebhookBuilder.setAvatar | public WebhookBuilder setAvatar(BufferedImage avatar, String fileType) {
"""
Sets the avatar.
@param avatar The avatar to set.
@param fileType The type of the avatar, e.g. "png" or "jpg".
@return The current instance in order to chain call methods.
"""
delegate.setAvatar(avatar, fileType);
... | java | public WebhookBuilder setAvatar(BufferedImage avatar, String fileType) {
delegate.setAvatar(avatar, fileType);
return this;
} | [
"public",
"WebhookBuilder",
"setAvatar",
"(",
"BufferedImage",
"avatar",
",",
"String",
"fileType",
")",
"{",
"delegate",
".",
"setAvatar",
"(",
"avatar",
",",
"fileType",
")",
";",
"return",
"this",
";",
"}"
] | Sets the avatar.
@param avatar The avatar to set.
@param fileType The type of the avatar, e.g. "png" or "jpg".
@return The current instance in order to chain call methods. | [
"Sets",
"the",
"avatar",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/webhook/WebhookBuilder.java#L74-L77 |
jenkinsci/github-plugin | src/main/java/org/jenkinsci/plugins/github/status/sources/misc/AnyBuildResult.java | AnyBuildResult.onAnyResult | public static AnyBuildResult onAnyResult(GHCommitState state, String msg) {
"""
@param state state to set
@param msg message to set. Can contain env vars
@return new instance of this conditional result
"""
AnyBuildResult cond = new AnyBuildResult();
cond.setState(state.name());
co... | java | public static AnyBuildResult onAnyResult(GHCommitState state, String msg) {
AnyBuildResult cond = new AnyBuildResult();
cond.setState(state.name());
cond.setMessage(msg);
return cond;
} | [
"public",
"static",
"AnyBuildResult",
"onAnyResult",
"(",
"GHCommitState",
"state",
",",
"String",
"msg",
")",
"{",
"AnyBuildResult",
"cond",
"=",
"new",
"AnyBuildResult",
"(",
")",
";",
"cond",
".",
"setState",
"(",
"state",
".",
"name",
"(",
")",
")",
";... | @param state state to set
@param msg message to set. Can contain env vars
@return new instance of this conditional result | [
"@param",
"state",
"state",
"to",
"set",
"@param",
"msg",
"message",
"to",
"set",
".",
"Can",
"contain",
"env",
"vars"
] | train | https://github.com/jenkinsci/github-plugin/blob/4e05b9aeb488af5342c78f78aa3c55114e8d462a/src/main/java/org/jenkinsci/plugins/github/status/sources/misc/AnyBuildResult.java#L37-L42 |
sebastiangraf/treetank | interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/algorithm/fmes/ConnectionMap.java | ConnectionMap.get | public boolean get(final T paramOrigin, final T paramDestination) {
"""
Returns whether there is a connection between a and b. Unknown objects do
never have a connection.
@param paramOrigin
origin object
@param paramDestination
destination object
@return true, iff there is a connection from a to b
"""
... | java | public boolean get(final T paramOrigin, final T paramDestination) {
assert paramOrigin != null;
assert paramDestination != null;
if (!mMap.containsKey(paramOrigin)) {
return false;
}
final Boolean bool = mMap.get(paramOrigin).get(paramDestination);
return boo... | [
"public",
"boolean",
"get",
"(",
"final",
"T",
"paramOrigin",
",",
"final",
"T",
"paramDestination",
")",
"{",
"assert",
"paramOrigin",
"!=",
"null",
";",
"assert",
"paramDestination",
"!=",
"null",
";",
"if",
"(",
"!",
"mMap",
".",
"containsKey",
"(",
"pa... | Returns whether there is a connection between a and b. Unknown objects do
never have a connection.
@param paramOrigin
origin object
@param paramDestination
destination object
@return true, iff there is a connection from a to b | [
"Returns",
"whether",
"there",
"is",
"a",
"connection",
"between",
"a",
"and",
"b",
".",
"Unknown",
"objects",
"do",
"never",
"have",
"a",
"connection",
"."
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/algorithm/fmes/ConnectionMap.java#L94-L103 |
apache/incubator-heron | heron/scheduler-core/src/java/org/apache/heron/scheduler/SchedulerMain.java | SchedulerMain.getServer | protected SchedulerServer getServer(
Config runtime, IScheduler scheduler, int port) throws IOException {
"""
Get the http server for receiving scheduler requests
@param runtime the runtime configuration
@param scheduler an instance of the scheduler
@param port the port for scheduler to listen on
@retu... | java | protected SchedulerServer getServer(
Config runtime, IScheduler scheduler, int port) throws IOException {
// create an instance of the server using scheduler class and port
return new SchedulerServer(runtime, scheduler, port);
} | [
"protected",
"SchedulerServer",
"getServer",
"(",
"Config",
"runtime",
",",
"IScheduler",
"scheduler",
",",
"int",
"port",
")",
"throws",
"IOException",
"{",
"// create an instance of the server using scheduler class and port",
"return",
"new",
"SchedulerServer",
"(",
"runt... | Get the http server for receiving scheduler requests
@param runtime the runtime configuration
@param scheduler an instance of the scheduler
@param port the port for scheduler to listen on
@return an instance of the http server | [
"Get",
"the",
"http",
"server",
"for",
"receiving",
"scheduler",
"requests"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/scheduler-core/src/java/org/apache/heron/scheduler/SchedulerMain.java#L324-L329 |
gresrun/jesque | src/main/java/net/greghaines/jesque/utils/ReflectionUtils.java | ReflectionUtils.createObject | public static <T> T createObject(final Class<T> clazz, final Object... args) throws NoSuchConstructorException,
AmbiguousConstructorException, ReflectiveOperationException {
"""
Create an object of the given type using a constructor that matches the
supplied arguments.
@param <T> the object type
@... | java | public static <T> T createObject(final Class<T> clazz, final Object... args) throws NoSuchConstructorException,
AmbiguousConstructorException, ReflectiveOperationException {
return findConstructor(clazz, args).newInstance(args);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"createObject",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
",",
"final",
"Object",
"...",
"args",
")",
"throws",
"NoSuchConstructorException",
",",
"AmbiguousConstructorException",
",",
"ReflectiveOperationException",
"{... | Create an object of the given type using a constructor that matches the
supplied arguments.
@param <T> the object type
@param clazz
the type to create
@param args
the arguments to the constructor
@return a new object of the given type, initialized with the given
arguments
@throws NoSuchConstructorException
if there is... | [
"Create",
"an",
"object",
"of",
"the",
"given",
"type",
"using",
"a",
"constructor",
"that",
"matches",
"the",
"supplied",
"arguments",
"."
] | train | https://github.com/gresrun/jesque/blob/44749183dccc40962a94c2af547ea7d0d880b5d1/src/main/java/net/greghaines/jesque/utils/ReflectionUtils.java#L118-L121 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/TitlePaneMenuButtonPainter.java | TitlePaneMenuButtonPainter.decodeInterior | private Shape decodeInterior(int width, int height) {
"""
Create the button interior shape
@param width the width.
@param height the height.
@return the shape of the button interior.
"""
path.reset();
path.moveTo(1, 1);
path.lineTo(width - 2, 1);
path.lineTo(width - 2,... | java | private Shape decodeInterior(int width, int height) {
path.reset();
path.moveTo(1, 1);
path.lineTo(width - 2, 1);
path.lineTo(width - 2, height - 3);
path.lineTo(width - 3, height - 2);
path.lineTo(3, height - 2);
path.lineTo(2, height - 3);
path.closePath... | [
"private",
"Shape",
"decodeInterior",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"path",
".",
"reset",
"(",
")",
";",
"path",
".",
"moveTo",
"(",
"1",
",",
"1",
")",
";",
"path",
".",
"lineTo",
"(",
"width",
"-",
"2",
",",
"1",
")",
"... | Create the button interior shape
@param width the width.
@param height the height.
@return the shape of the button interior. | [
"Create",
"the",
"button",
"interior",
"shape"
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/TitlePaneMenuButtonPainter.java#L197-L208 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/osgi/AbstractActivator.java | AbstractActivator.extractBundleContent | protected void extractBundleContent(String bundleRootPath, String toDirRoot) throws IOException {
"""
Extracts content from the bundle to a directory.
<p>
Sub-class calls this method to extract all or part of bundle's content to
a directory on disk.
</p>
<p>
Note: bundle's content will be extracted to a ... | java | protected void extractBundleContent(String bundleRootPath, String toDirRoot) throws IOException {
File toDir = new File(toDirRoot);
if (!toDir.isDirectory()) {
throw new RuntimeException("[" + toDir.getAbsolutePath()
+ "] is not a valid directory or does not exist!");
... | [
"protected",
"void",
"extractBundleContent",
"(",
"String",
"bundleRootPath",
",",
"String",
"toDirRoot",
")",
"throws",
"IOException",
"{",
"File",
"toDir",
"=",
"new",
"File",
"(",
"toDirRoot",
")",
";",
"if",
"(",
"!",
"toDir",
".",
"isDirectory",
"(",
")... | Extracts content from the bundle to a directory.
<p>
Sub-class calls this method to extract all or part of bundle's content to
a directory on disk.
</p>
<p>
Note: bundle's content will be extracted to a sub-directory
<code>toDirRoot/bundle_symbolic_name/bundle_version/</code>
</p>
@param bundleRootPath
bundle's cont... | [
"Extracts",
"content",
"from",
"the",
"bundle",
"to",
"a",
"directory",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/osgi/AbstractActivator.java#L105-L122 |
sundrio/sundrio | annotations/builder/src/main/java/io/sundr/builder/internal/functions/Descendants.java | Descendants.isDescendant | public static boolean isDescendant(TypeDef item, TypeDef candidate) {
"""
Checks if a type is an descendant of an other type
@param item The base type.
@param candidate The candidate type.
@return true if candidate is a descendant of base type.
"""
if (item == null || candidate == null) {
... | java | public static boolean isDescendant(TypeDef item, TypeDef candidate) {
if (item == null || candidate == null) {
return false;
} else if (candidate.isAssignableFrom(item)) {
return true;
}
return false;
} | [
"public",
"static",
"boolean",
"isDescendant",
"(",
"TypeDef",
"item",
",",
"TypeDef",
"candidate",
")",
"{",
"if",
"(",
"item",
"==",
"null",
"||",
"candidate",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"else",
"if",
"(",
"candidate",
".",
... | Checks if a type is an descendant of an other type
@param item The base type.
@param candidate The candidate type.
@return true if candidate is a descendant of base type. | [
"Checks",
"if",
"a",
"type",
"is",
"an",
"descendant",
"of",
"an",
"other",
"type"
] | train | https://github.com/sundrio/sundrio/blob/4e38368f4db0d950f7c41a8c75e15b0baff1f69a/annotations/builder/src/main/java/io/sundr/builder/internal/functions/Descendants.java#L152-L159 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ApplicationGatewaysInner.java | ApplicationGatewaysInner.beginCreateOrUpdateAsync | public Observable<ApplicationGatewayInner> beginCreateOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) {
"""
Creates or updates the specified application gateway.
@param resourceGroupName The name of the resource group.
@param applicationGatewayName The... | java | public Observable<ApplicationGatewayInner> beginCreateOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).map(new Func1<ServiceResponse<ApplicationGa... | [
"public",
"Observable",
"<",
"ApplicationGatewayInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"applicationGatewayName",
",",
"ApplicationGatewayInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
... | Creates or updates the specified application gateway.
@param resourceGroupName The name of the resource group.
@param applicationGatewayName The name of the application gateway.
@param parameters Parameters supplied to the create or update application gateway operation.
@throws IllegalArgumentException thrown if param... | [
"Creates",
"or",
"updates",
"the",
"specified",
"application",
"gateway",
"."
] | 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/ApplicationGatewaysInner.java#L508-L515 |
aalmiray/Json-lib | src/main/java/net/sf/json/JSONArray.java | JSONArray.addValue | private JSONArray addValue( Object value, JsonConfig jsonConfig ) {
"""
Append an object value. This increases the array's length by one.
@param value An object value. The value should be a Boolean, Double,
Integer, JSONArray, JSONObject, JSONFunction, Long, String,
JSONString or the JSONNull object.
@return... | java | private JSONArray addValue( Object value, JsonConfig jsonConfig ) {
return _addValue( processValue( value, jsonConfig ), jsonConfig );
} | [
"private",
"JSONArray",
"addValue",
"(",
"Object",
"value",
",",
"JsonConfig",
"jsonConfig",
")",
"{",
"return",
"_addValue",
"(",
"processValue",
"(",
"value",
",",
"jsonConfig",
")",
",",
"jsonConfig",
")",
";",
"}"
] | Append an object value. This increases the array's length by one.
@param value An object value. The value should be a Boolean, Double,
Integer, JSONArray, JSONObject, JSONFunction, Long, String,
JSONString or the JSONNull object.
@return this. | [
"Append",
"an",
"object",
"value",
".",
"This",
"increases",
"the",
"array",
"s",
"length",
"by",
"one",
"."
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONArray.java#L2347-L2349 |
knowm/XChange | xchange-dsx/src/main/java/org/knowm/xchange/dsx/service/core/DSXMarketDataServiceCore.java | DSXMarketDataServiceCore.getTrades | @Override
public Trades getTrades(CurrencyPair currencyPair, Object... args) throws IOException {
"""
Get recent trades from exchange
@param currencyPair
@param args Optional arguments. Exchange-specific. This implementation assumes args[0] is
integer value
@return Trades object
@throws IOException
""... | java | @Override
public Trades getTrades(CurrencyPair currencyPair, Object... args) throws IOException {
String marketName = DSXAdapters.currencyPairToMarketName(currencyPair);
int numberOfItems = -1;
try {
if (args != null) {
numberOfItems =
(Integer)
args[0]; // can ... | [
"@",
"Override",
"public",
"Trades",
"getTrades",
"(",
"CurrencyPair",
"currencyPair",
",",
"Object",
"...",
"args",
")",
"throws",
"IOException",
"{",
"String",
"marketName",
"=",
"DSXAdapters",
".",
"currencyPairToMarketName",
"(",
"currencyPair",
")",
";",
"int... | Get recent trades from exchange
@param currencyPair
@param args Optional arguments. Exchange-specific. This implementation assumes args[0] is
integer value
@return Trades object
@throws IOException | [
"Get",
"recent",
"trades",
"from",
"exchange"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-dsx/src/main/java/org/knowm/xchange/dsx/service/core/DSXMarketDataServiceCore.java#L100-L133 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/redis/Cache.java | Cache.pexpireAt | public Long pexpireAt(Object key, long millisecondsTimestamp) {
"""
这个命令和 EXPIREAT 命令类似,但它以毫秒为单位设置 key 的过期 unix 时间戳,而不是像 EXPIREAT 那样,以秒为单位。
"""
Jedis jedis = getJedis();
try {
return jedis.pexpireAt(keyToBytes(key), millisecondsTimestamp);
}
finally {close(jedis);}
} | java | public Long pexpireAt(Object key, long millisecondsTimestamp) {
Jedis jedis = getJedis();
try {
return jedis.pexpireAt(keyToBytes(key), millisecondsTimestamp);
}
finally {close(jedis);}
} | [
"public",
"Long",
"pexpireAt",
"(",
"Object",
"key",
",",
"long",
"millisecondsTimestamp",
")",
"{",
"Jedis",
"jedis",
"=",
"getJedis",
"(",
")",
";",
"try",
"{",
"return",
"jedis",
".",
"pexpireAt",
"(",
"keyToBytes",
"(",
"key",
")",
",",
"millisecondsTi... | 这个命令和 EXPIREAT 命令类似,但它以毫秒为单位设置 key 的过期 unix 时间戳,而不是像 EXPIREAT 那样,以秒为单位。 | [
"这个命令和",
"EXPIREAT",
"命令类似,但它以毫秒为单位设置",
"key",
"的过期",
"unix",
"时间戳,而不是像",
"EXPIREAT",
"那样,以秒为单位。"
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/redis/Cache.java#L351-L357 |
zerodhatech/javakiteconnect | kiteconnect/src/com/zerodhatech/ticker/KiteTicker.java | KiteTicker.getQuoteData | private Tick getQuoteData(byte[] bin, int x, int dec1) {
"""
Get quote data (last traded price, last traded quantity, average traded price, volume, total bid(buy quantity), total ask(sell quantity), open, high, low, close.)
"""
Tick tick2 = new Tick();
tick2.setMode(modeQuote);
tick2.se... | java | private Tick getQuoteData(byte[] bin, int x, int dec1){
Tick tick2 = new Tick();
tick2.setMode(modeQuote);
tick2.setInstrumentToken(x);
double lastTradedPrice = convertToDouble(getBytes(bin, 4, 8)) / dec1;
tick2.setLastTradedPrice(lastTradedPrice);
tick2.setLastTradedQuan... | [
"private",
"Tick",
"getQuoteData",
"(",
"byte",
"[",
"]",
"bin",
",",
"int",
"x",
",",
"int",
"dec1",
")",
"{",
"Tick",
"tick2",
"=",
"new",
"Tick",
"(",
")",
";",
"tick2",
".",
"setMode",
"(",
"modeQuote",
")",
";",
"tick2",
".",
"setInstrumentToken... | Get quote data (last traded price, last traded quantity, average traded price, volume, total bid(buy quantity), total ask(sell quantity), open, high, low, close.) | [
"Get",
"quote",
"data",
"(",
"last",
"traded",
"price",
"last",
"traded",
"quantity",
"average",
"traded",
"price",
"volume",
"total",
"bid",
"(",
"buy",
"quantity",
")",
"total",
"ask",
"(",
"sell",
"quantity",
")",
"open",
"high",
"low",
"close",
".",
... | train | https://github.com/zerodhatech/javakiteconnect/blob/4a3f15ff2c8a1b3b6ec61799f8bb047e4dfeb92d/kiteconnect/src/com/zerodhatech/ticker/KiteTicker.java#L513-L531 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassTree.java | ClassTree.subs | public List<ClassDoc> subs(ClassDoc cd, boolean isEnum) {
"""
Return the sub-class/interface list for the class/interface passed.
@param cd class/interface whose sub-class/interface list is required.
@param isEnum true if the subclasses should be forced to come from the
enum tree.
"""
if (isEnum) ... | java | public List<ClassDoc> subs(ClassDoc cd, boolean isEnum) {
if (isEnum) {
return get(subEnums, cd);
} else if (cd.isAnnotationType()) {
return get(subAnnotationTypes, cd);
} else if (cd.isInterface()) {
return get(subinterfaces, cd);
} else if (cd.isClas... | [
"public",
"List",
"<",
"ClassDoc",
">",
"subs",
"(",
"ClassDoc",
"cd",
",",
"boolean",
"isEnum",
")",
"{",
"if",
"(",
"isEnum",
")",
"{",
"return",
"get",
"(",
"subEnums",
",",
"cd",
")",
";",
"}",
"else",
"if",
"(",
"cd",
".",
"isAnnotationType",
... | Return the sub-class/interface list for the class/interface passed.
@param cd class/interface whose sub-class/interface list is required.
@param isEnum true if the subclasses should be forced to come from the
enum tree. | [
"Return",
"the",
"sub",
"-",
"class",
"/",
"interface",
"list",
"for",
"the",
"class",
"/",
"interface",
"passed",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassTree.java#L316-L329 |
pebble/pebble-android-sdk | PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/util/PebbleDictionary.java | PebbleDictionary.addUint8 | public void addUint8(final int key, final byte b) {
"""
Associate the specified unsigned byte with the provided key in the dictionary. If another key-value pair with the
same key is already present in the dictionary, it will be replaced.
@param key
key with which the specified value is associated
@param b
v... | java | public void addUint8(final int key, final byte b) {
PebbleTuple t = PebbleTuple.create(key, PebbleTuple.TupleType.UINT, PebbleTuple.Width.BYTE, b);
addTuple(t);
} | [
"public",
"void",
"addUint8",
"(",
"final",
"int",
"key",
",",
"final",
"byte",
"b",
")",
"{",
"PebbleTuple",
"t",
"=",
"PebbleTuple",
".",
"create",
"(",
"key",
",",
"PebbleTuple",
".",
"TupleType",
".",
"UINT",
",",
"PebbleTuple",
".",
"Width",
".",
... | Associate the specified unsigned byte with the provided key in the dictionary. If another key-value pair with the
same key is already present in the dictionary, it will be replaced.
@param key
key with which the specified value is associated
@param b
value to be associated with the specified key | [
"Associate",
"the",
"specified",
"unsigned",
"byte",
"with",
"the",
"provided",
"key",
"in",
"the",
"dictionary",
".",
"If",
"another",
"key",
"-",
"value",
"pair",
"with",
"the",
"same",
"key",
"is",
"already",
"present",
"in",
"the",
"dictionary",
"it",
... | train | https://github.com/pebble/pebble-android-sdk/blob/ddfc53ecf3950deebb62a1f205aa21fbe9bce45d/PebbleKit/PebbleKit/src/main/java/com/getpebble/android/kit/util/PebbleDictionary.java#L121-L124 |
graknlabs/grakn | server/src/graql/exception/GraqlQueryException.java | GraqlQueryException.insertMultipleProperties | public static GraqlQueryException insertMultipleProperties(
Statement varPattern, String property, Object value1, Object value2
) {
"""
Thrown when a concept is inserted with multiple properties when it can only have one.
<p>
For example: {@code insert $x isa movie; $x isa person;}
</p>
"""
... | java | public static GraqlQueryException insertMultipleProperties(
Statement varPattern, String property, Object value1, Object value2
) {
String message = "a concept `%s` cannot have multiple properties `%s` and `%s` for `%s`";
return create(message, varPattern, value1, value2, property);
... | [
"public",
"static",
"GraqlQueryException",
"insertMultipleProperties",
"(",
"Statement",
"varPattern",
",",
"String",
"property",
",",
"Object",
"value1",
",",
"Object",
"value2",
")",
"{",
"String",
"message",
"=",
"\"a concept `%s` cannot have multiple properties `%s` and... | Thrown when a concept is inserted with multiple properties when it can only have one.
<p>
For example: {@code insert $x isa movie; $x isa person;}
</p> | [
"Thrown",
"when",
"a",
"concept",
"is",
"inserted",
"with",
"multiple",
"properties",
"when",
"it",
"can",
"only",
"have",
"one",
".",
"<p",
">",
"For",
"example",
":",
"{"
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/graql/exception/GraqlQueryException.java#L144-L149 |
Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESClient.java | ESClient.executeQuery | public List executeQuery(QueryBuilder filter, AggregationBuilder aggregation, final EntityMetadata entityMetadata,
KunderaQuery query, int firstResult, int maxResults) {
"""
Execute query.
@param filter
the filter
@param aggregation
the aggregation
@param entityMetadata
the entity metadata
@pa... | java | public List executeQuery(QueryBuilder filter, AggregationBuilder aggregation, final EntityMetadata entityMetadata,
KunderaQuery query, int firstResult, int maxResults)
{
String[] fieldsToSelect = query.getResult();
Class clazz = entityMetadata.getEntityClazz();
MetamodelImpl met... | [
"public",
"List",
"executeQuery",
"(",
"QueryBuilder",
"filter",
",",
"AggregationBuilder",
"aggregation",
",",
"final",
"EntityMetadata",
"entityMetadata",
",",
"KunderaQuery",
"query",
",",
"int",
"firstResult",
",",
"int",
"maxResults",
")",
"{",
"String",
"[",
... | Execute query.
@param filter
the filter
@param aggregation
the aggregation
@param entityMetadata
the entity metadata
@param query
the query
@param firstResult
the first result
@param maxResults
the max results
@return the list | [
"Execute",
"query",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESClient.java#L313-L363 |
Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainersInner.java | ProtectionContainersInner.unregisterAsync | public Observable<Void> unregisterAsync(String resourceGroupName, String vaultName, String identityName) {
"""
Unregisters the given container from your Recovery Services vault.
@param resourceGroupName The name of the resource group associated with the Recovery Services vault.
@param vaultName The name of the... | java | public Observable<Void> unregisterAsync(String resourceGroupName, String vaultName, String identityName) {
return unregisterWithServiceResponseAsync(resourceGroupName, vaultName, identityName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void>... | [
"public",
"Observable",
"<",
"Void",
">",
"unregisterAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vaultName",
",",
"String",
"identityName",
")",
"{",
"return",
"unregisterWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vaultName",
",",
"iden... | Unregisters the given container from your Recovery Services vault.
@param resourceGroupName The name of the resource group associated with the Recovery Services vault.
@param vaultName The name of the Recovery Services vault.
@param identityName Name of the protection container to unregister.
@throws IllegalArgumentEx... | [
"Unregisters",
"the",
"given",
"container",
"from",
"your",
"Recovery",
"Services",
"vault",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2016_06_01/implementation/ProtectionContainersInner.java#L484-L491 |
vkostyukov/la4j | src/main/java/org/la4j/Matrices.java | Matrices.asModFunction | public static MatrixFunction asModFunction(final double arg) {
"""
Creates a mod function that calculates the modulus of it's argument and given {@code value}.
@param arg a divisor value
@return a closure that does {@code _ % _}
"""
return new MatrixFunction() {
@Override
... | java | public static MatrixFunction asModFunction(final double arg) {
return new MatrixFunction() {
@Override
public double evaluate(int i, int j, double value) {
return value % arg;
}
};
} | [
"public",
"static",
"MatrixFunction",
"asModFunction",
"(",
"final",
"double",
"arg",
")",
"{",
"return",
"new",
"MatrixFunction",
"(",
")",
"{",
"@",
"Override",
"public",
"double",
"evaluate",
"(",
"int",
"i",
",",
"int",
"j",
",",
"double",
"value",
")"... | Creates a mod function that calculates the modulus of it's argument and given {@code value}.
@param arg a divisor value
@return a closure that does {@code _ % _} | [
"Creates",
"a",
"mod",
"function",
"that",
"calculates",
"the",
"modulus",
"of",
"it",
"s",
"argument",
"and",
"given",
"{",
"@code",
"value",
"}",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Matrices.java#L503-L510 |
eurekaclinical/javautil | src/main/java/org/arp/javautil/arrays/Arrays.java | Arrays.matrixCopy | public static void matrixCopy(Object[][] src, Object[][] dest) {
"""
Copies a 2D array. Nothing happens if either argument is
<code>null</code>.
@param src an array.
@param dest an array.
"""
if (src != null && dest != null) {
for (int i = 0; i < src.length; i++) {
Syst... | java | public static void matrixCopy(Object[][] src, Object[][] dest) {
if (src != null && dest != null) {
for (int i = 0; i < src.length; i++) {
System.arraycopy(src[i], 0, dest[i], 0, src[i].length);
}
}
} | [
"public",
"static",
"void",
"matrixCopy",
"(",
"Object",
"[",
"]",
"[",
"]",
"src",
",",
"Object",
"[",
"]",
"[",
"]",
"dest",
")",
"{",
"if",
"(",
"src",
"!=",
"null",
"&&",
"dest",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
"... | Copies a 2D array. Nothing happens if either argument is
<code>null</code>.
@param src an array.
@param dest an array. | [
"Copies",
"a",
"2D",
"array",
".",
"Nothing",
"happens",
"if",
"either",
"argument",
"is",
"<code",
">",
"null<",
"/",
"code",
">",
"."
] | train | https://github.com/eurekaclinical/javautil/blob/779bbc5bf096c75f8eed4f99ca45b99c1d44df43/src/main/java/org/arp/javautil/arrays/Arrays.java#L49-L55 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java | Ftp.download | public void download(String path, String fileName, OutputStream out) {
"""
下载文件到输出流
@param path 文件路径
@param fileName 文件名
@param out 输出位置
"""
cd(path);
try {
client.setFileType(FTPClient.BINARY_FILE_TYPE);
client.retrieveFile(fileName, out);
} catch (IOException e) {
throw new FtpExcep... | java | public void download(String path, String fileName, OutputStream out) {
cd(path);
try {
client.setFileType(FTPClient.BINARY_FILE_TYPE);
client.retrieveFile(fileName, out);
} catch (IOException e) {
throw new FtpException(e);
}
} | [
"public",
"void",
"download",
"(",
"String",
"path",
",",
"String",
"fileName",
",",
"OutputStream",
"out",
")",
"{",
"cd",
"(",
"path",
")",
";",
"try",
"{",
"client",
".",
"setFileType",
"(",
"FTPClient",
".",
"BINARY_FILE_TYPE",
")",
";",
"client",
".... | 下载文件到输出流
@param path 文件路径
@param fileName 文件名
@param out 输出位置 | [
"下载文件到输出流"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java#L468-L476 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/UtilChecksum.java | UtilChecksum.checkSha | public static boolean checkSha(String value, String signature) {
"""
Compare a checksum with its supposed original value.
@param value The original value (must not be <code>null</code>).
@param signature The checksum value (must not be <code>null</code>).
@return <code>true</code> if corresponding (checksum o... | java | public static boolean checkSha(String value, String signature)
{
Check.notNull(signature);
return Arrays.equals(getSha(value).getBytes(StandardCharsets.UTF_8),
signature.getBytes(StandardCharsets.UTF_8));
} | [
"public",
"static",
"boolean",
"checkSha",
"(",
"String",
"value",
",",
"String",
"signature",
")",
"{",
"Check",
".",
"notNull",
"(",
"signature",
")",
";",
"return",
"Arrays",
".",
"equals",
"(",
"getSha",
"(",
"value",
")",
".",
"getBytes",
"(",
"Stan... | Compare a checksum with its supposed original value.
@param value The original value (must not be <code>null</code>).
@param signature The checksum value (must not be <code>null</code>).
@return <code>true</code> if corresponding (checksum of value is equal to its signature), <code>false</code>
else.
@throws LionEngin... | [
"Compare",
"a",
"checksum",
"with",
"its",
"supposed",
"original",
"value",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/UtilChecksum.java#L49-L55 |
google/flogger | api/src/main/java/com/google/common/flogger/backend/FormatOptions.java | FormatOptions.parseValidFlags | static int parseValidFlags(String flagChars, boolean hasUpperVariant) {
"""
Internal helper method for creating a bit-mask from a string of valid flag characters.
"""
int flags = hasUpperVariant ? FLAG_UPPER_CASE : 0;
for (int i = 0; i < flagChars.length(); i++) {
int flagIdx = indexOfFlagCharact... | java | static int parseValidFlags(String flagChars, boolean hasUpperVariant) {
int flags = hasUpperVariant ? FLAG_UPPER_CASE : 0;
for (int i = 0; i < flagChars.length(); i++) {
int flagIdx = indexOfFlagCharacter(flagChars.charAt(i));
if (flagIdx < 0) {
throw new IllegalArgumentException("invalid fl... | [
"static",
"int",
"parseValidFlags",
"(",
"String",
"flagChars",
",",
"boolean",
"hasUpperVariant",
")",
"{",
"int",
"flags",
"=",
"hasUpperVariant",
"?",
"FLAG_UPPER_CASE",
":",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"flagChars",
".",
... | Internal helper method for creating a bit-mask from a string of valid flag characters. | [
"Internal",
"helper",
"method",
"for",
"creating",
"a",
"bit",
"-",
"mask",
"from",
"a",
"string",
"of",
"valid",
"flag",
"characters",
"."
] | train | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/backend/FormatOptions.java#L245-L255 |
netty/netty | buffer/src/main/java/io/netty/buffer/ByteBufUtil.java | ByteBufUtil.prettyHexDump | public static String prettyHexDump(ByteBuf buffer) {
"""
Returns a multi-line hexadecimal dump of the specified {@link ByteBuf} that is easy to read by humans.
"""
return prettyHexDump(buffer, buffer.readerIndex(), buffer.readableBytes());
} | java | public static String prettyHexDump(ByteBuf buffer) {
return prettyHexDump(buffer, buffer.readerIndex(), buffer.readableBytes());
} | [
"public",
"static",
"String",
"prettyHexDump",
"(",
"ByteBuf",
"buffer",
")",
"{",
"return",
"prettyHexDump",
"(",
"buffer",
",",
"buffer",
".",
"readerIndex",
"(",
")",
",",
"buffer",
".",
"readableBytes",
"(",
")",
")",
";",
"}"
] | Returns a multi-line hexadecimal dump of the specified {@link ByteBuf} that is easy to read by humans. | [
"Returns",
"a",
"multi",
"-",
"line",
"hexadecimal",
"dump",
"of",
"the",
"specified",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/ByteBufUtil.java#L910-L912 |
couchbase/couchbase-jvm-core | src/main/java/com/couchbase/client/core/message/query/GenericQueryRequest.java | GenericQueryRequest.simpleStatement | public static GenericQueryRequest simpleStatement(String statement, String bucket, String password) {
"""
Creates a {@link GenericQueryRequest} and mark it as containing a single simple statement
(e.g. "SELECT * FROM default").
@param statement the N1QL query statement to perform.
@param bucket the bucket on ... | java | public static GenericQueryRequest simpleStatement(String statement, String bucket, String password) {
return new GenericQueryRequest(statement, false, bucket, bucket, password, null,
null, null);
} | [
"public",
"static",
"GenericQueryRequest",
"simpleStatement",
"(",
"String",
"statement",
",",
"String",
"bucket",
",",
"String",
"password",
")",
"{",
"return",
"new",
"GenericQueryRequest",
"(",
"statement",
",",
"false",
",",
"bucket",
",",
"bucket",
",",
"pa... | Creates a {@link GenericQueryRequest} and mark it as containing a single simple statement
(e.g. "SELECT * FROM default").
@param statement the N1QL query statement to perform.
@param bucket the bucket on which to search.
@param password the password for the target bucket.
@return a {@link GenericQueryRequest} for this... | [
"Creates",
"a",
"{",
"@link",
"GenericQueryRequest",
"}",
"and",
"mark",
"it",
"as",
"containing",
"a",
"single",
"simple",
"statement",
"(",
"e",
".",
"g",
".",
"SELECT",
"*",
"FROM",
"default",
")",
"."
] | train | https://github.com/couchbase/couchbase-jvm-core/blob/97f0427112c2168fee1d6499904f5fa0e24c6797/src/main/java/com/couchbase/client/core/message/query/GenericQueryRequest.java#L91-L94 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.