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 |
|---|---|---|---|---|---|---|---|---|---|---|
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java | DataStream.assignTimestampsAndWatermarks | public SingleOutputStreamOperator<T> assignTimestampsAndWatermarks(
AssignerWithPeriodicWatermarks<T> timestampAndWatermarkAssigner) {
"""
Assigns timestamps to the elements in the data stream and periodically creates
watermarks to signal event time progress.
<p>This method creates watermarks periodically (... | java | public SingleOutputStreamOperator<T> assignTimestampsAndWatermarks(
AssignerWithPeriodicWatermarks<T> timestampAndWatermarkAssigner) {
// match parallelism to input, otherwise dop=1 sources could lead to some strange
// behaviour: the watermark will creep along very slowly because the elements
// from the sou... | [
"public",
"SingleOutputStreamOperator",
"<",
"T",
">",
"assignTimestampsAndWatermarks",
"(",
"AssignerWithPeriodicWatermarks",
"<",
"T",
">",
"timestampAndWatermarkAssigner",
")",
"{",
"// match parallelism to input, otherwise dop=1 sources could lead to some strange",
"// behaviour: t... | Assigns timestamps to the elements in the data stream and periodically creates
watermarks to signal event time progress.
<p>This method creates watermarks periodically (for example every second), based
on the watermarks indicated by the given watermark generator. Even when no new elements
in the stream arrive, the giv... | [
"Assigns",
"timestamps",
"to",
"the",
"elements",
"in",
"the",
"data",
"stream",
"and",
"periodically",
"creates",
"watermarks",
"to",
"signal",
"event",
"time",
"progress",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java#L883-L897 |
Whiley/WhileyCompiler | src/main/java/wyil/transform/VerificationConditionGenerator.java | VerificationConditionGenerator.invertCondition | public Expr invertCondition(Expr expr, WyilFile.Expr elem) {
"""
Generate the logically inverted expression corresponding to a given
comparator. For example, inverting "<=" gives ">", inverting "==" gives "!=",
etc.
@param test
--- the binary comparator being inverted.
@return
"""
if (expr instanceof ... | java | public Expr invertCondition(Expr expr, WyilFile.Expr elem) {
if (expr instanceof Expr.Operator) {
Expr.Operator binTest = (Expr.Operator) expr;
switch (binTest.getOpcode()) {
case WyalFile.EXPR_eq:
return new Expr.NotEqual(binTest.getAll());
case WyalFile.EXPR_neq:
return new Expr.Equal(binTest.ge... | [
"public",
"Expr",
"invertCondition",
"(",
"Expr",
"expr",
",",
"WyilFile",
".",
"Expr",
"elem",
")",
"{",
"if",
"(",
"expr",
"instanceof",
"Expr",
".",
"Operator",
")",
"{",
"Expr",
".",
"Operator",
"binTest",
"=",
"(",
"Expr",
".",
"Operator",
")",
"e... | Generate the logically inverted expression corresponding to a given
comparator. For example, inverting "<=" gives ">", inverting "==" gives "!=",
etc.
@param test
--- the binary comparator being inverted.
@return | [
"Generate",
"the",
"logically",
"inverted",
"expression",
"corresponding",
"to",
"a",
"given",
"comparator",
".",
"For",
"example",
"inverting",
"<",
"=",
"gives",
">",
"inverting",
"==",
"gives",
"!",
"=",
"etc",
"."
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/transform/VerificationConditionGenerator.java#L2530-L2563 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java | JBBPDslBuilder.VarArray | public JBBPDslBuilder VarArray(final String name, final String sizeExpression, final String param) {
"""
Create named var array with fixed size.
@param name name of the array, can be null for anonymous one
@param sizeExpression expression to calculate size of the array, must not be null.
@param para... | java | public JBBPDslBuilder VarArray(final String name, final String sizeExpression, final String param) {
return this.CustomArray("var", name, sizeExpression, param);
} | [
"public",
"JBBPDslBuilder",
"VarArray",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"sizeExpression",
",",
"final",
"String",
"param",
")",
"{",
"return",
"this",
".",
"CustomArray",
"(",
"\"var\"",
",",
"name",
",",
"sizeExpression",
",",
"param",... | Create named var array with fixed size.
@param name name of the array, can be null for anonymous one
@param sizeExpression expression to calculate size of the array, must not be null.
@param param optional parameter for the field, can be null
@return the builder instance, must not be null | [
"Create",
"named",
"var",
"array",
"with",
"fixed",
"size",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L474-L476 |
neo4j/neo4j-java-driver | driver/src/main/java/org/neo4j/driver/internal/util/Format.java | Format.formatPairs | public static <V> String formatPairs( Map<String,V> entries ) {
"""
formats map using ':' as key-value separator instead of default '='
"""
Iterator<Entry<String,V>> iterator = entries.entrySet().iterator();
switch ( entries.size() ) {
case 0:
return "{}";
... | java | public static <V> String formatPairs( Map<String,V> entries )
{
Iterator<Entry<String,V>> iterator = entries.entrySet().iterator();
switch ( entries.size() ) {
case 0:
return "{}";
case 1:
{
return String.format( "{%s}", keyValueSt... | [
"public",
"static",
"<",
"V",
">",
"String",
"formatPairs",
"(",
"Map",
"<",
"String",
",",
"V",
">",
"entries",
")",
"{",
"Iterator",
"<",
"Entry",
"<",
"String",
",",
"V",
">",
">",
"iterator",
"=",
"entries",
".",
"entrySet",
"(",
")",
".",
"ite... | formats map using ':' as key-value separator instead of default '=' | [
"formats",
"map",
"using",
":",
"as",
"key",
"-",
"value",
"separator",
"instead",
"of",
"default",
"="
] | train | https://github.com/neo4j/neo4j-java-driver/blob/8dad6c48251fa1ab7017e72d9998a24fa2337a22/driver/src/main/java/org/neo4j/driver/internal/util/Format.java#L33-L60 |
amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/Subframe_LPC.java | Subframe_LPC.getData | public EncodedElement getData() {
"""
Get the data from the last encode attempt. Data is returned in an
EncodedElement, properly packed at the bit-level to be added directly to
a FLAC stream.
@return EncodedElement containing encoded subframe
"""
EncodedElement result = new EncodedElement(_totalBits/8... | java | public EncodedElement getData() {
EncodedElement result = new EncodedElement(_totalBits/8+1,_offset);
//result.clear((int)_totalBits+1, _offset);
writeLPC(_samples, _lastCount, _start,
_increment, result, _frameSampleSize, _lowOrderBits,
_precision, _shift, _quantizedCoeffs, _errors, _lpcOrd... | [
"public",
"EncodedElement",
"getData",
"(",
")",
"{",
"EncodedElement",
"result",
"=",
"new",
"EncodedElement",
"(",
"_totalBits",
"/",
"8",
"+",
"1",
",",
"_offset",
")",
";",
"//result.clear((int)_totalBits+1, _offset);",
"writeLPC",
"(",
"_samples",
",",
"_last... | Get the data from the last encode attempt. Data is returned in an
EncodedElement, properly packed at the bit-level to be added directly to
a FLAC stream.
@return EncodedElement containing encoded subframe | [
"Get",
"the",
"data",
"from",
"the",
"last",
"encode",
"attempt",
".",
"Data",
"is",
"returned",
"in",
"an",
"EncodedElement",
"properly",
"packed",
"at",
"the",
"bit",
"-",
"level",
"to",
"be",
"added",
"directly",
"to",
"a",
"FLAC",
"stream",
"."
] | train | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/Subframe_LPC.java#L198-L212 |
tvesalainen/util | util/src/main/java/org/vesalainen/ui/Transforms.java | Transforms.createScreenTransform | public static AffineTransform createScreenTransform(Rectangle2D userBounds, Rectangle2D screenBounds, boolean keepAspectRatio, AffineTransform transform) {
"""
Creates translation that translates userBounds in Cartesian coordinates
to screenBound in screen coordinates.
<p>In Cartesian y grows up while in screen ... | java | public static AffineTransform createScreenTransform(Rectangle2D userBounds, Rectangle2D screenBounds, boolean keepAspectRatio, AffineTransform transform)
{
double width = screenBounds.getWidth();
double height = screenBounds.getHeight();
double aspect = width / height;
double xM... | [
"public",
"static",
"AffineTransform",
"createScreenTransform",
"(",
"Rectangle2D",
"userBounds",
",",
"Rectangle2D",
"screenBounds",
",",
"boolean",
"keepAspectRatio",
",",
"AffineTransform",
"transform",
")",
"{",
"double",
"width",
"=",
"screenBounds",
".",
"getWidth... | Creates translation that translates userBounds in Cartesian coordinates
to screenBound in screen coordinates.
<p>In Cartesian y grows up while in screen y grows down
@param userBounds
@param screenBounds
@param keepAspectRatio
@param transform
@return Returns parameter transform | [
"Creates",
"translation",
"that",
"translates",
"userBounds",
"in",
"Cartesian",
"coordinates",
"to",
"screenBound",
"in",
"screen",
"coordinates",
".",
"<p",
">",
"In",
"Cartesian",
"y",
"grows",
"up",
"while",
"in",
"screen",
"y",
"grows",
"down"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/ui/Transforms.java#L57-L97 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/jama/QRDecomposition.java | QRDecomposition.getH | public Matrix getH () {
"""
Return the Householder vectors
@return Lower trapezoidal matrix whose columns define the reflections
"""
Matrix X = new Matrix(m,n);
double[][] H = X.getArray();
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
if (i >= j) {
H[i][j] = QR[i][j];
... | java | public Matrix getH () {
Matrix X = new Matrix(m,n);
double[][] H = X.getArray();
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
if (i >= j) {
H[i][j] = QR[i][j];
} else {
H[i][j] = 0.0;
}
}
}
return X;
} | [
"public",
"Matrix",
"getH",
"(",
")",
"{",
"Matrix",
"X",
"=",
"new",
"Matrix",
"(",
"m",
",",
"n",
")",
";",
"double",
"[",
"]",
"[",
"]",
"H",
"=",
"X",
".",
"getArray",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"m... | Return the Householder vectors
@return Lower trapezoidal matrix whose columns define the reflections | [
"Return",
"the",
"Householder",
"vectors"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/jama/QRDecomposition.java#L132-L145 |
resilience4j/resilience4j | resilience4j-metrics/src/main/java/io/github/resilience4j/metrics/BulkheadMetrics.java | BulkheadMetrics.ofIterable | public static BulkheadMetrics ofIterable(String prefix, Iterable<Bulkhead> bulkheads) {
"""
Creates a new instance BulkheadMetrics {@link BulkheadMetrics} with
an {@link Iterable} of bulkheads as a source.
@param bulkheads the bulkheads
"""
return new BulkheadMetrics(prefix, bulkheads);
} | java | public static BulkheadMetrics ofIterable(String prefix, Iterable<Bulkhead> bulkheads) {
return new BulkheadMetrics(prefix, bulkheads);
} | [
"public",
"static",
"BulkheadMetrics",
"ofIterable",
"(",
"String",
"prefix",
",",
"Iterable",
"<",
"Bulkhead",
">",
"bulkheads",
")",
"{",
"return",
"new",
"BulkheadMetrics",
"(",
"prefix",
",",
"bulkheads",
")",
";",
"}"
] | Creates a new instance BulkheadMetrics {@link BulkheadMetrics} with
an {@link Iterable} of bulkheads as a source.
@param bulkheads the bulkheads | [
"Creates",
"a",
"new",
"instance",
"BulkheadMetrics",
"{",
"@link",
"BulkheadMetrics",
"}",
"with",
"an",
"{",
"@link",
"Iterable",
"}",
"of",
"bulkheads",
"as",
"a",
"source",
"."
] | train | https://github.com/resilience4j/resilience4j/blob/fa843d30f531c00f0c3dc218b65a7f2bb51af336/resilience4j-metrics/src/main/java/io/github/resilience4j/metrics/BulkheadMetrics.java#L95-L97 |
minio/minio-java | api/src/main/java/io/minio/MinioClient.java | MinioClient.listObjectParts | private ListPartsResult listObjectParts(String bucketName, String objectName, String uploadId, int partNumberMarker)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseExceptio... | java | private ListPartsResult listObjectParts(String bucketName, String objectName, String uploadId, int partNumberMarker)
throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException,
InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseExceptio... | [
"private",
"ListPartsResult",
"listObjectParts",
"(",
"String",
"bucketName",
",",
"String",
"objectName",
",",
"String",
"uploadId",
",",
"int",
"partNumberMarker",
")",
"throws",
"InvalidBucketNameException",
",",
"NoSuchAlgorithmException",
",",
"InsufficientDataExceptio... | Executes list object parts for given bucket name, object name, upload ID and part number marker and
returns {@link ListPartsResult}. | [
"Executes",
"list",
"object",
"parts",
"for",
"given",
"bucket",
"name",
"object",
"name",
"upload",
"ID",
"and",
"part",
"number",
"marker",
"and",
"returns",
"{"
] | train | https://github.com/minio/minio-java/blob/b2028f56403c89ce2d5900ae813bc1314c87bc7f/api/src/main/java/io/minio/MinioClient.java#L4885-L4901 |
crowmagnumb/s6-util | src/main/java/net/crowmagnumb/util/string/StringUtilities.java | StringUtilities.computeAttrString | public static String computeAttrString( final String attrString,
final Map<String, ? extends Object> attributes ) {
"""
Return a variable substituted string, but if a value hasn't been
specified, then leave take out the ${variable} part and leave it
blank/empty/null... | java | public static String computeAttrString( final String attrString,
final Map<String, ? extends Object> attributes )
{
return computeAttrString( attrString, attributes, true, null );
} | [
"public",
"static",
"String",
"computeAttrString",
"(",
"final",
"String",
"attrString",
",",
"final",
"Map",
"<",
"String",
",",
"?",
"extends",
"Object",
">",
"attributes",
")",
"{",
"return",
"computeAttrString",
"(",
"attrString",
",",
"attributes",
",",
"... | Return a variable substituted string, but if a value hasn't been
specified, then leave take out the ${variable} part and leave it
blank/empty/null.
@param attrString to use
@param attributes to check for and substitute
@return substituted string | [
"Return",
"a",
"variable",
"substituted",
"string",
"but",
"if",
"a",
"value",
"hasn",
"t",
"been",
"specified",
"then",
"leave",
"take",
"out",
"the",
"$",
"{",
"variable",
"}",
"part",
"and",
"leave",
"it",
"blank",
"/",
"empty",
"/",
"null",
"."
] | train | https://github.com/crowmagnumb/s6-util/blob/0f9969bc0809e8a617501fa57c135e9b3984fae0/src/main/java/net/crowmagnumb/util/string/StringUtilities.java#L1535-L1539 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/bingspellcheck/src/main/java/com/microsoft/azure/cognitiveservices/language/spellcheck/implementation/BingSpellCheckOperationsImpl.java | BingSpellCheckOperationsImpl.spellChecker | public SpellCheck spellChecker(String text, SpellCheckerOptionalParameter spellCheckerOptionalParameter) {
"""
The Bing Spell Check API lets you perform contextual grammar and spell checking. Bing has developed a web-based spell-checker that leverages machine learning and statistical machine translation to dynamic... | java | public SpellCheck spellChecker(String text, SpellCheckerOptionalParameter spellCheckerOptionalParameter) {
return spellCheckerWithServiceResponseAsync(text, spellCheckerOptionalParameter).toBlocking().single().body();
} | [
"public",
"SpellCheck",
"spellChecker",
"(",
"String",
"text",
",",
"SpellCheckerOptionalParameter",
"spellCheckerOptionalParameter",
")",
"{",
"return",
"spellCheckerWithServiceResponseAsync",
"(",
"text",
",",
"spellCheckerOptionalParameter",
")",
".",
"toBlocking",
"(",
... | The Bing Spell Check API lets you perform contextual grammar and spell checking. Bing has developed a web-based spell-checker that leverages machine learning and statistical machine translation to dynamically train a constantly evolving and highly contextual algorithm. The spell-checker is based on a massive corpus of ... | [
"The",
"Bing",
"Spell",
"Check",
"API",
"lets",
"you",
"perform",
"contextual",
"grammar",
"and",
"spell",
"checking",
".",
"Bing",
"has",
"developed",
"a",
"web",
"-",
"based",
"spell",
"-",
"checker",
"that",
"leverages",
"machine",
"learning",
"and",
"sta... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/bingspellcheck/src/main/java/com/microsoft/azure/cognitiveservices/language/spellcheck/implementation/BingSpellCheckOperationsImpl.java#L75-L77 |
google/closure-compiler | src/com/google/javascript/jscomp/TypeValidator.java | TypeValidator.expectObject | boolean expectObject(Node n, JSType type, String msg) {
"""
Expect the type to be an object, or a type convertible to object. If the expectation is not
met, issue a warning at the provided node's source code position.
@return True if there was no warning, false if there was a mismatch.
"""
if (!type.ma... | java | boolean expectObject(Node n, JSType type, String msg) {
if (!type.matchesObjectContext()) {
mismatch(n, msg, type, OBJECT_TYPE);
return false;
}
return true;
} | [
"boolean",
"expectObject",
"(",
"Node",
"n",
",",
"JSType",
"type",
",",
"String",
"msg",
")",
"{",
"if",
"(",
"!",
"type",
".",
"matchesObjectContext",
"(",
")",
")",
"{",
"mismatch",
"(",
"n",
",",
"msg",
",",
"type",
",",
"OBJECT_TYPE",
")",
";",
... | Expect the type to be an object, or a type convertible to object. If the expectation is not
met, issue a warning at the provided node's source code position.
@return True if there was no warning, false if there was a mismatch. | [
"Expect",
"the",
"type",
"to",
"be",
"an",
"object",
"or",
"a",
"type",
"convertible",
"to",
"object",
".",
"If",
"the",
"expectation",
"is",
"not",
"met",
"issue",
"a",
"warning",
"at",
"the",
"provided",
"node",
"s",
"source",
"code",
"position",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L249-L255 |
mangstadt/biweekly | src/main/java/biweekly/io/chain/ChainingTextWriter.java | ChainingTextWriter.go | public void go(File file, boolean append) throws IOException {
"""
Writes the iCalendar objects to a file.
@param file the file to write to
@param append true to append onto the end of the file, false to overwrite
it
@throws IOException if there's a problem writing to the file
"""
ICalWriter writer = new... | java | public void go(File file, boolean append) throws IOException {
ICalWriter writer = new ICalWriter(file, append, getICalWriterConstructorVersion());
try {
go(writer);
} finally {
writer.close();
}
} | [
"public",
"void",
"go",
"(",
"File",
"file",
",",
"boolean",
"append",
")",
"throws",
"IOException",
"{",
"ICalWriter",
"writer",
"=",
"new",
"ICalWriter",
"(",
"file",
",",
"append",
",",
"getICalWriterConstructorVersion",
"(",
")",
")",
";",
"try",
"{",
... | Writes the iCalendar objects to a file.
@param file the file to write to
@param append true to append onto the end of the file, false to overwrite
it
@throws IOException if there's a problem writing to the file | [
"Writes",
"the",
"iCalendar",
"objects",
"to",
"a",
"file",
"."
] | train | https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/chain/ChainingTextWriter.java#L172-L179 |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java | AbstractInjectionEngine.processInjectionMetaData | @Override
public void processInjectionMetaData
(HashMap<Class<?>, InjectionTarget[]> injectionTargetMap,
ComponentNameSpaceConfiguration compNSConfig)
throws InjectionException {
"""
Populates the empty cookie map with cookies to be i... | java | @Override
public void processInjectionMetaData
(HashMap<Class<?>, InjectionTarget[]> injectionTargetMap,
ComponentNameSpaceConfiguration compNSConfig)
throws InjectionException
{
final boolean isTraceOn = TraceComponent.isAnyTr... | [
"@",
"Override",
"public",
"void",
"processInjectionMetaData",
"(",
"HashMap",
"<",
"Class",
"<",
"?",
">",
",",
"InjectionTarget",
"[",
"]",
">",
"injectionTargetMap",
",",
"ComponentNameSpaceConfiguration",
"compNSConfig",
")",
"throws",
"InjectionException",
"{",
... | Populates the empty cookie map with cookies to be injections.
@param injectionTargetMap An empty map to be populated with the injection targets from
the merged xml and annotations.
@param compNSConfig The component configuration information provided by the container.
@throws InjectionException if an error occurs proce... | [
"Populates",
"the",
"empty",
"cookie",
"map",
"with",
"cookies",
"to",
"be",
"injections",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/AbstractInjectionEngine.java#L404-L441 |
spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java | CoreOAuthConsumerSupport.openConnection | protected HttpURLConnection openConnection(URL requestTokenURL) {
"""
Open a connection to the given URL.
@param requestTokenURL The request token URL.
@return The HTTP URL connection.
"""
try {
HttpURLConnection connection = (HttpURLConnection) requestTokenURL.openConnection(selectProxy(requestT... | java | protected HttpURLConnection openConnection(URL requestTokenURL) {
try {
HttpURLConnection connection = (HttpURLConnection) requestTokenURL.openConnection(selectProxy(requestTokenURL));
connection.setConnectTimeout(getConnectionTimeout());
connection.setReadTimeout(getReadTimeout());
return c... | [
"protected",
"HttpURLConnection",
"openConnection",
"(",
"URL",
"requestTokenURL",
")",
"{",
"try",
"{",
"HttpURLConnection",
"connection",
"=",
"(",
"HttpURLConnection",
")",
"requestTokenURL",
".",
"openConnection",
"(",
"selectProxy",
"(",
"requestTokenURL",
")",
"... | Open a connection to the given URL.
@param requestTokenURL The request token URL.
@return The HTTP URL connection. | [
"Open",
"a",
"connection",
"to",
"the",
"given",
"URL",
"."
] | train | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java#L590-L600 |
WASdev/standards.jsr352.jbatch | com.ibm.jbatch.container/src/main/java/com/ibm/jbatch/container/impl/BatchKernelImpl.java | BatchKernelImpl.buildNewParallelPartitions | @Override
public List<BatchPartitionWorkUnit> buildNewParallelPartitions(PartitionsBuilderConfig config)
throws JobRestartException, JobStartException {
"""
Build a list of batch work units and set them up in STARTING state but don't start them yet.
"""
List<JSLJob> jobModels = config.getJobModels(... | java | @Override
public List<BatchPartitionWorkUnit> buildNewParallelPartitions(PartitionsBuilderConfig config)
throws JobRestartException, JobStartException {
List<JSLJob> jobModels = config.getJobModels();
Properties[] partitionPropertiesArray = config.getPartitionProperties();
List<BatchPartitionWorkUni... | [
"@",
"Override",
"public",
"List",
"<",
"BatchPartitionWorkUnit",
">",
"buildNewParallelPartitions",
"(",
"PartitionsBuilderConfig",
"config",
")",
"throws",
"JobRestartException",
",",
"JobStartException",
"{",
"List",
"<",
"JSLJob",
">",
"jobModels",
"=",
"config",
... | Build a list of batch work units and set them up in STARTING state but don't start them yet. | [
"Build",
"a",
"list",
"of",
"batch",
"work",
"units",
"and",
"set",
"them",
"up",
"in",
"STARTING",
"state",
"but",
"don",
"t",
"start",
"them",
"yet",
"."
] | train | https://github.com/WASdev/standards.jsr352.jbatch/blob/e267e79dccd4f0bd4bf9c2abc41a8a47b65be28f/com.ibm.jbatch.container/src/main/java/com/ibm/jbatch/container/impl/BatchKernelImpl.java#L268-L299 |
xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/util/walk/TypesWalker.java | TypesWalker.isCompatible | @SuppressWarnings("checkstyle:CyclomaticComplexity")
private static boolean isCompatible(final Type one, final Type two) {
"""
Check if one types are wildcards and apply wildcard rules:
<ul>
<li>Wildcard with multiple upper bounds (repackaged T extends A & B) must be checked against all bounds</li>
<li>Wild... | java | @SuppressWarnings("checkstyle:CyclomaticComplexity")
private static boolean isCompatible(final Type one, final Type two) {
final Class[] oneBounds = GenericsUtils.resolveUpperBounds(one, IGNORE_VARS);
final Class[] twoBounds = GenericsUtils.resolveUpperBounds(two, IGNORE_VARS);
boolean res ... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:CyclomaticComplexity\"",
")",
"private",
"static",
"boolean",
"isCompatible",
"(",
"final",
"Type",
"one",
",",
"final",
"Type",
"two",
")",
"{",
"final",
"Class",
"[",
"]",
"oneBounds",
"=",
"GenericsUtils",
".",
"res... | Check if one types are wildcards and apply wildcard rules:
<ul>
<li>Wildcard with multiple upper bounds (repackaged T extends A & B) must be checked against all bounds</li>
<li>Wildcard with lower bound (? super A) compatible only with A and it's supertypes</li>
</ul>
<p>
Non wildcard types are projected to class
@par... | [
"Check",
"if",
"one",
"types",
"are",
"wildcards",
"and",
"apply",
"wildcard",
"rules",
":",
"<ul",
">",
"<li",
">",
"Wildcard",
"with",
"multiple",
"upper",
"bounds",
"(",
"repackaged",
"T",
"extends",
"A",
"&",
"B",
")",
"must",
"be",
"checked",
"again... | train | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/walk/TypesWalker.java#L160-L196 |
calimero-project/calimero-core | src/tuwien/auto/calimero/cemi/CEMIFactory.java | CEMIFactory.toEmi | public static byte[] toEmi(final CEMILData msg) {
"""
Returns an EMI1/EMI2-formatted message of the supplied cEMI L-Data message.
@param msg a cEMI L-Data message
@return byte array containing the link layer message in EMI format
@throws KNXIllegalArgumentException on unsupported ASDU length
"""
int mc ... | java | public static byte[] toEmi(final CEMILData msg)
{
int mc = msg.getMessageCode();
final KNXAddress dst = msg.getDestination();
// find out if we need L-Data system broadcast
if (msg.isSystemBroadcast())
mc = Emi1_LSysBcast_req;
if (dst.getRawAddress() == 0) {
// APCI domain address.read is always system... | [
"public",
"static",
"byte",
"[",
"]",
"toEmi",
"(",
"final",
"CEMILData",
"msg",
")",
"{",
"int",
"mc",
"=",
"msg",
".",
"getMessageCode",
"(",
")",
";",
"final",
"KNXAddress",
"dst",
"=",
"msg",
".",
"getDestination",
"(",
")",
";",
"// find out if we n... | Returns an EMI1/EMI2-formatted message of the supplied cEMI L-Data message.
@param msg a cEMI L-Data message
@return byte array containing the link layer message in EMI format
@throws KNXIllegalArgumentException on unsupported ASDU length | [
"Returns",
"an",
"EMI1",
"/",
"EMI2",
"-",
"formatted",
"message",
"of",
"the",
"supplied",
"cEMI",
"L",
"-",
"Data",
"message",
"."
] | train | https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/cemi/CEMIFactory.java#L279-L299 |
landawn/AbacusUtil | src/com/landawn/abacus/util/CSVUtil.java | CSVUtil.exportCSV | public static long exportCSV(final File out, final Connection conn, final String querySQL, final Collection<String> selectColumnNames, final long offset,
final long count, final boolean writeTitle, final boolean quoted) throws UncheckedSQLException, UncheckedIOException {
"""
Exports the data from dat... | java | public static long exportCSV(final File out, final Connection conn, final String querySQL, final Collection<String> selectColumnNames, final long offset,
final long count, final boolean writeTitle, final boolean quoted) throws UncheckedSQLException, UncheckedIOException {
final NamedSQL namedSQL =... | [
"public",
"static",
"long",
"exportCSV",
"(",
"final",
"File",
"out",
",",
"final",
"Connection",
"conn",
",",
"final",
"String",
"querySQL",
",",
"final",
"Collection",
"<",
"String",
">",
"selectColumnNames",
",",
"final",
"long",
"offset",
",",
"final",
"... | Exports the data from database to CVS.
@param out
@param conn
@param querySQL
@param selectColumnNames
@param offset
@param count
@param writeTitle
@param quoted
@return | [
"Exports",
"the",
"data",
"from",
"database",
"to",
"CVS",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/CSVUtil.java#L725-L740 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java | ConfigurationFile.resetBootFile | public synchronized void resetBootFile(boolean reloadUsingLast, String newBootFileName) {
"""
Reset so the next call to {@link #getBootFile()} will re-determine the appropriate file to use for
parsing boot operations. If {@code reloadUsingLast} is {@code true}, while {@code newBootFileName} is not {@code null},
... | java | public synchronized void resetBootFile(boolean reloadUsingLast, String newBootFileName) {
this.bootFile = null;
this.bootFileReset = true;
this.reloadUsingLast = reloadUsingLast;
this.newReloadBootFileName = newBootFileName;
} | [
"public",
"synchronized",
"void",
"resetBootFile",
"(",
"boolean",
"reloadUsingLast",
",",
"String",
"newBootFileName",
")",
"{",
"this",
".",
"bootFile",
"=",
"null",
";",
"this",
".",
"bootFileReset",
"=",
"true",
";",
"this",
".",
"reloadUsingLast",
"=",
"r... | Reset so the next call to {@link #getBootFile()} will re-determine the appropriate file to use for
parsing boot operations. If {@code reloadUsingLast} is {@code true}, while {@code newBootFileName} is not {@code null},
{@code newBootFileName} will take precedence. If a {@code newBootFileName} is used, callers must call... | [
"Reset",
"so",
"the",
"next",
"call",
"to",
"{",
"@link",
"#getBootFile",
"()",
"}",
"will",
"re",
"-",
"determine",
"the",
"appropriate",
"file",
"to",
"use",
"for",
"parsing",
"boot",
"operations",
".",
"If",
"{",
"@code",
"reloadUsingLast",
"}",
"is",
... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/persistence/ConfigurationFile.java#L206-L211 |
FINRAOS/DataGenerator | dg-example-hadoop/src/main/java/org/finra/datagenerator/samples/consumer/ContextWriter.java | ContextWriter.writeOutput | public void writeOutput(DataPipe cr) {
"""
Write to a context. Uses NullWritable for key so that only value of output string is ultimately written
@param cr the DataPipe to write to
"""
try {
context.write(NullWritable.get(), new Text(cr.getPipeDelimited(outTemplate)));
} catch (... | java | public void writeOutput(DataPipe cr) {
try {
context.write(NullWritable.get(), new Text(cr.getPipeDelimited(outTemplate)));
} catch (Exception e) {
throw new RuntimeException("Exception occurred while writing to Context", e);
}
} | [
"public",
"void",
"writeOutput",
"(",
"DataPipe",
"cr",
")",
"{",
"try",
"{",
"context",
".",
"write",
"(",
"NullWritable",
".",
"get",
"(",
")",
",",
"new",
"Text",
"(",
"cr",
".",
"getPipeDelimited",
"(",
"outTemplate",
")",
")",
")",
";",
"}",
"ca... | Write to a context. Uses NullWritable for key so that only value of output string is ultimately written
@param cr the DataPipe to write to | [
"Write",
"to",
"a",
"context",
".",
"Uses",
"NullWritable",
"for",
"key",
"so",
"that",
"only",
"value",
"of",
"output",
"string",
"is",
"ultimately",
"written"
] | train | https://github.com/FINRAOS/DataGenerator/blob/1f69f949401cbed4db4f553c3eb8350832c4d45a/dg-example-hadoop/src/main/java/org/finra/datagenerator/samples/consumer/ContextWriter.java#L49-L55 |
belaban/JGroups | src/org/jgroups/protocols/pbcast/FLUSH.java | FLUSH.down | public Object down(Event evt) {
"""
/*
------------------- end JMX attributes and operations ---------------------
"""
if(!bypass){
switch (evt.getType()) {
case Event.CONNECT:
case Event.CONNECT_USE_FLUSH:
return handleConnect(evt,true);
... | java | public Object down(Event evt) {
if(!bypass){
switch (evt.getType()) {
case Event.CONNECT:
case Event.CONNECT_USE_FLUSH:
return handleConnect(evt,true);
case Event.CONNECT_WITH_STATE_TRANSFER:
case Event.CONNECT_WITH_STATE... | [
"public",
"Object",
"down",
"(",
"Event",
"evt",
")",
"{",
"if",
"(",
"!",
"bypass",
")",
"{",
"switch",
"(",
"evt",
".",
"getType",
"(",
")",
")",
"{",
"case",
"Event",
".",
"CONNECT",
":",
"case",
"Event",
".",
"CONNECT_USE_FLUSH",
":",
"return",
... | /*
------------------- end JMX attributes and operations --------------------- | [
"/",
"*",
"-------------------",
"end",
"JMX",
"attributes",
"and",
"operations",
"---------------------"
] | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/protocols/pbcast/FLUSH.java#L262-L299 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java | ComputeNodeOperations.rebootComputeNode | public void rebootComputeNode(String poolId, String nodeId, ComputeNodeRebootOption nodeRebootOption, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
"""
Reboots the specified compute node.
<p>You can reboot a compute node only when it is in the {@link com.microsoft.az... | java | public void rebootComputeNode(String poolId, String nodeId, ComputeNodeRebootOption nodeRebootOption, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException {
ComputeNodeRebootOptions options = new ComputeNodeRebootOptions();
BehaviorManager bhMgr = new BehaviorManage... | [
"public",
"void",
"rebootComputeNode",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"ComputeNodeRebootOption",
"nodeRebootOption",
",",
"Iterable",
"<",
"BatchClientBehavior",
">",
"additionalBehaviors",
")",
"throws",
"BatchErrorException",
",",
"IOException",
... | Reboots the specified compute node.
<p>You can reboot a compute node only when it is in the {@link com.microsoft.azure.batch.protocol.models.ComputeNodeState#IDLE Idle} or {@link com.microsoft.azure.batch.protocol.models.ComputeNodeState#RUNNING Running} state.</p>
@param poolId The ID of the pool that contains the co... | [
"Reboots",
"the",
"specified",
"compute",
"node",
".",
"<p",
">",
"You",
"can",
"reboot",
"a",
"compute",
"node",
"only",
"when",
"it",
"is",
"in",
"the",
"{",
"@link",
"com",
".",
"microsoft",
".",
"azure",
".",
"batch",
".",
"protocol",
".",
"models"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java#L306-L312 |
dbracewell/mango | src/main/java/com/davidbracewell/json/JsonWriter.java | JsonWriter.property | public JsonWriter property(String key, Object value) throws IOException {
"""
Writes a key value pair
@param key the key
@param value the value
@return This structured writer
@throws IOException Something went wrong writing
"""
Preconditions.checkArgument(!inArray(), "Cannot write a property ins... | java | public JsonWriter property(String key, Object value) throws IOException {
Preconditions.checkArgument(!inArray(), "Cannot write a property inside an array.");
writeName(key);
value(value);
return this;
} | [
"public",
"JsonWriter",
"property",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"!",
"inArray",
"(",
")",
",",
"\"Cannot write a property inside an array.\"",
")",
";",
"writeName",
"... | Writes a key value pair
@param key the key
@param value the value
@return This structured writer
@throws IOException Something went wrong writing | [
"Writes",
"a",
"key",
"value",
"pair"
] | train | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonWriter.java#L292-L297 |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java | GeneratedDUserDaoImpl.queryByBirthInfo | public Iterable<DUser> queryByBirthInfo(java.lang.String birthInfo) {
"""
query-by method for field birthInfo
@param birthInfo the specified attribute
@return an Iterable of DUsers for the specified birthInfo
"""
return queryByField(null, DUserMapper.Field.BIRTHINFO.getFieldName(), birthInfo);
} | java | public Iterable<DUser> queryByBirthInfo(java.lang.String birthInfo) {
return queryByField(null, DUserMapper.Field.BIRTHINFO.getFieldName(), birthInfo);
} | [
"public",
"Iterable",
"<",
"DUser",
">",
"queryByBirthInfo",
"(",
"java",
".",
"lang",
".",
"String",
"birthInfo",
")",
"{",
"return",
"queryByField",
"(",
"null",
",",
"DUserMapper",
".",
"Field",
".",
"BIRTHINFO",
".",
"getFieldName",
"(",
")",
",",
"bir... | query-by method for field birthInfo
@param birthInfo the specified attribute
@return an Iterable of DUsers for the specified birthInfo | [
"query",
"-",
"by",
"method",
"for",
"field",
"birthInfo"
] | train | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/dao/GeneratedDUserDaoImpl.java#L88-L90 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java | CPInstancePersistenceImpl.findByC_S | @Override
public CPInstance findByC_S(long CPDefinitionId, String sku)
throws NoSuchCPInstanceException {
"""
Returns the cp instance where CPDefinitionId = ? and sku = ? or throws a {@link NoSuchCPInstanceException} if it could not be found.
@param CPDefinitionId the cp definition ID
@param sku the... | java | @Override
public CPInstance findByC_S(long CPDefinitionId, String sku)
throws NoSuchCPInstanceException {
CPInstance cpInstance = fetchByC_S(CPDefinitionId, sku);
if (cpInstance == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("CPDefinitionId=");
... | [
"@",
"Override",
"public",
"CPInstance",
"findByC_S",
"(",
"long",
"CPDefinitionId",
",",
"String",
"sku",
")",
"throws",
"NoSuchCPInstanceException",
"{",
"CPInstance",
"cpInstance",
"=",
"fetchByC_S",
"(",
"CPDefinitionId",
",",
"sku",
")",
";",
"if",
"(",
"cp... | Returns the cp instance where CPDefinitionId = ? and sku = ? or throws a {@link NoSuchCPInstanceException} if it could not be found.
@param CPDefinitionId the cp definition ID
@param sku the sku
@return the matching cp instance
@throws NoSuchCPInstanceException if a matching cp instance could not be found | [
"Returns",
"the",
"cp",
"instance",
"where",
"CPDefinitionId",
"=",
"?",
";",
"and",
"sku",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCPInstanceException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPInstancePersistenceImpl.java#L4334-L4360 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java | Journal.alwaysAssert | private void alwaysAssert(boolean expression, String msg,
Object... formatArgs) {
"""
@throws AssertionError if the given expression is not true.
The message of the exception is formatted using the 'msg' and
'formatArgs' parameters.
This should be used in preference to Java's built-in assert in
non-per... | java | private void alwaysAssert(boolean expression, String msg,
Object... formatArgs) {
if (!expression) {
throw new AssertionError(String.format(msg, formatArgs));
}
} | [
"private",
"void",
"alwaysAssert",
"(",
"boolean",
"expression",
",",
"String",
"msg",
",",
"Object",
"...",
"formatArgs",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"throw",
"new",
"AssertionError",
"(",
"String",
".",
"format",
"(",
"msg",
",",
... | @throws AssertionError if the given expression is not true.
The message of the exception is formatted using the 'msg' and
'formatArgs' parameters.
This should be used in preference to Java's built-in assert in
non-performance-critical paths, where a failure of this invariant
might cause the protocol to lose data. | [
"@throws",
"AssertionError",
"if",
"the",
"given",
"expression",
"is",
"not",
"true",
".",
"The",
"message",
"of",
"the",
"exception",
"is",
"formatted",
"using",
"the",
"msg",
"and",
"formatArgs",
"parameters",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/qjournal/server/Journal.java#L784-L789 |
davidmoten/geo | geo/src/main/java/com/github/davidmoten/geo/GeoHash.java | GeoHash.adjacentHash | public static String adjacentHash(String hash, Direction direction) {
"""
Returns the adjacent hash in given {@link Direction}. Based on
https://github.com/davetroy/geohash-js/blob/master/geohash.js. This
method is an improvement on the original js method because it works at
borders too (at the poles and the -1... | java | public static String adjacentHash(String hash, Direction direction) {
checkHash(hash);
Preconditions.checkArgument(hash.length() > 0,
"adjacent has no meaning for a zero length hash that covers the whole world");
String adjacentHashAtBorder = adjacentHashAtBorder(hash, direction... | [
"public",
"static",
"String",
"adjacentHash",
"(",
"String",
"hash",
",",
"Direction",
"direction",
")",
"{",
"checkHash",
"(",
"hash",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"hash",
".",
"length",
"(",
")",
">",
"0",
",",
"\"adjacent has no m... | Returns the adjacent hash in given {@link Direction}. Based on
https://github.com/davetroy/geohash-js/blob/master/geohash.js. This
method is an improvement on the original js method because it works at
borders too (at the poles and the -180,180 longitude boundaries).
@param hash
string hash relative to which the adjac... | [
"Returns",
"the",
"adjacent",
"hash",
"in",
"given",
"{",
"@link",
"Direction",
"}",
".",
"Based",
"on",
"https",
":",
"//",
"github",
".",
"com",
"/",
"davetroy",
"/",
"geohash",
"-",
"js",
"/",
"blob",
"/",
"master",
"/",
"geohash",
".",
"js",
".",... | train | https://github.com/davidmoten/geo/blob/e90d2f406133cd9b60d54a3e6bdb7423d7fcce37/geo/src/main/java/com/github/davidmoten/geo/GeoHash.java#L141-L157 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urltemplates/URLTemplates.java | URLTemplates.addTemplateRefGroup | public void addTemplateRefGroup( String refGroupName, Map/*< String, String >*/ templateRefGroup ) {
"""
Add a template reference group from url-template-config by name.
@param refGroupName the name of the template reference group.
@param templateRefGroup the template reference group.
"""
if ( refG... | java | public void addTemplateRefGroup( String refGroupName, Map/*< String, String >*/ templateRefGroup )
{
if ( refGroupName == null || refGroupName.length() == 0 )
{
throw new IllegalArgumentException( "Template Reference Group name cannot be null or empty." );
}
if ( templat... | [
"public",
"void",
"addTemplateRefGroup",
"(",
"String",
"refGroupName",
",",
"Map",
"/*< String, String >*/",
"templateRefGroup",
")",
"{",
"if",
"(",
"refGroupName",
"==",
"null",
"||",
"refGroupName",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"n... | Add a template reference group from url-template-config by name.
@param refGroupName the name of the template reference group.
@param templateRefGroup the template reference group. | [
"Add",
"a",
"template",
"reference",
"group",
"from",
"url",
"-",
"template",
"-",
"config",
"by",
"name",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urltemplates/URLTemplates.java#L107-L120 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/CloudSchedulerClient.java | CloudSchedulerClient.createJob | public final Job createJob(String parent, Job job) {
"""
Creates a job.
<p>Sample code:
<pre><code>
try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Job job = Job.newBuilder().build();
Job response = cloudS... | java | public final Job createJob(String parent, Job job) {
CreateJobRequest request = CreateJobRequest.newBuilder().setParent(parent).setJob(job).build();
return createJob(request);
} | [
"public",
"final",
"Job",
"createJob",
"(",
"String",
"parent",
",",
"Job",
"job",
")",
"{",
"CreateJobRequest",
"request",
"=",
"CreateJobRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"parent",
")",
".",
"setJob",
"(",
"job",
")",
".",
"... | Creates a job.
<p>Sample code:
<pre><code>
try (CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Job job = Job.newBuilder().build();
Job response = cloudSchedulerClient.createJob(parent.toString(), job);
}
</code></pre>
@pa... | [
"Creates",
"a",
"job",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-scheduler/src/main/java/com/google/cloud/scheduler/v1beta1/CloudSchedulerClient.java#L438-L442 |
messagebird/java-rest-api | api/src/main/java/com/messagebird/MessageBirdClient.java | MessageBirdClient.viewRecording | public RecordingResponse viewRecording(String callID, String legId, String recordingId) throws NotFoundException, GeneralException, UnauthorizedException {
"""
Function to view recording by call id , leg id and recording id
@param callID Voice call ID
@param legId Leg ID
@param recordingId Recordin... | java | public RecordingResponse viewRecording(String callID, String legId, String recordingId) throws NotFoundException, GeneralException, UnauthorizedException {
if (callID == null) {
throw new IllegalArgumentException("Voice call ID must be specified.");
}
if (legId == null) {
... | [
"public",
"RecordingResponse",
"viewRecording",
"(",
"String",
"callID",
",",
"String",
"legId",
",",
"String",
"recordingId",
")",
"throws",
"NotFoundException",
",",
"GeneralException",
",",
"UnauthorizedException",
"{",
"if",
"(",
"callID",
"==",
"null",
")",
"... | Function to view recording by call id , leg id and recording id
@param callID Voice call ID
@param legId Leg ID
@param recordingId Recording ID
@return Recording
@throws NotFoundException not found with callId and legId
@throws UnauthorizedException if client is unauthorized
@throws GeneralException ... | [
"Function",
"to",
"view",
"recording",
"by",
"call",
"id",
"leg",
"id",
"and",
"recording",
"id"
] | train | https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L1051-L1071 |
airbnb/AirMapView | library/src/main/java/com/airbnb/android/airmapview/RuntimePermissionUtils.java | RuntimePermissionUtils.hasSelfPermissions | private static boolean hasSelfPermissions(Context context, String... permissions) {
"""
Returns true if the context has access to any given permissions.
"""
for (String permission : permissions) {
if (checkSelfPermission(context, permission) == PackageManager.PERMISSION_GRANTED) {
return true... | java | private static boolean hasSelfPermissions(Context context, String... permissions) {
for (String permission : permissions) {
if (checkSelfPermission(context, permission) == PackageManager.PERMISSION_GRANTED) {
return true;
}
}
return false;
} | [
"private",
"static",
"boolean",
"hasSelfPermissions",
"(",
"Context",
"context",
",",
"String",
"...",
"permissions",
")",
"{",
"for",
"(",
"String",
"permission",
":",
"permissions",
")",
"{",
"if",
"(",
"checkSelfPermission",
"(",
"context",
",",
"permission",... | Returns true if the context has access to any given permissions. | [
"Returns",
"true",
"if",
"the",
"context",
"has",
"access",
"to",
"any",
"given",
"permissions",
"."
] | train | https://github.com/airbnb/AirMapView/blob/f715197db2cc2903e8d70f78385d339c3f6a1c3b/library/src/main/java/com/airbnb/android/airmapview/RuntimePermissionUtils.java#L41-L48 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPointLight.java | GVRPointLight.setAmbientIntensity | public void setAmbientIntensity(float r, float g, float b, float a) {
"""
Set the ambient light intensity.
This designates the color of the ambient reflection.
It is multiplied by the material ambient color to derive
the hue of the ambient reflection for that material.
The built-in phong shader {@link GVRPho... | java | public void setAmbientIntensity(float r, float g, float b, float a) {
setVec4("ambient_intensity", r, g, b, a);
} | [
"public",
"void",
"setAmbientIntensity",
"(",
"float",
"r",
",",
"float",
"g",
",",
"float",
"b",
",",
"float",
"a",
")",
"{",
"setVec4",
"(",
"\"ambient_intensity\"",
",",
"r",
",",
"g",
",",
"b",
",",
"a",
")",
";",
"}"
] | Set the ambient light intensity.
This designates the color of the ambient reflection.
It is multiplied by the material ambient color to derive
the hue of the ambient reflection for that material.
The built-in phong shader {@link GVRPhongShader} uses a {@code vec4} uniform named
{@code ambient_intensity} to control the... | [
"Set",
"the",
"ambient",
"light",
"intensity",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPointLight.java#L116-L118 |
threerings/nenya | core/src/main/java/com/threerings/media/util/AStarPathUtil.java | AStarPathUtil.getPath | public static List<Point> getPath (
TraversalPred tpred, Stepper stepper, Object trav, int longest,
int ax, int ay, int bx, int by, boolean partial) {
"""
Return a list of <code>Point</code> objects representing a path from coordinates
<code>(ax, by)</code> to <code>(bx, by)</code>, inclusive, det... | java | public static List<Point> getPath (
TraversalPred tpred, Stepper stepper, Object trav, int longest,
int ax, int ay, int bx, int by, boolean partial)
{
Info info = new Info(tpred, trav, longest, bx, by);
// set up the starting node
Node s = info.getNode(ax, ay);
s.g =... | [
"public",
"static",
"List",
"<",
"Point",
">",
"getPath",
"(",
"TraversalPred",
"tpred",
",",
"Stepper",
"stepper",
",",
"Object",
"trav",
",",
"int",
"longest",
",",
"int",
"ax",
",",
"int",
"ay",
",",
"int",
"bx",
",",
"int",
"by",
",",
"boolean",
... | Return a list of <code>Point</code> objects representing a path from coordinates
<code>(ax, by)</code> to <code>(bx, by)</code>, inclusive, determined by performing an
A* search in the given scene's base tile layer. Assumes the starting and destination nodes
are traversable by the specified traverser.
@param tpred let... | [
"Return",
"a",
"list",
"of",
"<code",
">",
"Point<",
"/",
"code",
">",
"objects",
"representing",
"a",
"path",
"from",
"coordinates",
"<code",
">",
"(",
"ax",
"by",
")",
"<",
"/",
"code",
">",
"to",
"<code",
">",
"(",
"bx",
"by",
")",
"<",
"/",
"... | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/AStarPathUtil.java#L141-L196 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java | GISCoordinates.L2_L1 | @Pure
public static Point2d L2_L1(double x, double y) {
"""
This function convert France Lambert II coordinate to
France Lambert I coordinate.
@param x is the coordinate in France Lambert II
@param y is the coordinate in France Lambert II
@return the France Lambert I coordinate.
"""
final Point2d ntfL... | java | @Pure
public static Point2d L2_L1(double x, double y) {
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi(x, y,
LAMBERT_2_N,
LAMBERT_2_C,
LAMBERT_2_XS,
LAMBERT_2_YS);
return NTFLambdaPhi_NTFLambert(
ntfLambdaPhi.getX(), ntfLambdaPhi.getY(),
LAMBERT_1_N,
LAMBERT_1_C,
LAMBERT_1_XS,... | [
"@",
"Pure",
"public",
"static",
"Point2d",
"L2_L1",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"final",
"Point2d",
"ntfLambdaPhi",
"=",
"NTFLambert_NTFLambdaPhi",
"(",
"x",
",",
"y",
",",
"LAMBERT_2_N",
",",
"LAMBERT_2_C",
",",
"LAMBERT_2_XS",
",",
... | This function convert France Lambert II coordinate to
France Lambert I coordinate.
@param x is the coordinate in France Lambert II
@param y is the coordinate in France Lambert II
@return the France Lambert I coordinate. | [
"This",
"function",
"convert",
"France",
"Lambert",
"II",
"coordinate",
"to",
"France",
"Lambert",
"I",
"coordinate",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/coordinate/GISCoordinates.java#L450-L463 |
UrielCh/ovh-java-sdk | ovh-java-sdk-msServices/src/main/java/net/minidev/ovh/api/ApiOvhMsServices.java | ApiOvhMsServices.serviceName_account_userPrincipalName_mfa_disable_POST | public OvhTask serviceName_account_userPrincipalName_mfa_disable_POST(String serviceName, String userPrincipalName, Long period) throws IOException {
"""
Disable Multi Factor Authentication for a period of time
REST: POST /msServices/{serviceName}/account/{userPrincipalName}/mfa/disable
@param period [required... | java | public OvhTask serviceName_account_userPrincipalName_mfa_disable_POST(String serviceName, String userPrincipalName, Long period) throws IOException {
String qPath = "/msServices/{serviceName}/account/{userPrincipalName}/mfa/disable";
StringBuilder sb = path(qPath, serviceName, userPrincipalName);
HashMap<String, ... | [
"public",
"OvhTask",
"serviceName_account_userPrincipalName_mfa_disable_POST",
"(",
"String",
"serviceName",
",",
"String",
"userPrincipalName",
",",
"Long",
"period",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/msServices/{serviceName}/account/{userPrincipal... | Disable Multi Factor Authentication for a period of time
REST: POST /msServices/{serviceName}/account/{userPrincipalName}/mfa/disable
@param period [required] Multi Factor Authentication disable period in hours
@param serviceName [required] The internal name of your Active Directory organization
@param userPrincipalNa... | [
"Disable",
"Multi",
"Factor",
"Authentication",
"for",
"a",
"period",
"of",
"time"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-msServices/src/main/java/net/minidev/ovh/api/ApiOvhMsServices.java#L304-L311 |
hdecarne/java-default | src/main/java/de/carne/io/IOUtil.java | IOUtil.copyUrl | public static long copyUrl(OutputStream dst, URL src) throws IOException {
"""
Copies all bytes from a {@linkplain URL} to an {@linkplain OutputStream}.
@param dst the {@linkplain OutputStream} to copy to.
@param src the {@linkplain URL} to copy from.
@return the number of copied bytes.
@throws IOException i... | java | public static long copyUrl(OutputStream dst, URL src) throws IOException {
long copied;
try (InputStream srcStream = src.openStream()) {
copied = copyStream(dst, srcStream);
}
return copied;
} | [
"public",
"static",
"long",
"copyUrl",
"(",
"OutputStream",
"dst",
",",
"URL",
"src",
")",
"throws",
"IOException",
"{",
"long",
"copied",
";",
"try",
"(",
"InputStream",
"srcStream",
"=",
"src",
".",
"openStream",
"(",
")",
")",
"{",
"copied",
"=",
"cop... | Copies all bytes from a {@linkplain URL} to an {@linkplain OutputStream}.
@param dst the {@linkplain OutputStream} to copy to.
@param src the {@linkplain URL} to copy from.
@return the number of copied bytes.
@throws IOException if an I/O error occurs. | [
"Copies",
"all",
"bytes",
"from",
"a",
"{",
"@linkplain",
"URL",
"}",
"to",
"an",
"{",
"@linkplain",
"OutputStream",
"}",
"."
] | train | https://github.com/hdecarne/java-default/blob/ca16f6fdb0436e90e9e2df3106055e320bb3c9e3/src/main/java/de/carne/io/IOUtil.java#L152-L159 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.startCallable | public static <R> Observable<R> startCallable(Callable<? extends R> func) {
"""
Invokes the specified function asynchronously and returns an Observable that emits the result.
<p>
Note: The function is called immediately and once, not whenever an observer subscribes to the resulting
Observable. Multiple subscrip... | java | public static <R> Observable<R> startCallable(Callable<? extends R> func) {
return startCallable(func, Schedulers.computation());
} | [
"public",
"static",
"<",
"R",
">",
"Observable",
"<",
"R",
">",
"startCallable",
"(",
"Callable",
"<",
"?",
"extends",
"R",
">",
"func",
")",
"{",
"return",
"startCallable",
"(",
"func",
",",
"Schedulers",
".",
"computation",
"(",
")",
")",
";",
"}"
] | Invokes the specified function asynchronously and returns an Observable that emits the result.
<p>
Note: The function is called immediately and once, not whenever an observer subscribes to the resulting
Observable. Multiple subscriptions to this Observable observe the same return value.
<p>
<img width="640" src="https:... | [
"Invokes",
"the",
"specified",
"function",
"asynchronously",
"and",
"returns",
"an",
"Observable",
"that",
"emits",
"the",
"result",
".",
"<p",
">",
"Note",
":",
"The",
"function",
"is",
"called",
"immediately",
"and",
"once",
"not",
"whenever",
"an",
"observe... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L76-L78 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/metadata/SecurityServletConfiguratorHelper.java | SecurityServletConfiguratorHelper.createSecurityConstraint | private SecurityConstraint createSecurityConstraint(com.ibm.ws.javaee.dd.web.common.SecurityConstraint archiveConstraint, boolean denyUncoveredHttpMethods) {
"""
Creates a SecurityConstraint object that represents a security-constraint element in web.xml.
@param archiveConstraint the security-constraint
@retur... | java | private SecurityConstraint createSecurityConstraint(com.ibm.ws.javaee.dd.web.common.SecurityConstraint archiveConstraint, boolean denyUncoveredHttpMethods) {
List<WebResourceCollection> webResourceCollections = createWebResourceCollections(archiveConstraint, denyUncoveredHttpMethods);
List<String> roles... | [
"private",
"SecurityConstraint",
"createSecurityConstraint",
"(",
"com",
".",
"ibm",
".",
"ws",
".",
"javaee",
".",
"dd",
".",
"web",
".",
"common",
".",
"SecurityConstraint",
"archiveConstraint",
",",
"boolean",
"denyUncoveredHttpMethods",
")",
"{",
"List",
"<",
... | Creates a SecurityConstraint object that represents a security-constraint element in web.xml.
@param archiveConstraint the security-constraint
@return the security code's representation of a security constraint | [
"Creates",
"a",
"SecurityConstraint",
"object",
"that",
"represents",
"a",
"security",
"-",
"constraint",
"element",
"in",
"web",
".",
"xml",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/metadata/SecurityServletConfiguratorHelper.java#L523-L531 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/form/CmsFormRow.java | CmsFormRow.installTooltipEventHandlers | public static void installTooltipEventHandlers(final Panel icon, final Supplier<Data> dataSupplier) {
"""
Installs the DOM event handlers for displaying tooltips on a help icon.<p>
The supplier passed in should not create a new tooltip data instance each time,
but cache the different possible tooltip data inst... | java | public static void installTooltipEventHandlers(final Panel icon, final Supplier<Data> dataSupplier) {
icon.addDomHandler(new MouseOverHandler() {
public void onMouseOver(MouseOverEvent event) {
CmsFieldTooltip.getHandler().buttonHover(dataSupplier.get());
}
}, ... | [
"public",
"static",
"void",
"installTooltipEventHandlers",
"(",
"final",
"Panel",
"icon",
",",
"final",
"Supplier",
"<",
"Data",
">",
"dataSupplier",
")",
"{",
"icon",
".",
"addDomHandler",
"(",
"new",
"MouseOverHandler",
"(",
")",
"{",
"public",
"void",
"onMo... | Installs the DOM event handlers for displaying tooltips on a help icon.<p>
The supplier passed in should not create a new tooltip data instance each time,
but cache the different possible tooltip data instances.
@param icon the help icon
@param dataSupplier provides the tooltip data at the time the DOM events occur | [
"Installs",
"the",
"DOM",
"event",
"handlers",
"for",
"displaying",
"tooltips",
"on",
"a",
"help",
"icon",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/form/CmsFormRow.java#L170-L197 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/SegmentKeyCache.java | SegmentKeyCache.setLastIndexedOffset | void setLastIndexedOffset(long currentLastIndexedOffset, int cacheGeneration) {
"""
Updates the Last Indexed Offset (cached value of the Segment's {@link TableAttributes#INDEX_OFFSET} attribute).
Clears out any backpointers whose source offsets will be smaller than the new value for Last Indexed Offset.
"""
... | java | void setLastIndexedOffset(long currentLastIndexedOffset, int cacheGeneration) {
val candidates = new ArrayList<MigrationCandidate>();
synchronized (this) {
// Update stored last indexed offset.
Preconditions.checkArgument(currentLastIndexedOffset >= this.lastIndexedOffset,
... | [
"void",
"setLastIndexedOffset",
"(",
"long",
"currentLastIndexedOffset",
",",
"int",
"cacheGeneration",
")",
"{",
"val",
"candidates",
"=",
"new",
"ArrayList",
"<",
"MigrationCandidate",
">",
"(",
")",
";",
"synchronized",
"(",
"this",
")",
"{",
"// Update stored ... | Updates the Last Indexed Offset (cached value of the Segment's {@link TableAttributes#INDEX_OFFSET} attribute).
Clears out any backpointers whose source offsets will be smaller than the new value for Last Indexed Offset. | [
"Updates",
"the",
"Last",
"Indexed",
"Offset",
"(",
"cached",
"value",
"of",
"the",
"Segment",
"s",
"{"
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/SegmentKeyCache.java#L238-L266 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java | NonRecycleableTaglibs.getAttributes | private static Map<QMethod, String> getAttributes(JavaClass cls) {
"""
collect all possible attributes given the name of methods available.
@param cls
the class to look for setter methods to infer properties
@return the map of possible attributes/types
"""
Map<QMethod, String> atts = new HashMap<>... | java | private static Map<QMethod, String> getAttributes(JavaClass cls) {
Map<QMethod, String> atts = new HashMap<>();
Method[] methods = cls.getMethods();
for (Method m : methods) {
String name = m.getName();
if (name.startsWith("set") && m.isPublic() && !m.isStatic()) {
... | [
"private",
"static",
"Map",
"<",
"QMethod",
",",
"String",
">",
"getAttributes",
"(",
"JavaClass",
"cls",
")",
"{",
"Map",
"<",
"QMethod",
",",
"String",
">",
"atts",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"Method",
"[",
"]",
"methods",
"=",
"cl... | collect all possible attributes given the name of methods available.
@param cls
the class to look for setter methods to infer properties
@return the map of possible attributes/types | [
"collect",
"all",
"possible",
"attributes",
"given",
"the",
"name",
"of",
"methods",
"available",
"."
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/NonRecycleableTaglibs.java#L120-L140 |
RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipPhone.java | SipPhone.processAuthChallenge | public Request processAuthChallenge(Response response, Request req_msg) {
"""
This method is the same as the other processAuthChallenge() without the user/password option.
"""
return processAuthChallenge(response, req_msg, null, null);
} | java | public Request processAuthChallenge(Response response, Request req_msg) {
return processAuthChallenge(response, req_msg, null, null);
} | [
"public",
"Request",
"processAuthChallenge",
"(",
"Response",
"response",
",",
"Request",
"req_msg",
")",
"{",
"return",
"processAuthChallenge",
"(",
"response",
",",
"req_msg",
",",
"null",
",",
"null",
")",
";",
"}"
] | This method is the same as the other processAuthChallenge() without the user/password option. | [
"This",
"method",
"is",
"the",
"same",
"as",
"the",
"other",
"processAuthChallenge",
"()",
"without",
"the",
"user",
"/",
"password",
"option",
"."
] | train | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipPhone.java#L707-L709 |
RestComm/sip-servlets | sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java | FacebookRestClient.photos_get | public T photos_get(Integer subjId, Long albumId, Collection<Long> photoIds)
throws FacebookException, IOException {
"""
Used to retrieve photo objects using the search parameters (one or more of the
parameters must be provided).
@param subjId retrieve from photos associated with this user (optional).
@pa... | java | public T photos_get(Integer subjId, Long albumId, Collection<Long> photoIds)
throws FacebookException, IOException {
ArrayList<Pair<String, CharSequence>> params =
new ArrayList<Pair<String, CharSequence>>(FacebookMethod.PHOTOS_GET.numParams());
boolean hasUserId = null != subjId && 0 != subjId;
... | [
"public",
"T",
"photos_get",
"(",
"Integer",
"subjId",
",",
"Long",
"albumId",
",",
"Collection",
"<",
"Long",
">",
"photoIds",
")",
"throws",
"FacebookException",
",",
"IOException",
"{",
"ArrayList",
"<",
"Pair",
"<",
"String",
",",
"CharSequence",
">",
">... | Used to retrieve photo objects using the search parameters (one or more of the
parameters must be provided).
@param subjId retrieve from photos associated with this user (optional).
@param albumId retrieve from photos from this album (optional)
@param photoIds retrieve from this list of photos (optional)
@return an T ... | [
"Used",
"to",
"retrieve",
"photo",
"objects",
"using",
"the",
"search",
"parameters",
"(",
"one",
"or",
"more",
"of",
"the",
"parameters",
"must",
"be",
"provided",
")",
"."
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-examples/facebook-c2c/src/main/java/com/facebook/api/FacebookRestClient.java#L760-L780 |
apache/groovy | src/main/java/org/codehaus/groovy/ast/tools/GeneralUtils.java | GeneralUtils.getterX | public static Expression getterX(ClassNode annotatedNode, Expression receiver, PropertyNode pNode) {
"""
This method is similar to {@link #propX(Expression, Expression)} but will make sure that if the property
being accessed is defined inside the classnode provided as a parameter, then a getter call is generated
... | java | public static Expression getterX(ClassNode annotatedNode, Expression receiver, PropertyNode pNode) {
ClassNode owner = pNode.getDeclaringClass();
if (annotatedNode.equals(owner)) {
return callX(receiver, getterName(annotatedNode, pNode));
}
return propX(receiver, pNode.getNam... | [
"public",
"static",
"Expression",
"getterX",
"(",
"ClassNode",
"annotatedNode",
",",
"Expression",
"receiver",
",",
"PropertyNode",
"pNode",
")",
"{",
"ClassNode",
"owner",
"=",
"pNode",
".",
"getDeclaringClass",
"(",
")",
";",
"if",
"(",
"annotatedNode",
".",
... | This method is similar to {@link #propX(Expression, Expression)} but will make sure that if the property
being accessed is defined inside the classnode provided as a parameter, then a getter call is generated
instead of a field access.
@param annotatedNode the class node where the property node is accessed from
@param ... | [
"This",
"method",
"is",
"similar",
"to",
"{"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/tools/GeneralUtils.java#L816-L822 |
hexagonframework/spring-data-ebean | src/main/java/org/springframework/data/ebean/querychannel/EbeanQueryChannelService.java | EbeanQueryChannelService.createQuery | @Override
public <T> Query<T> createQuery(Class<T> entityType, Object queryObject) {
"""
Return an object relational query for finding a List, Set, Map or single entity bean.
@return the Query.
"""
Assert.notNull(entityType, "entityType must not null");
Assert.notNull(queryObject, "qu... | java | @Override
public <T> Query<T> createQuery(Class<T> entityType, Object queryObject) {
Assert.notNull(entityType, "entityType must not null");
Assert.notNull(queryObject, "queryObject must not null");
return query(entityType, queryObject);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"Query",
"<",
"T",
">",
"createQuery",
"(",
"Class",
"<",
"T",
">",
"entityType",
",",
"Object",
"queryObject",
")",
"{",
"Assert",
".",
"notNull",
"(",
"entityType",
",",
"\"entityType must not null\"",
")",
";",
... | Return an object relational query for finding a List, Set, Map or single entity bean.
@return the Query. | [
"Return",
"an",
"object",
"relational",
"query",
"for",
"finding",
"a",
"List",
"Set",
"Map",
"or",
"single",
"entity",
"bean",
"."
] | train | https://github.com/hexagonframework/spring-data-ebean/blob/dd11b97654982403b50dd1d5369cadad71fce410/src/main/java/org/springframework/data/ebean/querychannel/EbeanQueryChannelService.java#L388-L393 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxRetentionPolicy.java | BoxRetentionPolicy.createRetentionPolicy | private static BoxRetentionPolicy.Info createRetentionPolicy(BoxAPIConnection api, String name, String type,
int length, String action,
RetentionPolicyParams optionalParams) {
"""
Use... | java | private static BoxRetentionPolicy.Info createRetentionPolicy(BoxAPIConnection api, String name, String type,
int length, String action,
RetentionPolicyParams optionalParams) {
URL... | [
"private",
"static",
"BoxRetentionPolicy",
".",
"Info",
"createRetentionPolicy",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"name",
",",
"String",
"type",
",",
"int",
"length",
",",
"String",
"action",
",",
"RetentionPolicyParams",
"optionalParams",
")",
"{",
... | Used to create a new retention policy with optional parameters.
@param api the API connection to be used by the created user.
@param name the name of the retention policy.
@param type the type of the retention policy. Can be "finite" or "indefinite".
@param length the duration in days that the retention policy will be ... | [
"Used",
"to",
"create",
"a",
"new",
"retention",
"policy",
"with",
"optional",
"parameters",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxRetentionPolicy.java#L160-L193 |
icoloma/simpleds | src/main/java/org/simpleds/util/GenericCollectionTypeResolver.java | GenericCollectionTypeResolver.extractTypeFromClass | private static Class<?> extractTypeFromClass(Class clazz, Class<?> source, int typeIndex) {
"""
Extract the generic type from the given Class<?> object.
@param clazz the Class<?> to check
@param source the expected raw source type (can be <code>null</code>)
@param typeIndex the index of the actual type argument... | java | private static Class<?> extractTypeFromClass(Class clazz, Class<?> source, int typeIndex) {
return extractTypeFromClass(null, clazz, source, typeIndex, 1, 1);
} | [
"private",
"static",
"Class",
"<",
"?",
">",
"extractTypeFromClass",
"(",
"Class",
"clazz",
",",
"Class",
"<",
"?",
">",
"source",
",",
"int",
"typeIndex",
")",
"{",
"return",
"extractTypeFromClass",
"(",
"null",
",",
"clazz",
",",
"source",
",",
"typeInde... | Extract the generic type from the given Class<?> object.
@param clazz the Class<?> to check
@param source the expected raw source type (can be <code>null</code>)
@param typeIndex the index of the actual type argument
@return the generic type as Class, or <code>null</code> if none | [
"Extract",
"the",
"generic",
"type",
"from",
"the",
"given",
"Class<?",
">",
"object",
"."
] | train | https://github.com/icoloma/simpleds/blob/b07763df98b9375b764e625f617a6c78df4b068d/src/main/java/org/simpleds/util/GenericCollectionTypeResolver.java#L362-L364 |
openEHR/adl2-core | adl2core-common/src/main/java/org/openehr/adl/am/AmQuery.java | AmQuery.find | @Nullable
public static <T extends CObject> T find(Object obj, String path) {
"""
Gets the object on a path {@code path} relative to {@code obj}
If not found returns null.
The method returns first object found, and does not check if there are more than one matches.
@param obj Root object from which to se... | java | @Nullable
public static <T extends CObject> T find(Object obj, String path) {
return find(obj, RmPath.valueOf(path).segments());
} | [
"@",
"Nullable",
"public",
"static",
"<",
"T",
"extends",
"CObject",
">",
"T",
"find",
"(",
"Object",
"obj",
",",
"String",
"path",
")",
"{",
"return",
"find",
"(",
"obj",
",",
"RmPath",
".",
"valueOf",
"(",
"path",
")",
".",
"segments",
"(",
")",
... | Gets the object on a path {@code path} relative to {@code obj}
If not found returns null.
The method returns first object found, and does not check if there are more than one matches.
@param obj Root object from which to search, Must be either an Archetype or CComplexObject
@param path path identifying the object to ... | [
"Gets",
"the",
"object",
"on",
"a",
"path",
"{",
"@code",
"path",
"}",
"relative",
"to",
"{",
"@code",
"obj",
"}",
"If",
"not",
"found",
"returns",
"null",
".",
"The",
"method",
"returns",
"first",
"object",
"found",
"and",
"does",
"not",
"check",
"if"... | train | https://github.com/openEHR/adl2-core/blob/dd5c1c0fe7ef5e43fbfaf6a0389990ba5380e22c/adl2core-common/src/main/java/org/openehr/adl/am/AmQuery.java#L68-L71 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java | MariaDbDatabaseMetaData.getTablePrivileges | public ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern)
throws SQLException {
"""
Retrieves a description of the access rights for each table available in a catalog. Note that a
table privilege applies to one or more columns in the table. It would be wrong to assum... | java | public ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern)
throws SQLException {
String sql =
"SELECT TABLE_SCHEMA TABLE_CAT,NULL TABLE_SCHEM, TABLE_NAME, NULL GRANTOR,"
+ "GRANTEE, PRIVILEGE_TYPE PRIVILEGE, IS_GRANTABLE FROM INFORMATION_SCHEMA.TA... | [
"public",
"ResultSet",
"getTablePrivileges",
"(",
"String",
"catalog",
",",
"String",
"schemaPattern",
",",
"String",
"tableNamePattern",
")",
"throws",
"SQLException",
"{",
"String",
"sql",
"=",
"\"SELECT TABLE_SCHEMA TABLE_CAT,NULL TABLE_SCHEM, TABLE_NAME, NULL GRANTOR,\"",
... | Retrieves a description of the access rights for each table available in a catalog. Note that a
table privilege applies to one or more columns in the table. It would be wrong to assume that
this privilege applies to all columns (this may be true for some systems but is not true for
all.)
<P>Only privileges matching th... | [
"Retrieves",
"a",
"description",
"of",
"the",
"access",
"rights",
"for",
"each",
"table",
"available",
"in",
"a",
"catalog",
".",
"Note",
"that",
"a",
"table",
"privilege",
"applies",
"to",
"one",
"or",
"more",
"columns",
"in",
"the",
"table",
".",
"It",
... | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbDatabaseMetaData.java#L2134-L2146 |
haraldk/TwelveMonkeys | sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/ExTagSupport.java | ExTagSupport.getInitParameter | public String getInitParameter(String pName, int pScope) {
"""
Returns the initialisation parameter from the scope specified with the
name specified.
@param pName The name of the initialisation parameter to return the
value for.
@param pScope The scope to search for the initialisation parameter
within.
@re... | java | public String getInitParameter(String pName, int pScope) {
switch (pScope) {
case PageContext.PAGE_SCOPE:
return getServletConfig().getInitParameter(pName);
case PageContext.APPLICATION_SCOPE:
return getServletContext().getInitParameter(pName);
... | [
"public",
"String",
"getInitParameter",
"(",
"String",
"pName",
",",
"int",
"pScope",
")",
"{",
"switch",
"(",
"pScope",
")",
"{",
"case",
"PageContext",
".",
"PAGE_SCOPE",
":",
"return",
"getServletConfig",
"(",
")",
".",
"getInitParameter",
"(",
"pName",
"... | Returns the initialisation parameter from the scope specified with the
name specified.
@param pName The name of the initialisation parameter to return the
value for.
@param pScope The scope to search for the initialisation parameter
within.
@return The value of the parameter found. If no parameter with the
name speci... | [
"Returns",
"the",
"initialisation",
"parameter",
"from",
"the",
"scope",
"specified",
"with",
"the",
"name",
"specified",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-servlet/src/main/java/com/twelvemonkeys/servlet/jsp/taglib/ExTagSupport.java#L211-L220 |
spring-projects/spring-android | spring-android-rest-template/src/main/java/org/springframework/http/client/AbstractClientHttpRequestFactoryWrapper.java | AbstractClientHttpRequestFactoryWrapper.createRequest | public final ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod) throws IOException {
"""
This implementation simply calls {@link #createRequest(URI, HttpMethod, ClientHttpRequestFactory)}
with the wrapped request factory provided to the
{@linkplain #AbstractClientHttpRequestFactoryWrapper(ClientHttp... | java | public final ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod) throws IOException {
return createRequest(uri, httpMethod, requestFactory);
} | [
"public",
"final",
"ClientHttpRequest",
"createRequest",
"(",
"URI",
"uri",
",",
"HttpMethod",
"httpMethod",
")",
"throws",
"IOException",
"{",
"return",
"createRequest",
"(",
"uri",
",",
"httpMethod",
",",
"requestFactory",
")",
";",
"}"
] | This implementation simply calls {@link #createRequest(URI, HttpMethod, ClientHttpRequestFactory)}
with the wrapped request factory provided to the
{@linkplain #AbstractClientHttpRequestFactoryWrapper(ClientHttpRequestFactory) constructor}. | [
"This",
"implementation",
"simply",
"calls",
"{"
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-rest-template/src/main/java/org/springframework/http/client/AbstractClientHttpRequestFactoryWrapper.java#L51-L53 |
mahjong4j/mahjong4j | src/main/java/org/mahjong4j/hands/Hands.java | Hands.init | private void init(List<Mentsu> winCandidate, Toitsu toitsu) {
"""
操作変数・面子の候補を初期化し
雀頭の分をストックから減らします
@param winCandidate 面子の候補
@param toitsu この検索サイクルの雀頭候補
"""
// 操作変数を初期化
initStock();
winCandidate.clear();
//ストックから雀頭を減らす
handStocks[toitsu.getTile().getCode()] -=... | java | private void init(List<Mentsu> winCandidate, Toitsu toitsu) {
// 操作変数を初期化
initStock();
winCandidate.clear();
//ストックから雀頭を減らす
handStocks[toitsu.getTile().getCode()] -= 2;
winCandidate.add(toitsu);
} | [
"private",
"void",
"init",
"(",
"List",
"<",
"Mentsu",
">",
"winCandidate",
",",
"Toitsu",
"toitsu",
")",
"{",
"// 操作変数を初期化",
"initStock",
"(",
")",
";",
"winCandidate",
".",
"clear",
"(",
")",
";",
"//ストックから雀頭を減らす",
"handStocks",
"[",
"toitsu",
".",
"getT... | 操作変数・面子の候補を初期化し
雀頭の分をストックから減らします
@param winCandidate 面子の候補
@param toitsu この検索サイクルの雀頭候補 | [
"操作変数・面子の候補を初期化し",
"雀頭の分をストックから減らします"
] | train | https://github.com/mahjong4j/mahjong4j/blob/caa75963286b631ad51953d0d8c71cf6bf79b8f4/src/main/java/org/mahjong4j/hands/Hands.java#L241-L248 |
Azure/azure-sdk-for-java | policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyEventsInner.java | PolicyEventsInner.listQueryResultsForResourceGroupLevelPolicyAssignment | public PolicyEventsQueryResultsInner listQueryResultsForResourceGroupLevelPolicyAssignment(String subscriptionId, String resourceGroupName, String policyAssignmentName, QueryOptions queryOptions) {
"""
Queries policy events for the resource group level policy assignment.
@param subscriptionId Microsoft Azure su... | java | public PolicyEventsQueryResultsInner listQueryResultsForResourceGroupLevelPolicyAssignment(String subscriptionId, String resourceGroupName, String policyAssignmentName, QueryOptions queryOptions) {
return listQueryResultsForResourceGroupLevelPolicyAssignmentWithServiceResponseAsync(subscriptionId, resourceGroup... | [
"public",
"PolicyEventsQueryResultsInner",
"listQueryResultsForResourceGroupLevelPolicyAssignment",
"(",
"String",
"subscriptionId",
",",
"String",
"resourceGroupName",
",",
"String",
"policyAssignmentName",
",",
"QueryOptions",
"queryOptions",
")",
"{",
"return",
"listQueryResul... | Queries policy events for the resource group level policy assignment.
@param subscriptionId Microsoft Azure subscription ID.
@param resourceGroupName Resource group name.
@param policyAssignmentName Policy assignment name.
@param queryOptions Additional parameters for the operation
@throws IllegalArgumentException thr... | [
"Queries",
"policy",
"events",
"for",
"the",
"resource",
"group",
"level",
"policy",
"assignment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyEventsInner.java#L1581-L1583 |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/view/CShareableResource.java | CShareableResource.capHosting | private boolean capHosting(int nIdx, int min, int nbZeroes) {
"""
Reduce the cardinality wrt. the worst case scenario.
@param nIdx the node index
@param min the min (but > 0 ) consumption for a VM
@param nbZeroes the number of VMs consuming 0
@return {@code false} if the problem no longer has a solution
... | java | private boolean capHosting(int nIdx, int min, int nbZeroes) {
Node n = rp.getNode(nIdx);
double capa = getSourceResource().getCapacity(n) * getOverbookRatio(nIdx)/*.getLB()*/;
int card = (int) (capa / min) + nbZeroes + 1;
if (card < source.getMapping().getRunningVMs(n).size()) {
// T... | [
"private",
"boolean",
"capHosting",
"(",
"int",
"nIdx",
",",
"int",
"min",
",",
"int",
"nbZeroes",
")",
"{",
"Node",
"n",
"=",
"rp",
".",
"getNode",
"(",
"nIdx",
")",
";",
"double",
"capa",
"=",
"getSourceResource",
"(",
")",
".",
"getCapacity",
"(",
... | Reduce the cardinality wrt. the worst case scenario.
@param nIdx the node index
@param min the min (but > 0 ) consumption for a VM
@param nbZeroes the number of VMs consuming 0
@return {@code false} if the problem no longer has a solution | [
"Reduce",
"the",
"cardinality",
"wrt",
".",
"the",
"worst",
"case",
"scenario",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/view/CShareableResource.java#L372-L390 |
actframework/actframework | src/main/java/act/ws/WebSocketConnectionManager.java | WebSocketConnectionManager.sendJsonToUser | public void sendJsonToUser(Object data, String username) {
"""
Send JSON representation of given data object to all connections of a user
@param data the data object
@param username the username
"""
sendToUser(JSON.toJSONString(data), username);
} | java | public void sendJsonToUser(Object data, String username) {
sendToUser(JSON.toJSONString(data), username);
} | [
"public",
"void",
"sendJsonToUser",
"(",
"Object",
"data",
",",
"String",
"username",
")",
"{",
"sendToUser",
"(",
"JSON",
".",
"toJSONString",
"(",
"data",
")",
",",
"username",
")",
";",
"}"
] | Send JSON representation of given data object to all connections of a user
@param data the data object
@param username the username | [
"Send",
"JSON",
"representation",
"of",
"given",
"data",
"object",
"to",
"all",
"connections",
"of",
"a",
"user"
] | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/ws/WebSocketConnectionManager.java#L210-L212 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationsInner.java | ReplicationsInner.beginUpdate | public ReplicationInner beginUpdate(String resourceGroupName, String registryName, String replicationName, Map<String, String> tags) {
"""
Updates a replication for a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs... | java | public ReplicationInner beginUpdate(String resourceGroupName, String registryName, String replicationName, Map<String, String> tags) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).toBlocking().single().body();
} | [
"public",
"ReplicationInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"replicationName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"... | Updates a replication for a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param replicationName The name of the replication.
@param tags The tags for the replica... | [
"Updates",
"a",
"replication",
"for",
"a",
"container",
"registry",
"with",
"the",
"specified",
"parameters",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationsInner.java#L815-L817 |
EsotericSoftware/kryonet | src/com/esotericsoftware/kryonet/rmi/ObjectSpace.java | ObjectSpace.getRegisteredID | static int getRegisteredID (Connection connection, Object object) {
"""
Returns the first ID registered for the specified object with any of the ObjectSpaces the specified connection belongs to,
or Integer.MAX_VALUE if not found.
"""
ObjectSpace[] instances = ObjectSpace.instances;
for (int i = 0, n = ins... | java | static int getRegisteredID (Connection connection, Object object) {
ObjectSpace[] instances = ObjectSpace.instances;
for (int i = 0, n = instances.length; i < n; i++) {
ObjectSpace objectSpace = instances[i];
// Check if the connection is in this ObjectSpace.
Connection[] connections = objectSpace.connecti... | [
"static",
"int",
"getRegisteredID",
"(",
"Connection",
"connection",
",",
"Object",
"object",
")",
"{",
"ObjectSpace",
"[",
"]",
"instances",
"=",
"ObjectSpace",
".",
"instances",
";",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"n",
"=",
"instances",
".",
"l... | Returns the first ID registered for the specified object with any of the ObjectSpaces the specified connection belongs to,
or Integer.MAX_VALUE if not found. | [
"Returns",
"the",
"first",
"ID",
"registered",
"for",
"the",
"specified",
"object",
"with",
"any",
"of",
"the",
"ObjectSpaces",
"the",
"specified",
"connection",
"belongs",
"to",
"or",
"Integer",
".",
"MAX_VALUE",
"if",
"not",
"found",
"."
] | train | https://github.com/EsotericSoftware/kryonet/blob/2ed19b4743667664d15e3778447e579855ba3a65/src/com/esotericsoftware/kryonet/rmi/ObjectSpace.java#L669-L683 |
attribyte/wpdb | src/main/java/org/attribyte/wp/db/DB.java | DB.updatePostMetaValue | public void updatePostMetaValue(final long postId, final String metaKey, final String metaValue) throws SQLException {
"""
Updates a post meta value if it exists or inserts if it does not.
@param postId The post id.
@param metaKey The key.
@param metaValue The value.
@throws SQLException on database error.
... | java | public void updatePostMetaValue(final long postId, final String metaKey, final String metaValue) throws SQLException {
Meta currMeta = selectPostMetaValue(postId, metaKey);
if(currMeta == null) {
Connection conn = null;
PreparedStatement stmt = null;
Timer.Context ctx = metrics.s... | [
"public",
"void",
"updatePostMetaValue",
"(",
"final",
"long",
"postId",
",",
"final",
"String",
"metaKey",
",",
"final",
"String",
"metaValue",
")",
"throws",
"SQLException",
"{",
"Meta",
"currMeta",
"=",
"selectPostMetaValue",
"(",
"postId",
",",
"metaKey",
")... | Updates a post meta value if it exists or inserts if it does not.
@param postId The post id.
@param metaKey The key.
@param metaValue The value.
@throws SQLException on database error. | [
"Updates",
"a",
"post",
"meta",
"value",
"if",
"it",
"exists",
"or",
"inserts",
"if",
"it",
"does",
"not",
"."
] | train | https://github.com/attribyte/wpdb/blob/b9adf6131dfb67899ebff770c9bfeb001cc42f30/src/main/java/org/attribyte/wp/db/DB.java#L1947-L1981 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuTexRefGetMipmapLevelClamp | public static int cuTexRefGetMipmapLevelClamp(float pminMipmapLevelClamp[], float pmaxMipmapLevelClamp[], CUtexref hTexRef) {
"""
Gets the min/max mipmap level clamps for a texture reference.
<pre>
CUresult cuTexRefGetMipmapLevelClamp (
float* pminMipmapLevelClamp,
float* pmaxMipmapLevelClamp,
CUtexref hTex... | java | public static int cuTexRefGetMipmapLevelClamp(float pminMipmapLevelClamp[], float pmaxMipmapLevelClamp[], CUtexref hTexRef)
{
return checkResult(cuTexRefGetMipmapLevelClampNative(pminMipmapLevelClamp, pmaxMipmapLevelClamp, hTexRef));
} | [
"public",
"static",
"int",
"cuTexRefGetMipmapLevelClamp",
"(",
"float",
"pminMipmapLevelClamp",
"[",
"]",
",",
"float",
"pmaxMipmapLevelClamp",
"[",
"]",
",",
"CUtexref",
"hTexRef",
")",
"{",
"return",
"checkResult",
"(",
"cuTexRefGetMipmapLevelClampNative",
"(",
"pmi... | Gets the min/max mipmap level clamps for a texture reference.
<pre>
CUresult cuTexRefGetMipmapLevelClamp (
float* pminMipmapLevelClamp,
float* pmaxMipmapLevelClamp,
CUtexref hTexRef )
</pre>
<div>
<p>Gets the min/max mipmap level clamps for
a texture reference. Returns the min/max mipmap level clamps in <tt>pminMipma... | [
"Gets",
"the",
"min",
"/",
"max",
"mipmap",
"level",
"clamps",
"for",
"a",
"texture",
"reference",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L10731-L10734 |
uoa-group-applications/morc | src/main/java/nz/ac/auckland/morc/MorcBuilder.java | MorcBuilder.addPredicates | public Builder addPredicates(int index, Predicate... predicates) {
"""
Add a set of predicates to validate an exchange at a particular offset (n'th message)
@param index The exchange offset that these predicates should be validated against
@param predicates The set of predicates that will do the validatio... | java | public Builder addPredicates(int index, Predicate... predicates) {
while (index >= this.predicates.size()) {
this.predicates.add(new ArrayList<>());
}
this.predicates.get(index).addAll(new ArrayList<>(Arrays.asList(predicates)));
return self();
} | [
"public",
"Builder",
"addPredicates",
"(",
"int",
"index",
",",
"Predicate",
"...",
"predicates",
")",
"{",
"while",
"(",
"index",
">=",
"this",
".",
"predicates",
".",
"size",
"(",
")",
")",
"{",
"this",
".",
"predicates",
".",
"add",
"(",
"new",
"Arr... | Add a set of predicates to validate an exchange at a particular offset (n'th message)
@param index The exchange offset that these predicates should be validated against
@param predicates The set of predicates that will do the validation of the exchange | [
"Add",
"a",
"set",
"of",
"predicates",
"to",
"validate",
"an",
"exchange",
"at",
"a",
"particular",
"offset",
"(",
"n",
"th",
"message",
")"
] | train | https://github.com/uoa-group-applications/morc/blob/3add6308b1fbfc98187364ac73007c83012ea8ba/src/main/java/nz/ac/auckland/morc/MorcBuilder.java#L118-L124 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/Step.java | Step.updateRadioList | protected void updateRadioList(PageElement pageElement, String valueKeyOrKey, Map<String, String> printedValues) throws TechnicalException, FailureException {
"""
Update html radio button by value (value corresponding to key "index").
@param pageElement
Is concerned element
@param valueKeyOrKey
key printedVa... | java | protected void updateRadioList(PageElement pageElement, String valueKeyOrKey, Map<String, String> printedValues) throws TechnicalException, FailureException {
final String valueKey = Context.getValue(valueKeyOrKey) != null ? Context.getValue(valueKeyOrKey) : valueKeyOrKey;
try {
final Lis... | [
"protected",
"void",
"updateRadioList",
"(",
"PageElement",
"pageElement",
",",
"String",
"valueKeyOrKey",
",",
"Map",
"<",
"String",
",",
"String",
">",
"printedValues",
")",
"throws",
"TechnicalException",
",",
"FailureException",
"{",
"final",
"String",
"valueKey... | Update html radio button by value (value corresponding to key "index").
@param pageElement
Is concerned element
@param valueKeyOrKey
key printedValues
@param printedValues
contain all possible value (order by key)
@throws TechnicalException
is thrown if you have a technical error (format, configuration, datas, ...) in... | [
"Update",
"html",
"radio",
"button",
"by",
"value",
"(",
"value",
"corresponding",
"to",
"key",
"index",
")",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/Step.java#L601-L618 |
google/closure-compiler | src/com/google/javascript/rhino/jstype/JSTypeRegistry.java | JSTypeRegistry.registerPropertyOnType | public void registerPropertyOnType(String propertyName, JSType type) {
"""
Tells the type system that {@code owner} may have a property named
{@code propertyName}. This allows the registry to keep track of what
types a property is defined upon.
This is NOT the same as saying that {@code owner} must have a pro... | java | public void registerPropertyOnType(String propertyName, JSType type) {
if (isObjectLiteralThatCanBeSkipped(type)) {
type = getSentinelObjectLiteral();
}
if (type.isUnionType()) {
typesIndexedByProperty.putAll(propertyName, type.toMaybeUnionType().getAlternates());
} else {
typesIndexe... | [
"public",
"void",
"registerPropertyOnType",
"(",
"String",
"propertyName",
",",
"JSType",
"type",
")",
"{",
"if",
"(",
"isObjectLiteralThatCanBeSkipped",
"(",
"type",
")",
")",
"{",
"type",
"=",
"getSentinelObjectLiteral",
"(",
")",
";",
"}",
"if",
"(",
"type"... | Tells the type system that {@code owner} may have a property named
{@code propertyName}. This allows the registry to keep track of what
types a property is defined upon.
This is NOT the same as saying that {@code owner} must have a property
named type. ObjectType#hasProperty attempts to minimize false positives
("if w... | [
"Tells",
"the",
"type",
"system",
"that",
"{",
"@code",
"owner",
"}",
"may",
"have",
"a",
"property",
"named",
"{",
"@code",
"propertyName",
"}",
".",
"This",
"allows",
"the",
"registry",
"to",
"keep",
"track",
"of",
"what",
"types",
"a",
"property",
"is... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/jstype/JSTypeRegistry.java#L911-L926 |
lionsoul2014/jcseg | jcseg-core/src/main/java/org/lionsoul/jcseg/util/TimeUtil.java | TimeUtil.fillTimeToPool | public static final void fillTimeToPool(
IWord[] wPool, String timeVal) {
"""
fill a date-time time part with a standard time format like '15:45:36'
to the specified time pool
@param wPool
@param timeVal
"""
String[] p = timeVal.split(":");
TimeUtil.fillDateTimePool(wPool, ... | java | public static final void fillTimeToPool(
IWord[] wPool, String timeVal)
{
String[] p = timeVal.split(":");
TimeUtil.fillDateTimePool(wPool, TimeUtil.DATETIME_H,
new Word(p[0]+"点", IWord.T_CJK_WORD, Entity.E_TIME_H_A));
TimeUtil.fillDateTimePool(wPool, TimeUtil.DA... | [
"public",
"static",
"final",
"void",
"fillTimeToPool",
"(",
"IWord",
"[",
"]",
"wPool",
",",
"String",
"timeVal",
")",
"{",
"String",
"[",
"]",
"p",
"=",
"timeVal",
".",
"split",
"(",
"\":\"",
")",
";",
"TimeUtil",
".",
"fillDateTimePool",
"(",
"wPool",
... | fill a date-time time part with a standard time format like '15:45:36'
to the specified time pool
@param wPool
@param timeVal | [
"fill",
"a",
"date",
"-",
"time",
"time",
"part",
"with",
"a",
"standard",
"time",
"format",
"like",
"15",
":",
"45",
":",
"36",
"to",
"the",
"specified",
"time",
"pool"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/TimeUtil.java#L178-L191 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/InvokerHelper.java | InvokerHelper.setGroovyObjectProperty | public static void setGroovyObjectProperty(Object newValue, GroovyObject object, String property) {
"""
This is so we don't have to reorder the stack when we call this method.
At some point a better name might be in order.
"""
object.setProperty(property, newValue);
} | java | public static void setGroovyObjectProperty(Object newValue, GroovyObject object, String property) {
object.setProperty(property, newValue);
} | [
"public",
"static",
"void",
"setGroovyObjectProperty",
"(",
"Object",
"newValue",
",",
"GroovyObject",
"object",
",",
"String",
"property",
")",
"{",
"object",
".",
"setProperty",
"(",
"property",
",",
"newValue",
")",
";",
"}"
] | This is so we don't have to reorder the stack when we call this method.
At some point a better name might be in order. | [
"This",
"is",
"so",
"we",
"don",
"t",
"have",
"to",
"reorder",
"the",
"stack",
"when",
"we",
"call",
"this",
"method",
".",
"At",
"some",
"point",
"a",
"better",
"name",
"might",
"be",
"in",
"order",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/InvokerHelper.java#L236-L238 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UPropertyAliases.java | UPropertyAliases.getPropertyValueName | public String getPropertyValueName(int property, int value, int nameChoice) {
"""
Returns a value name given a property enum and a value enum.
Multiple names may be available for each value;
the nameChoice selects among them.
"""
int valueMapIndex=findProperty(property);
if(valueMapIndex==0) ... | java | public String getPropertyValueName(int property, int value, int nameChoice) {
int valueMapIndex=findProperty(property);
if(valueMapIndex==0) {
throw new IllegalArgumentException(
"Invalid property enum "+property+" (0x"+Integer.toHexString(property)+")");
}
... | [
"public",
"String",
"getPropertyValueName",
"(",
"int",
"property",
",",
"int",
"value",
",",
"int",
"nameChoice",
")",
"{",
"int",
"valueMapIndex",
"=",
"findProperty",
"(",
"property",
")",
";",
"if",
"(",
"valueMapIndex",
"==",
"0",
")",
"{",
"throw",
"... | Returns a value name given a property enum and a value enum.
Multiple names may be available for each value;
the nameChoice selects among them. | [
"Returns",
"a",
"value",
"name",
"given",
"a",
"property",
"enum",
"and",
"a",
"value",
"enum",
".",
"Multiple",
"names",
"may",
"be",
"available",
"for",
"each",
"value",
";",
"the",
"nameChoice",
"selects",
"among",
"them",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/UPropertyAliases.java#L257-L270 |
Waikato/moa | moa/src/main/java/moa/classifiers/meta/OnlineAccuracyUpdatedEnsemble.java | OnlineAccuracyUpdatedEnsemble.computeWeight | protected double computeWeight(int i, Instance example) {
"""
Computes the weight of a learner before training a given example.
@param i the identifier (in terms of array learners)
of the classifier for which the weight is supposed to be computed
@param example the newest example
@return the computed weight.
... | java | protected double computeWeight(int i, Instance example) {
int d = this.windowSize;
int t = this.processedInstances - this.ensemble[i].birthday;
double e_it = 0;
double mse_it = 0;
double voteSum = 0;
try{
double[] votes = this.ensemble[i].clas... | [
"protected",
"double",
"computeWeight",
"(",
"int",
"i",
",",
"Instance",
"example",
")",
"{",
"int",
"d",
"=",
"this",
".",
"windowSize",
";",
"int",
"t",
"=",
"this",
".",
"processedInstances",
"-",
"this",
".",
"ensemble",
"[",
"i",
"]",
".",
"birth... | Computes the weight of a learner before training a given example.
@param i the identifier (in terms of array learners)
of the classifier for which the weight is supposed to be computed
@param example the newest example
@return the computed weight. | [
"Computes",
"the",
"weight",
"of",
"a",
"learner",
"before",
"training",
"a",
"given",
"example",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/classifiers/meta/OnlineAccuracyUpdatedEnsemble.java#L300-L346 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java | ApiOvhIpLoadbalancing.serviceName_http_farm_GET | public ArrayList<Long> serviceName_http_farm_GET(String serviceName, Long vrackNetworkId, String zone) throws IOException {
"""
HTTP Farm for this iplb
REST: GET /ipLoadbalancing/{serviceName}/http/farm
@param zone [required] Filter the value of zone property (=)
@param vrackNetworkId [required] Filter the va... | java | public ArrayList<Long> serviceName_http_farm_GET(String serviceName, Long vrackNetworkId, String zone) throws IOException {
String qPath = "/ipLoadbalancing/{serviceName}/http/farm";
StringBuilder sb = path(qPath, serviceName);
query(sb, "vrackNetworkId", vrackNetworkId);
query(sb, "zone", zone);
String resp ... | [
"public",
"ArrayList",
"<",
"Long",
">",
"serviceName_http_farm_GET",
"(",
"String",
"serviceName",
",",
"Long",
"vrackNetworkId",
",",
"String",
"zone",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ipLoadbalancing/{serviceName}/http/farm\"",
";",
"S... | HTTP Farm for this iplb
REST: GET /ipLoadbalancing/{serviceName}/http/farm
@param zone [required] Filter the value of zone property (=)
@param vrackNetworkId [required] Filter the value of vrackNetworkId property (=)
@param serviceName [required] The internal name of your IP load balancing | [
"HTTP",
"Farm",
"for",
"this",
"iplb"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ipLoadbalancing/src/main/java/net/minidev/ovh/api/ApiOvhIpLoadbalancing.java#L507-L514 |
tvesalainen/util | util/src/main/java/d3/env/TSAGeoMag.java | TSAGeoMag.getNorthIntensity | public double getNorthIntensity( double dlat, double dlong, double year, double altitude ) {
"""
Returns the northerly magnetic field intensity from the
Department of Defense geomagnetic model and data
in nano Tesla.
@param dlat Latitude in decimal degrees.
@param dlong Longitude in decimal degrees.
@pa... | java | public double getNorthIntensity( double dlat, double dlong, double year, double altitude )
{
calcGeoMag( dlat, dlong, year, altitude );
return by;
} | [
"public",
"double",
"getNorthIntensity",
"(",
"double",
"dlat",
",",
"double",
"dlong",
",",
"double",
"year",
",",
"double",
"altitude",
")",
"{",
"calcGeoMag",
"(",
"dlat",
",",
"dlong",
",",
"year",
",",
"altitude",
")",
";",
"return",
"by",
";",
"}"
... | Returns the northerly magnetic field intensity from the
Department of Defense geomagnetic model and data
in nano Tesla.
@param dlat Latitude in decimal degrees.
@param dlong Longitude in decimal degrees.
@param year Date of the calculation in decimal years.
@param altitude Altitude of the calculation in kilometer... | [
"Returns",
"the",
"northerly",
"magnetic",
"field",
"intensity",
"from",
"the",
"Department",
"of",
"Defense",
"geomagnetic",
"model",
"and",
"data",
"in",
"nano",
"Tesla",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/d3/env/TSAGeoMag.java#L1073-L1077 |
glyptodon/guacamole-client | guacamole-ext/src/main/java/org/apache/guacamole/token/TokenFilter.java | TokenFilter.filterValues | public void filterValues(Map<?, String> map) {
"""
Given an arbitrary map containing String values, replace each non-null
value with the corresponding filtered value.
@param map
The map whose values should be filtered.
"""
// For each map entry
for (Map.Entry<?, String> entry : map.entryS... | java | public void filterValues(Map<?, String> map) {
// For each map entry
for (Map.Entry<?, String> entry : map.entrySet()) {
// If value is non-null, filter value through this TokenFilter
String value = entry.getValue();
if (value != null)
entry.setValue... | [
"public",
"void",
"filterValues",
"(",
"Map",
"<",
"?",
",",
"String",
">",
"map",
")",
"{",
"// For each map entry",
"for",
"(",
"Map",
".",
"Entry",
"<",
"?",
",",
"String",
">",
"entry",
":",
"map",
".",
"entrySet",
"(",
")",
")",
"{",
"// If valu... | Given an arbitrary map containing String values, replace each non-null
value with the corresponding filtered value.
@param map
The map whose values should be filtered. | [
"Given",
"an",
"arbitrary",
"map",
"containing",
"String",
"values",
"replace",
"each",
"non",
"-",
"null",
"value",
"with",
"the",
"corresponding",
"filtered",
"value",
"."
] | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/guacamole-ext/src/main/java/org/apache/guacamole/token/TokenFilter.java#L236-L248 |
aws/aws-sdk-java | aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/ApiStage.java | ApiStage.withThrottle | public ApiStage withThrottle(java.util.Map<String, ThrottleSettings> throttle) {
"""
<p>
Map containing method level throttling information for API stage in a usage plan.
</p>
@param throttle
Map containing method level throttling information for API stage in a usage plan.
@return Returns a reference to thi... | java | public ApiStage withThrottle(java.util.Map<String, ThrottleSettings> throttle) {
setThrottle(throttle);
return this;
} | [
"public",
"ApiStage",
"withThrottle",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"ThrottleSettings",
">",
"throttle",
")",
"{",
"setThrottle",
"(",
"throttle",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Map containing method level throttling information for API stage in a usage plan.
</p>
@param throttle
Map containing method level throttling information for API stage in a usage plan.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Map",
"containing",
"method",
"level",
"throttling",
"information",
"for",
"API",
"stage",
"in",
"a",
"usage",
"plan",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/ApiStage.java#L162-L165 |
integration-technology/amazon-mws-orders | src/main/java/com/amazonservices/mws/client/MwsUtl.java | MwsUtl.calculateStringToSignV0 | private static String calculateStringToSignV0(Map<String, String> parameters) {
"""
Calculate String to Sign for SignatureVersion 0
@param parameters
request parameters
@return String to Sign
"""
StringBuilder data = new StringBuilder();
data.append(parameters.get("Action")).append(paramet... | java | private static String calculateStringToSignV0(Map<String, String> parameters) {
StringBuilder data = new StringBuilder();
data.append(parameters.get("Action")).append(parameters.get("Timestamp"));
return data.toString();
} | [
"private",
"static",
"String",
"calculateStringToSignV0",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"StringBuilder",
"data",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"data",
".",
"append",
"(",
"parameters",
".",
"get",
"(",
... | Calculate String to Sign for SignatureVersion 0
@param parameters
request parameters
@return String to Sign | [
"Calculate",
"String",
"to",
"Sign",
"for",
"SignatureVersion",
"0"
] | train | https://github.com/integration-technology/amazon-mws-orders/blob/042e8cd5b10588a30150222bf9c91faf4f130b3c/src/main/java/com/amazonservices/mws/client/MwsUtl.java#L128-L132 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/interceptors/InvocationContextImpl.java | InvocationContextImpl.doAroundInvoke | public Object doAroundInvoke(InterceptorProxy[] proxies, Method businessMethod, Object[] parameters, EJSDeployedSupport s) //LIDB3294-41
throws Exception {
"""
Invoke each AroundInvoke interceptor methods for a specified
business method of an EJB being invoked.
@param proxies is an array of... | java | public Object doAroundInvoke(InterceptorProxy[] proxies, Method businessMethod, Object[] parameters, EJSDeployedSupport s) //LIDB3294-41
throws Exception {
ivMethod = businessMethod;
ivParameters = parameters;
ivEJSDeployedSupport = s; //LIDB3294-41
ivInterceptorProxi... | [
"public",
"Object",
"doAroundInvoke",
"(",
"InterceptorProxy",
"[",
"]",
"proxies",
",",
"Method",
"businessMethod",
",",
"Object",
"[",
"]",
"parameters",
",",
"EJSDeployedSupport",
"s",
")",
"//LIDB3294-41",
"throws",
"Exception",
"{",
"ivMethod",
"=",
"business... | Invoke each AroundInvoke interceptor methods for a specified
business method of an EJB being invoked.
@param proxies is an array of InterceptorProxy objects that
represent the list of AroundInvoke interceptor
methods to be invoked.
@param businessMethod is the Method object for invoking the business method.
@param par... | [
"Invoke",
"each",
"AroundInvoke",
"interceptor",
"methods",
"for",
"a",
"specified",
"business",
"method",
"of",
"an",
"EJB",
"being",
"invoked",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/interceptors/InvocationContextImpl.java#L254-L280 |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/PageLeafEntry.java | PageLeafEntry.copyTo | public int copyTo(byte []buffer, int rowOffset, int blobTail) {
"""
Copies the row and its inline blobs to the target buffer.
@return -1 if the row or the blobs can't fit in the new buffer.
"""
byte []blockBuffer = _block.getBuffer();
System.arraycopy(blockBuffer, _rowOffset, buffer, rowOffset, _le... | java | public int copyTo(byte []buffer, int rowOffset, int blobTail)
{
byte []blockBuffer = _block.getBuffer();
System.arraycopy(blockBuffer, _rowOffset, buffer, rowOffset, _length);
return _row.copyBlobs(blockBuffer, _rowOffset, buffer, rowOffset,
blobTail);
} | [
"public",
"int",
"copyTo",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"rowOffset",
",",
"int",
"blobTail",
")",
"{",
"byte",
"[",
"]",
"blockBuffer",
"=",
"_block",
".",
"getBuffer",
"(",
")",
";",
"System",
".",
"arraycopy",
"(",
"blockBuffer",
",",... | Copies the row and its inline blobs to the target buffer.
@return -1 if the row or the blobs can't fit in the new buffer. | [
"Copies",
"the",
"row",
"and",
"its",
"inline",
"blobs",
"to",
"the",
"target",
"buffer",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/PageLeafEntry.java#L108-L116 |
eserating/siren4j | src/main/java/com/google/code/siren4j/util/ReflectionUtils.java | ReflectionUtils.getMethodValue | public static Object getMethodValue(Method method, Object obj) {
"""
Convenience method to retrieve the method value for the specified object wrapped to
catch exceptions and re throw as <code>Siren4JRuntimeException</code>.
@param method cannot be <code>null</code>.
@param obj may be <code>null</code>.
@retu... | java | public static Object getMethodValue(Method method, Object obj) {
if (method == null) {
throw new IllegalArgumentException("method cannot be null.");
}
try {
return method.invoke(obj);
} catch (IllegalArgumentException e) {
throw new Siren4JRunti... | [
"public",
"static",
"Object",
"getMethodValue",
"(",
"Method",
"method",
",",
"Object",
"obj",
")",
"{",
"if",
"(",
"method",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"method cannot be null.\"",
")",
";",
"}",
"try",
"{",
"r... | Convenience method to retrieve the method value for the specified object wrapped to
catch exceptions and re throw as <code>Siren4JRuntimeException</code>.
@param method cannot be <code>null</code>.
@param obj may be <code>null</code>.
@return the value, may be <code>null</code>. | [
"Convenience",
"method",
"to",
"retrieve",
"the",
"method",
"value",
"for",
"the",
"specified",
"object",
"wrapped",
"to",
"catch",
"exceptions",
"and",
"re",
"throw",
"as",
"<code",
">",
"Siren4JRuntimeException<",
"/",
"code",
">",
"."
] | train | https://github.com/eserating/siren4j/blob/f12e3185076ad920352ec4f6eb2a071a3683505f/src/main/java/com/google/code/siren4j/util/ReflectionUtils.java#L365-L378 |
google/identity-toolkit-java-client | src/main/java/com/google/identitytoolkit/GitkitClient.java | GitkitClient.verifyPassword | public GitkitUser verifyPassword(String email, String password, String pendingIdToken, String captchaResponse)
throws GitkitClientException, GitkitServerException {
"""
Verifies the user entered password at Gitkit server.
@param email The email of the user
@param password The password inputed by the user... | java | public GitkitUser verifyPassword(String email, String password, String pendingIdToken, String captchaResponse)
throws GitkitClientException, GitkitServerException {
try {
JSONObject result = rpcHelper.verifyPassword(email, password, pendingIdToken, captchaResponse);
return jsonToUser(result);
... | [
"public",
"GitkitUser",
"verifyPassword",
"(",
"String",
"email",
",",
"String",
"password",
",",
"String",
"pendingIdToken",
",",
"String",
"captchaResponse",
")",
"throws",
"GitkitClientException",
",",
"GitkitServerException",
"{",
"try",
"{",
"JSONObject",
"result... | Verifies the user entered password at Gitkit server.
@param email The email of the user
@param password The password inputed by the user
@param pendingIdToken The GITKit token for the non-trusted IDP, which is to be confirmed by the user
@param captchaResponse Response to the captcha
@return Gitkit user if password is... | [
"Verifies",
"the",
"user",
"entered",
"password",
"at",
"Gitkit",
"server",
"."
] | train | https://github.com/google/identity-toolkit-java-client/blob/61dda1aabbd541ad5e431e840fd266bfca5f8a4a/src/main/java/com/google/identitytoolkit/GitkitClient.java#L231-L239 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.orthoSymmetricLH | public Matrix4f orthoSymmetricLH(float width, float height, float zNear, float zFar, Matrix4f dest) {
"""
Apply a symmetric orthographic projection transformation for a left-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code> to this matrix and store the result in <code>dest</code>.
<p>
... | java | public Matrix4f orthoSymmetricLH(float width, float height, float zNear, float zFar, Matrix4f dest) {
return orthoSymmetricLH(width, height, zNear, zFar, false, dest);
} | [
"public",
"Matrix4f",
"orthoSymmetricLH",
"(",
"float",
"width",
",",
"float",
"height",
",",
"float",
"zNear",
",",
"float",
"zFar",
",",
"Matrix4f",
"dest",
")",
"{",
"return",
"orthoSymmetricLH",
"(",
"width",
",",
"height",
",",
"zNear",
",",
"zFar",
"... | Apply a symmetric orthographic projection transformation for a left-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code> to this matrix and store the result in <code>dest</code>.
<p>
This method is equivalent to calling {@link #orthoLH(float, float, float, float, float, float, Matrix4f) orthoLH(... | [
"Apply",
"a",
"symmetric",
"orthographic",
"projection",
"transformation",
"for",
"a",
"left",
"-",
"handed",
"coordinate",
"system",
"using",
"OpenGL",
"s",
"NDC",
"z",
"range",
"of",
"<code",
">",
"[",
"-",
"1",
"..",
"+",
"1",
"]",
"<",
"/",
"code",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L7569-L7571 |
jimmoores/quandl4j | core/src/main/java/com/jimmoores/quandl/MetaDataResult.java | MetaDataResult.getString | public String getString(final String fieldName) {
"""
Get a String field. Throws a QuandlRuntimeException if it cannot find the field
@param fieldName the name of the field
@return the field value, or null if the field is null
"""
try {
return _jsonObject.getString(fieldName);
} catch (JSONEx... | java | public String getString(final String fieldName) {
try {
return _jsonObject.getString(fieldName);
} catch (JSONException ex) {
throw new RuntimeException("Cannot find field", ex);
}
} | [
"public",
"String",
"getString",
"(",
"final",
"String",
"fieldName",
")",
"{",
"try",
"{",
"return",
"_jsonObject",
".",
"getString",
"(",
"fieldName",
")",
";",
"}",
"catch",
"(",
"JSONException",
"ex",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
... | Get a String field. Throws a QuandlRuntimeException if it cannot find the field
@param fieldName the name of the field
@return the field value, or null if the field is null | [
"Get",
"a",
"String",
"field",
".",
"Throws",
"a",
"QuandlRuntimeException",
"if",
"it",
"cannot",
"find",
"the",
"field"
] | train | https://github.com/jimmoores/quandl4j/blob/5d67ae60279d889da93ae7aa3bf6b7d536f88822/core/src/main/java/com/jimmoores/quandl/MetaDataResult.java#L89-L95 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WLink.java | WLink.setAction | public void setAction(final Action action, final AjaxTarget... actionTargets) {
"""
Sets the action that will run if the link is pressed.
<p>
The intended use of this action is when the link opens a new window or launches another application such as
"mailto".
</p>
@param action the action to execute when th... | java | public void setAction(final Action action, final AjaxTarget... actionTargets) {
LinkModel model = getOrCreateComponentModel();
model.action = action;
model.actionTargets = actionTargets;
} | [
"public",
"void",
"setAction",
"(",
"final",
"Action",
"action",
",",
"final",
"AjaxTarget",
"...",
"actionTargets",
")",
"{",
"LinkModel",
"model",
"=",
"getOrCreateComponentModel",
"(",
")",
";",
"model",
".",
"action",
"=",
"action",
";",
"model",
".",
"a... | Sets the action that will run if the link is pressed.
<p>
The intended use of this action is when the link opens a new window or launches another application such as
"mailto".
</p>
@param action the action to execute when the link is pressed.
@param actionTargets the targets to replace when the link is clicked. | [
"Sets",
"the",
"action",
"that",
"will",
"run",
"if",
"the",
"link",
"is",
"pressed",
".",
"<p",
">",
"The",
"intended",
"use",
"of",
"this",
"action",
"is",
"when",
"the",
"link",
"opens",
"a",
"new",
"window",
"or",
"launches",
"another",
"application"... | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WLink.java#L320-L324 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java | ClassUtil.getDeclaredMethod | public static Method getDeclaredMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) throws SecurityException {
"""
查找指定类中的所有方法(包括非public方法),也包括父类和Object类的方法 找不到方法会返回<code>null</code>
@param clazz 被查找的类
@param methodName 方法名
@param parameterTypes 参数类型
@return 方法
@throws SecurityException 无访... | java | public static Method getDeclaredMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) throws SecurityException {
return ReflectUtil.getMethod(clazz, methodName, parameterTypes);
} | [
"public",
"static",
"Method",
"getDeclaredMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"...",
"parameterTypes",
")",
"throws",
"SecurityException",
"{",
"return",
"ReflectUtil",
".",
"getMethod",
"(",... | 查找指定类中的所有方法(包括非public方法),也包括父类和Object类的方法 找不到方法会返回<code>null</code>
@param clazz 被查找的类
@param methodName 方法名
@param parameterTypes 参数类型
@return 方法
@throws SecurityException 无访问权限抛出异常 | [
"查找指定类中的所有方法(包括非public方法),也包括父类和Object类的方法",
"找不到方法会返回<code",
">",
"null<",
"/",
"code",
">"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ClassUtil.java#L341-L343 |
pravega/pravega | client/src/main/java/io/pravega/client/netty/impl/FlowHandler.java | FlowHandler.createConnectionWithFlowDisabled | public ClientConnection createConnectionWithFlowDisabled(final ReplyProcessor rp) {
"""
Create a {@link ClientConnection} where flows are disabled. This implies that there is only one flow on the underlying
network connection.
@param rp The ReplyProcessor.
@return Client Connection object.
"""
Exce... | java | public ClientConnection createConnectionWithFlowDisabled(final ReplyProcessor rp) {
Exceptions.checkNotClosed(closed.get(), this);
Preconditions.checkState(!disableFlow.getAndSet(true), "Flows are disabled, incorrect usage pattern.");
log.info("Creating a new connection with flow disabled for en... | [
"public",
"ClientConnection",
"createConnectionWithFlowDisabled",
"(",
"final",
"ReplyProcessor",
"rp",
")",
"{",
"Exceptions",
".",
"checkNotClosed",
"(",
"closed",
".",
"get",
"(",
")",
",",
"this",
")",
";",
"Preconditions",
".",
"checkState",
"(",
"!",
"disa... | Create a {@link ClientConnection} where flows are disabled. This implies that there is only one flow on the underlying
network connection.
@param rp The ReplyProcessor.
@return Client Connection object. | [
"Create",
"a",
"{"
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/netty/impl/FlowHandler.java#L80-L86 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/datatable/TreeTableExample.java | TreeTableExample.createTable | private WDataTable createTable() {
"""
Creates and configures the table to be used by the example. The table is configured with global rather than user
data. Although this is not a realistic scenario, it will suffice for this example.
@return a new configured table.
"""
WDataTable tbl = new WDataTable();... | java | private WDataTable createTable() {
WDataTable tbl = new WDataTable();
tbl.addColumn(new WTableColumn("First name", new WTextField()));
tbl.addColumn(new WTableColumn("Last name", new WTextField()));
tbl.addColumn(new WTableColumn("DOB", new WDateField()));
tbl.setExpandMode(ExpandMode.CLIENT);
TableTreeNod... | [
"private",
"WDataTable",
"createTable",
"(",
")",
"{",
"WDataTable",
"tbl",
"=",
"new",
"WDataTable",
"(",
")",
";",
"tbl",
".",
"addColumn",
"(",
"new",
"WTableColumn",
"(",
"\"First name\"",
",",
"new",
"WTextField",
"(",
")",
")",
")",
";",
"tbl",
"."... | Creates and configures the table to be used by the example. The table is configured with global rather than user
data. Although this is not a realistic scenario, it will suffice for this example.
@return a new configured table. | [
"Creates",
"and",
"configures",
"the",
"table",
"to",
"be",
"used",
"by",
"the",
"example",
".",
"The",
"table",
"is",
"configured",
"with",
"global",
"rather",
"than",
"user",
"data",
".",
"Although",
"this",
"is",
"not",
"a",
"realistic",
"scenario",
"it... | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/datatable/TreeTableExample.java#L55-L66 |
craftercms/profile | security-provider/src/main/java/org/craftercms/security/servlet/filters/RequestSecurityFilter.java | RequestSecurityFilter.getLastProcessorInChain | protected RequestSecurityProcessor getLastProcessorInChain(final FilterChain chain) {
"""
Returns the last processor of the chain, which should actually call the {@link FilterChain}.
"""
return new RequestSecurityProcessor() {
public void processRequest(RequestContext context, RequestSecur... | java | protected RequestSecurityProcessor getLastProcessorInChain(final FilterChain chain) {
return new RequestSecurityProcessor() {
public void processRequest(RequestContext context, RequestSecurityProcessorChain processorChain) throws
Exception {
chain.doFilter(context.ge... | [
"protected",
"RequestSecurityProcessor",
"getLastProcessorInChain",
"(",
"final",
"FilterChain",
"chain",
")",
"{",
"return",
"new",
"RequestSecurityProcessor",
"(",
")",
"{",
"public",
"void",
"processRequest",
"(",
"RequestContext",
"context",
",",
"RequestSecurityProce... | Returns the last processor of the chain, which should actually call the {@link FilterChain}. | [
"Returns",
"the",
"last",
"processor",
"of",
"the",
"chain",
"which",
"should",
"actually",
"call",
"the",
"{"
] | train | https://github.com/craftercms/profile/blob/d829c1136b0fd21d87dc925cb7046cbd38a300a4/security-provider/src/main/java/org/craftercms/security/servlet/filters/RequestSecurityFilter.java#L188-L197 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java | QrCodeUtil.generate | public static void generate(String content, QrConfig config, String imageType, OutputStream out) {
"""
生成二维码到输出流
@param content 文本内容
@param config 二维码配置,包括长、宽、边距、颜色等
@param imageType 图片类型(图片扩展名),见{@link ImgUtil}
@param out 目标流
@since 4.1.2
"""
final BufferedImage image = generate(content, config);
... | java | public static void generate(String content, QrConfig config, String imageType, OutputStream out) {
final BufferedImage image = generate(content, config);
ImgUtil.write(image, imageType, out);
} | [
"public",
"static",
"void",
"generate",
"(",
"String",
"content",
",",
"QrConfig",
"config",
",",
"String",
"imageType",
",",
"OutputStream",
"out",
")",
"{",
"final",
"BufferedImage",
"image",
"=",
"generate",
"(",
"content",
",",
"config",
")",
";",
"ImgUt... | 生成二维码到输出流
@param content 文本内容
@param config 二维码配置,包括长、宽、边距、颜色等
@param imageType 图片类型(图片扩展名),见{@link ImgUtil}
@param out 目标流
@since 4.1.2 | [
"生成二维码到输出流"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/qrcode/QrCodeUtil.java#L120-L123 |
alkacon/opencms-core | src/org/opencms/ui/apps/cacheadmin/CmsImageCacheTable.java | CmsImageCacheTable.openExplorerForParent | void openExplorerForParent(String rootPath, String uuid) {
"""
Opens the explorer for given path and selected resource.<p>
@param rootPath to be opened
@param uuid to be selected
"""
String parentPath = CmsResource.getParentFolder(rootPath);
CmsAppWorkplaceUi.get().getNavigator().navigate... | java | void openExplorerForParent(String rootPath, String uuid) {
String parentPath = CmsResource.getParentFolder(rootPath);
CmsAppWorkplaceUi.get().getNavigator().navigateTo(
CmsFileExplorerConfiguration.APP_ID
+ "/"
+ A_CmsUI.getCmsObject().getRequestContext().ge... | [
"void",
"openExplorerForParent",
"(",
"String",
"rootPath",
",",
"String",
"uuid",
")",
"{",
"String",
"parentPath",
"=",
"CmsResource",
".",
"getParentFolder",
"(",
"rootPath",
")",
";",
"CmsAppWorkplaceUi",
".",
"get",
"(",
")",
".",
"getNavigator",
"(",
")"... | Opens the explorer for given path and selected resource.<p>
@param rootPath to be opened
@param uuid to be selected | [
"Opens",
"the",
"explorer",
"for",
"given",
"path",
"and",
"selected",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/cacheadmin/CmsImageCacheTable.java#L389-L404 |
RestComm/sipunit | src/main/java/org/cafesip/sipunit/SipAssert.java | SipAssert.assertRequestNotReceived | public static void assertRequestNotReceived(String msg, String method, MessageListener obj) {
"""
Asserts that the given message listener object has not received a request with the indicated
request method. Assertion failure output includes the given message text.
@param msg message text to output if the asser... | java | public static void assertRequestNotReceived(String msg, String method, MessageListener obj) {
assertNotNull("Null assert object passed in", obj);
assertFalse(msg, requestReceived(method, obj));
} | [
"public",
"static",
"void",
"assertRequestNotReceived",
"(",
"String",
"msg",
",",
"String",
"method",
",",
"MessageListener",
"obj",
")",
"{",
"assertNotNull",
"(",
"\"Null assert object passed in\"",
",",
"obj",
")",
";",
"assertFalse",
"(",
"msg",
",",
"request... | Asserts that the given message listener object has not received a request with the indicated
request method. Assertion failure output includes the given message text.
@param msg message text to output if the assertion fails.
@param method The request method to verify absent (eg, SipRequest.BYE)
@param obj The MessageL... | [
"Asserts",
"that",
"the",
"given",
"message",
"listener",
"object",
"has",
"not",
"received",
"a",
"request",
"with",
"the",
"indicated",
"request",
"method",
".",
"Assertion",
"failure",
"output",
"includes",
"the",
"given",
"message",
"text",
"."
] | train | https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipAssert.java#L519-L522 |
trellis-ldp/trellis | core/http/src/main/java/org/trellisldp/http/impl/PatchHandler.java | PatchHandler.initialize | public ResponseBuilder initialize(final Resource parent, final Resource resource) {
"""
Initialze the handler with a Trellis resource.
@param parent the parent resource
@param resource the Trellis resource
@return a response builder
"""
if (MISSING_RESOURCE.equals(resource)) {
// Can'... | java | public ResponseBuilder initialize(final Resource parent, final Resource resource) {
if (MISSING_RESOURCE.equals(resource)) {
// Can't patch non-existent resources
throw new NotFoundException();
} else if (DELETED_RESOURCE.equals(resource)) {
// Can't patch non-existe... | [
"public",
"ResponseBuilder",
"initialize",
"(",
"final",
"Resource",
"parent",
",",
"final",
"Resource",
"resource",
")",
"{",
"if",
"(",
"MISSING_RESOURCE",
".",
"equals",
"(",
"resource",
")",
")",
"{",
"// Can't patch non-existent resources",
"throw",
"new",
"N... | Initialze the handler with a Trellis resource.
@param parent the parent resource
@param resource the Trellis resource
@return a response builder | [
"Initialze",
"the",
"handler",
"with",
"a",
"Trellis",
"resource",
"."
] | train | https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/core/http/src/main/java/org/trellisldp/http/impl/PatchHandler.java#L118-L146 |
albfernandez/javadbf | src/main/java/com/linuxense/javadbf/Utils.java | Utils.textPadding | @Deprecated
public static byte[] textPadding(String text, String characterSetName, int length, int alignment)
throws UnsupportedEncodingException {
"""
Obtais the data to store in file for a text field.
Text is truncated if exceed field capacity. Uses spaces as padding
@param text the text to write
@param c... | java | @Deprecated
public static byte[] textPadding(String text, String characterSetName, int length, int alignment)
throws UnsupportedEncodingException {
return textPadding(text, characterSetName, length, alignment, (byte) ' ');
} | [
"@",
"Deprecated",
"public",
"static",
"byte",
"[",
"]",
"textPadding",
"(",
"String",
"text",
",",
"String",
"characterSetName",
",",
"int",
"length",
",",
"int",
"alignment",
")",
"throws",
"UnsupportedEncodingException",
"{",
"return",
"textPadding",
"(",
"te... | Obtais the data to store in file for a text field.
Text is truncated if exceed field capacity. Uses spaces as padding
@param text the text to write
@param characterSetName The charset to use
@param length field length
@param alignment where to align the data
@return byte[] to store in the file
@throws UnsupportedEncodi... | [
"Obtais",
"the",
"data",
"to",
"store",
"in",
"file",
"for",
"a",
"text",
"field",
".",
"Text",
"is",
"truncated",
"if",
"exceed",
"field",
"capacity",
".",
"Uses",
"spaces",
"as",
"padding"
] | train | https://github.com/albfernandez/javadbf/blob/ac9867b46786cb055bce9323e2cf074365207693/src/main/java/com/linuxense/javadbf/Utils.java#L247-L252 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/beagle/Beagle.java | Beagle.changeVector | private DoubleVector changeVector(DoubleVector data, int[] orderVector) {
"""
Shuffle the given vector based on the ordering information given in
{@code orderVector}.
@param data The vector to be shuffled.
@param orderVector The ordering of values to be used.
@return The shuffled version of {@code data}.
... | java | private DoubleVector changeVector(DoubleVector data, int[] orderVector) {
DoubleVector result = new DenseVector(indexVectorSize);
for (int i = 0; i < indexVectorSize; i++)
result.set(i, data.get(orderVector[i]));
return result;
} | [
"private",
"DoubleVector",
"changeVector",
"(",
"DoubleVector",
"data",
",",
"int",
"[",
"]",
"orderVector",
")",
"{",
"DoubleVector",
"result",
"=",
"new",
"DenseVector",
"(",
"indexVectorSize",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
... | Shuffle the given vector based on the ordering information given in
{@code orderVector}.
@param data The vector to be shuffled.
@param orderVector The ordering of values to be used.
@return The shuffled version of {@code data}. | [
"Shuffle",
"the",
"given",
"vector",
"based",
"on",
"the",
"ordering",
"information",
"given",
"in",
"{",
"@code",
"orderVector",
"}",
"."
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/beagle/Beagle.java#L419-L424 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSet.java | UnicodeSet._generatePattern | public StringBuffer _generatePattern(StringBuffer result,
boolean escapeUnprintable, boolean includeStrings) {
"""
Generate and append a string representation of this set to result.
This does not use this.pat, the cleaned up copy of the string
passed to applyPattern().
@param includeStrings if false... | java | public StringBuffer _generatePattern(StringBuffer result,
boolean escapeUnprintable, boolean includeStrings) {
return appendNewPattern(result, escapeUnprintable, includeStrings);
} | [
"public",
"StringBuffer",
"_generatePattern",
"(",
"StringBuffer",
"result",
",",
"boolean",
"escapeUnprintable",
",",
"boolean",
"includeStrings",
")",
"{",
"return",
"appendNewPattern",
"(",
"result",
",",
"escapeUnprintable",
",",
"includeStrings",
")",
";",
"}"
] | Generate and append a string representation of this set to result.
This does not use this.pat, the cleaned up copy of the string
passed to applyPattern().
@param includeStrings if false, doesn't include the strings. | [
"Generate",
"and",
"append",
"a",
"string",
"representation",
"of",
"this",
"set",
"to",
"result",
".",
"This",
"does",
"not",
"use",
"this",
".",
"pat",
"the",
"cleaned",
"up",
"copy",
"of",
"the",
"string",
"passed",
"to",
"applyPattern",
"()",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnicodeSet.java#L749-L752 |
JodaOrg/joda-time | src/main/java/org/joda/time/chrono/GJChronology.java | GJChronology.getInstance | public static GJChronology getInstance(
DateTimeZone zone,
ReadableInstant gregorianCutover,
int minDaysInFirstWeek) {
"""
Factory method returns instances of the GJ cutover chronology. Any
cutover date may be specified.
@param zone the time zone to use, null is default
@p... | java | public static GJChronology getInstance(
DateTimeZone zone,
ReadableInstant gregorianCutover,
int minDaysInFirstWeek) {
zone = DateTimeUtils.getZone(zone);
Instant cutoverInstant;
if (gregorianCutover == null) {
cutoverInstant = DEFAULT_CUT... | [
"public",
"static",
"GJChronology",
"getInstance",
"(",
"DateTimeZone",
"zone",
",",
"ReadableInstant",
"gregorianCutover",
",",
"int",
"minDaysInFirstWeek",
")",
"{",
"zone",
"=",
"DateTimeUtils",
".",
"getZone",
"(",
"zone",
")",
";",
"Instant",
"cutoverInstant",
... | Factory method returns instances of the GJ cutover chronology. Any
cutover date may be specified.
@param zone the time zone to use, null is default
@param gregorianCutover the cutover to use, null means default
@param minDaysInFirstWeek minimum number of days in first week of the year; default is 4 | [
"Factory",
"method",
"returns",
"instances",
"of",
"the",
"GJ",
"cutover",
"chronology",
".",
"Any",
"cutover",
"date",
"may",
"be",
"specified",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/GJChronology.java#L183-L222 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxHttpResponse.java | BoxHttpResponse.getBody | public InputStream getBody(ProgressListener listener) throws BoxException {
"""
Gets an InputStream for reading this response's body which will report its read progress to a ProgressListener.
@param listener a listener for monitoring the read progress of the body.
@return an InputStream for reading the response... | java | public InputStream getBody(ProgressListener listener) throws BoxException {
if (this.mInputStream == null) {
String contentEncoding = mConnection.getContentEncoding();
try {
if (this.rawInputStream == null) {
this.rawInputStream = mConnection.getInputS... | [
"public",
"InputStream",
"getBody",
"(",
"ProgressListener",
"listener",
")",
"throws",
"BoxException",
"{",
"if",
"(",
"this",
".",
"mInputStream",
"==",
"null",
")",
"{",
"String",
"contentEncoding",
"=",
"mConnection",
".",
"getContentEncoding",
"(",
")",
";"... | Gets an InputStream for reading this response's body which will report its read progress to a ProgressListener.
@param listener a listener for monitoring the read progress of the body.
@return an InputStream for reading the response's body.
@throws BoxException thrown if there was an issue getting the body including n... | [
"Gets",
"an",
"InputStream",
"for",
"reading",
"this",
"response",
"s",
"body",
"which",
"will",
"report",
"its",
"read",
"progress",
"to",
"a",
"ProgressListener",
"."
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxHttpResponse.java#L103-L128 |
RestComm/mss-arquillian | mss-arquillian-container-extension/src/main/java/org/jboss/arquillian/container/mss/extension/ContainerProducer.java | ContainerProducer.executeBeforeClass | public void executeBeforeClass(@Observes BeforeClass event, TestClass testClass) {
"""
/*
Use @BeforeClass event in order to scan the test class for annotation we might be interesting.
Event fired Before the Class execution.
"""
testClass = event.getTestClass();
Field[] fields = testClass.getJavaClass().... | java | public void executeBeforeClass(@Observes BeforeClass event, TestClass testClass){
testClass = event.getTestClass();
Field[] fields = testClass.getJavaClass().getDeclaredFields();
for (Field field : fields) {
if (field.isAnnotationPresent(GetDeployableContainer.class)){
if (field.getType().isAssignableFrom(... | [
"public",
"void",
"executeBeforeClass",
"(",
"@",
"Observes",
"BeforeClass",
"event",
",",
"TestClass",
"testClass",
")",
"{",
"testClass",
"=",
"event",
".",
"getTestClass",
"(",
")",
";",
"Field",
"[",
"]",
"fields",
"=",
"testClass",
".",
"getJavaClass",
... | /*
Use @BeforeClass event in order to scan the test class for annotation we might be interesting.
Event fired Before the Class execution. | [
"/",
"*",
"Use"
] | train | https://github.com/RestComm/mss-arquillian/blob/d217b4e53701282c6e7176365a03be6f898342be/mss-arquillian-container-extension/src/main/java/org/jboss/arquillian/container/mss/extension/ContainerProducer.java#L37-L48 |
vtatai/srec | core/src/main/java/com/github/srec/command/method/MethodCommand.java | MethodCommand.validateParameters | protected void validateParameters(Map<String, Value> callParameters) {
"""
Validates the parameters.
@param callParameters The runtime (call) params
"""
for (String name : callParameters.keySet()) {
if (!parameters.containsKey(name)) throw new IllegalParametersException("Parameter not su... | java | protected void validateParameters(Map<String, Value> callParameters) {
for (String name : callParameters.keySet()) {
if (!parameters.containsKey(name)) throw new IllegalParametersException("Parameter not supported: " + name);
}
for (Map.Entry<String, MethodParameter> entry : paramete... | [
"protected",
"void",
"validateParameters",
"(",
"Map",
"<",
"String",
",",
"Value",
">",
"callParameters",
")",
"{",
"for",
"(",
"String",
"name",
":",
"callParameters",
".",
"keySet",
"(",
")",
")",
"{",
"if",
"(",
"!",
"parameters",
".",
"containsKey",
... | Validates the parameters.
@param callParameters The runtime (call) params | [
"Validates",
"the",
"parameters",
"."
] | train | https://github.com/vtatai/srec/blob/87fa6754a6a5f8569ef628db4d149eea04062568/core/src/main/java/com/github/srec/command/method/MethodCommand.java#L103-L113 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeEncoder.java | QrCodeEncoder.getLengthBits | private static int getLengthBits(int version, int bitsA, int bitsB, int bitsC) {
"""
Returns the length of the message length variable in bits. Dependent on version
"""
int lengthBits;
if (version < 10)
lengthBits = bitsA;
else if (version < 27)
lengthBits = bitsB;
else
lengthBits = bitsC;
... | java | private static int getLengthBits(int version, int bitsA, int bitsB, int bitsC) {
int lengthBits;
if (version < 10)
lengthBits = bitsA;
else if (version < 27)
lengthBits = bitsB;
else
lengthBits = bitsC;
return lengthBits;
} | [
"private",
"static",
"int",
"getLengthBits",
"(",
"int",
"version",
",",
"int",
"bitsA",
",",
"int",
"bitsB",
",",
"int",
"bitsC",
")",
"{",
"int",
"lengthBits",
";",
"if",
"(",
"version",
"<",
"10",
")",
"lengthBits",
"=",
"bitsA",
";",
"else",
"if",
... | Returns the length of the message length variable in bits. Dependent on version | [
"Returns",
"the",
"length",
"of",
"the",
"message",
"length",
"variable",
"in",
"bits",
".",
"Dependent",
"on",
"version"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/QrCodeEncoder.java#L459-L469 |
killme2008/xmemcached | src/main/java/com/google/code/yanf4j/buffer/IoBuffer.java | IoBuffer.allocate | public static IoBuffer allocate(int capacity, boolean direct) {
"""
Returns the buffer which is capable of the specified size.
@param capacity the capacity of the buffer
@param direct <tt>true</tt> to get a direct buffer, <tt>false</tt> to get a heap buffer.
"""
if (capacity < 0) {
throw new Ille... | java | public static IoBuffer allocate(int capacity, boolean direct) {
if (capacity < 0) {
throw new IllegalArgumentException("capacity: " + capacity);
}
return allocator.allocate(capacity, direct);
} | [
"public",
"static",
"IoBuffer",
"allocate",
"(",
"int",
"capacity",
",",
"boolean",
"direct",
")",
"{",
"if",
"(",
"capacity",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"capacity: \"",
"+",
"capacity",
")",
";",
"}",
"return",
... | Returns the buffer which is capable of the specified size.
@param capacity the capacity of the buffer
@param direct <tt>true</tt> to get a direct buffer, <tt>false</tt> to get a heap buffer. | [
"Returns",
"the",
"buffer",
"which",
"is",
"capable",
"of",
"the",
"specified",
"size",
"."
] | train | https://github.com/killme2008/xmemcached/blob/66150915938813b3e3413de1d7b43b6ff9b1478d/src/main/java/com/google/code/yanf4j/buffer/IoBuffer.java#L201-L207 |
landawn/AbacusUtil | src/com/landawn/abacus/util/stream/Collectors.java | Collectors.minAll | @SuppressWarnings("rawtypes")
public static <T extends Comparable> Collector<T, ?, List<T>> minAll(final boolean areAllSmallestSame) {
"""
Use occurrences to save the count of largest objects if {@code areAllSmallestSame = true}(e.g. {@code Number/String/...}) and return a list by repeat the smallest object {... | java | @SuppressWarnings("rawtypes")
public static <T extends Comparable> Collector<T, ?, List<T>> minAll(final boolean areAllSmallestSame) {
return minAll(Integer.MAX_VALUE, areAllSmallestSame);
} | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"static",
"<",
"T",
"extends",
"Comparable",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"List",
"<",
"T",
">",
">",
"minAll",
"(",
"final",
"boolean",
"areAllSmallestSame",
")",
"{",
"return",
... | Use occurrences to save the count of largest objects if {@code areAllSmallestSame = true}(e.g. {@code Number/String/...}) and return a list by repeat the smallest object {@code n} times.
@param areAllSmallestSame
@return
@see Collectors#maxAll(Comparator, int, boolean) | [
"Use",
"occurrences",
"to",
"save",
"the",
"count",
"of",
"largest",
"objects",
"if",
"{",
"@code",
"areAllSmallestSame",
"=",
"true",
"}",
"(",
"e",
".",
"g",
".",
"{",
"@code",
"Number",
"/",
"String",
"/",
"...",
"}",
")",
"and",
"return",
"a",
"l... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/Collectors.java#L2548-L2551 |
lessthanoptimal/ddogleg | src/org/ddogleg/nn/alg/searches/KdTreeSearchBestBinFirst.java | KdTreeSearchBestBinFirst.searchNode | protected void searchNode(P target, KdTree.Node n) {
"""
Traverse a node down to a leaf. Unexplored branches are added to the priority queue.
"""
while( n != null) {
checkBestDistance(n, target);
if( n.isLeaf() )
break;
// select the most promising branch to investigate first
KdTree.Node n... | java | protected void searchNode(P target, KdTree.Node n) {
while( n != null) {
checkBestDistance(n, target);
if( n.isLeaf() )
break;
// select the most promising branch to investigate first
KdTree.Node nearer,further;
double splitValue = distance.valueAt( (P)n.point , n.split );
if( distance.value... | [
"protected",
"void",
"searchNode",
"(",
"P",
"target",
",",
"KdTree",
".",
"Node",
"n",
")",
"{",
"while",
"(",
"n",
"!=",
"null",
")",
"{",
"checkBestDistance",
"(",
"n",
",",
"target",
")",
";",
"if",
"(",
"n",
".",
"isLeaf",
"(",
")",
")",
"br... | Traverse a node down to a leaf. Unexplored branches are added to the priority queue. | [
"Traverse",
"a",
"node",
"down",
"to",
"a",
"leaf",
".",
"Unexplored",
"branches",
"are",
"added",
"to",
"the",
"priority",
"queue",
"."
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/nn/alg/searches/KdTreeSearchBestBinFirst.java#L136-L164 |
codelibs/jcifs | src/main/java/jcifs/smb1/smb1/SmbFile.java | SmbFile.listFiles | public SmbFile[] listFiles( SmbFilenameFilter filter ) throws SmbException {
"""
List the contents of this SMB resource. The list returned will be
identical to the list returned by the parameterless <code>listFiles()</code>
method minus files filtered by the specified filename filter.
@param filter a filter t... | java | public SmbFile[] listFiles( SmbFilenameFilter filter ) throws SmbException {
return listFiles( "*", ATTR_DIRECTORY | ATTR_HIDDEN | ATTR_SYSTEM, filter, null );
} | [
"public",
"SmbFile",
"[",
"]",
"listFiles",
"(",
"SmbFilenameFilter",
"filter",
")",
"throws",
"SmbException",
"{",
"return",
"listFiles",
"(",
"\"*\"",
",",
"ATTR_DIRECTORY",
"|",
"ATTR_HIDDEN",
"|",
"ATTR_SYSTEM",
",",
"filter",
",",
"null",
")",
";",
"}"
] | List the contents of this SMB resource. The list returned will be
identical to the list returned by the parameterless <code>listFiles()</code>
method minus files filtered by the specified filename filter.
@param filter a filter to exclude files from the results
@return An array of <tt>SmbFile</tt> objects
@throws SmbE... | [
"List",
"the",
"contents",
"of",
"this",
"SMB",
"resource",
".",
"The",
"list",
"returned",
"will",
"be",
"identical",
"to",
"the",
"list",
"returned",
"by",
"the",
"parameterless",
"<code",
">",
"listFiles",
"()",
"<",
"/",
"code",
">",
"method",
"minus",... | train | https://github.com/codelibs/jcifs/blob/ac6a8ba2925648ae003ca2508aec32316065dc34/src/main/java/jcifs/smb1/smb1/SmbFile.java#L1696-L1698 |
osglworks/java-tool-ext | src/main/java/org/osgl/util/Token.java | Token.parseToken | @Deprecated
public static Token parseToken(String secret, String token) {
"""
This method is deprecated. Please use {@link #parseToken(byte[], String)} instead
Parse a token string into token object
@param token the token string
@param secret the secret to decrypt the token string
@return a token instanc... | java | @Deprecated
public static Token parseToken(String secret, String token) {
return parseToken(secret.getBytes(Charsets.UTF_8), token);
} | [
"@",
"Deprecated",
"public",
"static",
"Token",
"parseToken",
"(",
"String",
"secret",
",",
"String",
"token",
")",
"{",
"return",
"parseToken",
"(",
"secret",
".",
"getBytes",
"(",
"Charsets",
".",
"UTF_8",
")",
",",
"token",
")",
";",
"}"
] | This method is deprecated. Please use {@link #parseToken(byte[], String)} instead
Parse a token string into token object
@param token the token string
@param secret the secret to decrypt the token string
@return a token instance parsed from the string | [
"This",
"method",
"is",
"deprecated",
".",
"Please",
"use",
"{",
"@link",
"#parseToken",
"(",
"byte",
"[]",
"String",
")",
"}",
"instead"
] | train | https://github.com/osglworks/java-tool-ext/blob/43f034bd0a42e571e437f44aa20487d45248a30b/src/main/java/org/osgl/util/Token.java#L354-L357 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.