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 |
|---|---|---|---|---|---|---|---|---|---|---|
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/PROCLUS.java | PROCLUS.findDimensions | private long[][] findDimensions(ArrayDBIDs medoids, Relation<V> database, DistanceQuery<V> distFunc, RangeQuery<V> rangeQuery) {
"""
Determines the set of correlated dimensions for each medoid in the
specified medoid set.
@param medoids the set of medoids
@param database the database containing the objects
@... | java | private long[][] findDimensions(ArrayDBIDs medoids, Relation<V> database, DistanceQuery<V> distFunc, RangeQuery<V> rangeQuery) {
// get localities
DataStore<DBIDs> localities = getLocalities(medoids, distFunc, rangeQuery);
// compute x_ij = avg distance from points in l_i to medoid m_i
final int dim = ... | [
"private",
"long",
"[",
"]",
"[",
"]",
"findDimensions",
"(",
"ArrayDBIDs",
"medoids",
",",
"Relation",
"<",
"V",
">",
"database",
",",
"DistanceQuery",
"<",
"V",
">",
"distFunc",
",",
"RangeQuery",
"<",
"V",
">",
"rangeQuery",
")",
"{",
"// get localities... | Determines the set of correlated dimensions for each medoid in the
specified medoid set.
@param medoids the set of medoids
@param database the database containing the objects
@param distFunc the distance function
@return the set of correlated dimensions for each medoid in the specified
medoid set | [
"Determines",
"the",
"set",
"of",
"correlated",
"dimensions",
"for",
"each",
"medoid",
"in",
"the",
"specified",
"medoid",
"set",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/PROCLUS.java#L378-L405 |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.verifyFactor | public Boolean verifyFactor(long userId, long deviceId, String otpToken, String stateToken) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
"""
Authenticates a one-time password (OTP) code provided by a multifactor authentication (MFA) device.
@param userId
The id of the user.
@param ... | java | public Boolean verifyFactor(long userId, long deviceId, String otpToken, String stateToken) throws OAuthSystemException, OAuthProblemException, URISyntaxException
{
cleanError();
prepareToken();
URIBuilder url = new URIBuilder(settings.getURL(Constants.VERIFY_FACTOR_URL, userId, deviceId));
url = new UR... | [
"public",
"Boolean",
"verifyFactor",
"(",
"long",
"userId",
",",
"long",
"deviceId",
",",
"String",
"otpToken",
",",
"String",
"stateToken",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
... | Authenticates a one-time password (OTP) code provided by a multifactor authentication (MFA) device.
@param userId
The id of the user.
@param deviceId
The id of the MFA device.
@param otpToken
OTP code provided by the device or SMS message sent to user.
When a device like OneLogin Protect that supports Push has
been us... | [
"Authenticates",
"a",
"one",
"-",
"time",
"password",
"(",
"OTP",
")",
"code",
"provided",
"by",
"a",
"multifactor",
"authentication",
"(",
"MFA",
")",
"device",
"."
] | train | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L2838-L2875 |
ThreeTen/threeten-extra | src/main/java/org/threeten/extra/chrono/EthiopicDate.java | EthiopicDate.ofYearDay | static EthiopicDate ofYearDay(int prolepticYear, int dayOfYear) {
"""
Obtains a {@code EthiopicDate} representing a date in the Ethiopic calendar
system from the proleptic-year and day-of-year fields.
<p>
This returns a {@code EthiopicDate} with the specified fields.
The day must be valid for the year, otherwi... | java | static EthiopicDate ofYearDay(int prolepticYear, int dayOfYear) {
EthiopicChronology.YEAR_RANGE.checkValidValue(prolepticYear, YEAR);
DAY_OF_YEAR.range().checkValidValue(dayOfYear, DAY_OF_YEAR);
if (dayOfYear == 366 && EthiopicChronology.INSTANCE.isLeapYear(prolepticYear) == false) {
... | [
"static",
"EthiopicDate",
"ofYearDay",
"(",
"int",
"prolepticYear",
",",
"int",
"dayOfYear",
")",
"{",
"EthiopicChronology",
".",
"YEAR_RANGE",
".",
"checkValidValue",
"(",
"prolepticYear",
",",
"YEAR",
")",
";",
"DAY_OF_YEAR",
".",
"range",
"(",
")",
".",
"ch... | Obtains a {@code EthiopicDate} representing a date in the Ethiopic calendar
system from the proleptic-year and day-of-year fields.
<p>
This returns a {@code EthiopicDate} with the specified fields.
The day must be valid for the year, otherwise an exception will be thrown.
@param prolepticYear the Ethiopic proleptic-y... | [
"Obtains",
"a",
"{",
"@code",
"EthiopicDate",
"}",
"representing",
"a",
"date",
"in",
"the",
"Ethiopic",
"calendar",
"system",
"from",
"the",
"proleptic",
"-",
"year",
"and",
"day",
"-",
"of",
"-",
"year",
"fields",
".",
"<p",
">",
"This",
"returns",
"a"... | train | https://github.com/ThreeTen/threeten-extra/blob/e94ecd3592ef70e54d6eea21095239ea9ffbab78/src/main/java/org/threeten/extra/chrono/EthiopicDate.java#L203-L210 |
logic-ng/LogicNG | src/main/java/org/logicng/solvers/maxsat/encodings/Encoder.java | Encoder.encodePB | public void encodePB(final MiniSatStyleSolver s, final LNGIntVector lits, final LNGIntVector coeffs, int rhs) {
"""
Encodes a pseudo-Boolean constraint.
@param s the solver
@param lits the literals of the constraint
@param coeffs the coefficients of the constraints
@param rhs the right hand side of t... | java | public void encodePB(final MiniSatStyleSolver s, final LNGIntVector lits, final LNGIntVector coeffs, int rhs) {
switch (this.pbEncoding) {
case SWC:
this.swc.encode(s, lits, coeffs, rhs);
break;
default:
throw new IllegalStateException("Unknown pseudo-Boolean encoding: " + this.p... | [
"public",
"void",
"encodePB",
"(",
"final",
"MiniSatStyleSolver",
"s",
",",
"final",
"LNGIntVector",
"lits",
",",
"final",
"LNGIntVector",
"coeffs",
",",
"int",
"rhs",
")",
"{",
"switch",
"(",
"this",
".",
"pbEncoding",
")",
"{",
"case",
"SWC",
":",
"this"... | Encodes a pseudo-Boolean constraint.
@param s the solver
@param lits the literals of the constraint
@param coeffs the coefficients of the constraints
@param rhs the right hand side of the constraint
@throws IllegalStateException if the pseudo-Boolean encoding is unknown | [
"Encodes",
"a",
"pseudo",
"-",
"Boolean",
"constraint",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/solvers/maxsat/encodings/Encoder.java#L252-L260 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/CharsTrieBuilder.java | CharsTrieBuilder.writeDeltaTo | @Deprecated
@Override
protected int writeDeltaTo(int jumpTarget) {
"""
{@inheritDoc}
@deprecated This API is ICU internal only.
@hide draft / provisional / internal are hidden on Android
"""
int i=charsLength-jumpTarget;
assert(i>=0);
if(i<=CharsTrie.kMaxOneUnitDelta) {
... | java | @Deprecated
@Override
protected int writeDeltaTo(int jumpTarget) {
int i=charsLength-jumpTarget;
assert(i>=0);
if(i<=CharsTrie.kMaxOneUnitDelta) {
return write(i);
}
int length;
if(i<=CharsTrie.kMaxTwoUnitDelta) {
intUnits[0]=(char)(CharsTr... | [
"@",
"Deprecated",
"@",
"Override",
"protected",
"int",
"writeDeltaTo",
"(",
"int",
"jumpTarget",
")",
"{",
"int",
"i",
"=",
"charsLength",
"-",
"jumpTarget",
";",
"assert",
"(",
"i",
">=",
"0",
")",
";",
"if",
"(",
"i",
"<=",
"CharsTrie",
".",
"kMaxOn... | {@inheritDoc}
@deprecated This API is ICU internal only.
@hide draft / provisional / internal are hidden on Android | [
"{"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/CharsTrieBuilder.java#L251-L270 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java | JDBC4PreparedStatement.setURL | @Override
public void setURL(int parameterIndex, URL x) throws SQLException {
"""
Sets the designated parameter to the given java.net.URL value.
"""
checkParameterBounds(parameterIndex);
this.parameters[parameterIndex-1] = x == null ? VoltType.NULL_STRING_OR_VARBINARY : x.toString();
} | java | @Override
public void setURL(int parameterIndex, URL x) throws SQLException
{
checkParameterBounds(parameterIndex);
this.parameters[parameterIndex-1] = x == null ? VoltType.NULL_STRING_OR_VARBINARY : x.toString();
} | [
"@",
"Override",
"public",
"void",
"setURL",
"(",
"int",
"parameterIndex",
",",
"URL",
"x",
")",
"throws",
"SQLException",
"{",
"checkParameterBounds",
"(",
"parameterIndex",
")",
";",
"this",
".",
"parameters",
"[",
"parameterIndex",
"-",
"1",
"]",
"=",
"x"... | Sets the designated parameter to the given java.net.URL value. | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"java",
".",
"net",
".",
"URL",
"value",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java#L599-L604 |
grails/grails-core | grails-core/src/main/groovy/grails/util/GrailsClassUtils.java | GrailsClassUtils.getStaticFieldValue | public static Object getStaticFieldValue(Class<?> clazz, String name) {
"""
<p>Get a static field value.</p>
@param clazz The class to check for static property
@param name The field name
@return The value if there is one, or null if unset OR there is no such field
"""
Field field = ReflectionUtil... | java | public static Object getStaticFieldValue(Class<?> clazz, String name) {
Field field = ReflectionUtils.findField(clazz, name);
if (field != null) {
ReflectionUtils.makeAccessible(field);
try {
return field.get(clazz);
} catch (IllegalAccessException ign... | [
"public",
"static",
"Object",
"getStaticFieldValue",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"name",
")",
"{",
"Field",
"field",
"=",
"ReflectionUtils",
".",
"findField",
"(",
"clazz",
",",
"name",
")",
";",
"if",
"(",
"field",
"!=",
"null",... | <p>Get a static field value.</p>
@param clazz The class to check for static property
@param name The field name
@return The value if there is one, or null if unset OR there is no such field | [
"<p",
">",
"Get",
"a",
"static",
"field",
"value",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/grails/util/GrailsClassUtils.java#L580-L589 |
webmetrics/browsermob-proxy | src/main/java/org/xbill/DNS/spi/DNSJavaNameService.java | DNSJavaNameService.getHostByAddr | public String getHostByAddr(byte [] addr) throws UnknownHostException {
"""
Performs a reverse DNS lookup.
@param addr The ip address to lookup.
@return The host name found for the ip address.
"""
Name name = ReverseMap.fromAddress(InetAddress.getByAddress(addr));
Record [] records = new Lookup(name, Type.... | java | public String getHostByAddr(byte [] addr) throws UnknownHostException {
Name name = ReverseMap.fromAddress(InetAddress.getByAddress(addr));
Record [] records = new Lookup(name, Type.PTR).run();
if (records == null)
throw new UnknownHostException();
return ((PTRRecord) records[0]).getTarget().toString();
} | [
"public",
"String",
"getHostByAddr",
"(",
"byte",
"[",
"]",
"addr",
")",
"throws",
"UnknownHostException",
"{",
"Name",
"name",
"=",
"ReverseMap",
".",
"fromAddress",
"(",
"InetAddress",
".",
"getByAddress",
"(",
"addr",
")",
")",
";",
"Record",
"[",
"]",
... | Performs a reverse DNS lookup.
@param addr The ip address to lookup.
@return The host name found for the ip address. | [
"Performs",
"a",
"reverse",
"DNS",
"lookup",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/spi/DNSJavaNameService.java#L150-L156 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.updateKeyAsync | public ServiceFuture<KeyBundle> updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, List<JsonWebKeyOperation> keyOps, KeyAttributes keyAttributes, Map<String, String> tags, final ServiceCallback<KeyBundle> serviceCallback) {
"""
The update key operation changes specified attributes of a stored k... | java | public ServiceFuture<KeyBundle> updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, List<JsonWebKeyOperation> keyOps, KeyAttributes keyAttributes, Map<String, String> tags, final ServiceCallback<KeyBundle> serviceCallback) {
return ServiceFuture.fromResponse(updateKeyWithServiceResponseAsync(... | [
"public",
"ServiceFuture",
"<",
"KeyBundle",
">",
"updateKeyAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"keyName",
",",
"String",
"keyVersion",
",",
"List",
"<",
"JsonWebKeyOperation",
">",
"keyOps",
",",
"KeyAttributes",
"keyAttributes",
",",
"Map",
"<"... | The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.
In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires... | [
"The",
"update",
"key",
"operation",
"changes",
"specified",
"attributes",
"of",
"a",
"stored",
"key",
"and",
"can",
"be",
"applied",
"to",
"any",
"key",
"type",
"and",
"key",
"version",
"stored",
"in",
"Azure",
"Key",
"Vault",
".",
"In",
"order",
"to",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L1292-L1294 |
lessthanoptimal/BoofCV | examples/src/main/java/boofcv/examples/features/ExampleLineDetection.java | ExampleLineDetection.detectLines | public static<T extends ImageGray<T>, D extends ImageGray<D>>
void detectLines( BufferedImage image ,
Class<T> imageType ,
Class<D> derivType ) {
"""
Detects lines inside the image using different types of Hough detectors
@param image Input image.
@param imageType Type of image processed ... | java | public static<T extends ImageGray<T>, D extends ImageGray<D>>
void detectLines( BufferedImage image ,
Class<T> imageType ,
Class<D> derivType )
{
// convert the line into a single band image
T input = ConvertBufferedImage.convertFromSingle(image, null, imageType );
// Comment/uncomment to ... | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
",",
"D",
"extends",
"ImageGray",
"<",
"D",
">",
">",
"void",
"detectLines",
"(",
"BufferedImage",
"image",
",",
"Class",
"<",
"T",
">",
"imageType",
",",
"Class",
"<",
"D",
">",
"d... | Detects lines inside the image using different types of Hough detectors
@param image Input image.
@param imageType Type of image processed by line detector.
@param derivType Type of image derivative. | [
"Detects",
"lines",
"inside",
"the",
"image",
"using",
"different",
"types",
"of",
"Hough",
"detectors"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/examples/src/main/java/boofcv/examples/features/ExampleLineDetection.java#L63-L88 |
sdl/odata | odata_renderer/src/main/java/com/sdl/odata/renderer/json/writer/JsonWriter.java | JsonWriter.writeJson | private String writeJson(Object data, Map<String, Object> meta) throws IOException, NoSuchFieldException,
IllegalAccessException, ODataEdmException, ODataRenderException {
"""
Write the given data to the JSON stream. The data to write will be either a single entity or a feed depending on
whether it is... | java | private String writeJson(Object data, Map<String, Object> meta) throws IOException, NoSuchFieldException,
IllegalAccessException, ODataEdmException, ODataRenderException {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
jsonGenerator = JSON_FACTORY.createGenerator(stream, JsonEn... | [
"private",
"String",
"writeJson",
"(",
"Object",
"data",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"meta",
")",
"throws",
"IOException",
",",
"NoSuchFieldException",
",",
"IllegalAccessException",
",",
"ODataEdmException",
",",
"ODataRenderException",
"{",
"B... | Write the given data to the JSON stream. The data to write will be either a single entity or a feed depending on
whether it is a single object or list.
@param data The given data.
@param meta Additional values to write.
@return The written JSON stream.
@throws ODataRenderException if unable to render | [
"Write",
"the",
"given",
"data",
"to",
"the",
"JSON",
"stream",
".",
"The",
"data",
"to",
"write",
"will",
"be",
"either",
"a",
"single",
"entity",
"or",
"a",
"feed",
"depending",
"on",
"whether",
"it",
"is",
"a",
"single",
"object",
"or",
"list",
"."
... | train | https://github.com/sdl/odata/blob/eb747d73e9af0f4e59a25b82ed656e526a7e2189/odata_renderer/src/main/java/com/sdl/odata/renderer/json/writer/JsonWriter.java#L168-L215 |
geomajas/geomajas-project-geometry | core/src/main/java/org/geomajas/geometry/service/GeometryService.java | GeometryService.toPolygon | public static Geometry toPolygon(Bbox bounds) {
"""
Transform the given bounding box into a polygon geometry.
@param bounds The bounding box to transform.
@return Returns the polygon equivalent of the given bounding box.
"""
double minX = bounds.getX();
double minY = bounds.getY();
double maxX = boun... | java | public static Geometry toPolygon(Bbox bounds) {
double minX = bounds.getX();
double minY = bounds.getY();
double maxX = bounds.getMaxX();
double maxY = bounds.getMaxY();
Geometry polygon = new Geometry(Geometry.POLYGON, 0, -1);
Geometry linearRing = new Geometry(Geometry.LINEAR_RING, 0, -1);
linearRing.... | [
"public",
"static",
"Geometry",
"toPolygon",
"(",
"Bbox",
"bounds",
")",
"{",
"double",
"minX",
"=",
"bounds",
".",
"getX",
"(",
")",
";",
"double",
"minY",
"=",
"bounds",
".",
"getY",
"(",
")",
";",
"double",
"maxX",
"=",
"bounds",
".",
"getMaxX",
"... | Transform the given bounding box into a polygon geometry.
@param bounds The bounding box to transform.
@return Returns the polygon equivalent of the given bounding box. | [
"Transform",
"the",
"given",
"bounding",
"box",
"into",
"a",
"polygon",
"geometry",
"."
] | train | https://github.com/geomajas/geomajas-project-geometry/blob/09a214fede69c9c01e41630828c4abbb551a557d/core/src/main/java/org/geomajas/geometry/service/GeometryService.java#L140-L153 |
adobe/htl-tck | src/main/java/io/sightly/tck/html/HTMLExtractor.java | HTMLExtractor.innerHTML | public static String innerHTML(String url, String markup, String selector) {
"""
Retrieves the content of the matched elements, without their own markup tags, identified by the {@code selector} from the given
{@code markup}. The {@code url} is used only for caching purposes, to avoid parsing multiple times the ma... | java | public static String innerHTML(String url, String markup, String selector) {
ensureMarkup(url, markup);
Document document = documents.get(url);
Elements elements = document.select(selector);
return elements.html();
} | [
"public",
"static",
"String",
"innerHTML",
"(",
"String",
"url",
",",
"String",
"markup",
",",
"String",
"selector",
")",
"{",
"ensureMarkup",
"(",
"url",
",",
"markup",
")",
";",
"Document",
"document",
"=",
"documents",
".",
"get",
"(",
"url",
")",
";"... | Retrieves the content of the matched elements, without their own markup tags, identified by the {@code selector} from the given
{@code markup}. The {@code url} is used only for caching purposes, to avoid parsing multiple times the markup returned for the
same resource.
@param url the url that identifies the marku... | [
"Retrieves",
"the",
"content",
"of",
"the",
"matched",
"elements",
"without",
"their",
"own",
"markup",
"tags",
"identified",
"by",
"the",
"{",
"@code",
"selector",
"}",
"from",
"the",
"given",
"{",
"@code",
"markup",
"}",
".",
"The",
"{",
"@code",
"url",
... | train | https://github.com/adobe/htl-tck/blob/2043a9616083c06cefbd685798c9a2b2ac2ea98e/src/main/java/io/sightly/tck/html/HTMLExtractor.java#L40-L45 |
samskivert/samskivert | src/main/java/com/samskivert/swing/LabelSausage.java | LabelSausage.drawBase | protected void drawBase (Graphics2D gfx, int x, int y) {
"""
Draws the base sausage within which all the other decorations are added.
"""
gfx.fillRoundRect(
x, y, _size.width - 1, _size.height - 1, _dia, _dia);
} | java | protected void drawBase (Graphics2D gfx, int x, int y)
{
gfx.fillRoundRect(
x, y, _size.width - 1, _size.height - 1, _dia, _dia);
} | [
"protected",
"void",
"drawBase",
"(",
"Graphics2D",
"gfx",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"gfx",
".",
"fillRoundRect",
"(",
"x",
",",
"y",
",",
"_size",
".",
"width",
"-",
"1",
",",
"_size",
".",
"height",
"-",
"1",
",",
"_dia",
",",... | Draws the base sausage within which all the other decorations are added. | [
"Draws",
"the",
"base",
"sausage",
"within",
"which",
"all",
"the",
"other",
"decorations",
"are",
"added",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/LabelSausage.java#L127-L131 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapperFieldModel.java | DynamoDBMapperFieldModel.betweenAny | public final Condition betweenAny(final V lo, final V hi) {
"""
Creates a condition which filters on any non-null argument; if {@code lo}
is null a {@code LE} condition is applied on {@code hi}, if {@code hi}
is null a {@code GE} condition is applied on {@code lo}.
@param lo The start of the range (inclusive).
... | java | public final Condition betweenAny(final V lo, final V hi) {
return lo == null ? (hi == null ? null : le(hi)) : (hi == null ? ge(lo) : (lo.equals(hi) ? eq(lo) : between(lo,hi)));
} | [
"public",
"final",
"Condition",
"betweenAny",
"(",
"final",
"V",
"lo",
",",
"final",
"V",
"hi",
")",
"{",
"return",
"lo",
"==",
"null",
"?",
"(",
"hi",
"==",
"null",
"?",
"null",
":",
"le",
"(",
"hi",
")",
")",
":",
"(",
"hi",
"==",
"null",
"?"... | Creates a condition which filters on any non-null argument; if {@code lo}
is null a {@code LE} condition is applied on {@code hi}, if {@code hi}
is null a {@code GE} condition is applied on {@code lo}.
@param lo The start of the range (inclusive).
@param hi The end of the range (inclusive).
@return The condition or nul... | [
"Creates",
"a",
"condition",
"which",
"filters",
"on",
"any",
"non",
"-",
"null",
"argument",
";",
"if",
"{"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/DynamoDBMapperFieldModel.java#L385-L387 |
amaembo/streamex | src/main/java/one/util/streamex/StreamEx.java | StreamEx.zipWith | public <V, R> StreamEx<R> zipWith(Stream<V> other, BiFunction<? super T, ? super V, ? extends R> mapper) {
"""
Creates a new {@link StreamEx} which is the result of applying of the
mapper {@code BiFunction} to the corresponding elements of this stream
and the supplied other stream. The resulting stream is ordere... | java | public <V, R> StreamEx<R> zipWith(Stream<V> other, BiFunction<? super T, ? super V, ? extends R> mapper) {
return zipWith((BaseStream<V, ?>) other, mapper);
} | [
"public",
"<",
"V",
",",
"R",
">",
"StreamEx",
"<",
"R",
">",
"zipWith",
"(",
"Stream",
"<",
"V",
">",
"other",
",",
"BiFunction",
"<",
"?",
"super",
"T",
",",
"?",
"super",
"V",
",",
"?",
"extends",
"R",
">",
"mapper",
")",
"{",
"return",
"zip... | Creates a new {@link StreamEx} which is the result of applying of the
mapper {@code BiFunction} to the corresponding elements of this stream
and the supplied other stream. The resulting stream is ordered if both of
the input streams are ordered, and parallel if either of the input
streams is parallel. When the resultin... | [
"Creates",
"a",
"new",
"{",
"@link",
"StreamEx",
"}",
"which",
"is",
"the",
"result",
"of",
"applying",
"of",
"the",
"mapper",
"{",
"@code",
"BiFunction",
"}",
"to",
"the",
"corresponding",
"elements",
"of",
"this",
"stream",
"and",
"the",
"supplied",
"oth... | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/StreamEx.java#L1838-L1840 |
jcustenborder/connect-utils | connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/ConfigUtils.java | ConfigUtils.passwordBytes | public static byte[] passwordBytes(AbstractConfig config, String key) {
"""
Method is used to return an array of bytes representing the password stored in the config.
@param config Config to read from
@param key Key to read from
@return byte array containing the password
"""
return passwordBytes(co... | java | public static byte[] passwordBytes(AbstractConfig config, String key) {
return passwordBytes(config, key, Charsets.UTF_8);
} | [
"public",
"static",
"byte",
"[",
"]",
"passwordBytes",
"(",
"AbstractConfig",
"config",
",",
"String",
"key",
")",
"{",
"return",
"passwordBytes",
"(",
"config",
",",
"key",
",",
"Charsets",
".",
"UTF_8",
")",
";",
"}"
] | Method is used to return an array of bytes representing the password stored in the config.
@param config Config to read from
@param key Key to read from
@return byte array containing the password | [
"Method",
"is",
"used",
"to",
"return",
"an",
"array",
"of",
"bytes",
"representing",
"the",
"password",
"stored",
"in",
"the",
"config",
"."
] | train | https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/ConfigUtils.java#L329-L331 |
Omertron/api-omdb | src/main/java/com/omertron/omdbapi/tools/OmdbBuilder.java | OmdbBuilder.setTitle | public OmdbBuilder setTitle(final String title) throws OMDBException {
"""
The title to search for
@param title
@return
@throws OMDBException
"""
if (StringUtils.isBlank(title)) {
throw new OMDBException(ApiExceptionType.UNKNOWN_CAUSE, "Must provide a title!");
}
params... | java | public OmdbBuilder setTitle(final String title) throws OMDBException {
if (StringUtils.isBlank(title)) {
throw new OMDBException(ApiExceptionType.UNKNOWN_CAUSE, "Must provide a title!");
}
params.add(Param.TITLE, title);
return this;
} | [
"public",
"OmdbBuilder",
"setTitle",
"(",
"final",
"String",
"title",
")",
"throws",
"OMDBException",
"{",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"title",
")",
")",
"{",
"throw",
"new",
"OMDBException",
"(",
"ApiExceptionType",
".",
"UNKNOWN_CAUSE",
",... | The title to search for
@param title
@return
@throws OMDBException | [
"The",
"title",
"to",
"search",
"for"
] | train | https://github.com/Omertron/api-omdb/blob/acb506ded2d7b8a4159b48161ffab8cb5b7bad44/src/main/java/com/omertron/omdbapi/tools/OmdbBuilder.java#L89-L95 |
mapsforge/mapsforge | mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java | MercatorProjection.calculateGroundResolutionWithScaleFactor | public static double calculateGroundResolutionWithScaleFactor(double latitude, double scaleFactor, int tileSize) {
"""
Calculates the distance on the ground that is represented by a single pixel on the map.
@param latitude the latitude coordinate at which the resolution should be calculated.
@param scaleFac... | java | public static double calculateGroundResolutionWithScaleFactor(double latitude, double scaleFactor, int tileSize) {
long mapSize = getMapSizeWithScaleFactor(scaleFactor, tileSize);
return Math.cos(latitude * (Math.PI / 180)) * EARTH_CIRCUMFERENCE / mapSize;
} | [
"public",
"static",
"double",
"calculateGroundResolutionWithScaleFactor",
"(",
"double",
"latitude",
",",
"double",
"scaleFactor",
",",
"int",
"tileSize",
")",
"{",
"long",
"mapSize",
"=",
"getMapSizeWithScaleFactor",
"(",
"scaleFactor",
",",
"tileSize",
")",
";",
"... | Calculates the distance on the ground that is represented by a single pixel on the map.
@param latitude the latitude coordinate at which the resolution should be calculated.
@param scaleFactor the scale at which the resolution should be calculated.
@return the ground resolution at the given latitude and scale. | [
"Calculates",
"the",
"distance",
"on",
"the",
"ground",
"that",
"is",
"represented",
"by",
"a",
"single",
"pixel",
"on",
"the",
"map",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-core/src/main/java/org/mapsforge/core/util/MercatorProjection.java#L62-L65 |
craftercms/deployer | src/main/java/org/craftercms/deployer/utils/ConfigUtils.java | ConfigUtils.loadYamlConfiguration | public static YamlConfiguration loadYamlConfiguration(Resource resource) throws DeployerConfigurationException {
"""
Loads the specified resource as {@link YamlConfiguration}.
@param resource the YAML configuration resource to load
@return the YAML configuration
@throws DeployerConfigurationException if an er... | java | public static YamlConfiguration loadYamlConfiguration(Resource resource) throws DeployerConfigurationException {
try {
try (Reader reader = new BufferedReader(new InputStreamReader(resource.getInputStream(), "UTF-8"))) {
return doLoadYamlConfiguration(reader);
}
}... | [
"public",
"static",
"YamlConfiguration",
"loadYamlConfiguration",
"(",
"Resource",
"resource",
")",
"throws",
"DeployerConfigurationException",
"{",
"try",
"{",
"try",
"(",
"Reader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"resour... | Loads the specified resource as {@link YamlConfiguration}.
@param resource the YAML configuration resource to load
@return the YAML configuration
@throws DeployerConfigurationException if an error occurred | [
"Loads",
"the",
"specified",
"resource",
"as",
"{",
"@link",
"YamlConfiguration",
"}",
"."
] | train | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/utils/ConfigUtils.java#L72-L80 |
liferay/com-liferay-commerce | commerce-user-segment-service/src/main/java/com/liferay/commerce/user/segment/service/persistence/impl/CommerceUserSegmentEntryPersistenceImpl.java | CommerceUserSegmentEntryPersistenceImpl.removeByG_K | @Override
public CommerceUserSegmentEntry removeByG_K(long groupId, String key)
throws NoSuchUserSegmentEntryException {
"""
Removes the commerce user segment entry where groupId = ? and key = ? from the database.
@param groupId the group ID
@param key the key
@return the commerce user segment entr... | java | @Override
public CommerceUserSegmentEntry removeByG_K(long groupId, String key)
throws NoSuchUserSegmentEntryException {
CommerceUserSegmentEntry commerceUserSegmentEntry = findByG_K(groupId,
key);
return remove(commerceUserSegmentEntry);
} | [
"@",
"Override",
"public",
"CommerceUserSegmentEntry",
"removeByG_K",
"(",
"long",
"groupId",
",",
"String",
"key",
")",
"throws",
"NoSuchUserSegmentEntryException",
"{",
"CommerceUserSegmentEntry",
"commerceUserSegmentEntry",
"=",
"findByG_K",
"(",
"groupId",
",",
"key",... | Removes the commerce user segment entry where groupId = ? and key = ? from the database.
@param groupId the group ID
@param key the key
@return the commerce user segment entry that was removed | [
"Removes",
"the",
"commerce",
"user",
"segment",
"entry",
"where",
"groupId",
"=",
"?",
";",
"and",
"key",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-user-segment-service/src/main/java/com/liferay/commerce/user/segment/service/persistence/impl/CommerceUserSegmentEntryPersistenceImpl.java#L1142-L1149 |
code4everything/util | src/main/java/com/zhazhapan/util/NetUtils.java | NetUtils.removeCookie | public static boolean removeCookie(String name, Cookie[] cookies, HttpServletResponse response) {
"""
删除指定Cookie
@param name Cookie名
@param cookies {@link Cookie}
@param response {@link HttpServletResponse}
@return {@link Boolean}
@since 1.0.8
"""
if (Checker.isNotEmpty(name) && Checker.isNo... | java | public static boolean removeCookie(String name, Cookie[] cookies, HttpServletResponse response) {
if (Checker.isNotEmpty(name) && Checker.isNotEmpty(cookies)) {
for (Cookie cookie : cookies) {
if (name.equals(cookie.getName())) {
return removeCookie(cookie, respon... | [
"public",
"static",
"boolean",
"removeCookie",
"(",
"String",
"name",
",",
"Cookie",
"[",
"]",
"cookies",
",",
"HttpServletResponse",
"response",
")",
"{",
"if",
"(",
"Checker",
".",
"isNotEmpty",
"(",
"name",
")",
"&&",
"Checker",
".",
"isNotEmpty",
"(",
... | 删除指定Cookie
@param name Cookie名
@param cookies {@link Cookie}
@param response {@link HttpServletResponse}
@return {@link Boolean}
@since 1.0.8 | [
"删除指定Cookie"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/NetUtils.java#L533-L542 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/util/Config.java | Config.getProperty | public static String getProperty(String key, String aDefault) {
"""
Retrieves a configuration property as a String object.
Loads the file if not already initialized.
@param key Key Name of the property to be returned.
@param aDefault the default value
@return Value of the property as a string or null if no... | java | public static String getProperty(String key, String aDefault)
{
return getSettings().getProperty(key, aDefault);
} | [
"public",
"static",
"String",
"getProperty",
"(",
"String",
"key",
",",
"String",
"aDefault",
")",
"{",
"return",
"getSettings",
"(",
")",
".",
"getProperty",
"(",
"key",
",",
"aDefault",
")",
";",
"}"
] | Retrieves a configuration property as a String object.
Loads the file if not already initialized.
@param key Key Name of the property to be returned.
@param aDefault the default value
@return Value of the property as a string or null if no property found. | [
"Retrieves",
"a",
"configuration",
"property",
"as",
"a",
"String",
"object",
"."
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/util/Config.java#L251-L255 |
ops4j/org.ops4j.pax.exam2 | containers/pax-exam-container-eclipse/src/main/java/org/ops4j/pax/exam/container/eclipse/impl/parser/AbstractParser.java | AbstractParser.getAttribute | protected static String getAttribute(Node node, String name, boolean required) {
"""
Get an Attribute from the given node and throwing an exception in the case it is required but
not present
@param node
@param name
@param required
@return
"""
NamedNodeMap attributes = node.getAttributes();
... | java | protected static String getAttribute(Node node, String name, boolean required) {
NamedNodeMap attributes = node.getAttributes();
Node idNode = attributes.getNamedItem(name);
if (idNode == null) {
if (required) {
throw new IllegalArgumentException(toPath(node) + "... | [
"protected",
"static",
"String",
"getAttribute",
"(",
"Node",
"node",
",",
"String",
"name",
",",
"boolean",
"required",
")",
"{",
"NamedNodeMap",
"attributes",
"=",
"node",
".",
"getAttributes",
"(",
")",
";",
"Node",
"idNode",
"=",
"attributes",
".",
"getN... | Get an Attribute from the given node and throwing an exception in the case it is required but
not present
@param node
@param name
@param required
@return | [
"Get",
"an",
"Attribute",
"from",
"the",
"given",
"node",
"and",
"throwing",
"an",
"exception",
"in",
"the",
"case",
"it",
"is",
"required",
"but",
"not",
"present"
] | train | https://github.com/ops4j/org.ops4j.pax.exam2/blob/7f83796cbbb857123d8fc7fe817a7637218d5d77/containers/pax-exam-container-eclipse/src/main/java/org/ops4j/pax/exam/container/eclipse/impl/parser/AbstractParser.java#L109-L127 |
elastic/elasticsearch-hadoop | mr/src/main/java/org/elasticsearch/hadoop/rest/pooling/PooledHttpTransportFactory.java | PooledHttpTransportFactory.borrowFrom | private Transport borrowFrom(TransportPool pool, String hostInfo) {
"""
Creates a Transport using the given TransportPool.
@param pool Transport is borrowed from
@param hostInfo For logging purposes
@return A Transport backed by a pooled resource
"""
if (!pool.getJobPoolingKey().equals(jobKey)) {
... | java | private Transport borrowFrom(TransportPool pool, String hostInfo) {
if (!pool.getJobPoolingKey().equals(jobKey)) {
throw new EsHadoopIllegalArgumentException("PooledTransportFactory found a pool with a different owner than this job. " +
"This could be a different job incorrectly ... | [
"private",
"Transport",
"borrowFrom",
"(",
"TransportPool",
"pool",
",",
"String",
"hostInfo",
")",
"{",
"if",
"(",
"!",
"pool",
".",
"getJobPoolingKey",
"(",
")",
".",
"equals",
"(",
"jobKey",
")",
")",
"{",
"throw",
"new",
"EsHadoopIllegalArgumentException",... | Creates a Transport using the given TransportPool.
@param pool Transport is borrowed from
@param hostInfo For logging purposes
@return A Transport backed by a pooled resource | [
"Creates",
"a",
"Transport",
"using",
"the",
"given",
"TransportPool",
"."
] | train | https://github.com/elastic/elasticsearch-hadoop/blob/f3acaba268ff96efae8eb946088c748c777c22cc/mr/src/main/java/org/elasticsearch/hadoop/rest/pooling/PooledHttpTransportFactory.java#L101-L114 |
lionsoul2014/jcseg | jcseg-core/src/main/java/org/lionsoul/jcseg/util/IIntFIFO.java | IIntFIFO.enQueue | public boolean enQueue( int data ) {
"""
add a new item to the queue
@param data
@return boolean
"""
Entry o = new Entry(data, head.next);
head.next = o;
size++;
return true;
} | java | public boolean enQueue( int data )
{
Entry o = new Entry(data, head.next);
head.next = o;
size++;
return true;
} | [
"public",
"boolean",
"enQueue",
"(",
"int",
"data",
")",
"{",
"Entry",
"o",
"=",
"new",
"Entry",
"(",
"data",
",",
"head",
".",
"next",
")",
";",
"head",
".",
"next",
"=",
"o",
";",
"size",
"++",
";",
"return",
"true",
";",
"}"
] | add a new item to the queue
@param data
@return boolean | [
"add",
"a",
"new",
"item",
"to",
"the",
"queue"
] | train | https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/IIntFIFO.java#L28-L35 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/impl/events/CacheEventDispatcherImpl.java | CacheEventDispatcherImpl.registerCacheEventListener | private synchronized void registerCacheEventListener(EventListenerWrapper<K, V> wrapper) {
"""
Synchronized to make sure listener addition is atomic in order to prevent having the same listener registered
under multiple configurations
@param wrapper the listener wrapper to register
"""
if(aSyncListener... | java | private synchronized void registerCacheEventListener(EventListenerWrapper<K, V> wrapper) {
if(aSyncListenersList.contains(wrapper) || syncListenersList.contains(wrapper)) {
throw new IllegalStateException("Cache Event Listener already registered: " + wrapper.getListener());
}
if (wrapper.isOrdered() ... | [
"private",
"synchronized",
"void",
"registerCacheEventListener",
"(",
"EventListenerWrapper",
"<",
"K",
",",
"V",
">",
"wrapper",
")",
"{",
"if",
"(",
"aSyncListenersList",
".",
"contains",
"(",
"wrapper",
")",
"||",
"syncListenersList",
".",
"contains",
"(",
"w... | Synchronized to make sure listener addition is atomic in order to prevent having the same listener registered
under multiple configurations
@param wrapper the listener wrapper to register | [
"Synchronized",
"to",
"make",
"sure",
"listener",
"addition",
"is",
"atomic",
"in",
"order",
"to",
"prevent",
"having",
"the",
"same",
"listener",
"registered",
"under",
"multiple",
"configurations"
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/events/CacheEventDispatcherImpl.java#L96-L119 |
jboss/jboss-el-api_spec | src/main/java/javax/el/ELUtil.java | ELUtil.getExceptionMessageString | public static String getExceptionMessageString(ELContext context, String messageId) {
"""
/*
<p>Convenience method, calls through to
{@link #getExceptionMessageString(javax.el.ELContext,java.lang.String,Object []).
</p>
@param context the ELContext from which the Locale for this message
is extracted.
@pa... | java | public static String getExceptionMessageString(ELContext context, String messageId) {
return getExceptionMessageString(context, messageId, null);
} | [
"public",
"static",
"String",
"getExceptionMessageString",
"(",
"ELContext",
"context",
",",
"String",
"messageId",
")",
"{",
"return",
"getExceptionMessageString",
"(",
"context",
",",
"messageId",
",",
"null",
")",
";",
"}"
] | /*
<p>Convenience method, calls through to
{@link #getExceptionMessageString(javax.el.ELContext,java.lang.String,Object []).
</p>
@param context the ELContext from which the Locale for this message
is extracted.
@param messageId the messageId String in the ResourceBundle
@return a localized String for the argument m... | [
"/",
"*",
"<p",
">",
"Convenience",
"method",
"calls",
"through",
"to",
"{",
"@link",
"#getExceptionMessageString",
"(",
"javax",
".",
"el",
".",
"ELContext",
"java",
".",
"lang",
".",
"String",
"Object",
"[]",
")",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/jboss/jboss-el-api_spec/blob/4cef117cae3ccf9f76439845687a8d219ad2eb43/src/main/java/javax/el/ELUtil.java#L164-L166 |
foundation-runtime/configuration | configuration-api/src/main/java/com/cisco/oss/foundation/configuration/validation/params/ParamValidators.java | ParamValidators.getValidator | public static<T extends ParamValidator> T getValidator(Class<T> clazz, boolean required) {
"""
return the relevant Validator by the given class type and required indication
"""
List<ParamValidator> validators = validatorsMap.get(clazz);
if (validators != null) {
if (required) {
... | java | public static<T extends ParamValidator> T getValidator(Class<T> clazz, boolean required) {
List<ParamValidator> validators = validatorsMap.get(clazz);
if (validators != null) {
if (required) {
return (T)validators.get(0);
}
return (T)validators.get(... | [
"public",
"static",
"<",
"T",
"extends",
"ParamValidator",
">",
"T",
"getValidator",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"boolean",
"required",
")",
"{",
"List",
"<",
"ParamValidator",
">",
"validators",
"=",
"validatorsMap",
".",
"get",
"(",
"clazz... | return the relevant Validator by the given class type and required indication | [
"return",
"the",
"relevant",
"Validator",
"by",
"the",
"given",
"class",
"type",
"and",
"required",
"indication"
] | train | https://github.com/foundation-runtime/configuration/blob/c5bd171a2cca0dc1c8d568f987843ca47c6d1eed/configuration-api/src/main/java/com/cisco/oss/foundation/configuration/validation/params/ParamValidators.java#L458-L471 |
EdwardRaff/JSAT | JSAT/src/jsat/math/decayrates/ExponetialDecay.java | ExponetialDecay.setMinRate | public void setMinRate(double min) {
"""
Sets the minimum learning rate to return
@param min the minimum learning rate to return
"""
if(min <= 0 || Double.isNaN(min) || Double.isInfinite(min))
throw new RuntimeException("minRate should be positive, not " + min);
this.min = min;
... | java | public void setMinRate(double min)
{
if(min <= 0 || Double.isNaN(min) || Double.isInfinite(min))
throw new RuntimeException("minRate should be positive, not " + min);
this.min = min;
} | [
"public",
"void",
"setMinRate",
"(",
"double",
"min",
")",
"{",
"if",
"(",
"min",
"<=",
"0",
"||",
"Double",
".",
"isNaN",
"(",
"min",
")",
"||",
"Double",
".",
"isInfinite",
"(",
"min",
")",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"minRate sho... | Sets the minimum learning rate to return
@param min the minimum learning rate to return | [
"Sets",
"the",
"minimum",
"learning",
"rate",
"to",
"return"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/math/decayrates/ExponetialDecay.java#L65-L70 |
kikinteractive/ice | ice/src/main/java/com/kik/config/ice/internal/MethodIdProxyFactory.java | MethodIdProxyFactory.getProxy | public static <C> C getProxy(final Class<C> configInterface, final Optional<String> scopeNameOpt) {
"""
Produces a proxy impl of a configuration interface to identify methods called on it
"""
final ClassAndScope key = new ClassAndScope(configInterface, scopeNameOpt);
final C methodIdProxy;
... | java | public static <C> C getProxy(final Class<C> configInterface, final Optional<String> scopeNameOpt)
{
final ClassAndScope key = new ClassAndScope(configInterface, scopeNameOpt);
final C methodIdProxy;
if (proxyMap.containsKey(key)) {
methodIdProxy = (C) proxyMap.get(key);
... | [
"public",
"static",
"<",
"C",
">",
"C",
"getProxy",
"(",
"final",
"Class",
"<",
"C",
">",
"configInterface",
",",
"final",
"Optional",
"<",
"String",
">",
"scopeNameOpt",
")",
"{",
"final",
"ClassAndScope",
"key",
"=",
"new",
"ClassAndScope",
"(",
"configI... | Produces a proxy impl of a configuration interface to identify methods called on it | [
"Produces",
"a",
"proxy",
"impl",
"of",
"a",
"configuration",
"interface",
"to",
"identify",
"methods",
"called",
"on",
"it"
] | train | https://github.com/kikinteractive/ice/blob/0c58d7bf2d9f6504892d0768d6022fcfa6df7514/ice/src/main/java/com/kik/config/ice/internal/MethodIdProxyFactory.java#L50-L63 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/olap/ParsedQuery.java | ParsedQuery.getInt | public int getInt(String key, int defaultValue) {
"""
Returns an integer value by the key specified or defaultValue if the key was not provided
"""
String value = get(key);
if(value == null) return defaultValue;
try {
return Integer.parseInt(value);
} catch (NumberFormatExcept... | java | public int getInt(String key, int defaultValue) {
String value = get(key);
if(value == null) return defaultValue;
try {
return Integer.parseInt(value);
} catch (NumberFormatException e) {
throw new IllegalArgumentException(key + " parameter should be a number");
}... | [
"public",
"int",
"getInt",
"(",
"String",
"key",
",",
"int",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"get",
"(",
"key",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"defaultValue",
";",
"try",
"{",
"return",
"Integer",
".",
"p... | Returns an integer value by the key specified or defaultValue if the key was not provided | [
"Returns",
"an",
"integer",
"value",
"by",
"the",
"key",
"specified",
"or",
"defaultValue",
"if",
"the",
"key",
"was",
"not",
"provided"
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/olap/ParsedQuery.java#L123-L131 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/RecommendedElasticPoolsInner.java | RecommendedElasticPoolsInner.listByServerAsync | public Observable<List<RecommendedElasticPoolInner>> listByServerAsync(String resourceGroupName, String serverName) {
"""
Returns recommended elastic pools.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the po... | java | public Observable<List<RecommendedElasticPoolInner>> listByServerAsync(String resourceGroupName, String serverName) {
return listByServerWithServiceResponseAsync(resourceGroupName, serverName).map(new Func1<ServiceResponse<List<RecommendedElasticPoolInner>>, List<RecommendedElasticPoolInner>>() {
@O... | [
"public",
"Observable",
"<",
"List",
"<",
"RecommendedElasticPoolInner",
">",
">",
"listByServerAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
")",
"{",
"return",
"listByServerWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName"... | Returns recommended elastic pools.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@throws IllegalArgumentException thrown if parameters fail the validation
@return... | [
"Returns",
"recommended",
"elastic",
"pools",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/RecommendedElasticPoolsInner.java#L197-L204 |
pressgang-ccms/PressGangCCMSQuery | src/main/java/org/jboss/pressgang/ccms/filter/base/BaseFilterQueryBuilder.java | BaseFilterQueryBuilder.addNotEqualsCondition | protected void addNotEqualsCondition(final String propertyName, final String value) {
"""
Add a Field Search Condition that will search a field for a specified value using the following SQL logic:
{@code field != 'value'}
@param propertyName The name of the field as defined in the Entity mapping class.
@param... | java | protected void addNotEqualsCondition(final String propertyName, final String value) {
fieldConditions.add(getCriteriaBuilder().notEqual(getRootPath().get(propertyName).as(String.class), value));
} | [
"protected",
"void",
"addNotEqualsCondition",
"(",
"final",
"String",
"propertyName",
",",
"final",
"String",
"value",
")",
"{",
"fieldConditions",
".",
"add",
"(",
"getCriteriaBuilder",
"(",
")",
".",
"notEqual",
"(",
"getRootPath",
"(",
")",
".",
"get",
"(",... | Add a Field Search Condition that will search a field for a specified value using the following SQL logic:
{@code field != 'value'}
@param propertyName The name of the field as defined in the Entity mapping class.
@param value The value to search against. | [
"Add",
"a",
"Field",
"Search",
"Condition",
"that",
"will",
"search",
"a",
"field",
"for",
"a",
"specified",
"value",
"using",
"the",
"following",
"SQL",
"logic",
":",
"{",
"@code",
"field",
"!",
"=",
"value",
"}"
] | train | https://github.com/pressgang-ccms/PressGangCCMSQuery/blob/2bb23430adab956737d0301cd2ea933f986dd85b/src/main/java/org/jboss/pressgang/ccms/filter/base/BaseFilterQueryBuilder.java#L463-L465 |
super-csv/super-csv | super-csv/src/main/java/org/supercsv/util/MethodCache.java | MethodCache.getGetMethod | public Method getGetMethod(final Object object, final String fieldName) {
"""
Returns the getter method for field on an object.
@param object
the object
@param fieldName
the field name
@return the getter associated with the field on the object
@throws NullPointerException
if object or fieldName is null
@... | java | public Method getGetMethod(final Object object, final String fieldName) {
if( object == null ) {
throw new NullPointerException("object should not be null");
} else if( fieldName == null ) {
throw new NullPointerException("fieldName should not be null");
}
Method method = getCache.get(object.getClass()... | [
"public",
"Method",
"getGetMethod",
"(",
"final",
"Object",
"object",
",",
"final",
"String",
"fieldName",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"object should not be null\"",
")",
";",
"}",
"else... | Returns the getter method for field on an object.
@param object
the object
@param fieldName
the field name
@return the getter associated with the field on the object
@throws NullPointerException
if object or fieldName is null
@throws SuperCsvReflectionException
if the getter doesn't exist or is not visible | [
"Returns",
"the",
"getter",
"method",
"for",
"field",
"on",
"an",
"object",
"."
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/util/MethodCache.java#L53-L66 |
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.createAsync | public Observable<ReplicationInner> createAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) {
"""
Creates a replication for a container registry with the specified parameters.
@param resourceGroupName The name of the resource group to which the container ... | java | public Observable<ReplicationInner> createAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) {
return createWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).map(new Func1<ServiceResponse<ReplicationInner>, Replication... | [
"public",
"Observable",
"<",
"ReplicationInner",
">",
"createAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"replicationName",
",",
"ReplicationInner",
"replication",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"... | Creates 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 replication The parameters fo... | [
"Creates",
"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#L239-L246 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service/src/com/ibm/ws/kernel/service/util/SecureAction.java | SecureAction.getFileOutputStream | public FileOutputStream getFileOutputStream(final File file, final boolean append) throws FileNotFoundException {
"""
Creates a FileInputStream from a File. Same as calling
new FileOutputStream(File,boolean).
@param file the File to create a FileOutputStream from.
@param append indicates if the OutputStream s... | java | public FileOutputStream getFileOutputStream(final File file, final boolean append) throws FileNotFoundException {
if (System.getSecurityManager() == null)
return new FileOutputStream(file.getAbsolutePath(), append);
try {
return AccessController.doPrivileged(new PrivilegedExcepti... | [
"public",
"FileOutputStream",
"getFileOutputStream",
"(",
"final",
"File",
"file",
",",
"final",
"boolean",
"append",
")",
"throws",
"FileNotFoundException",
"{",
"if",
"(",
"System",
".",
"getSecurityManager",
"(",
")",
"==",
"null",
")",
"return",
"new",
"File... | Creates a FileInputStream from a File. Same as calling
new FileOutputStream(File,boolean).
@param file the File to create a FileOutputStream from.
@param append indicates if the OutputStream should append content.
@return The FileOutputStream.
@throws FileNotFoundException if the File does not exist. | [
"Creates",
"a",
"FileInputStream",
"from",
"a",
"File",
".",
"Same",
"as",
"calling",
"new",
"FileOutputStream",
"(",
"File",
"boolean",
")",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service/src/com/ibm/ws/kernel/service/util/SecureAction.java#L171-L186 |
Cosium/spring-data-jpa-entity-graph | src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/QueryHintsUtils.java | QueryHintsUtils.removeEntityGraphs | static void removeEntityGraphs(Map<String, Object> queryHints) {
"""
Remove all EntityGraph pre existing in the QueryHints
@param queryHints
"""
if (queryHints == null) {
return;
}
queryHints.remove(EntityGraph.EntityGraphType.FETCH.getKey());
queryHints.remove(EntityGraph.EntityGraphT... | java | static void removeEntityGraphs(Map<String, Object> queryHints) {
if (queryHints == null) {
return;
}
queryHints.remove(EntityGraph.EntityGraphType.FETCH.getKey());
queryHints.remove(EntityGraph.EntityGraphType.LOAD.getKey());
} | [
"static",
"void",
"removeEntityGraphs",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"queryHints",
")",
"{",
"if",
"(",
"queryHints",
"==",
"null",
")",
"{",
"return",
";",
"}",
"queryHints",
".",
"remove",
"(",
"EntityGraph",
".",
"EntityGraphType",
"."... | Remove all EntityGraph pre existing in the QueryHints
@param queryHints | [
"Remove",
"all",
"EntityGraph",
"pre",
"existing",
"in",
"the",
"QueryHints"
] | train | https://github.com/Cosium/spring-data-jpa-entity-graph/blob/b5f2f6acfcbac535d3cac90bd88fefd1b8cd6a7f/src/main/java/com/cosium/spring/data/jpa/entity/graph/repository/support/QueryHintsUtils.java#L30-L36 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/FeatureOverlayQuery.java | FeatureOverlayQuery.tileFeatureCount | public long tileFeatureCount(LatLng latLng, double zoom) {
"""
Get the count of features in the tile at the lat lng coordinate and zoom level
@param latLng lat lng location
@param zoom zoom level
@return count
"""
int zoomValue = (int) zoom;
long tileFeaturesCount = tileFeatureCount(latL... | java | public long tileFeatureCount(LatLng latLng, double zoom) {
int zoomValue = (int) zoom;
long tileFeaturesCount = tileFeatureCount(latLng, zoomValue);
return tileFeaturesCount;
} | [
"public",
"long",
"tileFeatureCount",
"(",
"LatLng",
"latLng",
",",
"double",
"zoom",
")",
"{",
"int",
"zoomValue",
"=",
"(",
"int",
")",
"zoom",
";",
"long",
"tileFeaturesCount",
"=",
"tileFeatureCount",
"(",
"latLng",
",",
"zoomValue",
")",
";",
"return",
... | Get the count of features in the tile at the lat lng coordinate and zoom level
@param latLng lat lng location
@param zoom zoom level
@return count | [
"Get",
"the",
"count",
"of",
"features",
"in",
"the",
"tile",
"at",
"the",
"lat",
"lng",
"coordinate",
"and",
"zoom",
"level"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/tiles/overlay/FeatureOverlayQuery.java#L203-L207 |
stagemonitor/stagemonitor | stagemonitor-core/src/main/java/org/stagemonitor/core/util/MBeanUtils.java | MBeanUtils.registerMBean | public static void registerMBean(final ObjectInstance objectInstance, final String mBeanAttributeName, MetricName metricName, Metric2Registry metricRegistry) {
"""
Registers a MBean into the MetricRegistry
@param objectInstance The ObjectInstance
@param mBeanAttributeName The attribute name of the MBean th... | java | public static void registerMBean(final ObjectInstance objectInstance, final String mBeanAttributeName, MetricName metricName, Metric2Registry metricRegistry) {
metricRegistry.register(metricName, new Gauge<Object>() {
@Override
public Object getValue() {
return getValueFromMBean(objectInstance, mBeanAttribu... | [
"public",
"static",
"void",
"registerMBean",
"(",
"final",
"ObjectInstance",
"objectInstance",
",",
"final",
"String",
"mBeanAttributeName",
",",
"MetricName",
"metricName",
",",
"Metric2Registry",
"metricRegistry",
")",
"{",
"metricRegistry",
".",
"register",
"(",
"m... | Registers a MBean into the MetricRegistry
@param objectInstance The ObjectInstance
@param mBeanAttributeName The attribute name of the MBean that should be collected
@param metricName The name of the metric in the MetricRegistry
@param metricRegistry The metric registry the values of the mbean should b... | [
"Registers",
"a",
"MBean",
"into",
"the",
"MetricRegistry"
] | train | https://github.com/stagemonitor/stagemonitor/blob/7a1bf6848906f816aa465983f602ea1f1e8f2b7b/stagemonitor-core/src/main/java/org/stagemonitor/core/util/MBeanUtils.java#L84-L91 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsInner.java | StreamingEndpointsInner.beginScale | public void beginScale(String resourceGroupName, String accountName, String streamingEndpointName) {
"""
Scale StreamingEndpoint.
Scales an existing StreamingEndpoint.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@p... | java | public void beginScale(String resourceGroupName, String accountName, String streamingEndpointName) {
beginScaleWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName).toBlocking().single().body();
} | [
"public",
"void",
"beginScale",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"streamingEndpointName",
")",
"{",
"beginScaleWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
",",
"streamingEndpointName",
")",
".",
... | Scale StreamingEndpoint.
Scales an existing StreamingEndpoint.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param streamingEndpointName The name of the StreamingEndpoint.
@throws IllegalArgumentException thrown if parameters... | [
"Scale",
"StreamingEndpoint",
".",
"Scales",
"an",
"existing",
"StreamingEndpoint",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsInner.java#L1644-L1646 |
Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/command/DuCommand.java | DuCommand.getFormattedValues | private String getFormattedValues(boolean readable, long size, long totalSize) {
"""
Gets the size and its percentage information, if readable option is provided,
get the size in human readable format.
@param readable whether to print info of human readable format
@param size the size to get information from
... | java | private String getFormattedValues(boolean readable, long size, long totalSize) {
// If size is 1, total size is 5, and readable is true, it will
// return a string as "1B (20%)"
int percent = totalSize == 0 ? 0 : (int) (size * 100 / totalSize);
String subSizeMessage = readable ? FormatUtils.getSizeFromB... | [
"private",
"String",
"getFormattedValues",
"(",
"boolean",
"readable",
",",
"long",
"size",
",",
"long",
"totalSize",
")",
"{",
"// If size is 1, total size is 5, and readable is true, it will",
"// return a string as \"1B (20%)\"",
"int",
"percent",
"=",
"totalSize",
"==",
... | Gets the size and its percentage information, if readable option is provided,
get the size in human readable format.
@param readable whether to print info of human readable format
@param size the size to get information from
@param totalSize the total size to calculate percentage information
@return the formatted valu... | [
"Gets",
"the",
"size",
"and",
"its",
"percentage",
"information",
"if",
"readable",
"option",
"is",
"provided",
"get",
"the",
"size",
"in",
"human",
"readable",
"format",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/command/DuCommand.java#L156-L163 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/activerecord/Model.java | Model.findByIdLoadColumns | public M findByIdLoadColumns(Object idValue, String columns) {
"""
Find model by id and load specific columns only.
<pre>
Example:
User user = User.dao.findByIdLoadColumns(123, "name, age");
</pre>
@param idValue the id value of the model
@param columns the specific columns to load
"""
return findById... | java | public M findByIdLoadColumns(Object idValue, String columns) {
return findByIdLoadColumns(new Object[]{idValue}, columns);
} | [
"public",
"M",
"findByIdLoadColumns",
"(",
"Object",
"idValue",
",",
"String",
"columns",
")",
"{",
"return",
"findByIdLoadColumns",
"(",
"new",
"Object",
"[",
"]",
"{",
"idValue",
"}",
",",
"columns",
")",
";",
"}"
] | Find model by id and load specific columns only.
<pre>
Example:
User user = User.dao.findByIdLoadColumns(123, "name, age");
</pre>
@param idValue the id value of the model
@param columns the specific columns to load | [
"Find",
"model",
"by",
"id",
"and",
"load",
"specific",
"columns",
"only",
".",
"<pre",
">",
"Example",
":",
"User",
"user",
"=",
"User",
".",
"dao",
".",
"findByIdLoadColumns",
"(",
"123",
"name",
"age",
")",
";",
"<",
"/",
"pre",
">"
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/activerecord/Model.java#L771-L773 |
elki-project/elki | elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/invertedlist/InMemoryInvertedIndex.java | InMemoryInvertedIndex.naiveQueryDense | private double naiveQueryDense(NumberVector obj, WritableDoubleDataStore scores, HashSetModifiableDBIDs cands) {
"""
Query the most similar objects, dense version.
@param obj Query object
@param scores Score storage
@param cands Non-zero objects set
@return Result
"""
double len = 0.; // Length of qu... | java | private double naiveQueryDense(NumberVector obj, WritableDoubleDataStore scores, HashSetModifiableDBIDs cands) {
double len = 0.; // Length of query object, for final normalization
for(int dim = 0, max = obj.getDimensionality(); dim < max; dim++) {
final double val = obj.doubleValue(dim);
if(val == ... | [
"private",
"double",
"naiveQueryDense",
"(",
"NumberVector",
"obj",
",",
"WritableDoubleDataStore",
"scores",
",",
"HashSetModifiableDBIDs",
"cands",
")",
"{",
"double",
"len",
"=",
"0.",
";",
"// Length of query object, for final normalization",
"for",
"(",
"int",
"dim... | Query the most similar objects, dense version.
@param obj Query object
@param scores Score storage
@param cands Non-zero objects set
@return Result | [
"Query",
"the",
"most",
"similar",
"objects",
"dense",
"version",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/invertedlist/InMemoryInvertedIndex.java#L210-L229 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AuditResources.java | AuditResources.findByEntityId | @GET
@Path("/entity/ {
"""
Returns the audit record for the given id.
@param entityid The entity Id. Cannot be null.
@param limit max no of records
@return The audit object.
@throws WebApplicationException Throws the exception for invalid input data.
"""entityid}")
@Description("R... | java | @GET
@Path("/entity/{entityid}")
@Description("Returns the audit trail for an entity.")
@Produces(MediaType.APPLICATION_JSON)
public List<AuditDto> findByEntityId(@PathParam("entityid") BigInteger entityid,
@QueryParam("limit") BigInteger limit) {
if (entityid == null || entityid.compare... | [
"@",
"GET",
"@",
"Path",
"(",
"\"/entity/{entityid}\"",
")",
"@",
"Description",
"(",
"\"Returns the audit trail for an entity.\"",
")",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"List",
"<",
"AuditDto",
">",
"findByEntityId",
"(",
... | Returns the audit record for the given id.
@param entityid The entity Id. Cannot be null.
@param limit max no of records
@return The audit object.
@throws WebApplicationException Throws the exception for invalid input data. | [
"Returns",
"the",
"audit",
"record",
"for",
"the",
"given",
"id",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/AuditResources.java#L75-L95 |
algolia/instantsearch-android | ui/src/main/java/com/algolia/instantsearch/ui/databinding/BindingHelper.java | BindingHelper.setVariantForView | @Nullable
public static String setVariantForView(@NonNull View view, @NonNull AttributeSet attrs) {
"""
Associates programmatically a view with its variant, taking it from its `variant` layout attribute.
@param view any existing view.
@param attrs the view's AttributeSet.
@return the previous variant for... | java | @Nullable
public static String setVariantForView(@NonNull View view, @NonNull AttributeSet attrs) {
String previousVariant;
final TypedArray styledAttributes = view.getContext().getTheme()
.obtainStyledAttributes(attrs, R.styleable.View, 0, 0);
try {
previousVaria... | [
"@",
"Nullable",
"public",
"static",
"String",
"setVariantForView",
"(",
"@",
"NonNull",
"View",
"view",
",",
"@",
"NonNull",
"AttributeSet",
"attrs",
")",
"{",
"String",
"previousVariant",
";",
"final",
"TypedArray",
"styledAttributes",
"=",
"view",
".",
"getCo... | Associates programmatically a view with its variant, taking it from its `variant` layout attribute.
@param view any existing view.
@param attrs the view's AttributeSet.
@return the previous variant for this view, if any. | [
"Associates",
"programmatically",
"a",
"view",
"with",
"its",
"variant",
"taking",
"it",
"from",
"its",
"variant",
"layout",
"attribute",
"."
] | train | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/ui/src/main/java/com/algolia/instantsearch/ui/databinding/BindingHelper.java#L98-L111 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/ws/security/authentication/helper/AuthenticateUserHelper.java | AuthenticateUserHelper.validateInput | private void validateInput(AuthenticationService authenticationService, String username) throws AuthenticationException {
"""
Validate that the input parameters are not null.
@param authenticationService the service to authenticate a user
@param username the user to authenticate
@throws AuthenticationExceptio... | java | private void validateInput(AuthenticationService authenticationService, String username) throws AuthenticationException {
if (authenticationService == null) {
throw new AuthenticationException("authenticationService cannot be null.");
} else if (username == null) {
throw new Auth... | [
"private",
"void",
"validateInput",
"(",
"AuthenticationService",
"authenticationService",
",",
"String",
"username",
")",
"throws",
"AuthenticationException",
"{",
"if",
"(",
"authenticationService",
"==",
"null",
")",
"{",
"throw",
"new",
"AuthenticationException",
"(... | Validate that the input parameters are not null.
@param authenticationService the service to authenticate a user
@param username the user to authenticate
@throws AuthenticationException when either input is null | [
"Validate",
"that",
"the",
"input",
"parameters",
"are",
"not",
"null",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/ws/security/authentication/helper/AuthenticateUserHelper.java#L94-L100 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java | ImgUtil.writeJpg | public static void writeJpg(Image image, ImageOutputStream destImageStream) throws IORuntimeException {
"""
写出图像为JPG格式
@param image {@link Image}
@param destImageStream 写出到的目标流
@throws IORuntimeException IO异常
"""
write(image, IMAGE_TYPE_JPG, destImageStream);
} | java | public static void writeJpg(Image image, ImageOutputStream destImageStream) throws IORuntimeException {
write(image, IMAGE_TYPE_JPG, destImageStream);
} | [
"public",
"static",
"void",
"writeJpg",
"(",
"Image",
"image",
",",
"ImageOutputStream",
"destImageStream",
")",
"throws",
"IORuntimeException",
"{",
"write",
"(",
"image",
",",
"IMAGE_TYPE_JPG",
",",
"destImageStream",
")",
";",
"}"
] | 写出图像为JPG格式
@param image {@link Image}
@param destImageStream 写出到的目标流
@throws IORuntimeException IO异常 | [
"写出图像为JPG格式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/img/ImgUtil.java#L1354-L1356 |
alkacon/opencms-core | src/org/opencms/workplace/editors/CmsDefaultPageEditor.java | CmsDefaultPageEditor.buildSelectFonts | public String buildSelectFonts(String attributes) {
"""
Builds the html for the font face select box of a WYSIWYG editor.<p>
@param attributes optional attributes for the <select> tag
@return the html for the font face select box
"""
List<String> names = new ArrayList<String>();
for ... | java | public String buildSelectFonts(String attributes) {
List<String> names = new ArrayList<String>();
for (int i = 0; i < CmsDefaultPageEditor.SELECTBOX_FONTS.length; i++) {
String value = CmsDefaultPageEditor.SELECTBOX_FONTS[i];
names.add(value);
}
return buildSelec... | [
"public",
"String",
"buildSelectFonts",
"(",
"String",
"attributes",
")",
"{",
"List",
"<",
"String",
">",
"names",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"CmsDefaultPageEditor",
"."... | Builds the html for the font face select box of a WYSIWYG editor.<p>
@param attributes optional attributes for the <select> tag
@return the html for the font face select box | [
"Builds",
"the",
"html",
"for",
"the",
"font",
"face",
"select",
"box",
"of",
"a",
"WYSIWYG",
"editor",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/editors/CmsDefaultPageEditor.java#L367-L375 |
zaproxy/zaproxy | src/org/parosproxy/paros/view/AbstractParamContainerPanel.java | AbstractParamContainerPanel.showParamPanel | public void showParamPanel(AbstractParamPanel panel, String name) {
"""
Shows the panel with the given name.
<p>
The previously shown panel (if any) is notified that it will be hidden.
@param panel the panel that will be notified that is now shown, must not be {@code null}.
@param name the name of the panel ... | java | public void showParamPanel(AbstractParamPanel panel, String name) {
if (currentShownPanel == panel) {
return;
}
// ZAP: Notify previously shown panel that it was hidden
if (currentShownPanel != null) {
currentShownPanel.onHide();
}
... | [
"public",
"void",
"showParamPanel",
"(",
"AbstractParamPanel",
"panel",
",",
"String",
"name",
")",
"{",
"if",
"(",
"currentShownPanel",
"==",
"panel",
")",
"{",
"return",
";",
"}",
"// ZAP: Notify previously shown panel that it was hidden\r",
"if",
"(",
"currentShown... | Shows the panel with the given name.
<p>
The previously shown panel (if any) is notified that it will be hidden.
@param panel the panel that will be notified that is now shown, must not be {@code null}.
@param name the name of the panel that will be shown, must not be {@code null}.
@see AbstractParamPanel#onHide()
@se... | [
"Shows",
"the",
"panel",
"with",
"the",
"given",
"name",
".",
"<p",
">",
"The",
"previously",
"shown",
"panel",
"(",
"if",
"any",
")",
"is",
"notified",
"that",
"it",
"will",
"be",
"hidden",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/view/AbstractParamContainerPanel.java#L494-L520 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/SheetColumnResourcesImpl.java | SheetColumnResourcesImpl.updateColumn | public Column updateColumn(long sheetId, Column column) throws SmartsheetException {
"""
Update a column.
It mirrors to the following Smartsheet REST API method: PUT /sheets/{sheetId}/columns/{columnId}
Exceptions:
IllegalArgumentException : if any argument is null
InvalidRequestException : if there is any... | java | public Column updateColumn(long sheetId, Column column) throws SmartsheetException {
Util.throwIfNull(column);
return this.updateResource("sheets/" + sheetId + "/columns/" + column.getId(), Column.class, column);
} | [
"public",
"Column",
"updateColumn",
"(",
"long",
"sheetId",
",",
"Column",
"column",
")",
"throws",
"SmartsheetException",
"{",
"Util",
".",
"throwIfNull",
"(",
"column",
")",
";",
"return",
"this",
".",
"updateResource",
"(",
"\"sheets/\"",
"+",
"sheetId",
"+... | Update a column.
It mirrors to the following Smartsheet REST API method: PUT /sheets/{sheetId}/columns/{columnId}
Exceptions:
IllegalArgumentException : if any argument is null
InvalidRequestException : if there is any problem with the REST API request
AuthorizationException : if there is any problem with the REST AP... | [
"Update",
"a",
"column",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/SheetColumnResourcesImpl.java#L152-L155 |
albfernandez/itext2 | src/main/java/com/lowagie/text/rtf/parser/RtfParser.java | RtfParser.convertRtfDocument | public void convertRtfDocument(InputStream readerIn, Document doc) throws IOException {
"""
Converts an RTF document to an iText document.
Usage: Create a parser object and call this method with the input stream and the iText Document object
@param readerIn
The Reader to read the RTF file from.
@param doc
... | java | public void convertRtfDocument(InputStream readerIn, Document doc) throws IOException {
if(readerIn == null || doc == null) return;
this.init(TYPE_CONVERT, null, readerIn, doc, null);
this.setCurrentDestination(RtfDestinationMgr.DESTINATION_DOCUMENT);
this.groupLevel = 0;
this.tokenise();
} | [
"public",
"void",
"convertRtfDocument",
"(",
"InputStream",
"readerIn",
",",
"Document",
"doc",
")",
"throws",
"IOException",
"{",
"if",
"(",
"readerIn",
"==",
"null",
"||",
"doc",
"==",
"null",
")",
"return",
";",
"this",
".",
"init",
"(",
"TYPE_CONVERT",
... | Converts an RTF document to an iText document.
Usage: Create a parser object and call this method with the input stream and the iText Document object
@param readerIn
The Reader to read the RTF file from.
@param doc
The iText document that the RTF file is to be added to.
@throws IOException
On I/O errors.
@since 2.1.3 | [
"Converts",
"an",
"RTF",
"document",
"to",
"an",
"iText",
"document",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/rtf/parser/RtfParser.java#L538-L544 |
sksamuel/scrimage | scrimage-filters/src/main/java/thirdparty/jhlabs/image/ImageMath.java | ImageMath.bilinearInterpolate | public static int bilinearInterpolate(float x, float y, int nw, int ne, int sw, int se) {
"""
Bilinear interpolation of ARGB values.
@param x the X interpolation parameter 0..1
@param y the y interpolation parameter 0..1
@param rgb array of four ARGB values in the order NW, NE, SW, SE
@return the interpolated ... | java | public static int bilinearInterpolate(float x, float y, int nw, int ne, int sw, int se) {
float m0, m1;
int a0 = (nw >> 24) & 0xff;
int r0 = (nw >> 16) & 0xff;
int g0 = (nw >> 8) & 0xff;
int b0 = nw & 0xff;
int a1 = (ne >> 24) & 0xff;
int r1 = (ne >> 16) & 0xff;
int g1 = (ne >> 8) & 0xff;
int b1 = ne ... | [
"public",
"static",
"int",
"bilinearInterpolate",
"(",
"float",
"x",
",",
"float",
"y",
",",
"int",
"nw",
",",
"int",
"ne",
",",
"int",
"sw",
",",
"int",
"se",
")",
"{",
"float",
"m0",
",",
"m1",
";",
"int",
"a0",
"=",
"(",
"nw",
">>",
"24",
")... | Bilinear interpolation of ARGB values.
@param x the X interpolation parameter 0..1
@param y the y interpolation parameter 0..1
@param rgb array of four ARGB values in the order NW, NE, SW, SE
@return the interpolated value | [
"Bilinear",
"interpolation",
"of",
"ARGB",
"values",
"."
] | train | https://github.com/sksamuel/scrimage/blob/52dab448136e6657a71951b0e6b7d5e64dc979ac/scrimage-filters/src/main/java/thirdparty/jhlabs/image/ImageMath.java#L289-L328 |
zerodhatech/javakiteconnect | kiteconnect/src/com/zerodhatech/kiteconnect/KiteConnect.java | KiteConnect.placeMFSIP | public MFSIP placeMFSIP(String tradingsymbol, String frequency, int installmentDay, int instalments, int initialAmount, double amount) throws KiteException, IOException, JSONException {
"""
Place a mutualfunds sip.
@param tradingsymbol Tradingsymbol (ISIN) of the fund.
@param frequency weekly, monthly, or quarte... | java | public MFSIP placeMFSIP(String tradingsymbol, String frequency, int installmentDay, int instalments, int initialAmount, double amount) throws KiteException, IOException, JSONException {
Map<String, Object> params = new HashMap<String, Object>();
params.put("tradingsymbol", tradingsymbol);
params... | [
"public",
"MFSIP",
"placeMFSIP",
"(",
"String",
"tradingsymbol",
",",
"String",
"frequency",
",",
"int",
"installmentDay",
",",
"int",
"instalments",
",",
"int",
"initialAmount",
",",
"double",
"amount",
")",
"throws",
"KiteException",
",",
"IOException",
",",
"... | Place a mutualfunds sip.
@param tradingsymbol Tradingsymbol (ISIN) of the fund.
@param frequency weekly, monthly, or quarterly.
@param amount Amount worth of units to purchase. It should be equal to or greated than minimum_additional_purchase_amount and in multiple of purchase_amount_multiplier in the instrument master... | [
"Place",
"a",
"mutualfunds",
"sip",
"."
] | train | https://github.com/zerodhatech/javakiteconnect/blob/4a3f15ff2c8a1b3b6ec61799f8bb047e4dfeb92d/kiteconnect/src/com/zerodhatech/kiteconnect/KiteConnect.java#L686-L700 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/objdetect/Yolo2OutputLayer.java | Yolo2OutputLayer.getConfidenceMatrix | public INDArray getConfidenceMatrix(INDArray networkOutput, int example, int bbNumber) {
"""
Get the confidence matrix (confidence for all x/y positions) for the specified bounding box, from the network
output activations array
@param networkOutput Network output activations
@param example Example numbe... | java | public INDArray getConfidenceMatrix(INDArray networkOutput, int example, int bbNumber){
//Input format: [minibatch, 5B+C, H, W], with order [x,y,w,h,c]
//Therefore: confidences are at depths 4 + bbNumber * 5
INDArray conf = networkOutput.get(point(example), point(4+bbNumber*5), all(), all());
... | [
"public",
"INDArray",
"getConfidenceMatrix",
"(",
"INDArray",
"networkOutput",
",",
"int",
"example",
",",
"int",
"bbNumber",
")",
"{",
"//Input format: [minibatch, 5B+C, H, W], with order [x,y,w,h,c]",
"//Therefore: confidences are at depths 4 + bbNumber * 5",
"INDArray",
"conf",
... | Get the confidence matrix (confidence for all x/y positions) for the specified bounding box, from the network
output activations array
@param networkOutput Network output activations
@param example Example number, in minibatch
@param bbNumber Bounding box number
@return Confidence matrix | [
"Get",
"the",
"confidence",
"matrix",
"(",
"confidence",
"for",
"all",
"x",
"/",
"y",
"positions",
")",
"for",
"the",
"specified",
"bounding",
"box",
"from",
"the",
"network",
"output",
"activations",
"array"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/layers/objdetect/Yolo2OutputLayer.java#L648-L655 |
sonyxperiadev/gerrit-events | src/main/java/com/sonymobile/tools/gerrit/gerritevents/GerritQueryHandler.java | GerritQueryHandler.queryJson | public List<String> queryJson(String queryString) throws SshException, IOException {
"""
Runs the query and returns the result as a list of JSON formatted strings.
This is the equivalent of calling queryJava(queryString, true, true, false, false).
@param queryString the query.
@return a List of JSON formatted s... | java | public List<String> queryJson(String queryString) throws SshException, IOException {
return queryJson(queryString, true, true, false, false);
} | [
"public",
"List",
"<",
"String",
">",
"queryJson",
"(",
"String",
"queryString",
")",
"throws",
"SshException",
",",
"IOException",
"{",
"return",
"queryJson",
"(",
"queryString",
",",
"true",
",",
"true",
",",
"false",
",",
"false",
")",
";",
"}"
] | Runs the query and returns the result as a list of JSON formatted strings.
This is the equivalent of calling queryJava(queryString, true, true, false, false).
@param queryString the query.
@return a List of JSON formatted strings.
@throws SshException if there is an error in the SSH Connection.
@throws IOException for ... | [
"Runs",
"the",
"query",
"and",
"returns",
"the",
"result",
"as",
"a",
"list",
"of",
"JSON",
"formatted",
"strings",
".",
"This",
"is",
"the",
"equivalent",
"of",
"calling",
"queryJava",
"(",
"queryString",
"true",
"true",
"false",
"false",
")",
"."
] | train | https://github.com/sonyxperiadev/gerrit-events/blob/9a443d13dded85cc4709136ac33989f2bbb34fe2/src/main/java/com/sonymobile/tools/gerrit/gerritevents/GerritQueryHandler.java#L271-L273 |
openengsb/openengsb | api/edb/src/main/java/org/openengsb/core/edb/api/EDBObject.java | EDBObject.getObject | @SuppressWarnings("unchecked")
public <T> T getObject(String key, Class<T> clazz) {
"""
Returns the value of the EDBObjectEntry for the given key, casted as the given class. Returns null if there is no
element for the given key, or the value for the given key is null.
"""
EDBObjectEntry entry = ge... | java | @SuppressWarnings("unchecked")
public <T> T getObject(String key, Class<T> clazz) {
EDBObjectEntry entry = get(key);
return entry == null ? null : (T) entry.getValue();
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"getObject",
"(",
"String",
"key",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"EDBObjectEntry",
"entry",
"=",
"get",
"(",
"key",
")",
";",
"return",
"entry",
"==",
... | Returns the value of the EDBObjectEntry for the given key, casted as the given class. Returns null if there is no
element for the given key, or the value for the given key is null. | [
"Returns",
"the",
"value",
"of",
"the",
"EDBObjectEntry",
"for",
"the",
"given",
"key",
"casted",
"as",
"the",
"given",
"class",
".",
"Returns",
"null",
"if",
"there",
"is",
"no",
"element",
"for",
"the",
"given",
"key",
"or",
"the",
"value",
"for",
"the... | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/api/edb/src/main/java/org/openengsb/core/edb/api/EDBObject.java#L154-L158 |
mikepenz/MaterialDrawer | library/src/main/java/com/mikepenz/materialdrawer/Drawer.java | Drawer.updateName | public void updateName(long identifier, StringHolder name) {
"""
update the name for a specific drawerItem
identified by its id
@param identifier
@param name
"""
IDrawerItem drawerItem = getDrawerItem(identifier);
if (drawerItem instanceof Nameable) {
Nameable pdi = (Nameable) ... | java | public void updateName(long identifier, StringHolder name) {
IDrawerItem drawerItem = getDrawerItem(identifier);
if (drawerItem instanceof Nameable) {
Nameable pdi = (Nameable) drawerItem;
pdi.withName(name);
updateItem((IDrawerItem) pdi);
}
} | [
"public",
"void",
"updateName",
"(",
"long",
"identifier",
",",
"StringHolder",
"name",
")",
"{",
"IDrawerItem",
"drawerItem",
"=",
"getDrawerItem",
"(",
"identifier",
")",
";",
"if",
"(",
"drawerItem",
"instanceof",
"Nameable",
")",
"{",
"Nameable",
"pdi",
"=... | update the name for a specific drawerItem
identified by its id
@param identifier
@param name | [
"update",
"the",
"name",
"for",
"a",
"specific",
"drawerItem",
"identified",
"by",
"its",
"id"
] | train | https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/Drawer.java#L681-L688 |
grpc/grpc-java | core/src/main/java/io/grpc/internal/ServiceConfigUtil.java | ServiceConfigUtil.getTimeoutFromMethodConfig | @Nullable
static Long getTimeoutFromMethodConfig(Map<String, ?> methodConfig) {
"""
Returns the number of nanoseconds of timeout for the given method config.
@return duration nanoseconds, or {@code null} if it isn't present.
"""
if (!methodConfig.containsKey(METHOD_CONFIG_TIMEOUT_KEY)) {
return ... | java | @Nullable
static Long getTimeoutFromMethodConfig(Map<String, ?> methodConfig) {
if (!methodConfig.containsKey(METHOD_CONFIG_TIMEOUT_KEY)) {
return null;
}
String rawTimeout = getString(methodConfig, METHOD_CONFIG_TIMEOUT_KEY);
try {
return parseDuration(rawTimeout);
} catch (ParseExcep... | [
"@",
"Nullable",
"static",
"Long",
"getTimeoutFromMethodConfig",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"methodConfig",
")",
"{",
"if",
"(",
"!",
"methodConfig",
".",
"containsKey",
"(",
"METHOD_CONFIG_TIMEOUT_KEY",
")",
")",
"{",
"return",
"null",
";",
"... | Returns the number of nanoseconds of timeout for the given method config.
@return duration nanoseconds, or {@code null} if it isn't present. | [
"Returns",
"the",
"number",
"of",
"nanoseconds",
"of",
"timeout",
"for",
"the",
"given",
"method",
"config",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/core/src/main/java/io/grpc/internal/ServiceConfigUtil.java#L262-L273 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/MutableDictionary.java | MutableDictionary.setLong | @NonNull
@Override
public MutableDictionary setLong(@NonNull String key, long value) {
"""
Set a long value for the given key.
@param key The key
@param value The long value.
@return The self object.
"""
return setValue(key, value);
} | java | @NonNull
@Override
public MutableDictionary setLong(@NonNull String key, long value) {
return setValue(key, value);
} | [
"@",
"NonNull",
"@",
"Override",
"public",
"MutableDictionary",
"setLong",
"(",
"@",
"NonNull",
"String",
"key",
",",
"long",
"value",
")",
"{",
"return",
"setValue",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Set a long value for the given key.
@param key The key
@param value The long value.
@return The self object. | [
"Set",
"a",
"long",
"value",
"for",
"the",
"given",
"key",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableDictionary.java#L156-L160 |
spring-projects/spring-hateoas | src/main/java/org/springframework/hateoas/client/Hop.java | Hop.withParameter | public Hop withParameter(String name, Object value) {
"""
Add one parameter to the map of parameters.
@param name must not be {@literal null} or empty.
@param value can be {@literal null}.
@return
"""
Assert.hasText(name, "Name must not be null or empty!");
HashMap<String, Object> parameters = new H... | java | public Hop withParameter(String name, Object value) {
Assert.hasText(name, "Name must not be null or empty!");
HashMap<String, Object> parameters = new HashMap<>(this.parameters);
parameters.put(name, value);
return new Hop(this.rel, parameters, this.headers);
} | [
"public",
"Hop",
"withParameter",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"Assert",
".",
"hasText",
"(",
"name",
",",
"\"Name must not be null or empty!\"",
")",
";",
"HashMap",
"<",
"String",
",",
"Object",
">",
"parameters",
"=",
"new",
"H... | Add one parameter to the map of parameters.
@param name must not be {@literal null} or empty.
@param value can be {@literal null}.
@return | [
"Add",
"one",
"parameter",
"to",
"the",
"map",
"of",
"parameters",
"."
] | train | https://github.com/spring-projects/spring-hateoas/blob/70ebff9309f086cd8d6a97daf67e0dc215c87d9c/src/main/java/org/springframework/hateoas/client/Hop.java#L79-L87 |
Crab2died/Excel4J | src/main/java/com/github/crab2died/ExcelUtils.java | ExcelUtils.simpleSheet2Excel | public void simpleSheet2Excel(List<SimpleSheetWrapper> sheets, String targetPath)
throws IOException {
"""
无模板、无注解、多sheet数据
@param sheets 待导出sheet数据
@param targetPath 生成的Excel输出全路径
@throws IOException 异常
"""
try (OutputStream fos = new FileOutputStream(targetPath);
Wo... | java | public void simpleSheet2Excel(List<SimpleSheetWrapper> sheets, String targetPath)
throws IOException {
try (OutputStream fos = new FileOutputStream(targetPath);
Workbook workbook = exportExcelBySimpleHandler(sheets, true)) {
workbook.write(fos);
}
} | [
"public",
"void",
"simpleSheet2Excel",
"(",
"List",
"<",
"SimpleSheetWrapper",
">",
"sheets",
",",
"String",
"targetPath",
")",
"throws",
"IOException",
"{",
"try",
"(",
"OutputStream",
"fos",
"=",
"new",
"FileOutputStream",
"(",
"targetPath",
")",
";",
"Workboo... | 无模板、无注解、多sheet数据
@param sheets 待导出sheet数据
@param targetPath 生成的Excel输出全路径
@throws IOException 异常 | [
"无模板、无注解、多sheet数据"
] | train | https://github.com/Crab2died/Excel4J/blob/2ab0a3b8226a69ff868c3ead6e724f3a774f5f77/src/main/java/com/github/crab2died/ExcelUtils.java#L1386-L1393 |
leancloud/java-sdk-all | realtime/src/main/java/cn/leancloud/im/v2/AVIMConversation.java | AVIMConversation.updateMemberRole | public void updateMemberRole(final String memberId, final ConversationMemberRole role, final AVIMConversationCallback callback) {
"""
更新成员的角色信息
@param memberId 成员的 client id
@param role 角色
@param callback 结果回调函数
"""
AVIMConversationMemberInfo info = new AVIMConversationMemberInfo(this.conversatio... | java | public void updateMemberRole(final String memberId, final ConversationMemberRole role, final AVIMConversationCallback callback) {
AVIMConversationMemberInfo info = new AVIMConversationMemberInfo(this.conversationId, memberId, role);
Map<String, Object> params = new HashMap<String, Object>();
params.put(Conv... | [
"public",
"void",
"updateMemberRole",
"(",
"final",
"String",
"memberId",
",",
"final",
"ConversationMemberRole",
"role",
",",
"final",
"AVIMConversationCallback",
"callback",
")",
"{",
"AVIMConversationMemberInfo",
"info",
"=",
"new",
"AVIMConversationMemberInfo",
"(",
... | 更新成员的角色信息
@param memberId 成员的 client id
@param role 角色
@param callback 结果回调函数 | [
"更新成员的角色信息"
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/realtime/src/main/java/cn/leancloud/im/v2/AVIMConversation.java#L1210-L1219 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.withReader | public static <T> T withReader(InputStream in, @ClosureParams(value=SimpleType.class, options="java.io.Reader") Closure<T> closure) throws IOException {
"""
Helper method to create a new Reader for a stream and then
passes it into the closure. The reader (and this stream) is closed after
the closure returns.
... | java | public static <T> T withReader(InputStream in, @ClosureParams(value=SimpleType.class, options="java.io.Reader") Closure<T> closure) throws IOException {
return withReader(new InputStreamReader(in), closure);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"withReader",
"(",
"InputStream",
"in",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.io.Reader\"",
")",
"Closure",
"<",
"T",
">",
"closure",
")",
"throws",
... | Helper method to create a new Reader for a stream and then
passes it into the closure. The reader (and this stream) is closed after
the closure returns.
@param in a stream
@param closure the closure to invoke with the InputStream
@return the value returned by the closure
@throws IOException if an IOException occ... | [
"Helper",
"method",
"to",
"create",
"a",
"new",
"Reader",
"for",
"a",
"stream",
"and",
"then",
"passes",
"it",
"into",
"the",
"closure",
".",
"The",
"reader",
"(",
"and",
"this",
"stream",
")",
"is",
"closed",
"after",
"the",
"closure",
"returns",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/IOGroovyMethods.java#L1209-L1211 |
scireum/server-sass | src/main/java/org/serversass/Functions.java | Functions.rgba | public static Expression rgba(Generator generator, FunctionCall input) {
"""
Creates a color from given RGB and alpha values.
@param generator the surrounding generator
@param input the function call to evaluate
@return the result of the evaluation
"""
if (input.getParameters().size() == 4) {
... | java | public static Expression rgba(Generator generator, FunctionCall input) {
if (input.getParameters().size() == 4) {
return new Color(input.getExpectedIntParam(0),
input.getExpectedIntParam(1),
input.getExpectedIntParam(2),
... | [
"public",
"static",
"Expression",
"rgba",
"(",
"Generator",
"generator",
",",
"FunctionCall",
"input",
")",
"{",
"if",
"(",
"input",
".",
"getParameters",
"(",
")",
".",
"size",
"(",
")",
"==",
"4",
")",
"{",
"return",
"new",
"Color",
"(",
"input",
"."... | Creates a color from given RGB and alpha values.
@param generator the surrounding generator
@param input the function call to evaluate
@return the result of the evaluation | [
"Creates",
"a",
"color",
"from",
"given",
"RGB",
"and",
"alpha",
"values",
"."
] | train | https://github.com/scireum/server-sass/blob/e74af983567f10c43420d70cd31165dd080ba8fc/src/main/java/org/serversass/Functions.java#L55-L69 |
ineunetOS/knife-commons | knife-commons-utils/src/main/java/com/ineunet/knife/util/StringUtils.java | StringUtils.endsWithAny | public static boolean endsWithAny(String string, String[] searchStrings) {
"""
<p>Check if a String ends with any of an array of specified strings.</p>
<pre>
StringUtils.endsWithAny(null, null) = false
StringUtils.endsWithAny(null, new String[] {"abc"}) = false
StringUtils.endsWithAny("abcxyz", null) ... | java | public static boolean endsWithAny(String string, String[] searchStrings) {
if (isEmpty(string) || ArrayUtils.isEmpty(searchStrings)) {
return false;
}
for (int i = 0; i < searchStrings.length; i++) {
String searchString = searchStrings[i];
if (StringUtils.ends... | [
"public",
"static",
"boolean",
"endsWithAny",
"(",
"String",
"string",
",",
"String",
"[",
"]",
"searchStrings",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"string",
")",
"||",
"ArrayUtils",
".",
"isEmpty",
"(",
"searchStrings",
")",
")",
"{",
"return",
"false",... | <p>Check if a String ends with any of an array of specified strings.</p>
<pre>
StringUtils.endsWithAny(null, null) = false
StringUtils.endsWithAny(null, new String[] {"abc"}) = false
StringUtils.endsWithAny("abcxyz", null) = false
StringUtils.endsWithAny("abcxyz", new String[] {""}) = true
StringUtils.endsWi... | [
"<p",
">",
"Check",
"if",
"a",
"String",
"ends",
"with",
"any",
"of",
"an",
"array",
"of",
"specified",
"strings",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ineunetOS/knife-commons/blob/eae9e59afa020a00ae8977c10d43ac8ae46ae236/knife-commons-utils/src/main/java/com/ineunet/knife/util/StringUtils.java#L6442-L6453 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.readStaticExportPublishedResourceParameters | public String readStaticExportPublishedResourceParameters(CmsRequestContext context, String rfsName)
throws CmsException {
"""
Returns the parameters of a resource in the table of all published template resources.<p>
@param context the current request context
@param rfsName the rfs name of the resource
... | java | public String readStaticExportPublishedResourceParameters(CmsRequestContext context, String rfsName)
throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
String result = null;
try {
result = m_driverManager.readStaticExportPublishedResourceParameter... | [
"public",
"String",
"readStaticExportPublishedResourceParameters",
"(",
"CmsRequestContext",
"context",
",",
"String",
"rfsName",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
")",
";",
"String... | Returns the parameters of a resource in the table of all published template resources.<p>
@param context the current request context
@param rfsName the rfs name of the resource
@return the parameter string of the requested resource
@throws CmsException if something goes wrong | [
"Returns",
"the",
"parameters",
"of",
"a",
"resource",
"in",
"the",
"table",
"of",
"all",
"published",
"template",
"resources",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L5290-L5306 |
netty/netty | codec-http2/src/main/java/io/netty/handler/codec/http2/Http2Settings.java | Http2Settings.put | @Override
public Long put(char key, Long value) {
"""
Adds the given setting key/value pair. For standard settings defined by the HTTP/2 spec, performs
validation on the values.
@throws IllegalArgumentException if verification for a standard HTTP/2 setting fails.
"""
verifyStandardSetting(key, ... | java | @Override
public Long put(char key, Long value) {
verifyStandardSetting(key, value);
return super.put(key, value);
} | [
"@",
"Override",
"public",
"Long",
"put",
"(",
"char",
"key",
",",
"Long",
"value",
")",
"{",
"verifyStandardSetting",
"(",
"key",
",",
"value",
")",
";",
"return",
"super",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Adds the given setting key/value pair. For standard settings defined by the HTTP/2 spec, performs
validation on the values.
@throws IllegalArgumentException if verification for a standard HTTP/2 setting fails. | [
"Adds",
"the",
"given",
"setting",
"key",
"/",
"value",
"pair",
".",
"For",
"standard",
"settings",
"defined",
"by",
"the",
"HTTP",
"/",
"2",
"spec",
"performs",
"validation",
"on",
"the",
"values",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2Settings.java#L73-L77 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/AbstractCalendarAndExceptionFactory.java | AbstractCalendarAndExceptionFactory.processWorkWeekDay | private void processWorkWeekDay(byte[] data, int offset, ProjectCalendarWeek week, Day day) {
"""
Process an individual work week day.
@param data calendar data
@param offset current offset into data
@param week parent week
@param day current day
"""
//System.out.println(ByteArrayHelper.hexdump(dat... | java | private void processWorkWeekDay(byte[] data, int offset, ProjectCalendarWeek week, Day day)
{
//System.out.println(ByteArrayHelper.hexdump(data, offset, 60, false));
int dayType = MPPUtility.getShort(data, offset + 0);
if (dayType == 1)
{
week.setWorkingDay(day, DayType.DEFAULT);
... | [
"private",
"void",
"processWorkWeekDay",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"ProjectCalendarWeek",
"week",
",",
"Day",
"day",
")",
"{",
"//System.out.println(ByteArrayHelper.hexdump(data, offset, 60, false));",
"int",
"dayType",
"=",
"MPPUtility",... | Process an individual work week day.
@param data calendar data
@param offset current offset into data
@param week parent week
@param day current day | [
"Process",
"an",
"individual",
"work",
"week",
"day",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/AbstractCalendarAndExceptionFactory.java#L281-L314 |
SonarSource/sonarqube | server/sonar-server-common/src/main/java/org/sonar/server/favorite/FavoriteUpdater.java | FavoriteUpdater.add | public void add(DbSession dbSession, ComponentDto componentDto, @Nullable Integer userId, boolean failIfTooManyFavorites) {
"""
Set favorite to the logged in user. If no user, no action is done
"""
if (userId == null) {
return;
}
List<PropertyDto> existingFavoriteOnComponent = dbClient.prope... | java | public void add(DbSession dbSession, ComponentDto componentDto, @Nullable Integer userId, boolean failIfTooManyFavorites) {
if (userId == null) {
return;
}
List<PropertyDto> existingFavoriteOnComponent = dbClient.propertiesDao().selectByQuery(PropertyQuery.builder()
.setKey(PROP_FAVORITE_KEY)
... | [
"public",
"void",
"add",
"(",
"DbSession",
"dbSession",
",",
"ComponentDto",
"componentDto",
",",
"@",
"Nullable",
"Integer",
"userId",
",",
"boolean",
"failIfTooManyFavorites",
")",
"{",
"if",
"(",
"userId",
"==",
"null",
")",
"{",
"return",
";",
"}",
"List... | Set favorite to the logged in user. If no user, no action is done | [
"Set",
"favorite",
"to",
"the",
"logged",
"in",
"user",
".",
"If",
"no",
"user",
"no",
"action",
"is",
"done"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server-common/src/main/java/org/sonar/server/favorite/FavoriteUpdater.java#L44-L65 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/log/Log.java | Log.wtf | public static int wtf(String tag, String msg) {
"""
What a Terrible Failure: Report a condition that should never happen. The error will always
be logged at level ASSERT with the call stack and with {@link SUBSYSTEM#MAIN} as default one.
@param tag Used to identify the source of a log message. It usually identi... | java | public static int wtf(String tag, String msg) {
return wtf(SUBSYSTEM.MAIN, tag, msg);
} | [
"public",
"static",
"int",
"wtf",
"(",
"String",
"tag",
",",
"String",
"msg",
")",
"{",
"return",
"wtf",
"(",
"SUBSYSTEM",
".",
"MAIN",
",",
"tag",
",",
"msg",
")",
";",
"}"
] | What a Terrible Failure: Report a condition that should never happen. The error will always
be logged at level ASSERT with the call stack and with {@link SUBSYSTEM#MAIN} as default one.
@param tag Used to identify the source of a log message. It usually identifies the class or
activity where the log call occurs.
@para... | [
"What",
"a",
"Terrible",
"Failure",
":",
"Report",
"a",
"condition",
"that",
"should",
"never",
"happen",
".",
"The",
"error",
"will",
"always",
"be",
"logged",
"at",
"level",
"ASSERT",
"with",
"the",
"call",
"stack",
"and",
"with",
"{"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/log/Log.java#L353-L355 |
alipay/sofa-rpc | extension-impl/remoting-bolt/src/main/java/com/alipay/sofa/rpc/transport/bolt/AloneBoltClientConnectionManager.java | AloneBoltClientConnectionManager.getConnection | public Connection getConnection(RpcClient rpcClient, ClientTransportConfig transportConfig, Url url) {
"""
通过配置获取长连接
@param rpcClient bolt客户端
@param transportConfig 传输层配置
@param url 传输层地址
@return 长连接
"""
if (rpcClient == null || transportConfig == null || url == null) {
... | java | public Connection getConnection(RpcClient rpcClient, ClientTransportConfig transportConfig, Url url) {
if (rpcClient == null || transportConfig == null || url == null) {
return null;
}
Connection connection;
try {
connection = rpcClient.getConnection(url, url.getC... | [
"public",
"Connection",
"getConnection",
"(",
"RpcClient",
"rpcClient",
",",
"ClientTransportConfig",
"transportConfig",
",",
"Url",
"url",
")",
"{",
"if",
"(",
"rpcClient",
"==",
"null",
"||",
"transportConfig",
"==",
"null",
"||",
"url",
"==",
"null",
")",
"... | 通过配置获取长连接
@param rpcClient bolt客户端
@param transportConfig 传输层配置
@param url 传输层地址
@return 长连接 | [
"通过配置获取长连接"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/remoting-bolt/src/main/java/com/alipay/sofa/rpc/transport/bolt/AloneBoltClientConnectionManager.java#L48-L65 |
aws/aws-sdk-java | aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/UpdateIdentityPoolRequest.java | UpdateIdentityPoolRequest.withSupportedLoginProviders | public UpdateIdentityPoolRequest withSupportedLoginProviders(java.util.Map<String, String> supportedLoginProviders) {
"""
<p>
Optional key:value pairs mapping provider names to provider app IDs.
</p>
@param supportedLoginProviders
Optional key:value pairs mapping provider names to provider app IDs.
@return ... | java | public UpdateIdentityPoolRequest withSupportedLoginProviders(java.util.Map<String, String> supportedLoginProviders) {
setSupportedLoginProviders(supportedLoginProviders);
return this;
} | [
"public",
"UpdateIdentityPoolRequest",
"withSupportedLoginProviders",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"supportedLoginProviders",
")",
"{",
"setSupportedLoginProviders",
"(",
"supportedLoginProviders",
")",
";",
"return",
"this",
... | <p>
Optional key:value pairs mapping provider names to provider app IDs.
</p>
@param supportedLoginProviders
Optional key:value pairs mapping provider names to provider app IDs.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Optional",
"key",
":",
"value",
"pairs",
"mapping",
"provider",
"names",
"to",
"provider",
"app",
"IDs",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/UpdateIdentityPoolRequest.java#L254-L257 |
cogroo/cogroo4 | lang/pt_br/cogroo-addon/src/org/cogroo/addon/dialogs/reporterror/WizardDialog.java | WizardDialog.insertRoadmapItem | public void insertRoadmapItem(int Index, boolean _bEnabled, String _sLabel, int _ID) {
"""
To fully understand the example one has to be aware that the passed ???Index??? parameter
refers to the position of the roadmap item in the roadmapmodel container
whereas the variable ???_ID??? directyl references to a cer... | java | public void insertRoadmapItem(int Index, boolean _bEnabled, String _sLabel, int _ID) {
try {
// a roadmap is a SingleServiceFactory that can only create roadmapitems that are the only possible
// element types of the container
Object oRoadmapItem = m_xSSFRoadmap.createInstanc... | [
"public",
"void",
"insertRoadmapItem",
"(",
"int",
"Index",
",",
"boolean",
"_bEnabled",
",",
"String",
"_sLabel",
",",
"int",
"_ID",
")",
"{",
"try",
"{",
"// a roadmap is a SingleServiceFactory that can only create roadmapitems that are the only possible",
"// element types... | To fully understand the example one has to be aware that the passed ???Index??? parameter
refers to the position of the roadmap item in the roadmapmodel container
whereas the variable ???_ID??? directyl references to a certain step of dialog. | [
"To",
"fully",
"understand",
"the",
"example",
"one",
"has",
"to",
"be",
"aware",
"that",
"the",
"passed",
"???Index???",
"parameter",
"refers",
"to",
"the",
"position",
"of",
"the",
"roadmap",
"item",
"in",
"the",
"roadmapmodel",
"container",
"whereas",
"the"... | train | https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/lang/pt_br/cogroo-addon/src/org/cogroo/addon/dialogs/reporterror/WizardDialog.java#L1489-L1504 |
CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java | CleverTapAPI.pushGcmRegistrationId | @SuppressWarnings("WeakerAccess")
public void pushGcmRegistrationId(String gcmId, boolean register) {
"""
Sends the GCM registration ID to CleverTap.
@param gcmId The GCM registration ID
@param register Boolean indicating whether to register
or not for receiving push messages from CleverTap.
Set this ... | java | @SuppressWarnings("WeakerAccess")
public void pushGcmRegistrationId(String gcmId, boolean register) {
pushDeviceToken(gcmId, register, PushType.GCM);
} | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"void",
"pushGcmRegistrationId",
"(",
"String",
"gcmId",
",",
"boolean",
"register",
")",
"{",
"pushDeviceToken",
"(",
"gcmId",
",",
"register",
",",
"PushType",
".",
"GCM",
")",
";",
"}"
] | Sends the GCM registration ID to CleverTap.
@param gcmId The GCM registration ID
@param register Boolean indicating whether to register
or not for receiving push messages from CleverTap.
Set this to true to receive push messages from CleverTap,
and false to not receive any messages from CleverTap. | [
"Sends",
"the",
"GCM",
"registration",
"ID",
"to",
"CleverTap",
"."
] | train | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java#L4807-L4810 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/handlers/LogRepositoryConfiguration.java | LogRepositoryConfiguration.setTraceMemory | public void setTraceMemory(String dataDirectory, long memoryBufferSize) {
"""
Modify the trace to use a memory buffer
@param dataDirectory directory where buffer will be dumped if requested
@param memoryBufferSize amount of memory (in Mb) to be used for this circular buffer
"""
TraceState state = (TraceSta... | java | public void setTraceMemory(String dataDirectory, long memoryBufferSize) {
TraceState state = (TraceState)ivTrace.clone();
state.ivStorageType = MEMORYBUFFER_TYPE;
state.ivDataDirectory = dataDirectory;
state.ivMemoryBufferSize = memoryBufferSize;
updateTraceConfiguration(state);
state.copyTo(ivTrace);... | [
"public",
"void",
"setTraceMemory",
"(",
"String",
"dataDirectory",
",",
"long",
"memoryBufferSize",
")",
"{",
"TraceState",
"state",
"=",
"(",
"TraceState",
")",
"ivTrace",
".",
"clone",
"(",
")",
";",
"state",
".",
"ivStorageType",
"=",
"MEMORYBUFFER_TYPE",
... | Modify the trace to use a memory buffer
@param dataDirectory directory where buffer will be dumped if requested
@param memoryBufferSize amount of memory (in Mb) to be used for this circular buffer | [
"Modify",
"the",
"trace",
"to",
"use",
"a",
"memory",
"buffer"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/handlers/LogRepositoryConfiguration.java#L436-L445 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/transform/fft/DiscreteFourierTransformOps.java | DiscreteFourierTransformOps.realToComplex | public static void realToComplex(GrayF32 real , InterleavedF32 complex ) {
"""
Converts a regular image into a complex interleaved image with the imaginary component set to zero.
@param real (Input) Regular image.
@param complex (Output) Equivalent complex image.
"""
checkImageArguments(real,complex);
... | java | public static void realToComplex(GrayF32 real , InterleavedF32 complex ) {
checkImageArguments(real,complex);
for( int y = 0; y < complex.height; y++ ) {
int indexReal = real.startIndex + y*real.stride;
int indexComplex = complex.startIndex + y*complex.stride;
for( int x = 0; x < real.width; x++, indexRe... | [
"public",
"static",
"void",
"realToComplex",
"(",
"GrayF32",
"real",
",",
"InterleavedF32",
"complex",
")",
"{",
"checkImageArguments",
"(",
"real",
",",
"complex",
")",
";",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"complex",
".",
"height",
";",... | Converts a regular image into a complex interleaved image with the imaginary component set to zero.
@param real (Input) Regular image.
@param complex (Output) Equivalent complex image. | [
"Converts",
"a",
"regular",
"image",
"into",
"a",
"complex",
"interleaved",
"image",
"with",
"the",
"imaginary",
"component",
"set",
"to",
"zero",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/fft/DiscreteFourierTransformOps.java#L354-L366 |
tvesalainen/util | util/src/main/java/org/vesalainen/util/ArrayHelp.java | ArrayHelp.containsOnly | public static final <T> boolean containsOnly(short[] array, T... items) {
"""
Throws UnsupportedOperationException if one of array members is not one
of items
@param <T>
@param array
@param items
@return
"""
for (short b : array)
{
if (!contains(items, b))
{
... | java | public static final <T> boolean containsOnly(short[] array, T... items)
{
for (short b : array)
{
if (!contains(items, b))
{
return false;
}
}
return true;
} | [
"public",
"static",
"final",
"<",
"T",
">",
"boolean",
"containsOnly",
"(",
"short",
"[",
"]",
"array",
",",
"T",
"...",
"items",
")",
"{",
"for",
"(",
"short",
"b",
":",
"array",
")",
"{",
"if",
"(",
"!",
"contains",
"(",
"items",
",",
"b",
")",... | Throws UnsupportedOperationException if one of array members is not one
of items
@param <T>
@param array
@param items
@return | [
"Throws",
"UnsupportedOperationException",
"if",
"one",
"of",
"array",
"members",
"is",
"not",
"one",
"of",
"items"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/util/ArrayHelp.java#L450-L460 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLChannel.java | SSLChannel.getSSLContextForInboundLink | public SSLContext getSSLContextForInboundLink(SSLConnectionLink link, VirtualConnection vc) throws ChannelException {
"""
This method is overloaded from the base class in order to determine the host and port
of the connection required by the calls to the core security code which will eventually
return an SSLCont... | java | public SSLContext getSSLContextForInboundLink(SSLConnectionLink link, VirtualConnection vc) throws ChannelException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "getSSLContextForInboundLink");
}
SSLContext context = getSSLContextForLink(vc, this.... | [
"public",
"SSLContext",
"getSSLContextForInboundLink",
"(",
"SSLConnectionLink",
"link",
",",
"VirtualConnection",
"vc",
")",
"throws",
"ChannelException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
... | This method is overloaded from the base class in order to determine the host and port
of the connection required by the calls to the core security code which will eventually
return an SSLContext to use. This is only used by inbound connections.
@param link
@param vc
@return SSLContext
@throws ChannelException | [
"This",
"method",
"is",
"overloaded",
"from",
"the",
"base",
"class",
"in",
"order",
"to",
"determine",
"the",
"host",
"and",
"port",
"of",
"the",
"connection",
"required",
"by",
"the",
"calls",
"to",
"the",
"core",
"security",
"code",
"which",
"will",
"ev... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLChannel.java#L270-L282 |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/concurrency/BoofConcurrency.java | BoofConcurrency.loopFor | public static void loopFor(int start , int endExclusive , IntConsumer consumer ) {
"""
Concurrent for loop. Each loop with spawn as a thread up to the maximum number of threads.
@param start starting value, inclusive
@param endExclusive ending value, exclusive
@param consumer The consumer
"""
try {
p... | java | public static void loopFor(int start , int endExclusive , IntConsumer consumer ) {
try {
pool.submit(() ->IntStream.range(start, endExclusive).parallel().forEach(consumer)).get();
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
}
} | [
"public",
"static",
"void",
"loopFor",
"(",
"int",
"start",
",",
"int",
"endExclusive",
",",
"IntConsumer",
"consumer",
")",
"{",
"try",
"{",
"pool",
".",
"submit",
"(",
"(",
")",
"->",
"IntStream",
".",
"range",
"(",
"start",
",",
"endExclusive",
")",
... | Concurrent for loop. Each loop with spawn as a thread up to the maximum number of threads.
@param start starting value, inclusive
@param endExclusive ending value, exclusive
@param consumer The consumer | [
"Concurrent",
"for",
"loop",
".",
"Each",
"loop",
"with",
"spawn",
"as",
"a",
"thread",
"up",
"to",
"the",
"maximum",
"number",
"of",
"threads",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/concurrency/BoofConcurrency.java#L60-L66 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionPersistenceImpl.java | CPDefinitionPersistenceImpl.fetchByC_ERC | @Override
public CPDefinition fetchByC_ERC(long companyId,
String externalReferenceCode) {
"""
Returns the cp definition where companyId = ? and externalReferenceCode = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param companyId the company ID
@param externalRefe... | java | @Override
public CPDefinition fetchByC_ERC(long companyId,
String externalReferenceCode) {
return fetchByC_ERC(companyId, externalReferenceCode, true);
} | [
"@",
"Override",
"public",
"CPDefinition",
"fetchByC_ERC",
"(",
"long",
"companyId",
",",
"String",
"externalReferenceCode",
")",
"{",
"return",
"fetchByC_ERC",
"(",
"companyId",
",",
"externalReferenceCode",
",",
"true",
")",
";",
"}"
] | Returns the cp definition where companyId = ? and externalReferenceCode = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param companyId the company ID
@param externalReferenceCode the external reference code
@return the matching cp definition, or <code>null</code> if a matchi... | [
"Returns",
"the",
"cp",
"definition",
"where",
"companyId",
"=",
"?",
";",
"and",
"externalReferenceCode",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
"find... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionPersistenceImpl.java#L5232-L5236 |
blackfizz/EazeGraph | EazeGraphLibrary/src/main/java/org/eazegraph/lib/utils/Utils.java | Utils.vectorToScalarScroll | public static float vectorToScalarScroll(float _Dx, float _Dy, float _X, float _Y) {
"""
Helper method for translating (_X,_Y) scroll vectors into scalar rotation of a circle.
@param _Dx The _X component of the current scroll vector.
@param _Dy The _Y component of the current scroll vector.
@param _X The _X ... | java | public static float vectorToScalarScroll(float _Dx, float _Dy, float _X, float _Y) {
// get the length of the vector
float l = (float) Math.sqrt(_Dx * _Dx + _Dy * _Dy);
// decide if the scalar should be negative or positive by finding
// the dot product of the vector perpendicular to (_... | [
"public",
"static",
"float",
"vectorToScalarScroll",
"(",
"float",
"_Dx",
",",
"float",
"_Dy",
",",
"float",
"_X",
",",
"float",
"_Y",
")",
"{",
"// get the length of the vector",
"float",
"l",
"=",
"(",
"float",
")",
"Math",
".",
"sqrt",
"(",
"_Dx",
"*",
... | Helper method for translating (_X,_Y) scroll vectors into scalar rotation of a circle.
@param _Dx The _X component of the current scroll vector.
@param _Dy The _Y component of the current scroll vector.
@param _X The _X position of the current touch, relative to the circle center.
@param _Y The _Y position of the cu... | [
"Helper",
"method",
"for",
"translating",
"(",
"_X",
"_Y",
")",
"scroll",
"vectors",
"into",
"scalar",
"rotation",
"of",
"a",
"circle",
"."
] | train | https://github.com/blackfizz/EazeGraph/blob/ce5e68ecc70e154f83bbb2fcce1a970db125c1e6/EazeGraphLibrary/src/main/java/org/eazegraph/lib/utils/Utils.java#L74-L87 |
alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/topology/TopologyBuilder.java | TopologyBuilder.setSpout | public SpoutDeclarer setSpout(String id, IRichSpout spout, Number parallelism_hint) throws IllegalArgumentException {
"""
Define a new spout in this topology with the specified parallelism. If the spout declares
itself as non-distributed, the parallelism_hint will be ignored and only one task
will be allocated t... | java | public SpoutDeclarer setSpout(String id, IRichSpout spout, Number parallelism_hint) throws IllegalArgumentException {
validateUnusedId(id);
initCommon(id, spout, parallelism_hint);
_spouts.put(id, spout);
return new SpoutGetter(id);
} | [
"public",
"SpoutDeclarer",
"setSpout",
"(",
"String",
"id",
",",
"IRichSpout",
"spout",
",",
"Number",
"parallelism_hint",
")",
"throws",
"IllegalArgumentException",
"{",
"validateUnusedId",
"(",
"id",
")",
";",
"initCommon",
"(",
"id",
",",
"spout",
",",
"paral... | Define a new spout in this topology with the specified parallelism. If the spout declares
itself as non-distributed, the parallelism_hint will be ignored and only one task
will be allocated to this component.
@param id the id of this component. This id is referenced by other components that want to consume this spout'... | [
"Define",
"a",
"new",
"spout",
"in",
"this",
"topology",
"with",
"the",
"specified",
"parallelism",
".",
"If",
"the",
"spout",
"declares",
"itself",
"as",
"non",
"-",
"distributed",
"the",
"parallelism_hint",
"will",
"be",
"ignored",
"and",
"only",
"one",
"t... | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/topology/TopologyBuilder.java#L321-L326 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/IssuesApi.java | IssuesApi.closeIssue | public Issue closeIssue(Object projectIdOrPath, Integer issueIid) throws GitLabApiException {
"""
Closes an existing project issue.
<pre><code>GitLab Endpoint: PUT /projects/:id/issues/:issue_iid</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance,... | java | public Issue closeIssue(Object projectIdOrPath, Integer issueIid) throws GitLabApiException {
if (issueIid == null) {
throw new RuntimeException("issue IID cannot be null");
}
GitLabApiForm formData = new GitLabApiForm().withParam("state_event", StateEvent.CLOSE);
... | [
"public",
"Issue",
"closeIssue",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"issueIid",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"issueIid",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"issue IID cannot be null\"",
")",
";... | Closes an existing project issue.
<pre><code>GitLab Endpoint: PUT /projects/:id/issues/:issue_iid</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
@param issueIid the issue IID to update, required
@return an instance of the updated Issue
@throw... | [
"Closes",
"an",
"existing",
"project",
"issue",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/IssuesApi.java#L380-L389 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java | DependencyBundlingAnalyzer.hashesMatch | private boolean hashesMatch(Dependency dependency1, Dependency dependency2) {
"""
Compares the SHA1 hashes of two dependencies to determine if they are
equal.
@param dependency1 a dependency object to compare
@param dependency2 a dependency object to compare
@return true if the sha1 hashes of the two depende... | java | private boolean hashesMatch(Dependency dependency1, Dependency dependency2) {
if (dependency1 == null || dependency2 == null || dependency1.getSha1sum() == null || dependency2.getSha1sum() == null) {
return false;
}
return dependency1.getSha1sum().equals(dependency2.getSha1sum());
... | [
"private",
"boolean",
"hashesMatch",
"(",
"Dependency",
"dependency1",
",",
"Dependency",
"dependency2",
")",
"{",
"if",
"(",
"dependency1",
"==",
"null",
"||",
"dependency2",
"==",
"null",
"||",
"dependency1",
".",
"getSha1sum",
"(",
")",
"==",
"null",
"||",
... | Compares the SHA1 hashes of two dependencies to determine if they are
equal.
@param dependency1 a dependency object to compare
@param dependency2 a dependency object to compare
@return true if the sha1 hashes of the two dependencies match; otherwise
false | [
"Compares",
"the",
"SHA1",
"hashes",
"of",
"two",
"dependencies",
"to",
"determine",
"if",
"they",
"are",
"equal",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java#L390-L395 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/AtomPositionMap.java | AtomPositionMap.getLength | public int getLength(int positionA, int positionB, String startingChain) {
"""
Calculates the number of residues of the specified chain in a given range, inclusive.
@param positionA index of the first atom to count
@param positionB index of the last atom to count
@param startingChain Case-sensitive chain
@retu... | java | public int getLength(int positionA, int positionB, String startingChain) {
int positionStart, positionEnd;
if (positionA <= positionB) {
positionStart = positionA;
positionEnd = positionB;
} else {
positionStart = positionB;
positionEnd = positionA;
}
int count = 0;
// Inefficient search
for... | [
"public",
"int",
"getLength",
"(",
"int",
"positionA",
",",
"int",
"positionB",
",",
"String",
"startingChain",
")",
"{",
"int",
"positionStart",
",",
"positionEnd",
";",
"if",
"(",
"positionA",
"<=",
"positionB",
")",
"{",
"positionStart",
"=",
"positionA",
... | Calculates the number of residues of the specified chain in a given range, inclusive.
@param positionA index of the first atom to count
@param positionB index of the last atom to count
@param startingChain Case-sensitive chain
@return The number of atoms between A and B inclusive belonging to the given chain | [
"Calculates",
"the",
"number",
"of",
"residues",
"of",
"the",
"specified",
"chain",
"in",
"a",
"given",
"range",
"inclusive",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/AtomPositionMap.java#L187-L209 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java | HttpChannelConfig.parsePersistTimeout | private void parsePersistTimeout(Map<Object, Object> props) {
"""
Check the input configuration for the timeout to use in between
persistent requests.
@param props
"""
Object value = props.get(HttpConfigConstants.PROPNAME_PERSIST_TIMEOUT);
if (null != value) {
try {
... | java | private void parsePersistTimeout(Map<Object, Object> props) {
Object value = props.get(HttpConfigConstants.PROPNAME_PERSIST_TIMEOUT);
if (null != value) {
try {
this.persistTimeout = TIMEOUT_MODIFIER * minLimit(convertInteger(value), HttpConfigConstants.MIN_TIMEOUT);
... | [
"private",
"void",
"parsePersistTimeout",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"props",
")",
"{",
"Object",
"value",
"=",
"props",
".",
"get",
"(",
"HttpConfigConstants",
".",
"PROPNAME_PERSIST_TIMEOUT",
")",
";",
"if",
"(",
"null",
"!=",
"value",
... | Check the input configuration for the timeout to use in between
persistent requests.
@param props | [
"Check",
"the",
"input",
"configuration",
"for",
"the",
"timeout",
"to",
"use",
"in",
"between",
"persistent",
"requests",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L635-L650 |
tzaeschke/zoodb | src/org/zoodb/internal/server/index/LLIndexPage.java | LLIndexPage.binarySearch | int binarySearch(int fromIndex, int toIndex, long key, long value) {
"""
Binary search.
@param toIndex Exclusive, search stops at (toIndex-1).
@param value For non-unique trees, the value is taken into account as well.
"""
if (ind.isUnique()) {
return binarySearchUnique(fromIndex, toIndex, key);
}
... | java | int binarySearch(int fromIndex, int toIndex, long key, long value) {
if (ind.isUnique()) {
return binarySearchUnique(fromIndex, toIndex, key);
}
return binarySearchNonUnique(fromIndex, toIndex, key, value);
} | [
"int",
"binarySearch",
"(",
"int",
"fromIndex",
",",
"int",
"toIndex",
",",
"long",
"key",
",",
"long",
"value",
")",
"{",
"if",
"(",
"ind",
".",
"isUnique",
"(",
")",
")",
"{",
"return",
"binarySearchUnique",
"(",
"fromIndex",
",",
"toIndex",
",",
"ke... | Binary search.
@param toIndex Exclusive, search stops at (toIndex-1).
@param value For non-unique trees, the value is taken into account as well. | [
"Binary",
"search",
"."
] | train | https://github.com/tzaeschke/zoodb/blob/058d0ff161a8ee9d53244c433aca97ee9c654410/src/org/zoodb/internal/server/index/LLIndexPage.java#L227-L232 |
rzwitserloot/lombok.ast | src/ast/lombok/ast/Ast.java | Ast.setAllPositions | public static Node setAllPositions(Node node, Position position) {
"""
Sets the position of {@code node} to {@code position}, and then does the same for all of {@code node}'s children, recursively.
"""
node.setPosition(position);
for (Node child : node.getChildren()) setAllPositions(child, position);
ret... | java | public static Node setAllPositions(Node node, Position position) {
node.setPosition(position);
for (Node child : node.getChildren()) setAllPositions(child, position);
return node;
}
/**
* Get the current lombok.ast version.
*/
public static String getVersion() {
return Version.getVersion();
}
publi... | [
"public",
"static",
"Node",
"setAllPositions",
"(",
"Node",
"node",
",",
"Position",
"position",
")",
"{",
"node",
".",
"setPosition",
"(",
"position",
")",
";",
"for",
"(",
"Node",
"child",
":",
"node",
".",
"getChildren",
"(",
")",
")",
"setAllPositions"... | Sets the position of {@code node} to {@code position}, and then does the same for all of {@code node}'s children, recursively. | [
"Sets",
"the",
"position",
"of",
"{"
] | train | https://github.com/rzwitserloot/lombok.ast/blob/ed83541c1a5a08952a5d4d7e316a6be9a05311fb/src/ast/lombok/ast/Ast.java#L31-L48 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_datacenter_datacenterId_backup_enable_POST | public OvhTask serviceName_datacenter_datacenterId_backup_enable_POST(String serviceName, Long datacenterId, OvhOfferTypeEnum backupOffer) throws IOException {
"""
Enable backup solution on a Private Cloud
REST: POST /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/backup/enable
@param backupOffer [requ... | java | public OvhTask serviceName_datacenter_datacenterId_backup_enable_POST(String serviceName, Long datacenterId, OvhOfferTypeEnum backupOffer) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/backup/enable";
StringBuilder sb = path(qPath, serviceName, datacenterId);
HashMap... | [
"public",
"OvhTask",
"serviceName_datacenter_datacenterId_backup_enable_POST",
"(",
"String",
"serviceName",
",",
"Long",
"datacenterId",
",",
"OvhOfferTypeEnum",
"backupOffer",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicatedCloud/{serviceName}/datacent... | Enable backup solution on a Private Cloud
REST: POST /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/backup/enable
@param backupOffer [required] Backup offer type
@param serviceName [required] Domain of the service
@param datacenterId [required] | [
"Enable",
"backup",
"solution",
"on",
"a",
"Private",
"Cloud"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L2430-L2437 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/BaseNDArrayFactory.java | BaseNDArrayFactory.randn | @Override
public INDArray randn(long rows, long columns, long seed) {
"""
Random normal using the specified seed
@param rows the number of rows in the matrix
@param columns the number of columns in the matrix
@return
"""
Nd4j.getRandom().setSeed(seed);
return randn(new long[] {rows,... | java | @Override
public INDArray randn(long rows, long columns, long seed) {
Nd4j.getRandom().setSeed(seed);
return randn(new long[] {rows, columns}, Nd4j.getRandom());
} | [
"@",
"Override",
"public",
"INDArray",
"randn",
"(",
"long",
"rows",
",",
"long",
"columns",
",",
"long",
"seed",
")",
"{",
"Nd4j",
".",
"getRandom",
"(",
")",
".",
"setSeed",
"(",
"seed",
")",
";",
"return",
"randn",
"(",
"new",
"long",
"[",
"]",
... | Random normal using the specified seed
@param rows the number of rows in the matrix
@param columns the number of columns in the matrix
@return | [
"Random",
"normal",
"using",
"the",
"specified",
"seed"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/factory/BaseNDArrayFactory.java#L536-L540 |
Wikidata/Wikidata-Toolkit | wdtk-examples/src/main/java/org/wikidata/wdtk/examples/ClassPropertyUsageAnalyzer.java | ClassPropertyUsageAnalyzer.printRelatedProperties | private void printRelatedProperties(PrintStream out, UsageRecord usageRecord) {
"""
Prints a list of related properties to the output. The list is encoded as
a single CSV value, using "@" as a separator. Miga can decode this.
Standard CSV processors do not support lists of entries as values,
however.
@param ... | java | private void printRelatedProperties(PrintStream out, UsageRecord usageRecord) {
List<ImmutablePair<PropertyIdValue, Double>> list = new ArrayList<ImmutablePair<PropertyIdValue, Double>>(
usageRecord.propertyCoCounts.size());
for (Entry<PropertyIdValue, Integer> coCountEntry : usageRecord.propertyCoCounts
.... | [
"private",
"void",
"printRelatedProperties",
"(",
"PrintStream",
"out",
",",
"UsageRecord",
"usageRecord",
")",
"{",
"List",
"<",
"ImmutablePair",
"<",
"PropertyIdValue",
",",
"Double",
">",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"ImmutablePair",
"<",
"Prope... | Prints a list of related properties to the output. The list is encoded as
a single CSV value, using "@" as a separator. Miga can decode this.
Standard CSV processors do not support lists of entries as values,
however.
@param out
the output to write to
@param usageRecord
the data to write | [
"Prints",
"a",
"list",
"of",
"related",
"properties",
"to",
"the",
"output",
".",
"The",
"list",
"is",
"encoded",
"as",
"a",
"single",
"CSV",
"value",
"using",
"@",
"as",
"a",
"separator",
".",
"Miga",
"can",
"decode",
"this",
".",
"Standard",
"CSV",
"... | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-examples/src/main/java/org/wikidata/wdtk/examples/ClassPropertyUsageAnalyzer.java#L798-L844 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/XFactory.java | XFactory.createXMethod | public static XMethod createXMethod(InvokeInstruction invokeInstruction, ConstantPoolGen cpg) {
"""
Create an XMethod object from an InvokeInstruction.
@param invokeInstruction
the InvokeInstruction
@param cpg
ConstantPoolGen from the class containing the instruction
@return XMethod representing the method ... | java | public static XMethod createXMethod(InvokeInstruction invokeInstruction, ConstantPoolGen cpg) {
String className = invokeInstruction.getClassName(cpg);
String methodName = invokeInstruction.getName(cpg);
String methodSig = invokeInstruction.getSignature(cpg);
if (invokeInstruction instan... | [
"public",
"static",
"XMethod",
"createXMethod",
"(",
"InvokeInstruction",
"invokeInstruction",
",",
"ConstantPoolGen",
"cpg",
")",
"{",
"String",
"className",
"=",
"invokeInstruction",
".",
"getClassName",
"(",
"cpg",
")",
";",
"String",
"methodName",
"=",
"invokeIn... | Create an XMethod object from an InvokeInstruction.
@param invokeInstruction
the InvokeInstruction
@param cpg
ConstantPoolGen from the class containing the instruction
@return XMethod representing the method called by the InvokeInstruction | [
"Create",
"an",
"XMethod",
"object",
"from",
"an",
"InvokeInstruction",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/XFactory.java#L616-L631 |
moparisthebest/beehive | beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java | JdbcControlImpl.onRelease | @EventHandler(field = "_resourceContext", eventSet = ResourceContext.ResourceEvents.class, eventName = "onRelease")
public void onRelease() {
"""
Invoked by the controls runtime when an instance of this class is released by the runtime
"""
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("E... | java | @EventHandler(field = "_resourceContext", eventSet = ResourceContext.ResourceEvents.class, eventName = "onRelease")
public void onRelease() {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Enter: onRelease()");
}
for (PreparedStatement ps : getResources()) {
try {
... | [
"@",
"EventHandler",
"(",
"field",
"=",
"\"_resourceContext\"",
",",
"eventSet",
"=",
"ResourceContext",
".",
"ResourceEvents",
".",
"class",
",",
"eventName",
"=",
"\"onRelease\"",
")",
"public",
"void",
"onRelease",
"(",
")",
"{",
"if",
"(",
"LOGGER",
".",
... | Invoked by the controls runtime when an instance of this class is released by the runtime | [
"Invoked",
"by",
"the",
"controls",
"runtime",
"when",
"an",
"instance",
"of",
"this",
"class",
"is",
"released",
"by",
"the",
"runtime"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java#L120-L146 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/runtime/JCuda.java | JCuda.cudaGraphicsUnmapResources | public static int cudaGraphicsUnmapResources(int count, cudaGraphicsResource resources[], cudaStream_t stream) {
"""
Unmap graphics resources.
<pre>
cudaError_t cudaGraphicsUnmapResources (
int count,
cudaGraphicsResource_t* resources,
cudaStream_t stream = 0 )
</pre>
<div>
<p>Unmap graphics resources. ... | java | public static int cudaGraphicsUnmapResources(int count, cudaGraphicsResource resources[], cudaStream_t stream)
{
return checkResult(cudaGraphicsUnmapResourcesNative(count, resources, stream));
} | [
"public",
"static",
"int",
"cudaGraphicsUnmapResources",
"(",
"int",
"count",
",",
"cudaGraphicsResource",
"resources",
"[",
"]",
",",
"cudaStream_t",
"stream",
")",
"{",
"return",
"checkResult",
"(",
"cudaGraphicsUnmapResourcesNative",
"(",
"count",
",",
"resources",... | Unmap graphics resources.
<pre>
cudaError_t cudaGraphicsUnmapResources (
int count,
cudaGraphicsResource_t* resources,
cudaStream_t stream = 0 )
</pre>
<div>
<p>Unmap graphics resources. Unmaps the
<tt>count</tt> graphics resources in <tt>resources</tt>.
</p>
<p>Once unmapped, the resources in <tt>resources</tt> may... | [
"Unmap",
"graphics",
"resources",
"."
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/runtime/JCuda.java#L11559-L11562 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java | CommonOps_DDF2.multTransAB | public static void multTransAB( double alpha , DMatrix2x2 a , DMatrix2x2 b , DMatrix2x2 c) {
"""
<p>
Performs the following operation:<br>
<br>
c = α*a<sup>T</sup> * b<sup>T</sup><br>
c<sub>ij</sub> = α*∑<sub>k=1:n</sub> { a<sub>ki</sub> * b<sub>jk</sub>}
</p>
@param alpha Scaling factor.
... | java | public static void multTransAB( double alpha , DMatrix2x2 a , DMatrix2x2 b , DMatrix2x2 c) {
c.a11 = alpha*(a.a11*b.a11 + a.a21*b.a12);
c.a12 = alpha*(a.a11*b.a21 + a.a21*b.a22);
c.a21 = alpha*(a.a12*b.a11 + a.a22*b.a12);
c.a22 = alpha*(a.a12*b.a21 + a.a22*b.a22);
} | [
"public",
"static",
"void",
"multTransAB",
"(",
"double",
"alpha",
",",
"DMatrix2x2",
"a",
",",
"DMatrix2x2",
"b",
",",
"DMatrix2x2",
"c",
")",
"{",
"c",
".",
"a11",
"=",
"alpha",
"*",
"(",
"a",
".",
"a11",
"*",
"b",
".",
"a11",
"+",
"a",
".",
"a... | <p>
Performs the following operation:<br>
<br>
c = α*a<sup>T</sup> * b<sup>T</sup><br>
c<sub>ij</sub> = α*∑<sub>k=1:n</sub> { a<sub>ki</sub> * b<sub>jk</sub>}
</p>
@param alpha Scaling factor.
@param a The left matrix in the multiplication operation. Not modified.
@param b The right matrix in the multi... | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"c",
"=",
"&alpha",
";",
"*",
"a<sup",
">",
"T<",
"/",
"sup",
">",
"*",
"b<sup",
">",
"T<",
"/",
"sup",
">",
"<br",
">",
"c<sub",
">",
"ij<",
"/",
"sub",
">",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java#L325-L330 |
micronaut-projects/micronaut-core | inject-java/src/main/java/io/micronaut/annotation/processing/AnnotationUtils.java | AnnotationUtils.getAnnotationMetadata | public AnnotationMetadata getAnnotationMetadata(Element parent, Element element) {
"""
Get the annotation metadata for the given element.
@param parent The parent
@param element The element
@return The {@link AnnotationMetadata}
"""
return newAnnotationBuilder().buildForParent(parent, element);
... | java | public AnnotationMetadata getAnnotationMetadata(Element parent, Element element) {
return newAnnotationBuilder().buildForParent(parent, element);
} | [
"public",
"AnnotationMetadata",
"getAnnotationMetadata",
"(",
"Element",
"parent",
",",
"Element",
"element",
")",
"{",
"return",
"newAnnotationBuilder",
"(",
")",
".",
"buildForParent",
"(",
"parent",
",",
"element",
")",
";",
"}"
] | Get the annotation metadata for the given element.
@param parent The parent
@param element The element
@return The {@link AnnotationMetadata} | [
"Get",
"the",
"annotation",
"metadata",
"for",
"the",
"given",
"element",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject-java/src/main/java/io/micronaut/annotation/processing/AnnotationUtils.java#L210-L212 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/utils/UriUtils.java | UriUtils.urlToUri | public static URI urlToUri( String urlAsString ) throws URISyntaxException {
"""
Builds an URI from an URL string (with an handle for URLs not compliant with RFC 2396).
@param urlAsString an URL as a string
@return an URI
@throws URISyntaxException if the URI is invalid and could not be repaired
"""
URL ... | java | public static URI urlToUri( String urlAsString ) throws URISyntaxException {
URL url;
try {
url = new URL( urlAsString );
} catch( Exception e ) {
throw new URISyntaxException( urlAsString, "Invalid URL." );
}
return urlToUri( url );
} | [
"public",
"static",
"URI",
"urlToUri",
"(",
"String",
"urlAsString",
")",
"throws",
"URISyntaxException",
"{",
"URL",
"url",
";",
"try",
"{",
"url",
"=",
"new",
"URL",
"(",
"urlAsString",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
... | Builds an URI from an URL string (with an handle for URLs not compliant with RFC 2396).
@param urlAsString an URL as a string
@return an URI
@throws URISyntaxException if the URI is invalid and could not be repaired | [
"Builds",
"an",
"URI",
"from",
"an",
"URL",
"string",
"(",
"with",
"an",
"handle",
"for",
"URLs",
"not",
"compliant",
"with",
"RFC",
"2396",
")",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/utils/UriUtils.java#L87-L98 |
korpling/ANNIS | annis-visualizers/src/main/java/annis/visualizers/iframe/partitur/TimeHelper.java | TimeHelper.getTimePosition | private String getTimePosition(String time, boolean first) {
"""
Split a time annotation s.ms-(s.ms)? Whether the flag first is set to true,
we return the first value, otherwise we did try to return the second. The
end time don't have to be annotated, in this case it returns "undefined".
Without a defined start... | java | private String getTimePosition(String time, boolean first)
{
if (time == null)
{
return "undefined";
}
String[] splittedTimeAnno = time.split("-");
if (splittedTimeAnno.length > 1)
{
if (first)
{
return splittedTimeAnno[0].equals("") ? "undefined"
: splitt... | [
"private",
"String",
"getTimePosition",
"(",
"String",
"time",
",",
"boolean",
"first",
")",
"{",
"if",
"(",
"time",
"==",
"null",
")",
"{",
"return",
"\"undefined\"",
";",
"}",
"String",
"[",
"]",
"splittedTimeAnno",
"=",
"time",
".",
"split",
"(",
"\"-... | Split a time annotation s.ms-(s.ms)? Whether the flag first is set to true,
we return the first value, otherwise we did try to return the second. The
end time don't have to be annotated, in this case it returns "undefined".
Without a defined start time the result is an empty String "undefined". If
there is no time anno... | [
"Split",
"a",
"time",
"annotation",
"s",
".",
"ms",
"-",
"(",
"s",
".",
"ms",
")",
"?",
"Whether",
"the",
"flag",
"first",
"is",
"set",
"to",
"true",
"we",
"return",
"the",
"first",
"value",
"otherwise",
"we",
"did",
"try",
"to",
"return",
"the",
"... | train | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/iframe/partitur/TimeHelper.java#L60-L90 |
signalapp/libsignal-service-java | java/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java | SignalServiceAccountManager.requestVoiceVerificationCode | public void requestVoiceVerificationCode(Locale locale, Optional<String> captchaToken) throws IOException {
"""
Request a Voice verification code. On success, the server will
make a voice call to this Signal user.
@throws IOException
"""
this.pushServiceSocket.requestVoiceVerificationCode(locale, capt... | java | public void requestVoiceVerificationCode(Locale locale, Optional<String> captchaToken) throws IOException {
this.pushServiceSocket.requestVoiceVerificationCode(locale, captchaToken);
} | [
"public",
"void",
"requestVoiceVerificationCode",
"(",
"Locale",
"locale",
",",
"Optional",
"<",
"String",
">",
"captchaToken",
")",
"throws",
"IOException",
"{",
"this",
".",
"pushServiceSocket",
".",
"requestVoiceVerificationCode",
"(",
"locale",
",",
"captchaToken"... | Request a Voice verification code. On success, the server will
make a voice call to this Signal user.
@throws IOException | [
"Request",
"a",
"Voice",
"verification",
"code",
".",
"On",
"success",
"the",
"server",
"will",
"make",
"a",
"voice",
"call",
"to",
"this",
"Signal",
"user",
"."
] | train | https://github.com/signalapp/libsignal-service-java/blob/64f1150c5e4062d67d31c9a2a9c3a0237d022902/java/src/main/java/org/whispersystems/signalservice/api/SignalServiceAccountManager.java#L147-L149 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.